From d8e2087a21001f7f82fcc580e383a1da8ec91a7c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 10 May 2006 05:03:14 +0000 Subject: [PATCH] r818: Implementing new logging --- editcomment.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/editcomment.php b/editcomment.php index 2293e5d..dd06294 100644 --- a/editcomment.php +++ b/editcomment.php @@ -73,12 +73,13 @@ if ($_POST['do'] == 'update') $commentapi->update(); // setup logging - require_once('./includes/class_history.php'); - $log = new History(); - $log->bugid = $bug['bugid']; - $log->commentid = $comment['commentid']; - $log->log($log->diff('comment ' . $comment['commentid'] . ' text', $comment['comment_parsed'], nl2br($bugsys->in['comment_parsed']))); - $log->log($log->diff('comment ' . $comment['commentid'] . ' hidden', $comment['hidden'], intval($bugsys->in['hidden']))); + require_once('./includes/class_logging.php'); + $log = new Logging; + $log->set_bugid($bug['bugid']); + $log->set_commentid($comment['commentid']); + + $log->add_data(true, $commentapi->objdata, array('comment', 'hidden'), false, 'comment'); + $log->add_data(false, $commentapi->values, array('comment', 'hidden'), false, 'comment'); $lastgood = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "comment WHERE bugid = $bug[bugid] AND !hidden ORDER BY dateline DESC"); $db->query(" @@ -88,6 +89,8 @@ if ($_POST['do'] == 'update') WHERE bugid = $bug[bugid]" ); + $log->update_history(); + $message->redirect($lang->string('The comment was modified successfully.'), "showreport.php?bugid=$bug[bugid]"); } else -- 2.22.5