From d4bb7d5dfb8dfd5c878a5f83a3d835ad3a6a5554 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 23 Dec 2004 06:42:00 +0000 Subject: [PATCH] r15: Basic bug viewing. --- showreport.php | 114 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 showreport.php diff --git a/showreport.php b/showreport.php new file mode 100644 index 0000000..d61614b --- /dev/null +++ b/showreport.php @@ -0,0 +1,114 @@ +userinfo['permissions'] & CANVIEWBUGS)) +{ + echo 'no permission'; + exit; +} + +// ################################################################### + +if (empty($_REQUEST['do'])) +{ + $_REQUEST['do'] = 'modify'; +} + +// ################################################################### + +if ($_REQUEST['do'] == 'modify') +{ + sanitize(array('bugid' => INT)); + + if (!$vars['bugid']) + { + echo 'alert: bad bug'; + exit; + } + + $bugfetch = $DB_sql->query(" + SELECT bug.*, user1.displayname, user1.email, user1.showemail, + comment.userid AS posterid, user2.displayname AS postedby, + user2.email AS posteremail, user2.showemail AS postershowemail, + comment.comment, comment.dateline AS postedon + FROM " . TABLE_PREFIX . "bug AS bug + LEFT JOIN " . TABLE_PREFIX . "comment AS comment + ON (bug.bugid = comment.bugid) + LEFT JOIN " . TABLE_PREFIX . "user AS user1 + ON (bug.userid = user1.userid) + LEFT JOIN " . TABLE_PREFIX . "user AS user2 + ON (comment.userid = user1.userid) + WHERE bug.bugid = $vars[bugid] + ORDER BY comment.dateline ASC" + ); + while ($buginfo = $DB_sql->fetch_array($bugfetch)) + { + if (!is_array($bug)) + { + $bug = array( + 'bugid' => $buginfo['bugid'], + 'userid' => $buginfo['userid'], + 'displayname' => $buginfo['displayname'], + 'email' => $buginfo['email'], + 'showemail' => $buginfo['showemail'], + 'productid' => $buginfo['productid'], + 'componentid' => $buginfo['componentid'], + 'versionid' => $buginfo['versionid'], + 'summary' => $buginfo['summary'], + 'priority' => $buginfo['priority'], + 'severity' => $buginfo['severity'], + 'status' => $buginfo['status'], + 'resolution' => $buginfo['resolution'], + 'assignedto' => $buginfo['assignedto'] + ); + } + $comments[] = array( + 'userid' => $buginfo['posterid'], + 'displayname' => $buginfo['displayname'], + 'email' => $buginfo['posteremail'], + 'showemail' => $buginfo['postershowemail'], + 'dateline' => $buginfo['postedon'], + 'comment' => $buginfo['comment'] + ); + } + + echo "
Bug ID: $bug[bugid]
"; + echo "
Reported by: $bug[displayname]" . iff($bug['showemail'], " <$bug[email]>") . " (userid: $bug[userid])
"; + echo "
Product: " . $bugsys->datastore['product']["$bug[productid]"]['title'] . iff($bug['componentid'], ' / Component:' . $bugsys->datastore['product']["$bug[componentid]"]['title'] . '') . ' / Version: ' . $bugsys->datastore['version']["$bug[versionid]"]['version'] . "
"; + echo "
Title / summary: $bug[summary]
"; + echo "
Status: " . $bugsys->datastore['status']["$bug[status]"]['status'] . " / Resolution: " . $bugsys->datastore['resolution']["$bug[resolution]"]['resolution'] . "
"; + echo "
Severity: " . $bugsys->datastore['severity']["$bug[severity]"]['severity'] . "
"; + echo "
Priority: " . $bugsys->datastore['priority']["$bug[priority]"]['priority'] . "
"; + $assigninfo = $bugsys->datastore['assignto']["$bug[assignedto]"]; + echo iff(is_array($assigninfo), "
Assigned to: " . $assigninfo['displayname'] . iff($assigninfo['showemail'], " <$assigninfo[email]>") . " (userid: $assigninfo[userid])
"); + + echo '
'; + + foreach ($comments AS $comment) + { + echo '"; + echo "
' . datelike('standard', $comment['dateline']) . '' . $comment['displayname'] . iff($comment['showemail'], " <$comment[email]>") . " (userid: $comment[userid])
" . nl2br($comment['comment']) . "
"; + } + + /*print_r($bug); + print_r($comments);*/ +} + +/*=====================================================================*\ +|| ################################################################### +|| # $HeadURL$ +|| # $Id$ +|| ################################################################### +\*=====================================================================*/ +?> \ No newline at end of file -- 2.22.5