|
From: Ulf E. <ulf...@us...> - 2005-08-22 20:40:16
|
Update of /cvsroot/phpbt/phpbt/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20444/phpbt/inc Modified Files: functions.php Log Message: RFE #711560 - Edit query capability Index: functions.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/functions.php,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- functions.php 22 Aug 2005 20:21:42 -0000 1.58 +++ functions.php 22 Aug 2005 20:40:08 -0000 1.59 @@ -107,8 +107,7 @@ break; case 'group': if ($project) { // If we are building for project admin page - if (is_array($selected) && (!count($selected) or (count($selected) && in_array(0, $selected))) or - !isset($selected) or $selected == 0) { + if (!is_array($selected) or !count($selected) or (count($selected) && in_array(0, $selected))) { $sel = ' selected'; } else { $sel = ''; @@ -138,8 +137,10 @@ case 'version': $rs = $db->query($queries[$box]); while ($rs->fetchInto($row)) { - if ($selected == $row[$box.'_id'] and $selected != '') { + if (is_array($selected) && count($selected) && in_array($row[$box.'_id'], $selected)) { $sel = ' selected'; + } elseif ($selected == $row[$box.'_id'] and $selected != '') { + $sel = ' selected'; } else { $sel = ''; } @@ -153,6 +154,8 @@ if ($selected == '' and isset($row['Regex']) and preg_match($row['Regex'],$GLOBALS['HTTP_USER_AGENT'])) { $sel = ' selected'; + } elseif (is_array($selected) && count($selected) && in_array($row[$box.'_id'], $selected)) { + $sel = ' selected'; } elseif ($selected == $row[$box.'_id']) { $sel = ' selected'; } else { @@ -166,7 +169,7 @@ $rs = $db->query("select DISTINCT u.user_id, login from ".TBL_AUTH_USER." u, ".TBL_USER_GROUP." ug, ".TBL_GROUP_PERM." gp, ".TBL_AUTH_PERM." p where u.active > 0 and u.user_id = ug.user_id and ug.group_id = gp.group_id and gp.perm_id = p.perm_id and p.perm_name = 'Assignable' order by login"); while ($rs->fetchInto($row)) { // either singular matches, or array matches are acceptable - if (($selected == $row['user_id']) || (is_array($selected) && in_array($row['user_id'], $selected))) { + if (($selected == $row['user_id']) || (is_array($selected) && count($selected) && in_array($row['user_id'], $selected))) { $sel = ' selected'; } else { $sel = ''; @@ -285,7 +288,9 @@ default : $deadarray = $select[$box]; while(list($val,$item) = each($deadarray)) { - if ($selected == $val and $selected != '') { + if (is_array($selected) && count($selected) && in_array($val, $selected)) { + $sel = ' selected'; + } elseif ($selected == $val and $selected != '') { $sel = ' selected'; } else { $sel = ''; |