From: <sy...@us...> - 2006-03-02 15:16:05
|
Update of /cvsroot/tikiwiki/tiki/lib/wiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3332/lib/wiki Modified Files: histlib.php wikilib.php Log Message: contribution(see doc on edut.tw.org) Index: histlib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/wiki/histlib.php,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- histlib.php 26 Sep 2005 18:08:17 -0000 1.27 +++ histlib.php 2 Mar 2006 15:15:53 -0000 1.28 @@ -17,7 +17,16 @@ } // Removes a specific version of a page - function remove_version($page, $version, $comment = '') { + function remove_version($page, $version, $comment = '', $historyId = '') { + global $feature_contribution; + if ($feature_contribution == 'y') { + global $contributionlib; include_once('lib/contribution/contributionlib.php'); + if ($historyId == '') { + $query = 'select `historyId` from `tiki_history` where `pageName`=? and `version`=?'; + $historyId = $this->getOne($query, array($page, $version)); + } + $contributionlib->remove_history($historyId); + } $query = "delete from `tiki_history` where `pageName`=? and `version`=?"; $result = $this->query($query,array($page,$version)); global $logslib; include_once('lib/logs/logslib.php'); @@ -108,8 +117,9 @@ // Returns all the versions for this page // without the data itself function get_page_history($page) { + global $feature_contribution; - $query = "select `pageName`, `description`, `version`, `lastModif`, `user`, `ip`, `data`, `comment` from `tiki_history` where `pageName`=? order by `version` desc"; + $query = "select * from `tiki_history` where `pageName`=? order by `version` desc"; $result = $this->query($query,array($page)); $ret = array(); @@ -125,6 +135,10 @@ $aux["description"] = $res["description"]; $aux["comment"] = $res["comment"]; //$aux["percent"] = levenshtein($res["data"],$actual); + if ($feature_contribution == 'y') { + global $contributionlib; include_once('lib/contribution/contributionlib.php'); + $aux['contributions'] = $contributionlib->get_assigned_contributions($res['historyId'], 'history'); + } $ret[] = $aux; } Index: wikilib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/wiki/wikilib.php,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- wikilib.php 20 Jan 2006 09:54:56 -0000 1.90 +++ wikilib.php 2 Mar 2006 15:15:53 -0000 1.91 @@ -464,7 +464,12 @@ } $histlib->use_version($res["pageName"], $res["version"]); - $histlib->remove_version($res["pageName"], $res["version"]); + if ($feature_contribution == 'y') { + global $contributionlib; include_once('lib/contribution/contributionlib.php'); + $info = $tikilib->get_page_info($res['pageName']); + $contributionlib->change_assigned_contributions($res['historyId'], 'history', $res['pageName'], 'wiki page', $info['description'], $res['pageName'], "tiki-index.php?page".urlencode($res['pageName'])); + } + $histlib->remove_version($res['pageName'], $res['version']); } else { $this->remove_all_versions($page); } |