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 = " . intval($bugsys->in['bugid']) ); if (!is_array($bug)) { echo 'alert: bad bug'; exit; } // ------------------------------------------------------------------- // prep display $bug['userinfo'] = construct_user_display($bug); $bug['product'] = $bugsys->datastore['product']["$bug[productid]"]['title']; $bug['component'] = (($bug['componentid']) ? $bugsys->datastore['product']["$bug[componentid]"]['title'] : ''); $bug['version'] = $bugsys->datastore['version']["$bug[versionid]"]['version']; $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status']; $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution']; $bug['severity'] = $bugsys->datastore['severity']["$bug[severity]"]['severity']; $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority']; $assigninfo = $bugsys->datastore['assignto']["$bug[assignedto]"]; $bug['assigninfo'] = ((is_array($assigninfo)) ? construct_user_display($assigninfo) : ''); if (((can_perform('caneditown') AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers')) AND can_perform('caneditinfo')) { $show['editreport'] = true; } else { $show['editreport'] = false; } // ------------------------------------------------------------------- // hilight $words = explode(' ', $bugsys->in['hilight']); foreach ($words AS $word) { if (trim($word)) { $word = preg_quote($bugsys->unsanitize($word)); $hilight[] = $temp = trim(preg_replace('#[^0-9a-zA-Z_ ]#', '', $word)); } } print_r($words); print_r($hilight); // ------------------------------------------------------------------- // attachments $show['getattachments'] = ((can_perform('cangetattach')) ? true : false); $show['putattachments'] = ((can_perform('canputattach')) ? true : false); if ($show['getattachments'] OR $show['putattachments']) { $attachments_fetch = $db->query(" SELECT attachment.*, user.email, user.showemail, user.displayname FROM " . TABLE_PREFIX . "attachment AS attachment LEFT JOIN " . TABLE_PREFIX . "user AS user ON (attachment.userid = user.userid) WHERE attachment.bugid = $bug[bugid] ORDER BY attachment.dateline" ); while ($attachment = $db->fetch_array($attachments_fetch)) { $attachment['date'] = datelike('standard', $attachment['dateline']); $attachment['user'] = construct_user_display($attachment); eval('$attachments .= "' . $template->fetch('showreport_attachment') . '";'); } } // ------------------------------------------------------------------- // get comments $comments_fetch = $db->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 = $bug[bugid] ORDER BY comment.dateline ASC" ); while ($comment = $db->fetch_array($comments_fetch)) { $comment['posttime'] = datelike('standard', $comment['dateline']); $comment['postby'] = construct_user_display($comment); if ((can_perform('caneditown') AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers')) { $show['editcomment'] = true; } else { $show['editcomment'] = false; } if (is_array($hilight)) { foreach ($hilight AS $id => $find) { $find = "#($find)#"; $replace = "\\1"; $comment['comment_parsed'] = preg_replace($find, $replace, $comment['comment_parsed']); } } eval('$comments .= "' . $template->fetch('showreport_comment') . '";'); } if (can_perform('canpostcomments')) { $show['newreply'] = true; } else { $show['newreply'] = false; } if (is_array($hilight)) { foreach ($hilight AS $id => $find) { $find = "#($find)#"; $replace = "\\1"; $bug['summary'] = preg_replace($find, $replace, $bug['summary']); } } eval('$template->flush("' . $template->fetch('SHOWREPORT') . '");'); /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>