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
4aa633ce
Commit
4aa633ce
authored
Sep 28, 2013
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 891311: Text in the "My Requests" page is misleading about how the AND/OR radio button works
r=dkl a=justdave
parent
72bc89ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
34 deletions
+36
-34
request.cgi
request.cgi
+31
-27
queue.html.tmpl
template/en/default/request/queue.html.tmpl
+5
-7
No files found.
request.cgi
View file @
4aa633ce
...
...
@@ -159,22 +159,8 @@ sub queue {
# need to display a "status" column in the report because the value for that
# 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
$do_union
;
}
elsif
(
$status
ne
"all"
)
{
push
(
@criteria
,
"flags.status = '$status'"
);
push
(
@excluded_columns
,
'status'
)
unless
$do_union
;
}
}
# Filter results by exact email address of requester or requestee.
if
(
defined
$cgi
->
param
(
'requester'
)
&&
$cgi
->
param
(
'requester'
)
ne
""
)
{
my
$requester
=
$dbh
->
quote
(
$cgi
->
param
(
'requester'
));
...
...
@@ -186,23 +172,44 @@ sub queue {
if
(
$cgi
->
param
(
'requestee'
)
ne
"-"
)
{
my
$requestee
=
$dbh
->
quote
(
$cgi
->
param
(
'requestee'
));
trick_taint
(
$requestee
);
# Quoted above
push
(
@criteria
,
$dbh
->
sql_istrcmp
(
'requestees.login_name'
,
$requestee
));
push
(
@criteria
,
$dbh
->
sql_istrcmp
(
'requestees.login_name'
,
$requestee
));
}
else
{
push
(
@criteria
,
"flags.requestee_id IS NULL"
);
}
else
{
push
(
@criteria
,
"flags.requestee_id IS NULL"
)
}
push
(
@excluded_columns
,
'requestee'
)
unless
$do_union
;
}
# If the user wants requester = foo OR requestee = bar, we have to join
# these criteria separately as all other criteria use AND.
if
(
@criteria
==
2
&&
$do_union
)
{
my
$union
=
join
(
' OR '
,
@criteria
);
@criteria
=
(
"($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'
);
}
elsif
(
$status
ne
"all"
)
{
push
(
@criteria
,
"flags.status = '$status'"
);
push
(
@excluded_columns
,
'status'
);
}
}
# 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
$do_union
;
push
(
@excluded_columns
,
'product'
);
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
$do_union
;
push
(
@excluded_columns
,
'component'
);
}
}
...
...
@@ -220,14 +227,11 @@ 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
$do_union
;
push
(
@excluded_columns
,
'type'
);
}
# 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
);
$query
.=
' AND '
.
join
(
' AND '
,
@criteria
)
if
scalar
(
@criteria
);
# Group the records by flag ID so we don't get multiple rows of data
# for each flag. This is only necessary because of the code that
# removes flags on bugs the user is unauthorized to access.
...
...
template/en/default/request/queue.html.tmpl
View file @
4aa633ce
...
...
@@ -147,18 +147,16 @@ to some group are shown by default.
<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>
<select id="do_union" name="do_union">
<option value="0">Match the requester AND requestee</option>
<option value="1" [% 'selected="selected"' IF cgi.param('do_union') %]>
Match the requester OR requestee</option>
</select>
</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