|
From: Benjamin C. <bc...@us...> - 2002-10-21 19:41:36
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv12314
Modified Files:
index.php
Log Message:
Fixed a problem with showing a bug twice if it was closed twice. Also removed a dependency on the word 'closed' in the same query.
Index: index.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/index.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- index.php 19 Jun 2002 13:45:35 -0000 1.34
+++ index.php 21 Oct 2002 19:41:32 -0000 1.35
@@ -10,12 +10,12 @@
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
-//
+//
// phpBugTracker is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with phpBugTracker; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -25,30 +25,30 @@
function grab_data($restricted_projects) {
global $db;
-
+
// Grab the legend
$rs = $db->query("select status_id, status_name from ".TBL_STATUS." order by sort_order");
while ($rs->fetchInto($row)) {
$stats[$row['status_id']]['name'] = $row['status_name'];
}
-
+
// Grab the data
$rs = $db->query("select status_id, count(status_id) as count from ".TBL_BUG.
" where project_id not in ($restricted_projects) group by status_id");
while ($rs->fetchInto($row)) {
$stats[$row['status_id']]['count'] = $row['count'];
}
-
+
return $stats;
}
function build_image($restricted_projects) {
global $STRING;
-
+
error_reporting(0); // Force this, just in case
include_once JPGRAPH_PATH.'jpgraph.php';
include_once JPGRAPH_PATH.'jpgraph_pie.php';
-
+
$stats = grab_data($restricted_projects);
$totalbugs = 0;
foreach ($stats as $statid => $stat) {
@@ -60,12 +60,12 @@
$totalbugs += $stat['count'];
}
}
-
+
if (!$totalbugs) {
return $STRING['nobugs'];
}
-
- // Create the Pie Graph.
+
+ // Create the Pie Graph.
$graph = new PieGraph(350,200,"bug_cat_summary");
$graph->SetShadow();
@@ -106,7 +106,7 @@
// Grab the resolutions from the database
$rs = $db->query($QUERY['index-projsummary-2'].
- db_concat($QUERY['index-projsummary-3'], 'resolution_id',
+ db_concat($QUERY['index-projsummary-3'], 'resolution_id',
$QUERY['index-projsummary-4'], 'resolution_name', "'\"' ").
$QUERY['index-projsummary-5']);
while (list($fieldname, $countquery) = $rs->fetchRow(DB_FETCHMODE_ORDERED)) {
@@ -114,34 +114,34 @@
$querystring .= $countquery;
}
$resfields[] = 'Total';
-
+
$db->setOption('optimize', 'performance'); // For Oracle to do this loop
$t->assign(array(
'resfields' => $resfields,
- 'projects' => $db->getAll(sprintf($QUERY['index-projsummary-6'],
+ 'projects' => $db->getAll(sprintf($QUERY['index-projsummary-6'],
$querystring, $restricted_projects))
));
- $db->setOption('optimize', 'portability');
+ $db->setOption('optimize', 'portability');
}
// Show the recently added and closed bugs
-$t->assign('recentbugs',
+$t->assign('recentbugs',
$db->getAll($db->modifyLimitQuery("select bug_id, title, project_name from ".TBL_BUG.
' b, '.TBL_PROJECT." p where b.project_id not in ($restricted_projects)".
' and b.project_id = p.project_id order by b.created_date desc', 0, 5)));
-$t->assign('closedbugs',
+$t->assign('closedbugs',
$db->getAll($db->modifyLimitQuery('select b.bug_id, title, project_name from '.TBL_BUG.' b, '.
- TBL_BUG_HISTORY.' h, '.TBL_PROJECT.' p'.
- " where b.project_id not in ($restricted_projects) and b.bug_id = h.bug_id".
- " and changed_field = 'status' and new_value = 'Closed'".
- ' and b.project_id = p.project_id order by h.created_date desc', 0, 5)));
+ TBL_PROJECT.' p'.
+ " where b.project_id not in ($restricted_projects)".
+ ' and status_id = '.BUG_CLOSED.
+ ' and b.project_id = p.project_id order by close_date desc', 0, 5)));
if ($u != 'nobody') {
$pref = $db->GetOne('select saved_queries from '.TBL_USER_PREF." where user_id='".$u."'");
if ((isset($pref['saved_queries'])) && ($pref['saved_queries'])) {
// Grab the saved queries if there are any and user wants them
- $t->assign('queries',
+ $t->assign('queries',
$db->getAll("select * from ".TBL_SAVED_QUERY." where user_id = '$u'"));
}
}
|