cvs: bugtracker /includes template.php /template/generic/bug index.php

From: Date: Fri, 01 Aug 2008 15:57:56 +0000
Subject: cvs: bugtracker /includes template.php /template/generic/bug index.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-2277@lists.php.net to get a copy of this message
bcarlyon Fri Aug 1 15:57:56 2008 UTC Modified files: /bugtracker/includes template.php /bugtracker/template/generic/bug index.php Log: Doing a end of the day, before the weekend commit http://cvs.php.net/viewvc.cgi/bugtracker/includes/template.php?r1=1.2&r2=1.3&diff_format=u Index: bugtracker/includes/template.php diff -u bugtracker/includes/template.php:1.2 bugtracker/includes/template.php:1.3 --- bugtracker/includes/template.php:1.2 Fri Aug 1 14:31:41 2008 +++ bugtracker/includes/template.php Fri Aug 1 15:57:56 2008 @@ -256,7 +256,7 @@ return; } function load_template() { - global $db; + global $db,$cache; if ($this->template_type == 'php') { include($this->template_file); } http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/bug/index.php?r1=1.17&r2=1.18&diff_format=u Index: bugtracker/template/generic/bug/index.php diff -u bugtracker/template/generic/bug/index.php:1.17 bugtracker/template/generic/bug/index.php:1.18 --- bugtracker/template/generic/bug/index.php:1.17 Fri Aug 1 14:31:41 2008 +++ bugtracker/template/generic/bug/index.php Fri Aug 1 15:57:56 2008 @@ -4,6 +4,54 @@ $bug_id = $_REQUEST['bug_id']; $bug_id = str_replace('/','',$bug_id); +if (is_numeric($bug_id)) +{ + $this->page_title .= 'Bug #' . $bug_id; + $this->content_title = 'Bug #' . $bug_id; + + $query = "SELECT *,UNIX_TIMESTAMP(reported_on),UNIX_TIMESTAMP(assigned_on),UNIX_TIMESTAMP(updated) FROM bug WHERE bug_id = '{$bug_id}'"; + $db->get_data($query); + + if (!$db->total_rows) + { + //invalid bug + $this->page_title .= ' - Invalid'; + $this->content_title .= ' - Invalid'; + } + else + { + $row = $db->fetch_row(); + + $bug->bug_id = $bug_id; + $bug_row = $row; + + //get comments + $query = "SELECT * FROM bug_comment WHERE bug_id = '{$bug_id}' AND ( comment_type = " . DESCRIPTION . ' OR comment_type = ' . REPRODUCE . ' OR comment_type = ' . EXPECTED . ' OR comment_type = ' . ACTUAL . ')'; + $db->get_data($query); + $comments = array(); + while ($entry = $db->fetch_row()) + { + $thistype = $cache->obtain('comment_type', $entry['comment_type']); + $comments[$thistype] = $entry['comment']; + } + $bug_row['password'] = ''; + $bug_row = array_merge($bug_row, $comments); + + $this->page_title .= ' ' . $bug_row['summary']; + $this->content_title .= ' ' . $bug_row['summary']; + + //lets generate for display + + //first some nice html + //we are going to pass it to the loop function! I know! Shock Horror + } +} +else if ($bug_id) +{ + $content = 'I has no search engine :-('; +} +else +{ //some statage $query = 'SELECT * FROM bug WHERE status = \'0\''; $db->get_data($query); @@ -17,7 +65,7 @@ $db->get_data($query); - $this->page_title = 'Bug Index'; + $this->page_title .= 'Bug Index'; $this->content_title = 'Bug Summary'; $content .= 'There are Currenty ' . $db->total_rows . ' bugs in the system, of which ' . $pending . ' are pending review, the average review time is {AVERAGE_REVIEW}, the average close time is {AVERAGE_CLOSE}'; @@ -51,7 +99,7 @@ $content .= '<h2>No Bugs</h2>'; $template_data['system_error'] = 'There does not appear to be any bugs, perhaps one needs to be <a href="/report/" title="Report a bug">reported</a>.'; } - +} //we are inside the template engine!!! $this->prehtml = $content;

« previous php.webmaster (#2277) next »