summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-12-11 02:38:08 +0100
committerByron Jones <bjones@mozilla.com>2012-12-11 02:38:08 +0100
commit7ef08cc7c04992fb524f7f6b802ede78e6671f3b (patch)
tree352f09633a8285104c75c6a47bdcf116a23188a2
parent30d411c5782453456a5818f04fad113305300443 (diff)
downloadbugzilla-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.pm15
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 };
}