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 \*=====================================================================*/
22 $fetchtemplates = array(
27 define('SVN', '$Id$');
29 $focus['showreport'] = 'focus';
31 require_once('./global.php');
33 $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX
. "bug WHERE bugid = " . intval($bugsys->in
['bugid']));
36 $message->error($lang->getlex('error_invalid_id'));
39 if (($bug['hidden'] AND !can_perform('canviewhidden', $bug['productid'])) OR !can_perform('canviewbugs', $bug['productid']))
41 $message->error_permission();
44 // ###################################################################
46 $customfields = $db->query("
48 FROM " . TABLE_PREFIX
. "bugfield AS bugfield
49 LEFT JOIN " . TABLE_PREFIX
. "bugfieldpermission AS permission
50 ON (bugfield.fieldid = permission.fieldid)
51 WHERE permission.mask <> 0
52 AND permission.usergroupid = {$bugsys->userinfo['usergroupid']}"
55 while ($field = $db->fetch_array($customfields))
57 $fieldlist["custom_field$field[fieldid]"] = 'custom_field' . $field['fieldid'] . " (\"$field[name]\")";
60 // ###################################################################
62 $logs_fetch = $db->query("
63 SELECT history.*, user.userid, user.email, user.displayname, user.showemail
64 FROM " . TABLE_PREFIX
. "history AS history
65 LEFT JOIN " . TABLE_PREFIX
. "user AS user
66 ON (user.userid = history.userid)
67 WHERE bugid = $bug[bugid]"
69 while ($log = $db->fetch_array($logs_fetch))
71 $log['date'] = $datef->format($bugsys->options
['dateformat'], $log['dateline']);
72 $log['user'] = construct_user_display($log);
74 $logs["$log[dateline]"]["$log[historyid]"] = $log;
75 ksort($logs["$log[dateline]"]);
80 foreach ($logs AS $dateline => $logitems)
82 $show['group'] = true
;
84 foreach ($logitems AS $log)
86 $funct->exec_swap_bg('', $stylevar['alt_colour']);
87 $bgcolour = $funct->bgcolour
;
89 if ($newlog = $fieldlist["$log[field]"])
91 $log['field'] = $newlog;
94 eval('$history .= "' . $template->fetch('history_bit') . '";');
95 $show['group'] = false
;
99 eval('$template->flush("' . $template->fetch('history') . '");');
101 /*=====================================================================*\
102 || ###################################################################
105 || ###################################################################
106 \*=====================================================================*/