From 1ccc683d4d94ea70e763fbd4af9721cb4bca1c0d Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Mon, 2 Feb 2015 12:38:16 +0800 Subject: Bug 1123769: add a "rank" field to bugzilla to track priority --- extensions/BMO/Extension.pm | 13 +++++++ extensions/BMO/lib/Data.pm | 17 +++++---- .../hook/bug/edit-after_importance.html.tmpl | 10 ++++++ .../default/hook/bug/edit-custom_field.html.tmpl | 11 ++++++ extensions/BMO/web/styles/edit_bug.css | 40 +++++++++------------- 5 files changed, 61 insertions(+), 30 deletions(-) create mode 100644 extensions/BMO/template/en/default/hook/bug/edit-custom_field.html.tmpl (limited to 'extensions') diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index 75ca30d8d..97e31796c 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -834,6 +834,19 @@ sub install_update_db { # remove tables from the old TryAutoLand extension $dbh->bz_drop_table('autoland_branches'); $dbh->bz_drop_table('autoland_attachments'); + + unless (Bugzilla::Field->new({ name => 'cf_rank' })) { + Bugzilla::Field->create({ + name => 'cf_rank', + description => 'Rank', + type => FIELD_TYPE_INTEGER, + mailhead => 0, + enter_bug => 0, + obsolete => 0, + custom => 1, + buglist => 1, + }); + } } sub _last_closed_date { diff --git a/extensions/BMO/lib/Data.pm b/extensions/BMO/lib/Data.pm index bc205de19..521f585d9 100644 --- a/extensions/BMO/lib/Data.pm +++ b/extensions/BMO/lib/Data.pm @@ -49,7 +49,7 @@ tie(%$cf_visible_in_products, "Tie::IxHash", "DCOps", ], }, - qw/^cf_office$/ => { + qr/^cf_office$/ => { "mozilla.org" => ["Server Operations: Desktop Issues"], }, qr/^cf_crash_signature$/ => { @@ -86,7 +86,7 @@ tie(%$cf_visible_in_products, "Tie::IxHash", "Thunderbird" => [], "Toolkit" => [], }, - qw/^cf_due_date$/ => { + qr/^cf_due_date$/ => { "bugzilla.mozilla.org" => [], "Community Building" => [], "Data & BI Services Team" => [], @@ -98,16 +98,20 @@ tie(%$cf_visible_in_products, "Tie::IxHash", "Mozilla PR" => [], "Mozilla Reps" => [], }, - qw/^cf_locale$/ => { + qr/^cf_locale$/ => { "Mozilla Localizations" => ['Other'], "www.mozilla.org" => [], }, - qw/^cf_mozilla_project$/ => { + qr/^cf_mozilla_project$/ => { "Data & BI Services Team" => [], }, - qw/^cf_machine_state$/ => { + qr/^cf_machine_state$/ => { "Release Engineering" => ["Buildduty"], }, + qr/^cf_rank$/ => { + "Loop" => [], + "Firefox" => [], + }, ); # Who to CC on particular bugmails when certain groups are added or removed. @@ -124,7 +128,8 @@ our %group_change_notification = ( # Who can set custom flags (use full field names only, not regex's) our $cf_setters = { - 'cf_colo_site' => ['infra', 'build'], + 'cf_colo_site' => [ 'infra', 'build' ], + 'cf_rank' => [ 'rank-setters' ], }; # Groups in which you can always file a bug, regardless of product or user. diff --git a/extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl b/extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl index d7c0d58a8..5260a6c7a 100644 --- a/extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl +++ b/extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl @@ -74,3 +74,13 @@ } }); + +[% UNLESS cf_hidden_in_product('cf_rank', bug.product, bug.component) %] + [% IF bug.check_can_change_field('cf_rank', 0, 1) %] + + + [% ELSIF bug.cf_rank != '' %] + + [% bug.cf_rank FILTER html %] + [% END %] +[% END %] diff --git a/extensions/BMO/template/en/default/hook/bug/edit-custom_field.html.tmpl b/extensions/BMO/template/en/default/hook/bug/edit-custom_field.html.tmpl new file mode 100644 index 000000000..6e871f731 --- /dev/null +++ b/extensions/BMO/template/en/default/hook/bug/edit-custom_field.html.tmpl @@ -0,0 +1,11 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% IF field.name == 'cf_rank' %] + [% field.hidden = 1 %] +[% END %] diff --git a/extensions/BMO/web/styles/edit_bug.css b/extensions/BMO/web/styles/edit_bug.css index 24212270d..a5dc72d0c 100644 --- a/extensions/BMO/web/styles/edit_bug.css +++ b/extensions/BMO/web/styles/edit_bug.css @@ -1,29 +1,12 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the BMO Bugzilla Extension; - * - * The Initial Developer of the Original Code is the Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2011 the - * Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Byron Jones +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. * - * ***** END LICENSE BLOCK ***** - */ + * This Source Code Form is "Incompatible With Secondary Licenses", as + * defined by the Mozilla Public License, v. 2.0. */ -#project-flags, + +#project-flags, #custom-flags { width: auto; } @@ -47,3 +30,12 @@ #toggle_comp_desc { white-space: nowrap; } + +#rank_label { + padding-right: 0; +} + +input#cf_rank { + text-align: right; + width: 3em; +} -- cgit v1.2.3-24-g4f1b