Update of /cvsroot/phpbt/phpbt
In directory sc8-pr-cvs1:/tmp/cvs-serv24962
Modified Files:
Tag: phpbt-1_0
CHANGELOG bug.php config-dist.php config.php index.php
install.php query.php upgrade.php
Log Message:
transfer
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/phpbt/phpbt/CHANGELOG,v
retrieving revision 1.66
retrieving revision 1.66.2.1
diff -u -r1.66 -r1.66.2.1
--- CHANGELOG 9 Apr 2003 12:41:30 -0000 1.66
+++ CHANGELOG 25 Jul 2003 02:50:07 -0000 1.66.2.1
@@ -11,6 +11,7 @@
: Added ability to disable all email sent from the system.
: Fixed a bug with not being able to change the name of the 'Developer' group.
: Added tracking of changes in priority to the bug history.
+: You can now search on "additional comments" and "description".
-- 0.9.1 -- 4 Jan 2003
: Fixed bugs with PostgreSQL
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.133
retrieving revision 1.133.2.1
diff -u -r1.133 -r1.133.2.1
--- bug.php 6 Jul 2003 22:57:33 -0000 1.133
+++ bug.php 25 Jul 2003 02:50:07 -0000 1.133.2.1
@@ -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.25.2.1
diff -u -r1.25 -r1.25.2.1
--- config-dist.php 10 Jun 2003 16:18:59 -0000 1.25
+++ config-dist.php 25 Jul 2003 02:50:07 -0000 1.25.2.1
@@ -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.37.2.1
diff -u -r1.37 -r1.37.2.1
--- config.php 4 Jun 2003 18:47:19 -0000 1.37
+++ config.php 25 Jul 2003 02:50:07 -0000 1.37.2.1
@@ -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.38.2.1
diff -u -r1.38 -r1.38.2.1
--- index.php 18 Feb 2003 12:50:57 -0000 1.38
+++ index.php 25 Jul 2003 02:50:07 -0000 1.38.2.1
@@ -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.38.2.1
diff -u -r1.38 -r1.38.2.1
--- install.php 11 Jun 2003 12:05:17 -0000 1.38
+++ install.php 25 Jul 2003 02:50:07 -0000 1.38.2.1
@@ -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: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.96.2.1
retrieving revision 1.96.2.2
diff -u -r1.96.2.1 -r1.96.2.2
--- query.php 13 Jul 2003 14:20:18 -0000 1.96.2.1
+++ query.php 25 Jul 2003 02:50:07 -0000 1.96.2.2
@@ -20,7 +20,7 @@
// along with phpBugTracker; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ------------------------------------------------------------------------
-// $Id$
+
include 'include.php';
@@ -123,8 +123,14 @@
$query[] = '('.@join(' and ',$equery).')';
}
+ // Search for additional comments with 'description'
+ $bugs_with_comment = array();
+ foreach ($db->getAll('SELECT bug_id FROM '.TBL_COMMENT.' WHERE comment_text LIKE \'%'.$description.'%\'') as $row) {
+ $bugs_with_comment[] = $row['bug_id'];
+ }
+
// Text search field(s)
- foreach(array('title','description','url') as $searchfield) {
+ foreach(array('title','url') as $searchfield) {
if (!empty($$searchfield)) {
switch (${$searchfield."_type"}) {
case 'like' : $cond = "like '%".$$searchfield."%'"; break;
@@ -133,6 +139,14 @@
}
$fields[] = "$searchfield $cond";
}
+ }
+ if (!empty($description)) {
+ switch($description_type) {
+ case 'like' : $cond = 'like \'%'.$description.'%\''; break;
+ case 'rlike' : $cond = 'rlike \''.$description.'\''; break;
+ case 'not rlike' : $cond = 'not rlike \''.$description.'\'';
+ }
+ $fields[] = '(description '.$cond.(count($bugs_with_comment) ? ' OR bug_id = '.join(' OR bug_id = ', $bugs_with_comment):'').')';
}
if (!empty($fields)) $query[] = '('.@join(' and ',$fields).')';
Index: upgrade.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/upgrade.php,v
retrieving revision 1.34
retrieving revision 1.34.2.1
diff -u -r1.34 -r1.34.2.1
--- upgrade.php 4 Jun 2003 18:47:19 -0000 1.34
+++ upgrade.php 25 Jul 2003 02:50:08 -0000 1.34.2.1
@@ -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 */
|