2 /*=====================================================================*\
3 || ################################################################### ||
4 || # Renapsus [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # All parts of this file are ©2003-[#]year[#] Iris Studios, Inc. No # ||
7 || # part of this file may be reproduced in any way: part or whole. # ||
8 || # --------------------------------------------------------------- # ||
9 || # ©2003 - [#]year[#] Iris Studios, Inc. | http://www.iris-studios.com # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 $fetchtemplates = array(
18 require_once('./global.php');
20 if (!can_perform('canviewbugs'))
26 // ###################################################################
28 // -------------------------------------------------------------------
30 sanitize(array('bugid' => INT, 'hilight' => STR
));
32 $bug = $DB_sql->query_first("
33 SELECT bug.*, user.displayname, user.email, user.showemail
34 FROM " . TABLE_PREFIX
. "bug AS bug
35 LEFT JOIN " . TABLE_PREFIX
. "user AS user
36 ON (bug.userid = user.userid)
37 WHERE bug.bugid = $vars[bugid]"
42 echo 'alert: bad bug';
46 // -------------------------------------------------------------------
48 $bug['userinfo'] = construct_user_display($bug);
49 $bug['product'] = $bugsys->datastore
['product']["$bug[productid]"]['title'];
50 $bug['component'] = iff($bug['componentid'], $bugsys->datastore
['product']["$bug[componentid]"]['title']);
51 $bug['version'] = $bugsys->datastore
['version']["$bug[versionid]"]['version'];
52 $bug['status'] = $bugsys->datastore
['status']["$bug[status]"]['status'];
53 $bug['resolution'] = $bugsys->datastore
['resolution']["$bug[resolution]"]['resolution'];
54 $bug['severity'] = $bugsys->datastore
['severity']["$bug[severity]"]['severity'];
55 $bug['priority'] = $bugsys->datastore
['priority']["$bug[priority]"]['priority'];
57 $assigninfo = $bugsys->datastore
['assignto']["$bug[assignedto]"];
58 $bug['assigninfo'] = iff(is_array($assigninfo), construct_user_display($assigninfo));
60 if (((can_perform('caneditown') AND $bugsys->userinfo
['userid'] == $comment['userid']) OR can_perform('caneditothers')) AND can_perform('caneditinfo'))
62 $show['editreport'] = true
;
66 $show['editreport'] = false
;
69 // -------------------------------------------------------------------
71 $words = explode(' ', $vars['hilight']);
72 foreach ($words AS $word)
76 $word = preg_quote($word);
77 $hilight[] = $temp = trim(preg_replace('#[^0-9a-zA-Z_ ]#', '', $word));
83 // -------------------------------------------------------------------
85 $comments_fetch = $DB_sql->query("
86 SELECT comment.*, user.email, user.showemail, user.displayname
87 FROM " . TABLE_PREFIX
. "comment AS comment
88 LEFT JOIN " . TABLE_PREFIX
. "user AS user
89 ON (comment.userid = user.userid)
90 WHERE comment.bugid = $vars[bugid]
91 ORDER BY comment.dateline ASC"
93 while ($comment = $DB_sql->fetch_array($comments_fetch))
95 $comment['posttime'] = datelike('standard', $comment['dateline']);
96 $comment['postby'] = construct_user_display($comment);
97 if ((can_perform('caneditown') AND $bugsys->userinfo
['userid'] == $comment['userid']) OR can_perform('caneditothers'))
99 $show['editcomment'] = true
;
103 $show['editcomment'] = false
;
106 if (is_array($hilight))
108 foreach ($hilight AS $id => $find)
111 $replace = "<span style=\"background-color: yellow; font-weight: bold; color: red;\">\\1</span>";
112 $comment['comment_parsed'] = preg_replace($find, $replace, $comment['comment_parsed']);
116 eval('$comments .= "' . $tpl->fetch('showreport_comment') . '";');
119 if (can_perform('canpostcomments'))
121 $show['newreply'] = true
;
125 $show['newreply'] = false
;
128 if (is_array($hilight))
130 foreach ($hilight AS $id => $find)
133 $replace = "<span style=\"background-color: yellow; font-weight: bold; color: red;\">\\1</span>";
134 $bug['summary'] = preg_replace($find, $replace, $bug['summary']);
138 eval('$tpl->flush("' . $tpl->fetch('SHOWREPORT') . '");');
140 /*=====================================================================*\
141 || ###################################################################
144 || ###################################################################
145 \*=====================================================================*/