summaryrefslogtreecommitdiffstats
path: root/extensions/BMO
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-02-02 05:38:16 +0100
committerByron Jones <glob@mozilla.com>2015-02-02 05:38:16 +0100
commit1ccc683d4d94ea70e763fbd4af9721cb4bca1c0d (patch)
tree90ec8af17c49c130b0e817d2ef00c8c667dcb764 /extensions/BMO
parente62f3072492aa55e626325e8889365b23c25892f (diff)
downloadbugzilla-1ccc683d4d94ea70e763fbd4af9721cb4bca1c0d.tar.gz
bugzilla-1ccc683d4d94ea70e763fbd4af9721cb4bca1c0d.tar.xz
Bug 1123769: add a "rank" field to bugzilla to track priority
Diffstat (limited to 'extensions/BMO')
-rw-r--r--extensions/BMO/Extension.pm13
-rw-r--r--extensions/BMO/lib/Data.pm17
-rw-r--r--extensions/BMO/template/en/default/hook/bug/edit-after_importance.html.tmpl10
-rw-r--r--extensions/BMO/template/en/default/hook/bug/edit-custom_field.html.tmpl11
-rw-r--r--extensions/BMO/web/styles/edit_bug.css40
5 files changed, 61 insertions, 30 deletions
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 @@
}
});
</script>
+
+[% UNLESS cf_hidden_in_product('cf_rank', bug.product, bug.component) %]
+ [% IF bug.check_can_change_field('cf_rank', 0, 1) %]
+ <label class="field_label" id="rank_label" for="cf_rank">Rank:</label>
+ <input type="number" id="cf_rank" name="cf_rank" size="3" value="[% bug.cf_rank FILTER html %]">
+ [% ELSIF bug.cf_rank != '' %]
+ <label class="field_label" id="rank_label" for="cf_rank">Rank:</label>
+ <span id="cf_rank">[% bug.cf_rank FILTER html %]</span>
+ [% 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 <glob@mozilla.com>
+/* 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;
+}