|
From: Benjamin C. <bc...@us...> - 2001-09-01 16:15:05
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv6360
Modified Files:
include.php
Log Message:
Tweaked build_select a bit, plus fixed a problem with the project query in it
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- include.php 2001/09/01 15:44:20 1.45
+++ include.php 2001/09/01 16:15:01 1.46
@@ -269,22 +269,23 @@
//create hash to map tablenames
$cfgDatabase=array(
- 'project' => TBL_PROJECT,
- 'component' => TBL_COMPONENT,
- 'status' => TBL_STATUS,
- 'resolution' => TBL_RESOLUTION,
- 'severity' => TBL_SEVERITY,
- 'version' => TBL_VERSION
+ 'project' => TBL_PROJECT,
+ 'component' => TBL_COMPONENT,
+ 'status' => TBL_STATUS,
+ 'resolution' => TBL_RESOLUTION,
+ 'severity' => TBL_SEVERITY,
+ 'version' => TBL_VERSION
);
$text = '';
+ $querystart = "select {$box}_id, {$box}_name from $cfgDatabase[$box]";
$queries = array(
- 'severity' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where sort_order > 0 order by sort_order",
- 'status' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where sort_order > 0 order by sort_order",
- 'resolution' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where sort_order > 0 order by sort_order",
- 'project' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where active = 0 order by {$box}_name",
- 'component' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where project_id = $project order by {$box}_name",
- 'version' => "select {$box}_id, {$box}_name from ".$cfgDatabase[$box]." where project_id = $project order by {$box}_name"
+ 'severity' => $querystart.' where sort_order > 0 order by sort_order',
+ 'status' => $querystart.' where sort_order > 0 order by sort_order',
+ 'resolution' => $querystart.' where sort_order > 0 order by sort_order',
+ 'project' => $querystart." where active > 0 order by {$box}_name",
+ 'component' => $querystart." where project_id = $project order by {$box}_name",
+ 'version' => $querystart." where project_id = $project order by {$box}_name"
);
switch($box) {
@@ -299,7 +300,7 @@
if ($value == $row[$box.'_id'] and $value != '') $sel = ' selected';
else $sel = '';
$text .= '<option value="'.
- $row[$box.'_id']."\"$sel>".$row[$box.'_name']."</option>";
+ $row[$box.'_id']."\"$sel>".$row[$box.'_name'].'</option>';
}
break;
case 'os' :
|