From 7ef08cc7c04992fb524f7f6b802ede78e6671f3b Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Mon, 10 Dec 2012 17:38:08 -0800 Subject: Bug 819589: change the sort order of bugzilla products when component searching for mozilla employees --- extensions/BMO/lib/WebService.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'extensions') diff --git a/extensions/BMO/lib/WebService.pm b/extensions/BMO/lib/WebService.pm index cd3b9a92c..a9387b330 100644 --- a/extensions/BMO/lib/WebService.pm +++ b/extensions/BMO/lib/WebService.pm @@ -163,6 +163,21 @@ sub prod_comp_search { ORDER BY products.name $limit", { Slice => {} }); + # To help mozilla staff file bmo administration bugs into the right + # component, sort bmo in front of bugzilla. + if ($user->in_group('mozilla-corporation') || $user->in_group('mozilla-foundation')) { + $products = [ + sort { + return 1 if $a->{product} eq 'Bugzilla' + && $b->{product} eq 'bugzilla.mozilla.org'; + return -1 if $b->{product} eq 'Bugzilla' + && $a->{product} eq 'bugzilla.mozilla.org'; + return lc($a->{product}) cmp lc($b->{product}) + || lc($a->{component}) cmp lc($b->{component}); + } @$products + ]; + } + return { products => $products }; } -- cgit v1.2.3-24-g4f1b