|
From: Ken T. <ke...@us...> - 2003-07-25 02:50:11
|
Update of /cvsroot/phpbt/phpbt/inc
In directory sc8-pr-cvs1:/tmp/cvs-serv24962/inc
Modified Files:
Tag: phpbt-1_0
functions.php
Log Message:
transfer
Index: functions.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/functions.php,v
retrieving revision 1.42
retrieving revision 1.42.2.1
diff -u -r1.42 -r1.42.2.1
--- functions.php 5 Jul 2003 22:54:26 -0000 1.42
+++ functions.php 25 Jul 2003 02:50:08 -0000 1.42.2.1
@@ -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.' = '.(count($closed_statuses ? join(' OR '.$column.' = ', $closed_statuses) : '1')).')';
+}
+
+// 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;
+ }
+}
?>
|