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
3331c1ba
Commit
3331c1ba
authored
Jul 25, 2015
by
David Lawrence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1161070: api searches should honour the same fields in its "order" parameter as the web UI
r=dylan,a=simon
parent
300331b4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
24 deletions
+49
-24
Bug.pm
Bugzilla/API/1_0/Resource/Bug.pm
+19
-1
Bug.pm
Bugzilla/WebService/Bug.pm
+19
-1
buglist.cgi
buglist.cgi
+11
-22
No files found.
Bugzilla/API/1_0/Resource/Bug.pm
View file @
3331c1ba
...
@@ -716,7 +716,25 @@ sub search {
...
@@ -716,7 +716,25 @@ sub search {
ThrowUserError
(
'buglist_parameters_required'
);
ThrowUserError
(
'buglist_parameters_required'
);
}
}
$options
{
order
}
=
[
split
(
/\s*,\s*/
,
delete
$match_params
->
{
order
})
]
if
$match_params
->
{
order
};
# Allow the use of order shortcuts similar to web UI
if
(
$match_params
->
{
order
})
{
# Convert the value of the "order" form field into a list of columns
# by which to sort the results.
my
%
order_types
=
(
"Bug Number"
=>
[
"bug_id"
],
"Importance"
=>
[
"priority"
,
"bug_severity"
],
"Assignee"
=>
[
"assigned_to"
,
"bug_status"
,
"priority"
,
"bug_id"
],
"Last Changed"
=>
[
"changeddate"
,
"bug_status"
,
"priority"
,
"assigned_to"
,
"bug_id"
],
);
if
(
$order_types
{
$match_params
->
{
order
}})
{
$options
{
order
}
=
$order_types
{
$match_params
->
{
order
}};
}
else
{
$options
{
order
}
=
[
split
(
/\s*,\s*/
,
$match_params
->
{
order
})
];
}
}
$options
{
params
}
=
$match_params
;
$options
{
params
}
=
$match_params
;
my
$search
=
new
Bugzilla::
Search
(
%
options
);
my
$search
=
new
Bugzilla::
Search
(
%
options
);
...
...
Bugzilla/WebService/Bug.pm
View file @
3331c1ba
...
@@ -575,7 +575,25 @@ sub search {
...
@@ -575,7 +575,25 @@ sub search {
ThrowUserError
(
'buglist_parameters_required'
);
ThrowUserError
(
'buglist_parameters_required'
);
}
}
$options
{
order
}
=
[
split
(
/\s*,\s*/
,
delete
$match_params
->
{
order
})
]
if
$match_params
->
{
order
};
# Allow the use of order shortcuts similar to web UI
if
(
$match_params
->
{
order
})
{
# Convert the value of the "order" form field into a list of columns
# by which to sort the results.
my
%
order_types
=
(
"Bug Number"
=>
[
"bug_id"
],
"Importance"
=>
[
"priority"
,
"bug_severity"
],
"Assignee"
=>
[
"assigned_to"
,
"bug_status"
,
"priority"
,
"bug_id"
],
"Last Changed"
=>
[
"changeddate"
,
"bug_status"
,
"priority"
,
"assigned_to"
,
"bug_id"
],
);
if
(
$order_types
{
$match_params
->
{
order
}})
{
$options
{
order
}
=
$order_types
{
$match_params
->
{
order
}};
}
else
{
$options
{
order
}
=
[
split
(
/\s*,\s*/
,
$match_params
->
{
order
})
];
}
}
$options
{
params
}
=
$match_params
;
$options
{
params
}
=
$match_params
;
my
$search
=
new
Bugzilla::
Search
(
%
options
);
my
$search
=
new
Bugzilla::
Search
(
%
options
);
...
...
buglist.cgi
View file @
3331c1ba
...
@@ -645,29 +645,18 @@ my @order_columns;
...
@@ -645,29 +645,18 @@ my @order_columns;
if
(
$order
)
{
if
(
$order
)
{
# Convert the value of the "order" form field into a list of columns
# Convert the value of the "order" form field into a list of columns
# by which to sort the results.
# by which to sort the results.
ORDER:
for
(
$order
)
{
my
%
order_types
=
(
/^Bug Number$/
&&
do
{
"Bug Number"
=>
[
"bug_id"
],
@order_columns
=
(
"bug_id"
);
"Importance"
=>
[
"priority"
,
"bug_severity"
],
last
ORDER
;
"Assignee"
=>
[
"assigned_to"
,
"bug_status"
,
"priority"
,
"bug_id"
],
};
"Last Changed"
=>
[
"changeddate"
,
"bug_status"
,
"priority"
,
/^Importance$/
&&
do
{
"assigned_to"
,
"bug_id"
],
@order_columns
=
(
"priority"
,
"bug_severity"
);
);
last
ORDER
;
if
(
$order_types
{
$order
})
{
};
@order_columns
=
@
{
$order_types
{
$order
}
};
/^Assignee$/
&&
do
{
}
@order_columns
=
(
"assigned_to"
,
"bug_status"
,
"priority"
,
else
{
"bug_id"
);
last
ORDER
;
};
/^Last Changed$/
&&
do
{
@order_columns
=
(
"changeddate"
,
"bug_status"
,
"priority"
,
"assigned_to"
,
"bug_id"
);
last
ORDER
;
};
do
{
# A custom list of columns. Bugzilla::Search will validate items.
@order_columns
=
split
(
/\s*,\s*/
,
$order
);
@order_columns
=
split
(
/\s*,\s*/
,
$order
);
};
}
}
}
}
...
...
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