|
From: Ken T. <ke...@us...> - 2003-07-24 04:51:04
|
Update of /cvsroot/phpbt/phpbt/inc
In directory sc8-pr-cvs1:/tmp/cvs-serv1772/inc
Modified Files:
functions.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: functions.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/functions.php,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- functions.php 5 Jul 2003 22:54:26 -0000 1.42
+++ functions.php 24 Jul 2003 04:47:13 -0000 1.43
@@ -571,4 +571,27 @@
return ($retval);
}
+// Generate a testable WHERE expression for closed bugs
+function in_closed($column) {
+ global $db;
+
+ $closed_statuses = array();
+
+ foreach($db->getAll('SELECT status_id FROM '.TBL_STATUS.' WHERE bug_open = 0') as $row) {
+ $closed_statuses[] = (int)$row['status_id'];
+ }
+
+ return '('.$column.' = '.join(' OR '.$column.' = ', $closed_statuses).')';
+}
+
+// Check whether or not a status-id means BUG_CLOSED
+function is_closed($status_id) {
+ global $db;
+
+ if ($db->getOne('SELECT status_id FROM '.TBL_STATUS.' WHERE bug_open = 0 AND status_id = '.$status_id)) {
+ return true;
+ } else {
+ return false;
+ }
+}
?>
|