diff options
author | Byron Jones <bjones@mozilla.com> | 2012-12-11 02:38:08 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2012-12-11 02:38:08 +0100 |
commit | 7ef08cc7c04992fb524f7f6b802ede78e6671f3b (patch) | |
tree | 352f09633a8285104c75c6a47bdcf116a23188a2 | |
parent | 30d411c5782453456a5818f04fad113305300443 (diff) | |
download | bugzilla-7ef08cc7c04992fb524f7f6b802ede78e6671f3b.tar.gz bugzilla-7ef08cc7c04992fb524f7f6b802ede78e6671f3b.tar.xz |
Bug 819589: change the sort order of bugzilla products when component searching for mozilla employees
-rw-r--r-- | extensions/BMO/lib/WebService.pm | 15 |
1 files changed, 15 insertions, 0 deletions
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 }; } |