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;
}
$bug = $DB_sql->query_first("
SELECT bug.*, user.displayname, user.email, user.showemail
FROM " . TABLE_PREFIX . "bug AS bug
LEFT JOIN " . TABLE_PREFIX . "user AS user
ON (bug.userid = user.userid)
WHERE bug.bugid = $vars[bugid]"
);
if (!is_array($bug))
{
echo 'alert: bad bug';
exit;
}
echo "
Bug ID: $bug[bugid]
";
echo "Reported by: " . construct_user_display($bug) . "
";
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: " . construct_user_display($assigninfo) . "
");
if ($bugsys->userinfo['permissions'] & CANEDITINFO)
{
echo '';
}
echo '
';
$comments = $DB_sql->query("
SELECT comment.*, user.email, user.showemail, user.displayname
FROM " . TABLE_PREFIX . "comment AS comment
LEFT JOIN " . TABLE_PREFIX . "user AS user
ON (comment.userid = user.userid)
WHERE comment.bugid = $vars[bugid]
ORDER BY comment.dateline ASC"
);
while ($comment = $DB_sql->fetch_array($comments))
{
echo '' . datelike('standard', $comment['dateline']) . '' . construct_user_display($comment) . " |
";
echo "" . $comment['comment_parsed'] . " |
";
if (($bugsys->userinfo['permissions'] & CANEDITOWN AND $bugsys->userinfo['userid'] == $comment['userid']) OR $bugsys->userinfo['permissions'] & CANEDITOTHERS)
{
echo "[Edit Comment] |
";
}
echo "
";
}
if ($bugsys->userinfo['permissions'] & CANPOSTCOMMENTS)
{
echo "";
}
/*print_r($bug);
print_r($comments);*/
}
/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$
|| # $Id$
|| ###################################################################
\*=====================================================================*/
?>