|
From: Ken T. <ke...@us...> - 2003-07-24 04:51:05
|
Update of /cvsroot/phpbt/phpbt
In directory sc8-pr-cvs1:/tmp/cvs-serv1772
Modified Files:
bug.php config-dist.php config.php index.php install.php
upgrade.php
Log Message:
Multiple statuses can now be set as 'open' or 'closed' -- no longer will
just BUG_CLOSED show up in most-recently-closed-bugs, etc.
Admin ui allow reassigning open/closed bit to statuses. mysql DB
touched, rolling to version 4.
Fixed install.php DB_VERSIONing problem.
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -r1.133 -r1.134
--- bug.php 6 Jul 2003 22:57:33 -0000 1.133
+++ bug.php 24 Jul 2003 04:47:13 -0000 1.134
@@ -437,7 +437,7 @@
$os_id = $os_id ? $os_id : 0;
$severity_id = $severity_id ? $severity_id : 0;
- if ($status_id == BUG_CLOSED) {
+ if (is_closed($status_id)) {
$closed_query = ", close_date = $now";
} else {
$closed_query = '';
Index: config-dist.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/config-dist.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- config-dist.php 10 Jun 2003 16:18:59 -0000 1.25
+++ config-dist.php 24 Jul 2003 04:47:13 -0000 1.26
@@ -34,7 +34,7 @@
// Database Table Config
// you can change either the prefix of the table names or each table name individually
-define ('DB_VERSION', 3); // the version of the database
+define ('DB_VERSION', 4); // the version of the database
define ('TBL_PREFIX', '{tbl_prefix}'); // the prefix for all tables, leave empty to use the old style
define ('TBL_ACTIVE_SESSIONS', TBL_PREFIX.'active_sessions');
Index: config.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/config.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- config.php 4 Jun 2003 18:47:19 -0000 1.37
+++ config.php 24 Jul 2003 04:47:13 -0000 1.38
@@ -37,7 +37,7 @@
// Database Table Config
// you can change either the prefix of the table names or each table name individually
-define ('DB_VERSION', 3); // the version of the database
+define ('DB_VERSION', 4); // the version of the database
define ('TBL_PREFIX', ''); // the prefix for all tables, leave empty to use the old style
define ('TBL_ACTIVE_SESSIONS', TBL_PREFIX.'active_sessions');
define ('TBL_DB_SEQUENCE', TBL_PREFIX.'db_sequence');
Index: index.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/index.php,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- index.php 18 Feb 2003 12:50:57 -0000 1.38
+++ index.php 24 Jul 2003 04:47:13 -0000 1.39
@@ -171,7 +171,7 @@
$db->getAll($db->modifyLimitQuery('select b.bug_id, title, project_name from '.TBL_BUG.' b, '.
TBL_PROJECT.' p'.
" where b.project_id not in ($restricted_projects)".
- ' and status_id = '.BUG_CLOSED.
+ ' and '.in_closed('status_id').
' and b.project_id = p.project_id order by close_date desc', 0, 5)));
if ($u != 'nobody') {
Index: install.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/install.php,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- install.php 11 Jun 2003 12:05:17 -0000 1.38
+++ install.php 24 Jul 2003 04:47:13 -0000 1.39
@@ -193,6 +193,12 @@
$db->query(stripslashes($do_query));
$do_query = '';
}
+ /*!! BAD! Must figure out how to get db_version from config-dist.php... */
+ $query = preg_replace(array_keys($tables), array_values($tables), 'INSERT INTO '.TBL_CONFIGURATION.' (varname,varvalue,description,vartype) VALUES (\'DB_VERSION\', './*!!!*/4/*!!!*/.', \'Database Version <b>Warning:</b> Changing this might make things go horribly wrong, so don\\\'t change it.\', \'mixed\')');
+ $res = $db->query($query);
+ if (PEAR::isError($res)) {
+ echo 'DB_VERSION not set!';
+ }
}
function check_vars() {
Index: upgrade.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/upgrade.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- upgrade.php 4 Jun 2003 18:47:19 -0000 1.34
+++ upgrade.php 24 Jul 2003 04:47:13 -0000 1.35
@@ -43,10 +43,15 @@
break;
case 'mysql' :
$db->query("create table if not exists ".TBL_PROJECT_PERM." ( project_id int(11) NOT NULL default '0', user_id int(11) NOT NULL default '0' )");
- if ($thisvers < 2)
+ if ($thisvers < 2) {
$db->query("alter table ".TBL_AUTH_GROUP." ADD assignable TINYINT DEFAULT 0 NOT NULL AFTER locked");
- if ($thisvers < 3)
+ }
+ if ($thisvers < 3) {
$db->query("ALTER TABLE ".TBL_USER_PREF." ADD def_results INT DEFAULT '20' NOT NULL");
+ }
+ if ($thisvers < 4) {
+ $db->query('ALTER TABLE '.TBL_STATUS.' ADD bug_open TINYINT DEFAULT \'1\' NOT NULL');
+ }
break;
case 'pgsql' :
//! Missing Alter/Create's
@@ -57,12 +62,18 @@
break;
}
+ /** Database-independent changes */
if ($thisvers < 2) {
$db->query("DELETE FROM ".TBL_CONFIGURATION." WHERE varname = 'GROUP_ASSIGN_TO'");
$db->query("UPDATE ".TBL_AUTH_GROUP." SET assignable = 1 WHERE group_id = 3");
$db->query("INSERT INTO ".TBL_CONFIGURATION." VALUES ('EMAIL_DISABLED', '0', 'Whether to disable all mail sent from the system', 'bool');");
/* add db-version attribute */
$db->query("INSERT INTO ".TBL_CONFIGURATION." VALUES ('DB_VERSION', '".DB_VERSION."', 'Database Version <b>Warning:</b> Changing this might make things go horribly wrong.', 'string')");
+ }
+
+ if ($thisvers < 4) {
+ $db->query('DELETE FROM '.TBL_CONFIGURATION.' WHERE varname = \'BUG_CLOSED\'');
+ echo 'You must set your Statuses to either open or closed. Default settings should be modified so that "resolved", "closed", and "verified" are shown as being closed, and all other statuses are set to open.';
}
/* update to current DB_VERSION */
|