|
From: Benjamin C. <bc...@us...> - 2002-03-29 18:25:41
|
Update of /cvsroot/phpbt/phpbt/inc
In directory usw-pr-cvs1:/tmp/cvs-serv20053/inc
Modified Files:
functions.php
Log Message:
Database independence... ooo-eee!
Index: functions.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/functions.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- functions.php 26 Mar 2002 18:40:27 -0000 1.12
+++ functions.php 29 Mar 2002 18:25:38 -0000 1.13
@@ -43,7 +43,7 @@
///
/// Build a select box with the item matching $value selected
function build_select($box, $value = '', $project = 0) {
- global $db, $select, $perm, $STRING, $restricted_projects;
+ global $db, $select, $perm, $STRING, $restricted_projects, $QUERY;
//create hash to map tablenames
$cfgDatabase = array(
@@ -131,8 +131,7 @@
}
break;
case 'bug_cc' :
- $rs = $db->query('select b.user_id, login from '.TBL_BUG_CC.' b left join '.
- TBL_AUTH_USER." using(user_id) where bug_id = $value");
+ $rs = $db->query(sprintf($QUERY['functions-bug-cc'], $value));
while (list($uid, $user) = $rs->fetchRow(DB_FETCHMODE_ORDERED)) {
$text .= "<option value=\"$uid\">".maskemail($user).'</option>';
}
@@ -314,7 +313,7 @@
///
/// Build the javascript for the dynamic project -> component -> version select boxes
function build_project_js() {
- global $db, $u, $perm, $_sv;
+ global $db, $u, $perm, $_sv, $QUERY;
$js = '';
@@ -323,11 +322,7 @@
$rs = $db->query("select project_id, project_name from ".TBL_PROJECT.
" where active = 1 order by project_name");
} else {
- $rs = $db->query('select p.project_id, project_name from '.TBL_PROJECT.
- ' p left join '.TBL_PROJECT_GROUP.' pg using(project_id)
- where active = 1 and (pg.project_id is null or pg.group_id in ('.
- delimit_list(',', $_sv['group_ids']).')) group by
- p.project_id, p.project_name order by project_name');
+ $rs = $db->query(sprintf($QUERY['functions-project-js'], $_sv['group_ids']));
}
while (list($pid, $pname) = $rs->fetchRow(DB_FETCHMODE_ORDERED)) {
$pname = addslashes($pname);
|