Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
c0f6b0de
Commit
c0f6b0de
authored
May 28, 2012
by
Koosha Khajeh Moogahi
Committed by
Frédéric Buclin
May 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 206455: Add radio buttons in request.cgi to use the do_union param
r/a=LpSolit
parent
d1f2e120
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
11 deletions
+24
-11
request.cgi
request.cgi
+12
-11
queue.html.tmpl
template/en/default/request/queue.html.tmpl
+12
-0
No files found.
request.cgi
View file @
c0f6b0de
...
...
@@ -160,16 +160,18 @@ sub queue {
# column will always be the same.
my
@excluded_columns
=
();
my
$do_union
=
$cgi
->
param
(
'do_union'
);
# Filter requests by status: "pending", "granted", "denied", "all"
# (which means any), or "fulfilled" (which means "granted" or "denied").
if
(
$status
)
{
if
(
$status
eq
"+-"
)
{
push
(
@criteria
,
"flags.status IN ('+', '-')"
);
push
(
@excluded_columns
,
'status'
)
unless
$
cgi
->
param
(
'do_union'
)
;
push
(
@excluded_columns
,
'status'
)
unless
$
do_union
;
}
elsif
(
$status
ne
"all"
)
{
push
(
@criteria
,
"flags.status = '$status'"
);
push
(
@excluded_columns
,
'status'
)
unless
$
cgi
->
param
(
'do_union'
)
;
push
(
@excluded_columns
,
'status'
)
unless
$
do_union
;
}
}
...
...
@@ -178,7 +180,7 @@ sub queue {
my
$requester
=
$dbh
->
quote
(
$cgi
->
param
(
'requester'
));
trick_taint
(
$requester
);
# Quoted above
push
(
@criteria
,
$dbh
->
sql_istrcmp
(
'requesters.login_name'
,
$requester
));
push
(
@excluded_columns
,
'requester'
)
unless
$
cgi
->
param
(
'do_union'
)
;
push
(
@excluded_columns
,
'requester'
)
unless
$
do_union
;
}
if
(
defined
$cgi
->
param
(
'requestee'
)
&&
$cgi
->
param
(
'requestee'
)
ne
""
)
{
if
(
$cgi
->
param
(
'requestee'
)
ne
"-"
)
{
...
...
@@ -188,19 +190,19 @@ sub queue {
$requestee
));
}
else
{
push
(
@criteria
,
"flags.requestee_id IS NULL"
)
}
push
(
@excluded_columns
,
'requestee'
)
unless
$
cgi
->
param
(
'do_union'
)
;
push
(
@excluded_columns
,
'requestee'
)
unless
$
do_union
;
}
# Filter results by exact product or component.
if
(
defined
$cgi
->
param
(
'product'
)
&&
$cgi
->
param
(
'product'
)
ne
""
)
{
my
$product
=
Bugzilla::
Product
->
check
(
scalar
$cgi
->
param
(
'product'
));
push
(
@criteria
,
"bugs.product_id = "
.
$product
->
id
);
push
(
@excluded_columns
,
'product'
)
unless
$
cgi
->
param
(
'do_union'
)
;
push
(
@excluded_columns
,
'product'
)
unless
$
do_union
;
if
(
defined
$cgi
->
param
(
'component'
)
&&
$cgi
->
param
(
'component'
)
ne
""
)
{
my
$component
=
Bugzilla::
Component
->
check
({
product
=>
$product
,
name
=>
scalar
$cgi
->
param
(
'component'
)
});
push
(
@criteria
,
"bugs.component_id = "
.
$component
->
id
);
push
(
@excluded_columns
,
'component'
)
unless
$
cgi
->
param
(
'do_union'
)
;
push
(
@excluded_columns
,
'component'
)
unless
$
do_union
;
}
}
...
...
@@ -218,13 +220,12 @@ sub queue {
my
$quoted_form_type
=
$dbh
->
quote
(
$form_type
);
trick_taint
(
$quoted_form_type
);
# Already SQL quoted
push
(
@criteria
,
"flagtypes.name = "
.
$quoted_form_type
);
push
(
@excluded_columns
,
'type'
)
unless
$
cgi
->
param
(
'do_union'
)
;
push
(
@excluded_columns
,
'type'
)
unless
$
do_union
;
}
# Add the criteria to the query. We do an intersection by default
# but do a union if the "do_union" URL parameter (for which there is no UI
# because it's an advanced feature that people won't usually want) is true.
my
$and_or
=
$cgi
->
param
(
'do_union'
)
?
" OR "
:
" AND "
;
# Add the criteria to the query. Do a union if OR is selected.
# Otherwise do an intersection.
my
$and_or
=
$do_union
?
' OR '
:
' AND '
;
$query
.=
" AND ("
.
join
(
$and_or
,
@criteria
)
.
") "
if
scalar
(
@criteria
);
# Group the records by flag ID so we don't get multiple rows of data
...
...
template/en/default/request/queue.html.tmpl
View file @
c0f6b0de
...
...
@@ -147,10 +147,22 @@ to some group are shown by default.
} %]
[% PROCESS "global/select-menu.html.tmpl" name="group" options=groups default=cgi.param('group') %]
</td>
</tr>
<tr>
<th></th>
<td>
<label><input type="radio" name="do_union" value="0"
[% 'checked="checked"' IF !cgi.param('do_union') %]>AND *</label>
<label><input type="radio" name="do_union" value="1"
[% 'checked="checked"' IF cgi.param('do_union') %]>OR *</label>
</td>
<td colspan="3"></td>
<td><input type="submit" id="filter" value="Filter"></td>
</tr>
</table>
<p>(* The logical conjunction/disjunction between the requester
and the requestee)</p>
</form>
[% column_headers = {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment