2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
25 DELETE FROM history WHERE field IN ('lastposttime', 'lastpostby', 'hiddenlastposttime', 'hiddenlastpostby')
32 * This class is used to record changes in a bug's fields, comments, and
35 * @author Iris Studios, Inc.
36 * @copyright Copyright ©2002 - [#]year[#], Iris Studios, Inc.
51 * The original data to compare against
55 var $original = array();
62 var $modified = array();
64 // ###################################################################
66 * Sets the bug ID for the current logging instance
70 * @param integer New bug ID
72 function set_bugid($newbugid)
74 $this->bugid
= $newbugid;
77 // ###################################################################
79 * Assigns data into the $this->original or $this->modified array based
80 * on the passed arrays of information and the fields to add (and what
81 * name to add them under), the element they go into, and any prefix
85 * @param bool TRUE for original, FALSE for modified
86 * @param array Data array
87 * @param array List of fields in the data array to add; in format of array('field name' => 'display name', 'display name 2', 'display name 3')
88 * @param bool If TRUE, then the list of fields is used to exclude, not include
89 * @param string Element to add to
90 * @param string Field prefix
92 function add_data($orig, $data, $fields, $exclude = false
, $element = '', $prefix = '')
94 $array = ($orig ?
'original' : 'modified');
97 if ($exclude == false
)
99 foreach ($fields AS $fname => $fdisplay)
101 if (is_numeric($fname))
106 $this->{$array}["$element"]["$prefix$fdisplay"] = array('name' => $fname, 'value' => $data["$fname"]);
111 foreach ($data AS $fname => $value)
113 if (!in_array($fname, $fields))
115 $this->{$array}["$element"]["$prefix$fname"] = array('name' => $fname, 'value' => $value);
122 /*=====================================================================*\
123 || ###################################################################
126 || ###################################################################
127 \*=====================================================================*/