From 0a07cc286bfc870929f1af17e1bfdf8df73b9ff2 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 19 Jun 2014 18:49:12 +0000 Subject: Bug 1012782 - Expose cf_last_resolved in the RPC API r=glob --- extensions/LastResolved/Extension.pm | 9 +++++---- .../template/en/default/hook/bug/edit-custom_field.html.tmpl | 12 ++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 extensions/LastResolved/template/en/default/hook/bug/edit-custom_field.html.tmpl (limited to 'extensions/LastResolved') diff --git a/extensions/LastResolved/Extension.pm b/extensions/LastResolved/Extension.pm index 3627330c2..ad0519387 100644 --- a/extensions/LastResolved/Extension.pm +++ b/extensions/LastResolved/Extension.pm @@ -61,11 +61,12 @@ sub _migrate_last_resolved { } } -sub active_custom_fields { +sub bug_check_can_change_field { my ($self, $args) = @_; - my $fields = $args->{'fields'}; - my @tmp_fields = grep($_->name ne 'cf_last_resolved', @$$fields); - $$fields = \@tmp_fields; + my ($field, $priv_results) = @$args{qw(field priv_results)}; + if ($field eq 'cf_last_resolved') { + push (@$priv_results, PRIVILEGES_REQUIRED_EMPOWERED); + } } sub bug_end_of_update { diff --git a/extensions/LastResolved/template/en/default/hook/bug/edit-custom_field.html.tmpl b/extensions/LastResolved/template/en/default/hook/bug/edit-custom_field.html.tmpl new file mode 100644 index 000000000..27366b01f --- /dev/null +++ b/extensions/LastResolved/template/en/default/hook/bug/edit-custom_field.html.tmpl @@ -0,0 +1,12 @@ +[%# 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. + #%] + +[%# Do not display the last resolved value in the UI %] +[% IF field.name == 'cf_last_resolved' %] + [% field.hidden = 1 %] +[% END %] -- cgit v1.2.3-24-g4f1b