2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 $fetchtemplates = array(
18 require_once('./global.php');
20 if (!can_perform('canviewbugs'))
26 // ###################################################################
28 // -------------------------------------------------------------------
30 $bug = $db->query_first("
31 SELECT bug.*, user.displayname, user.email, user.showemail
32 FROM " . TABLE_PREFIX
. "bug AS bug
33 LEFT JOIN " . TABLE_PREFIX
. "user AS user
34 ON (bug.userid = user.userid)
35 WHERE bug.bugid = " . intval($bugsys->in
['bugid'])
40 echo 'alert: bad bug';
44 // -------------------------------------------------------------------
46 $bug['userinfo'] = construct_user_display($bug);
47 $bug['product'] = $bugsys->datastore
['product']["$bug[productid]"]['title'];
48 $bug['component'] = (($bug['componentid']) ?
$bugsys->datastore
['product']["$bug[componentid]"]['title'] : '');
49 $bug['version'] = $bugsys->datastore
['version']["$bug[versionid]"]['version'];
50 $bug['status'] = $bugsys->datastore
['status']["$bug[status]"]['status'];
51 $bug['resolution'] = $bugsys->datastore
['resolution']["$bug[resolution]"]['resolution'];
52 $bug['severity'] = $bugsys->datastore
['severity']["$bug[severity]"]['severity'];
53 $bug['priority'] = $bugsys->datastore
['priority']["$bug[priority]"]['priority'];
55 $assigninfo = $bugsys->datastore
['assignto']["$bug[assignedto]"];
56 $bug['assigninfo'] = ((is_array($assigninfo)) ?
construct_user_display($assigninfo) : '');
58 if (((can_perform('caneditown') AND $bugsys->userinfo
['userid'] == $comment['userid']) OR can_perform('caneditothers')) AND can_perform('caneditinfo'))
60 $show['editreport'] = true
;
64 $show['editreport'] = false
;
67 // -------------------------------------------------------------------
69 $words = explode(' ', $bugsys->in
['hilight']);
70 foreach ($words AS $word)
74 $word = preg_quote($bugsys->unsanitize($word));
75 $hilight[] = $temp = trim(preg_replace('#[^0-9a-zA-Z_ ]#', '', $word));
81 // -------------------------------------------------------------------
83 $comments_fetch = $db->query("
84 SELECT comment.*, user.email, user.showemail, user.displayname
85 FROM " . TABLE_PREFIX
. "comment AS comment
86 LEFT JOIN " . TABLE_PREFIX
. "user AS user
87 ON (comment.userid = user.userid)
88 WHERE comment.bugid = $bug[bugid]
89 ORDER BY comment.dateline ASC"
91 while ($comment = $db->fetch_array($comments_fetch))
93 $comment['posttime'] = datelike('standard', $comment['dateline']);
94 $comment['postby'] = construct_user_display($comment);
95 if ((can_perform('caneditown') AND $bugsys->userinfo
['userid'] == $comment['userid']) OR can_perform('caneditothers'))
97 $show['editcomment'] = true
;
101 $show['editcomment'] = false
;
104 if (is_array($hilight))
106 foreach ($hilight AS $id => $find)
109 $replace = "<span style=\"background-color: yellow; font-weight: bold; color: red;\">\\1</span>";
110 $comment['comment_parsed'] = preg_replace($find, $replace, $comment['comment_parsed']);
114 eval('$comments .= "' . $template->fetch('showreport_comment') . '";');
117 if (can_perform('canpostcomments'))
119 $show['newreply'] = true
;
123 $show['newreply'] = false
;
126 if (is_array($hilight))
128 foreach ($hilight AS $id => $find)
131 $replace = "<span style=\"background-color: yellow; font-weight: bold; color: red;\">\\1</span>";
132 $bug['summary'] = preg_replace($find, $replace, $bug['summary']);
136 eval('$template->flush("' . $template->fetch('SHOWREPORT') . '");');
138 /*=====================================================================*\
139 || ###################################################################
142 || ###################################################################
143 \*=====================================================================*/