From 03dd1bda8b9106572bb5f5639fb397acd39de65c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 15 May 2005 01:38:34 +0000 Subject: [PATCH] r142: Added the backbone for bug history logging --- docs/schema_changes.sql | 10 ++++++++++ includes/functions.php | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/docs/schema_changes.sql b/docs/schema_changes.sql index 181a88c..7ab6407 100644 --- a/docs/schema_changes.sql +++ b/docs/schema_changes.sql @@ -14,4 +14,14 @@ CREATE TABLE `attachment` ( `userid` INT(10) UNSIGNED NOT NULL, `obsolete` INT(1) UNSIGNED NOT NULL, PRIMARY KEY (`attachmentid`) +); + +CREATE TABLE `history` ( + `historyid` INT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `bugid` INT(10) UNSIGNED NOT NULL, + `dateline` INT(20) UNSIGNED NOT NULL, + `userid` INT(10) UNSIGNED NOT NULL, + `language` VARCHAR(255) NOT NULL, + `arguments` MEDIUMTEXT NOT NULL, + PRIMARY KEY (`historyid`) ); \ No newline at end of file diff --git a/includes/functions.php b/includes/functions.php index e4a21ab..0e42cb1 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -301,6 +301,21 @@ function parse_pcv_select($input, $validate = false) } } +// ######################### Start log_action ######################## +function log_action($bugid, $language, $arguments) +{ + global $bugsys; + + $bugsys->db->query(" + INSERT INTO " . TABLE_PREFIX . "history + (bugid, dateline, userid, language, arguments) + VALUES + (" . intval($bugid) . ", " . time() . ", " . $bugsys->userinfo['userid'] . ", + '" . $bugsys->escape($language) . "', '" . $bugsys->escape(serialize($arguments)) . "' + )" + ); +} + /*=====================================================================*\ || ################################################################### || # $HeadURL$ -- 2.43.5