|
From: Ken T. <ke...@us...> - 2003-07-26 02:28:21
|
Update of /cvsroot/phpbt/phpbt
In directory sc8-pr-cvs1:/tmp/cvs-serv22010
Modified Files:
Tag: phpbt-1_0
config-dist.php config.php upgrade.php
Log Message:
DB_VERSION => CUR_DB_VERSION
Index: config-dist.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/config-dist.php,v
retrieving revision 1.25.2.1
retrieving revision 1.25.2.2
diff -u -r1.25.2.1 -r1.25.2.2
--- config-dist.php 25 Jul 2003 02:50:07 -0000 1.25.2.1
+++ config-dist.php 25 Jul 2003 19:26:33 -0000 1.25.2.2
@@ -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', 4); // the version of the database
+define ('CUR_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.2.1
retrieving revision 1.37.2.2
diff -u -r1.37.2.1 -r1.37.2.2
--- config.php 25 Jul 2003 02:50:07 -0000 1.37.2.1
+++ config.php 25 Jul 2003 19:26:33 -0000 1.37.2.2
@@ -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', 4); // the version of the database
+define ('CUR_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: upgrade.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/upgrade.php,v
retrieving revision 1.34.2.1
retrieving revision 1.34.2.2
diff -u -r1.34.2.1 -r1.34.2.2
--- upgrade.php 25 Jul 2003 02:50:08 -0000 1.34.2.1
+++ upgrade.php 25 Jul 2003 19:26:33 -0000 1.34.2.2
@@ -30,7 +30,7 @@
global $db;
$thisvers = $db->getOne('select varvalue from '.TBL_CONFIGURATION.' where varname = \'DB_VERSION\'');
- if ($thisvers == DB_VERSION) $upgraded = 1;
+ if ($thisvers == CUR_DB_VERSION) $upgraded = 1;
if (!$upgraded or DB::isError($thisvers)) {
if (!@is_writeable('c_templates')) {
include('templates/default/base/templatesperm.html');
@@ -68,7 +68,12 @@
$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')");
+ $db->query("INSERT INTO ".TBL_CONFIGURATION." VALUES ('DB_VERSION', '".CUR_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.';
}
if ($thisvers < 4) {
@@ -77,7 +82,7 @@
}
/* update to current DB_VERSION */
- $db->query("UPDATE ".TBL_CONFIGURATION." SET varvalue = '".DB_VERSION."' WHERE varname = 'DB_VERSION'");
+ $db->query("UPDATE ".TBL_CONFIGURATION." SET varvalue = '".CUR_DB_VERSION."' WHERE varname = 'DB_VERSION'");
}
include 'templates/default/upgrade-finished.html';
|