|
From: Benjamin C. <bc...@us...> - 2002-09-03 19:43:52
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv25579
Modified Files:
query.php
Log Message:
Fixes bugs #546264 and 591125
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -r1.85 -r1.86
--- query.php 27 Aug 2002 00:14:32 -0000 1.85
+++ query.php 3 Sep 2002 19:43:48 -0000 1.86
@@ -57,7 +57,18 @@
function build_query($assignedto, $reportedby, $open) {
global $db, $_sv, $_gv, $perm, $restricted_projects;
- foreach ($_gv as $k => $v) { $$k = $v; }
+ $paramstr = '';
+ foreach ($_gv as $k => $v) {
+ $$k = $v;
+ if ($k == 'order' or $k == 'sort') continue;
+ if (is_array($v)) {
+ foreach ($v as $value) {
+ $paramstr .= "&{$k}[]=$value";
+ }
+ } else {
+ $paramstr .= "&$k=$v";
+ }
+ }
// Open bugs assigned to the user -- a hit list
if ($assignedto || $reportedby) {
@@ -136,9 +147,9 @@
}
if (!empty($query)) {
- return delimit_list(' and ',$query);
+ return array(delimit_list(' and ',$query), $paramstr);
} else {
- return '';
+ return array('', '');
}
}
@@ -273,12 +284,12 @@
$HTTP_SESSION_VARS['queryinfo']['sort'] = $sort;
if (empty($HTTP_SESSION_VARS['queryinfo']['query']) or isset($op)) {
- $HTTP_SESSION_VARS['queryinfo']['query'] = build_query($assignedto, $reportedby, $open);
+ list($HTTP_SESSION_VARS['queryinfo']['query'], $paramstr) =
+ build_query($assignedto, $reportedby, $open);
}
-
$nr = $db->getOne($QUERY['query-list-bugs-count'].
(!empty($HTTP_SESSION_VARS['queryinfo']['query'])
- ? "and {$HTTP_SESSION_VARS['queryinfo']['query']}": ''));
+ ? $HTTP_SESSION_VARS['queryinfo']['query']: '1'));
$HTTP_SESSION_VARS['queryinfo']['numrows'] = $nr;
list($selrange, $llimit) = multipages($nr, $page, "order=$order&sort=$sort");
@@ -304,7 +315,7 @@
? "and {$HTTP_SESSION_VARS['queryinfo']['query']} " : ''),
$order, $sort), $llimit, $selrange)));
- sorting_headers($me, $headers, $order, $sort, "page=$page");
+ sorting_headers($me, $headers, $order, $sort, "page=$page".$paramstr);
$t->wrap('buglist.html', 'buglist');
}
|