array_walk($obsoletes, 'intval');
$db->query("UPDATE " . TABLE_PREFIX . "attachment SET obsolete = 1 WHERE attachmentid IN (" . implode(',', $obsoletes) . ") AND !obsolete AND bugid = $bug[bugid]");
- $log->arguments = array($attachmentid, $FILE['name'], implode(', ', $obsoletes));
- $log->log($log->diff($lang->string('Obsoleted attachments'), '', implode(', ', $obsoletes)));
+ foreach ($obsoletes AS $attachmentid)
+ {
+ $log->attachmentid = $attachmentid;
+ $log->log($log->diff('obsolete', 0, 1));
+ }
}
// handle comment stuff
$diff[0] = array_diff_assoc($attachment, $hist[1]);
$diff[1] = array_diff_assoc($hist[1], $attachment);
- $log->arguments = array($attachment['attachmentid']);
+ $log->attachmentid = $attachment['attachmentid'];
$log->log($log->diff('description', $diff[0]['description'], $diff[1]['description']));
$log->log($log->diff('obsolete', $diff[0]['obsolete'], $diff[1]['obsolete']));
ALTER TABLE `history` DROP `arguments`;
-ALTER TABLE `user` ADD `showcolours` INT(2) UNSIGNED NOT NULL AFTER `showemail`;
\ No newline at end of file
+ALTER TABLE `user` ADD `showcolours` INT(2) UNSIGNED NOT NULL AFTER `showemail`;
+
+ALTER TABLE `history` ADD `attachmentid` INT(10) UNSIGNED NOT NULL AFTER `bugid`;
+
+ALTER TABLE `history` ADD `commentid` INT(10) UNSIGNED NOT NULL AFTER `attachmentid`;
\ No newline at end of file
require_once('./includes/class_history.php');
$log = new History();
$log->bugid = $bug['bugid'];
- $log->arguments = array($comment['commentid']);
- $log->log();
+ $log->commentid = $comment['commentid'];
+ $log->log($log->diff('text', $comment['comment_parsed'], $bugsys->in['comment_parsed']));
$log->log($log->diff('hidden', $comment['hidden'], intval($bugsys->in['hidden'])));
$lastgood = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "comment WHERE bugid = $bug[bugid] AND !hidden ORDER BY dateline DESC");
hiddenlastpostby = " . $bugsys->userinfo['userid'] . "
WHERE bugid = " . intval($bugsys->in['bugid'])
);
-
- if ($hascomment)
- {
- $log->arguments = array($commentid);
- $log->log();
- }
}
class History
{
var $bugid = 0;
- var $fieldid = 0;
+ var $attachmentid = 0;
+ var $commentid = 0;
+ var $allowempty = false;
// -------------------------------------------------------------------
// -- Create a log entry
global $bugsys;
$this->bugid = intval($this->bugid);
- $this->fieldid = intval($this->fieldid);
+ $this->attachmentid = intval($this->attachmentid);
+ $this->commentid = intval($this->commentid);
if ($diffdata == -1)
{
$bugsys->db->query("
INSERT INTO " . TABLE_PREFIX . "history
- (bugid, dateline, userid, field, fieldid, original, changed)
+ (bugid, attachmentid, commentid, dateline, userid, field, original, changed)
VALUES
- (" . $this->bugid . ", " . LOG_TIME . ", " . $bugsys->userinfo['userid'] . ",
- '" . $bugsys->escape($diffdata['field']) . "', " . $this->fieldid . ",
+ (" . $this->bugid . ", " . $this->attachmentid . ", " . $this->commentid . ", " . TIMENOW . ",
+ " . $bugsys->userinfo['userid'] . ", '" . $bugsys->escape($diffdata['field']) . "',
'" . $bugsys->escape($diffdata['initial']) . "', '" . $bugsys->escape($diffdata['final']) . "'
)"
);
unset($database, $servername, $username, $password, $usepconnect, $tableprefix, $cookieprefix);
-define('LOG_TIME', time());
-
require_once('./includes/functions_datastore.php');
require_once('./includes/functions.php');