|
From: Benjamin C. <bc...@us...> - 2002-07-18 13:02:18
|
Update of /cvsroot/phpbt/phpbt/inc/db
In directory usw-pr-cvs1:/tmp/cvs-serv9963/inc/db
Modified Files:
mysql.php oci8.php pgsql.php
Log Message:
Added configuration constants for four types of bug statuses. This removes the dependency on certain bug statuses having set names.
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/db/mysql.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- mysql.php 25 Jun 2002 14:00:06 -0000 1.11
+++ mysql.php 18 Jul 2002 13:02:15 -0000 1.12
@@ -106,12 +106,14 @@
'where active = 1 and (pg.project_id is null or pg.group_id in (%s)) '.
'group by p.project_id, p.project_name '.
'order by project_name',
- 'include-template-owner' => "SELECT sum(CASE WHEN status_name in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) , ".
- "sum(CASE WHEN status_name not in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) ".
+ 'include-template-owner' => "SELECT sum(CASE WHEN s.status_id ".
+ "in (".OPEN_BUG_STATUSES.") THEN 1 ELSE 0 END ) , ".
+ "sum(CASE WHEN s.status_id ".
+ "not in (".OPEN_BUG_STATUSES.") THEN 1 ELSE 0 END ) ".
"from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) ".
"where assigned_to = %s",
- 'include-template-reporter' => "SELECT sum(CASE WHEN status_name in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) , ".
- "sum(CASE WHEN status_name not in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) ".
+ 'include-template-reporter' => "SELECT sum(CASE WHEN s.status_id in (".OPEN_BUG_STATUSES.") THEN 1 ELSE 0 END ) , ".
+ "sum(CASE WHEN s.status_id not in (".OPEN_BUG_STATUSES.") THEN 1 ELSE 0 END ) ".
"from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) ".
"where created_by = %s",
'index-projsummary-1' => 'select project_name as "Project", '.
Index: oci8.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/db/oci8.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- oci8.php 25 Jun 2002 14:13:46 -0000 1.7
+++ oci8.php 18 Jul 2002 13:02:15 -0000 1.8
@@ -95,7 +95,7 @@
'owner.login as owner, r.resolution_name, st.status_name '.
'from '.TBL_BUG.' b, '.TBL_AUTH_USER.' owner, '.TBL_AUTH_USER.' reporter, '.
TBL_RESOLUTION.' r, '.TBL_SEVERITY.' sv, '.
- TBL_STATUS.' st, '.TBL_SITE.' site '
+ TBL_STATUS.' st, '.TBL_SITE.' site '.
'where b.resolution_id = r.resolution_id(+) '.
'and b.assigned_to = owner.user_id(+) '.
'and b.created_by = reporter.user_id(+) '.
@@ -110,10 +110,12 @@
'where p.project_id = pg.project_id(+) and active = 1 '.
'and (pg.project_id is null or pg.group_id in (%s)) '.
'group by p.project_id, p.project_name order by project_name',
- 'include-template-owner' => "SELECT sum(decode( s.status_name, 'Unconfirmed', 1, 'New', 1, 'Assigned', 1, 'Reopened', 1, 0 )) ".
+ 'include-template-owner' => "SELECT sum(decode( s.status_id, ".BUG_UNCONFIRMED.", 1, ".BUG_PROMOTED.", 1, ".BUG_ASSIGNED.", 1, ".BUG_REOPENED.", 1, 0 )), ".
+ "sum(decode( s.status_id, ".BUG_UNCONFIRMED.", 0, ".BUG_PROMOTED.", 0, ".BUG_ASSIGNED.", 0, ".BUG_REOPENED.", 0, 1 )), ".
'from '.TBL_BUG.' b, '.TBL_STATUS.' s '.
'where b.status_id = s.status_id (+) and b.assigned_to = %s',
- 'include-template-reporter' => "SELECT sum(decode( s.status_name, 'Unconfirmed', 1, 'New', 1, 'Assigned', 1, 'Reopened', 1, 0 )) ".
+ 'include-template-reporter' => "SELECT sum(decode( s.status_name, ".BUG_UNCONFIRMED.", 1, ".BUG_PROMOTED.", 1, ".BUG_ASSIGNED.", 1, ".BUG_REOPENED.", 1, 0 )), ".
+ "sum(decode( s.status_id, ".BUG_UNCONFIRMED.", 0, ".BUG_PROMOTED.", 0, ".BUG_ASSIGNED.", 0, ".BUG_REOPENED.", 0, 1 )), ".
'from '.TBL_BUG.' b, ' . TBL_STATUS.' s '.
'where b.status_id = s.status_id (+) and b.created_by = %s',
'index-projsummary-1' => 'select b.project_id, p.project_name as "Project", '.
Index: pgsql.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/db/pgsql.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- pgsql.php 8 Jul 2002 08:17:24 -0000 1.16
+++ pgsql.php 18 Jul 2002 13:02:15 -0000 1.17
@@ -106,12 +106,12 @@
'where active = 1 and (pg.project_id is null or pg.group_id in (%s)) '.
'group by p.project_id, p.project_name '.
'order by project_name',
- 'include-template-owner' => "SELECT sum(CASE WHEN status_name in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) , ".
- "sum(CASE WHEN status_name not in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) ".
+ 'include-template-owner' => "SELECT sum(CASE WHEN s.status_id in (".OPEN_BUG_STATUSES.") THEN 1 ELSE 0 END ) , ".
+ "sum(CASE WHEN s.status_id not in (".OPEN_BUG_STATUSES.") THEN 1 ELSE 0 END ) ".
"from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) ".
"where assigned_to = %s",
- 'include-template-reporter' => "SELECT sum(CASE WHEN status_name in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) , ".
- "sum(CASE WHEN status_name not in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) ".
+ 'include-template-reporter' => "SELECT sum(CASE WHEN s.status_id in (".OPEN_BUG_STATUSES.") THEN 1 ELSE 0 END ) , ".
+ "sum(CASE WHEN s.status_id not in (".OPEN_BUG_STATUSES.") THEN 1 ELSE 0 END ) ".
"from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) ".
"where created_by = %s",
'index-projsummary-1' => 'select project_name as "Project", '.
|