From: <sy...@us...> - 2006-05-18 12:48:28
|
Update of /cvsroot/tikiwiki/tiki In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv29148 Modified Files: tiki-admin_actionlog.php Log Message: can edit contribution in actionlog Index: tiki-admin_actionlog.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/tiki-admin_actionlog.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- tiki-admin_actionlog.php 12 May 2006 18:27:07 -0000 1.15 +++ tiki-admin_actionlog.php 18 May 2006 12:48:10 -0000 1.16 @@ -10,6 +10,8 @@ include_once('lib/userslib.php'); include_once('lib/commentslib.php'); include_once('lib/categories/categlib.php'); + +include_once('lib/contribution/contributionlib.php'); $commentslib = new Comments($dbTiki); if ($tiki_p_admin != 'y') { @@ -47,15 +49,20 @@ die; } $smarty->assign_by_ref('action', $action); - if (isset($_REQUEST['saveAction'])) { - $logslib->delete_params($_REQUEST['actionId']); - if (isset($_REQUEST['contributions'])) - $logslib->insert_params($_REQUEST['actionId'], 'contribution', $_REQUEST['contributions']); + if (isset($_REQUEST['saveAction']) && $feature_contribution == 'y') { + if ($contributionlib->update($action, empty($_REQUEST['contributions']) ? '': $_REQUEST['contributions'])) { + $logslib->delete_params($_REQUEST['actionId']); + if (isset($_REQUEST['contributions'])) { + $logslib->insert_params($_REQUEST['actionId'], 'contribution', $_REQUEST['contributions']); + } + } else { + $smarty->assign('error', 'found more than one object that can correspond'); + } } else { if ($action['objectType'] == 'wiki page') { $contributions = $logslib->get_action_contributions($action['actionId']); } elseif ($id = $logslib->get_comment_action($action)) { - $contributions = $this->get_action_contributions($action['actionId']); + $contributions = $logslib->get_action_contributions($action['actionId']); } else { $contributions = $contributionlib->get_assigned_contributions($action['object'], $action['objectType']); // todo: do a left join } @@ -67,7 +74,6 @@ $_REQUEST['contributions'] = $cont; include('contribution.php'); $contributions['data'][] = array('contributionId'=>0, 'name'=>''); -print_r($contributions); if (!empty($_REQUEST['startDate'])) $smarty->assign('startDate', $_REQUEST['startDate']); if (!empty($_REQUEST['endDate'])) |