From a68b0d94e176d37e1381f38f235f760ca0a1001d Mon Sep 17 00:00:00 2001
From: dklawren
Date: Wed, 29 Aug 2018 10:40:06 -0400
Subject: Bug 1486369 - please enable "due date" for Firefox -> Security:
Review Request compoent
---
extensions/BMO/lib/Data.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/extensions/BMO/lib/Data.pm b/extensions/BMO/lib/Data.pm
index 30a32c95e..b444d6a24 100644
--- a/extensions/BMO/lib/Data.pm
+++ b/extensions/BMO/lib/Data.pm
@@ -140,6 +140,7 @@ tie(%$cf_visible_in_products, "Tie::IxHash",
"Data & BI Services Team" => [],
"Data Compliance" => [],
"Developer Engagement" => [],
+ "Firefox" => ["Security: Review Requests"],
"Infrastructure & Operations" => [],
"Marketing" => [],
"mozilla.org" => ["Security Assurance: Review Request"],
--
cgit v1.2.3-24-g4f1b
From 2e6e3e13587ee526ba94faabd5551e67508518f5 Mon Sep 17 00:00:00 2001
From: dklawren
Date: Fri, 7 Sep 2018 06:04:50 -0400
Subject: Bug 1488292 - Remove MozReview extension from BMO code tree as
MozReview is being decommissioned
---
Bugzilla/CGI.pm | 6 -
Makefile.PL | 2 +-
extensions/BMO/lib/Data.pm | 21 --
extensions/MozReview/Config.pm | 16 --
extensions/MozReview/Extension.pm | 132 -----------
extensions/MozReview/bin/add-mozreview-children.pl | 257 ---------------------
extensions/MozReview/lib/Config.pm | 55 -----
extensions/MozReview/lib/WebService.pm | 209 -----------------
.../en/default/admin/params/mozreview.html.tmpl | 20 --
.../hook/attachment/create-before_form.html.tmpl | 17 --
.../en/default/hook/attachment/edit-view.html.tmpl | 16 --
.../default/hook/bug/edit-after_bug_data.html.tmpl | 35 ---
.../en/default/hook/bug/show-header-end.html.tmpl | 13 --
.../default/hook/bug_modal/edit-module.html.tmpl | 21 --
.../en/default/hook/bug_modal/header-end.html.tmpl | 13 --
.../en/default/hook/global/header-start.html.tmpl | 11 -
.../hook/global/user-error-errors.html.tmpl | 15 --
.../en/default/moz_review/header.html.tmpl | 10 -
.../template/en/default/moz_review/table.html.tmpl | 28 ---
extensions/MozReview/web/js/mozreview.js | 134 -----------
extensions/MozReview/web/style/attachment.css | 13 --
extensions/MozReview/web/style/mozreview.css | 79 -------
extensions/Push/lib/Connector/ReviewBoard.pm | 178 --------------
extensions/Push/t/ReviewBoard.t | 225 ------------------
scripts/issue-api-key.pl | 4 -
template/en/default/account/prefs/apikey.html.tmpl | 18 +-
template/en/default/attachment/create.html.tmpl | 1 -
template/en/default/bug/edit.html.tmpl | 195 ++++++++--------
template/en/default/email/new-api-key.txt.tmpl | 5 +-
29 files changed, 103 insertions(+), 1646 deletions(-)
delete mode 100644 extensions/MozReview/Config.pm
delete mode 100644 extensions/MozReview/Extension.pm
delete mode 100755 extensions/MozReview/bin/add-mozreview-children.pl
delete mode 100644 extensions/MozReview/lib/Config.pm
delete mode 100644 extensions/MozReview/lib/WebService.pm
delete mode 100644 extensions/MozReview/template/en/default/admin/params/mozreview.html.tmpl
delete mode 100644 extensions/MozReview/template/en/default/hook/attachment/create-before_form.html.tmpl
delete mode 100644 extensions/MozReview/template/en/default/hook/attachment/edit-view.html.tmpl
delete mode 100644 extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl
delete mode 100644 extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl
delete mode 100644 extensions/MozReview/template/en/default/hook/bug_modal/edit-module.html.tmpl
delete mode 100644 extensions/MozReview/template/en/default/hook/bug_modal/header-end.html.tmpl
delete mode 100644 extensions/MozReview/template/en/default/hook/global/header-start.html.tmpl
delete mode 100644 extensions/MozReview/template/en/default/hook/global/user-error-errors.html.tmpl
delete mode 100644 extensions/MozReview/template/en/default/moz_review/header.html.tmpl
delete mode 100644 extensions/MozReview/template/en/default/moz_review/table.html.tmpl
delete mode 100644 extensions/MozReview/web/js/mozreview.js
delete mode 100644 extensions/MozReview/web/style/attachment.css
delete mode 100644 extensions/MozReview/web/style/mozreview.css
delete mode 100644 extensions/Push/lib/Connector/ReviewBoard.pm
delete mode 100644 extensions/Push/t/ReviewBoard.t
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm
index 6236b015a..985e504f7 100644
--- a/Bugzilla/CGI.pm
+++ b/Bugzilla/CGI.pm
@@ -89,12 +89,6 @@ sub SHOW_BUG_MODAL_CSP {
push @{ $policy{img_src} }, $attach_base;
}
- # MozReview API calls
- my $mozreview_url = Bugzilla->params->{mozreview_base_url};
- if ($mozreview_url) {
- push @{ $policy{connect_src} }, $mozreview_url . 'api/extensions/mozreview.extension.MozReviewExtension/summary/';
- }
-
return %policy;
}
diff --git a/Makefile.PL b/Makefile.PL
index 3bf6926a5..3c600bef6 100755
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -323,7 +323,7 @@ my %optional_features = (
}
},
linux_pid => {
- description => 'Linux::PID for MozReview',
+ description => 'Linux::PID',
prereqs => {
runtime => {
requires => { 'Linux::Pid' => 0 },
diff --git a/extensions/BMO/lib/Data.pm b/extensions/BMO/lib/Data.pm
index b444d6a24..dc6a3894f 100644
--- a/extensions/BMO/lib/Data.pm
+++ b/extensions/BMO/lib/Data.pm
@@ -27,21 +27,6 @@ our @EXPORT = qw( $cf_visible_in_products
# will result in the user being redirected to that URL when viewing the
# attachment.
-my $mozreview_url_re = qr{
- # begins with mozreview hostname
- ^
- https?://reviewboard(?:-dev)?\.(?:allizom|mozilla)\.org
-
- # followed by a review path
- /r/\d+
-
- # ends with optional suffix
- (?: /
- | /diff/\#index_header
- )?
- $
-}ix;
-
sub phabricator_url_re {
my $phab_uri = Bugzilla->params->{phabricator_base_uri} || 'https://example.com';
return qr/^\Q${phab_uri}\ED\d+$/i;
@@ -54,12 +39,6 @@ our %autodetect_attach_urls = (
content_type => 'text/x-github-pull-request',
can_review => 1,
},
- reviewboard => {
- title => 'MozReview',
- regex => $mozreview_url_re,
- content_type => 'text/x-review-board-request',
- can_review => 1,
- },
Phabricator => {
title => 'Phabricator',
regex => \&phabricator_url_re,
diff --git a/extensions/MozReview/Config.pm b/extensions/MozReview/Config.pm
deleted file mode 100644
index 34d98907c..000000000
--- a/extensions/MozReview/Config.pm
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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.
-
-package Bugzilla::Extension::MozReview;
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use constant NAME => 'MozReview';
-
-__PACKAGE__->NAME;
diff --git a/extensions/MozReview/Extension.pm b/extensions/MozReview/Extension.pm
deleted file mode 100644
index 907f12e56..000000000
--- a/extensions/MozReview/Extension.pm
+++ /dev/null
@@ -1,132 +0,0 @@
-# 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.
-
-package Bugzilla::Extension::MozReview;
-
-use 5.10.1;
-use strict;
-use warnings;
-use parent qw(Bugzilla::Extension);
-
-use Bugzilla::Attachment;
-use Bugzilla::Error;
-use Bugzilla::Extension::MozReview::WebService;
-use List::MoreUtils qw( any );
-
-our $VERSION = '0.01';
-
-my @METHOD_WHITELIST = (
- 'User.get',
- 'User.login',
- 'User.valid_login',
- 'Bug.add_comment',
- 'Bug.add_attachment',
- 'Bug.attachments',
- 'Bug.get',
- 'Bug.update_attachment',
-);
-
-BEGIN {
- package Bugzilla::User::APIKey;
-
- sub is_mozreview {
- my ($self) = @_;
- my $mozreview_app_id = Bugzilla->params->{mozreview_app_id};
- return 0 unless $mozreview_app_id;
-
- return 1 if $self->app_id && $self->app_id eq $mozreview_app_id;
- }
-}
-
-sub template_before_process {
- my ($self, $args) = @_;
- my $file = $args->{'file'};
- my $vars = $args->{'vars'};
-
- return unless (($file =~ /bug\/(show-header|edit).html.tmpl$/ ||
- $file =~ /bug_modal\/(header|edit).html.tmpl$/ ||
- $file eq 'attachment/create.html.tmpl') &&
- Bugzilla->params->{mozreview_base_url});
-
- my $bug = exists $vars->{'bugs'} ? $vars->{'bugs'}[0] : $vars->{'bug'};
-
- if ($bug) {
- if ($file eq 'attachment/create.html.tmpl') {
- if ($bug->product eq 'Core' || $bug->product eq 'Firefox' ||
- $bug->product eq 'Firefox for Android') {
- $vars->{'mozreview_enabled'} = 1;
- }
- } else {
- my $has_mozreview = 0;
- my $attachments = Bugzilla::Attachment->get_attachments_by_bug($bug);
-
- foreach my $attachment (@$attachments) {
- if ($attachment->contenttype eq 'text/x-review-board-request'
- && !$attachment->isobsolete) {
- $has_mozreview = 1;
- last;
- }
- }
-
- if ($has_mozreview) {
- $vars->{'mozreview'} = 1;
- }
- }
- }
-}
-
-sub auth_delegation_confirm {
- my ($self, $args) = @_;
- my $mozreview_callback_url = Bugzilla->params->{mozreview_auth_callback_url};
- my $mozreview_app_id = Bugzilla->params->{mozreview_app_id};
-
- return unless $mozreview_callback_url;
- return unless $mozreview_app_id;
-
- if (index($args->{callback}, $mozreview_callback_url) == 0 && $args->{app_id} eq $mozreview_app_id) {
- ${$args->{skip_confirmation}} = 1;
- }
-}
-
-sub config_add_panels {
- my ($self, $args) = @_;
- my $modules = $args->{panel_modules};
- $modules->{MozReview} = "Bugzilla::Extension::MozReview::Config";
-}
-
-sub webservice {
- my ($self, $args) = @_;
- my $dispatch = $args->{dispatch};
- $dispatch->{MozReview} = "Bugzilla::Extension::MozReview::WebService";
-}
-
-sub webservice_before_call {
- my ($self, $args) = @_;
- my ($method, $full_method) = ($args->{method}, $args->{full_method});
- my $mozreview_app_id = Bugzilla->params->{mozreview_app_id} // '';
- my $user = Bugzilla->user;
- my $getter = eval { $user->authorizer->successful_info_getter() } or return;
- my $app_id = $getter->can("app_id") ? $getter->app_id // '' : '';
-
- $full_method =~ s/^Bugzilla::Extension::(\w+)::WebService\./$1./;
-
- my $is_mozreview_method = $full_method =~ /^MozReview\./;
-
- if ($is_mozreview_method && (!$mozreview_app_id || !$app_id || $mozreview_app_id ne $app_id)) {
- ThrowUserError('forbidden_method', { method => $full_method });
- }
-
- return unless $mozreview_app_id && $app_id;
-
- if ($app_id eq $mozreview_app_id && !$is_mozreview_method) {
- unless (any { $full_method eq $_ } @METHOD_WHITELIST) {
- ThrowUserError('forbidden_method', { method => $full_method });
- }
- }
-}
-
-__PACKAGE__->NAME;
diff --git a/extensions/MozReview/bin/add-mozreview-children.pl b/extensions/MozReview/bin/add-mozreview-children.pl
deleted file mode 100755
index 9faa923fa..000000000
--- a/extensions/MozReview/bin/add-mozreview-children.pl
+++ /dev/null
@@ -1,257 +0,0 @@
-#!/usr/bin/perl
-
-# 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.
-
-# This script obsoletes attachments containing URLs to MozReview parent
-# review requests and adds attachments, with review flags, for MozReview
-# child (commit) review requests to match the new scheme.
-
-use strict;
-use warnings;
-use 5.10.1;
-
-use lib qw(. lib local/lib/perl5);
-
-BEGIN {
- use Bugzilla;
- Bugzilla->extensions;
-}
-use Bugzilla::Constants qw( USAGE_MODE_CMDLINE );
-Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
-
-use Bugzilla::Attachment;
-use Bugzilla::Bug;
-use Bugzilla::Constants;
-use Bugzilla::Flag;
-use Bugzilla::FlagType;
-use JSON;
-use LWP::Simple qw( get $ua );
-
-$Bugzilla::Flag::disable_flagmail = 1;
-
-if (my $proxy = Bugzilla->params->{proxy_url}) {
- $ua->proxy('https', $proxy);
-}
-
-my $MOZREVIEW_MIMETYPE = 'text/x-review-board-request';
-
-# Disable the "cannot ask for review" so we can reassign their flags to
-# the new attachments.
-Bugzilla->params->{max_reviewer_last_seen} = 0;
-
-my $rb_host = shift or die "syntax: $0 review-board-url\n";
-$rb_host =~ s#/$##;
-
-sub rr_url {
- my ($rrid) = @_;
- return $rb_host . "/r/" . $rrid . "/";
-}
-
-sub set_review_flag {
- my ($child_attach, $flag_type, $flag_status, $reviewer, $setter) = @_;
-
- my %params = (
- type_id => $flag_type->id,
- status => $flag_status
- );
-
- if ($flag_status eq "?") {
- $params{'requestee'} = $reviewer->login;
- $params{'setter'} = $setter;
- } else {
- $params{'setter'} = $reviewer;
- }
-
- return Bugzilla::Flag->set_flag($child_attach, \%params);
-}
-
-my $dbh = Bugzilla->dbh;
-
-my $bugs_query = "SELECT distinct bug_id FROM attachments WHERE mimetype='text/x-review-board-request' AND isobsolete=0";
-my $bug_ids = $dbh->selectcol_arrayref($bugs_query);
-my $total_bugs = scalar @$bug_ids;
-$total_bugs or die "No bugs were found.\n";
-my $bug_count = 0;
-
-print < to stop or to continue...
-EOF
-getc();
-
-foreach my $bug_id (@$bug_ids) {
- $dbh->bz_start_transaction();
- my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
- my $bug_changed = 0;
- my $bug = Bugzilla::Bug->new($bug_id);
- print "Bug " . $bug->id . " (" . ++$bug_count . "/" . $total_bugs . ")\n";
-
- my $url = $rb_host . "/api/extensions/mozreview.extension.MozReviewExtension/summary/?bug=" . $bug->id;
- print " Fetching reviews from $url...\n";
- my $body = get($url);
- die "Error fetching review requests for bug " . $bug->id
- unless defined $body;
-
- my $data = from_json($body);
- my $summaries = $data->{"review_request_summaries"};
- my $attachments = Bugzilla::Attachment->get_attachments_by_bug($bug);
- my %attach_map;
-
- my $flag_types = Bugzilla::FlagType::match({
- 'target_type' => 'attachment',
- 'product_id' => $bug->product_id,
- 'component_id' => $bug->component_id,
- 'is_active' => 1});
- my $flag_type;
-
- foreach my $ft (@$flag_types) {
- if ($ft->is_active && $ft->name eq "review") {
- $flag_type = $ft;
- last;
- }
- }
-
- if (!defined($flag_type)) {
- print " Couldn't find flag type for attachments on this bug!\n";
- $dbh->bz_rollback_transaction();
- next;
- }
-
- foreach my $attachment (@$attachments) {
- next if ($attachment->isobsolete
- || $attachment->contenttype ne $MOZREVIEW_MIMETYPE);
-
- print " Attachment " . $attachment->id . ": " . $attachment->data . "\n";
- my ($rrid) = $attachment->data =~ m#/r/(\d+)/?$#;
- if (!defined($rrid)) {
- print " Malformed or missing reviewboard URL\n";
- next;
- }
-
- $attach_map{$attachment->data} = $attachment;
- }
-
- foreach my $summary (@$summaries) {
- my $parent = $summary->{"parent"};
- my $attacher = Bugzilla::User->new({ id => $parent->{"submitter_bmo_id"},
- cache => 1 });
- Bugzilla->set_user($attacher);
- print " Parent review request " . $parent->{"id"} . "\n";
-
- # %parent_flags is used to keep track of review flags related to
- # reviewers. It maps requestee => status if status is "?" or
- # setter => status otherwise.
- my %parent_flags;
-
- my $parent_url = rr_url($parent->{"id"});
- my $parent_attach = $attach_map{$parent_url};
- if (defined($parent_attach)) {
- print " Parent attachment has ID " . $parent_attach->id . ". Obsoleting it.\n";
- foreach my $flag (@{ $parent_attach->flags }) {
- if ($flag->type->name eq "review") {
- if ($flag->status eq "?") {
- $parent_flags{$flag->requestee->id} = $flag;
- } else {
- $parent_flags{$flag->setter->id} = $flag;
- }
- }
- }
- $parent_attach->set_is_obsolete(1);
- $parent_attach->update($timestamp);
- print " Posting comment.\n";
- $bug->add_comment('',
- { isprivate => 0,
- type => CMT_ATTACHMENT_UPDATED,
- extra_data => $parent_attach->id });
- $bug_changed = 1;
- } else {
- print " Parent attachment not found.\n";
- }
-
- my @children = @{ $summary->{"children"} };
- foreach my $child (@children) {
- print " Child review request " . $child->{"id"} . "\n";
- my $child_url = rr_url($child->{"id"});
- my $child_attach = $attach_map{$child_url};
- if (defined($child_attach)) {
- print " Found attachment.\n";
- next;
- }
-
- print " No attachment found for child " . $child_url . "\n";
- my %child_attach_params = (
- bug => $bug,
- data => $rb_host . "/r/" . $child->{"id"} . "/",
- description => "MozReview Request: " . $child->{"summary"},
- filename => "reviewboard-" . $child->{"id"} . "-url.txt",
- mimetype => $MOZREVIEW_MIMETYPE,
- );
- $child_attach = Bugzilla::Attachment->create(\%child_attach_params);
- print " New attachment id: " . $child_attach->id . "\n";
- $bug_changed = 1;
-
- # Set flags. If there was a parent, check it for flags by the
- # requestee. Otherwise, set an r? flag.
-
- # Preserve the original flag hash since we need to modify it for
- # every child to find extra reviewers (see below the 'foreach').
- my %tmp_parent_flags = %parent_flags;
-
- foreach my $reviewer_id (@{ $child->{"reviewers_bmo_ids"} }) {
- my $reviewer = Bugzilla::User->new({ id => $reviewer_id,
- cache => 1 });
- print " Reviewer " . $reviewer->login . " (" . $reviewer->id . ")\n";
- $reviewer->settings->{block_reviews}->{value} = 'off';
- my $flag = $tmp_parent_flags{$reviewer->id};
- if (defined($flag)) {
- print " Flag for reviewer " . $reviewer->id . ": " . $flag->status . "\n";
-
- set_review_flag($child_attach, $flag_type, $flag->status,
- $reviewer, $attacher);
- delete $tmp_parent_flags{$reviewer->id};
- } else {
- # No flag on the parent; this probably means the reviewer
- # canceled the review, so don't set r?.
- print " No review flag for reviewer " . $reviewer->id . "\n";
- }
- }
-
- # Preserve flags that were set directly on the attachment
- # from reviewers not listed in the review request.
- foreach my $extra_reviewer_id (keys %tmp_parent_flags) {
- my $extra_reviewer = Bugzilla::User->new({
- id => $extra_reviewer_id,
- cache => 1
- });
- my $flag = $tmp_parent_flags{$extra_reviewer_id};
- print " Extra flag set for reviewer " . $extra_reviewer->login . "\n";
- set_review_flag($child_attach, $flag->type, $flag->status,
- $extra_reviewer, $flag->setter);
- }
-
- $child_attach->update($timestamp);
- print " Posting comment.\n";
- $bug->add_comment('',
- { isprivate => 0,
- type => CMT_ATTACHMENT_CREATED,
- extra_data => $child_attach->id });
- }
- }
-
- if ($bug_changed) {
- print " Updating bug.\n";
- $bug->update($timestamp);
- $dbh->do("UPDATE bugs SET lastdiffed = ?, delta_ts = ? WHERE bug_id = ?",
- undef, $timestamp, $timestamp, $bug_id);
- }
- $dbh->bz_commit_transaction();
- Bugzilla->memcached->clear_all();
-}
-
-print "Done.\n";
diff --git a/extensions/MozReview/lib/Config.pm b/extensions/MozReview/lib/Config.pm
deleted file mode 100644
index e0d6377d8..000000000
--- a/extensions/MozReview/lib/Config.pm
+++ /dev/null
@@ -1,55 +0,0 @@
-# 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.
-
-package Bugzilla::Extension::MozReview::Config;
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use Bugzilla::Config::Common;
-
-our $sortkey = 1300;
-
-sub get_param_list {
- my ($class) = @_;
-
- my @params = (
- {
- name => 'mozreview_base_url',
- type => 't',
- default => '',
- checker => \&check_urlbase
- },
- {
- name => 'mozreview_auth_callback_url',
- type => 't',
- default => '',
- checker => sub {
- my ($url) = (@_);
-
- return 'must be an HTTP/HTTPS absolute URL' unless $url =~ m{^https?://};
- return '';
- }
- },
- {
- name => 'mozreview_app_id',
- type => 't',
- default => '',
- checker => sub {
- my ($app_id) = (@_);
-
- return 'must be a hex number' unless $app_id =~ /^[[:xdigit:]]+$/;
- return '';
- },
- },
- );
-
- return @params;
-}
-
-1;
diff --git a/extensions/MozReview/lib/WebService.pm b/extensions/MozReview/lib/WebService.pm
deleted file mode 100644
index c6916d1fa..000000000
--- a/extensions/MozReview/lib/WebService.pm
+++ /dev/null
@@ -1,209 +0,0 @@
-# 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.
-
-package Bugzilla::Extension::MozReview::WebService;
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use base qw(Bugzilla::WebService);
-
-use Bugzilla::Attachment;
-use Bugzilla::Bug;
-use Bugzilla::Comment;
-use Bugzilla::Constants;
-use Bugzilla::Error;
-use Bugzilla::WebService::Constants;
-use Bugzilla::WebService::Util qw(extract_flags validate translate);
-use Bugzilla::Util qw(trim);
-
-use List::MoreUtils qw(uniq all);
-use List::Util qw(max);
-use Storable qw(dclone);
-
-use constant PUBLIC_METHODS => qw( attachments );
-
-BEGIN {
- *_attachment_to_hash = \&Bugzilla::WebService::Bug::_attachment_to_hash;
- *_flag_to_hash = \&Bugzilla::WebService::Bug::_flag_to_hash;
-}
-
-sub attachments {
- my ($self, $params) = validate(@_, 'attachments');
- my $dbh = Bugzilla->dbh;
-
- # BMO: Don't allow updating of bugs if disabled
- if (Bugzilla->params->{disable_bug_updates}) {
- ThrowErrorPage('bug/process/updates-disabled.html.tmpl',
- 'Bug updates are currently disabled.');
- }
-
- my $user = Bugzilla->login(LOGIN_REQUIRED);
-
- ThrowCodeError('param_required', { param => 'attachments' })
- unless defined $params->{attachments};
-
- my $bug = Bugzilla::Bug->check($params->{bug_id});
-
- ThrowUserError("product_edit_denied", { product => $bug->product })
- unless $user->can_edit_product($bug->product_id);
-
- my (@modified, @created);
- $dbh->bz_start_transaction();
- my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
-
- my $comment_tags = $params->{comment_tags};
- my $attachments = $params->{attachments};
-
- if ($comment_tags) {
- ThrowUserError('comment_tag_disabled')
- unless Bugzilla->params->{comment_taggers_group};
-
- my $all_mozreview_tags = all { /^mozreview-?/i } @$comment_tags;
- if ($all_mozreview_tags || $user->can_tag_comments) {
- # there should be a method of User that does this.
- local $user->{can_tag_comments} = 1;
- $bug->set_all({ comment_tags => $comment_tags });
- }
- else {
- ThrowUserError('auth_failure',
- { group => Bugzilla->params->{comment_taggers_group},
- action => 'update',
- object => 'comment_tags' })
- }
- }
-
- foreach my $attachment (@$attachments) {
- my $flags = delete $attachment->{flags};
- my $attachment_id = delete $attachment->{attachment_id};
- my $comment = delete $attachment->{comment};
- my $attachment_obj;
-
- if ($attachment_id) {
- $attachment_obj = Bugzilla::Attachment->check({ id => $attachment_id });
- ThrowUserError("mozreview_attachment_bug_mismatch", { bug => $bug, attachment => $attachment_obj })
- if $attachment_obj->bug_id != $bug->id;
-
- # HACK: preload same bug object.
- $attachment_obj->{bug} = $bug;
-
- $attachment = translate($attachment, Bugzilla::WebService::Bug::ATTACHMENT_MAPPED_SETTERS);
-
- my ($update_flags, $new_flags) = $flags
- ? extract_flags($flags, $bug, $attachment_obj)
- : ([], []);
- if ($attachment_obj->validate_can_edit) {
- $attachment_obj->set_all($attachment);
- $attachment_obj->set_flags($update_flags, $new_flags) if $flags;
- }
- elsif (scalar @$update_flags && !scalar(@$new_flags) && !scalar keys %$attachment) {
- # Requestees can set flags targetted to them, even if they cannot
- # edit the attachment. Flag setters can edit their own flags too.
- my %flag_list = map { $_->{id} => $_ } @$update_flags;
- my $flag_objs = Bugzilla::Flag->new_from_list([ keys %flag_list ]);
- my @editable_flags;
- foreach my $flag_obj (@$flag_objs) {
- if ($flag_obj->setter_id == $user->id
- || ($flag_obj->requestee_id && $flag_obj->requestee_id == $user->id))
- {
- push(@editable_flags, $flag_list{$flag_obj->id});
- }
- }
- if (!scalar @editable_flags) {
- ThrowUserError('illegal_attachment_edit', { attach_id => $attachment_obj->id });
- }
- $attachment_obj->set_flags(\@editable_flags, []);
- }
- else {
- ThrowUserError('illegal_attachment_edit', { attach_id => $attachment_obj->id });
- }
-
- my $changes = $attachment_obj->update($timestamp);
-
- if (my $comment_text = trim($comment)) {
- $attachment_obj->bug->add_comment($comment_text,
- { isprivate => $attachment_obj->isprivate,
- type => CMT_ATTACHMENT_UPDATED,
- extra_data => $attachment_obj->id });
- }
-
- $changes = translate($changes, Bugzilla::WebService::Bug::ATTACHMENT_MAPPED_RETURNS);
-
- my %hash = (
- id => $self->type('int', $attachment_obj->id),
- last_change_time => $self->type('dateTime', $attachment_obj->modification_time),
- changes => {},
- );
-
- foreach my $field (keys %$changes) {
- my $change = $changes->{$field};
-
- # We normalize undef to an empty string, so that the API
- # stays consistent for things like Deadline that can become
- # empty.
- $hash{changes}->{$field} = {
- removed => $self->type('string', $change->[0] // ''),
- added => $self->type('string', $change->[1] // '')
- };
- }
-
- push(@modified, \%hash);
- }
- else {
- $attachment_obj = Bugzilla::Attachment->create({
- bug => $bug,
- creation_ts => $timestamp,
- data => $attachment->{data},
- description => $attachment->{summary},
- filename => $attachment->{file_name},
- mimetype => $attachment->{content_type},
- ispatch => $attachment->{is_patch},
- isprivate => $attachment->{is_private},
- });
-
- if ($flags) {
- my ($old_flags, $new_flags) = extract_flags($flags, $bug, $attachment_obj);
- $attachment_obj->set_flags($old_flags, $new_flags);
- }
-
- push(@created, $attachment_obj);
-
- $attachment_obj->update($timestamp);
- $bug->add_comment($comment,
- { isprivate => $attachment_obj->isprivate,
- type => CMT_ATTACHMENT_CREATED,
- extra_data => $attachment_obj->id });
-
- }
- }
-
- $bug->update($timestamp);
-
- $dbh->bz_commit_transaction();
- $bug->send_changes();
-
- my %attachments_created = map { $_->id => $self->_attachment_to_hash($_, $params) } @created;
- my %attachments_modified = map { (ref $_->{id} ? $_->{id}->value : $_->{id}) => $_ } @modified;
-
- return { attachments_created => \%attachments_created, attachments_modified => \%attachments_modified };
-}
-
-sub rest_resources {
- return [
- qr{^/mozreview/(\d+)/attachments$}, {
- POST => {
- method => 'attachments',
- params => sub {
- return { bug_id => $1 };
- },
- },
- },
- ];
-}
-
-1;
diff --git a/extensions/MozReview/template/en/default/admin/params/mozreview.html.tmpl b/extensions/MozReview/template/en/default/admin/params/mozreview.html.tmpl
deleted file mode 100644
index 4a35555a4..000000000
--- a/extensions/MozReview/template/en/default/admin/params/mozreview.html.tmpl
+++ /dev/null
@@ -1,20 +0,0 @@
-[%# 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.
- #%]
-
-[%
- title = "MozReview"
- desc = "Configure MozReview"
-%]
-
-[%
- param_descs = {
- mozreview_base_url => 'MozReview Base URL',
- mozreview_auth_callback_url => 'MozReview Auth Delegation URL',
- mozreview_app_id => 'app_id for API Keys delegated to MozReview',
- }
-%]
diff --git a/extensions/MozReview/template/en/default/hook/attachment/create-before_form.html.tmpl b/extensions/MozReview/template/en/default/hook/attachment/create-before_form.html.tmpl
deleted file mode 100644
index bfa842c89..000000000
--- a/extensions/MozReview/template/en/default/hook/attachment/create-before_form.html.tmpl
+++ /dev/null
@@ -1,17 +0,0 @@
-[%# 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.
- #%]
-
-[% RETURN UNLESS mozreview_enabled %]
-
-
- Are you attaching a patch? Consider trying out
- MozReview, Mozilla's
- new repository-based code-review tool.
- Read
- the docs to get started.
-
diff --git a/extensions/MozReview/template/en/default/hook/attachment/edit-view.html.tmpl b/extensions/MozReview/template/en/default/hook/attachment/edit-view.html.tmpl
deleted file mode 100644
index 044c36ae9..000000000
--- a/extensions/MozReview/template/en/default/hook/attachment/edit-view.html.tmpl
+++ /dev/null
@@ -1,16 +0,0 @@
-[%# 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.
- #%]
-
-[%
- RETURN UNLESS attachment.mimetype == "text/x-review-board-request" && attachment.external_redirect;
- custom_attachment_viewer = 1;
- url = attachment.data;
-%]
-
diff --git a/extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl b/extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl
deleted file mode 100644
index b0e4ce600..000000000
--- a/extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl
+++ /dev/null
@@ -1,35 +0,0 @@
-[%# 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.
- #%]
-
-[% RETURN UNLESS mozreview %]
-
-
diff --git a/extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl b/extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl
deleted file mode 100644
index d70e36b57..000000000
--- a/extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-[%# 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 mozreview;
- PROCESS moz_review/header.html.tmpl;
- END;
-%]
diff --git a/extensions/MozReview/template/en/default/hook/bug_modal/edit-module.html.tmpl b/extensions/MozReview/template/en/default/hook/bug_modal/edit-module.html.tmpl
deleted file mode 100644
index 9785fa0bd..000000000
--- a/extensions/MozReview/template/en/default/hook/bug_modal/edit-module.html.tmpl
+++ /dev/null
@@ -1,21 +0,0 @@
-[%# 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.
- #%]
-
-[% RETURN UNLESS mozreview %]
-
-[% WRAPPER bug_modal/module.html.tmpl
- title = "MozReview Requests"
- collapsed = 0
-%]
- [% INCLUDE moz_review/table.html.tmpl %]
-
-
-
-[% END %]
diff --git a/extensions/MozReview/template/en/default/hook/bug_modal/header-end.html.tmpl b/extensions/MozReview/template/en/default/hook/bug_modal/header-end.html.tmpl
deleted file mode 100644
index d70e36b57..000000000
--- a/extensions/MozReview/template/en/default/hook/bug_modal/header-end.html.tmpl
+++ /dev/null
@@ -1,13 +0,0 @@
-[%# 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 mozreview;
- PROCESS moz_review/header.html.tmpl;
- END;
-%]
diff --git a/extensions/MozReview/template/en/default/hook/global/header-start.html.tmpl b/extensions/MozReview/template/en/default/hook/global/header-start.html.tmpl
deleted file mode 100644
index 6ad026de6..000000000
--- a/extensions/MozReview/template/en/default/hook/global/header-start.html.tmpl
+++ /dev/null
@@ -1,11 +0,0 @@
-[%# 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 template.name == 'attachment/create.html.tmpl' %]
- [% style_urls.push('extensions/MozReview/web/style/attachment.css') %]
-[% END %]
diff --git a/extensions/MozReview/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/MozReview/template/en/default/hook/global/user-error-errors.html.tmpl
deleted file mode 100644
index 151e63b21..000000000
--- a/extensions/MozReview/template/en/default/hook/global/user-error-errors.html.tmpl
+++ /dev/null
@@ -1,15 +0,0 @@
-[%# 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 error == "forbidden_method" %]
- The requested method '[% method FILTER html %]' is not allowed to be called using the current API Key.
-[% ELSIF error == "mozreview_attachment_bug_mismatch" %]
- You tried to update attachment [% attachment.id FILTER html %]
- as part of adding or updating attachments on [% bug.id FILTER html %].
- That attachment actually belongs to [% terms.bug %] [% attachment.bug_id FILTER html %].
-[% END %]
diff --git a/extensions/MozReview/template/en/default/moz_review/header.html.tmpl b/extensions/MozReview/template/en/default/moz_review/header.html.tmpl
deleted file mode 100644
index 99fb81ba4..000000000
--- a/extensions/MozReview/template/en/default/moz_review/header.html.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-[%# 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.
- #%]
-
-[% style_urls.push('extensions/MozReview/web/style/mozreview.css') %]
-[% javascript_urls.push('extensions/MozReview/web/js/mozreview.js') %]
diff --git a/extensions/MozReview/template/en/default/moz_review/table.html.tmpl b/extensions/MozReview/template/en/default/moz_review/table.html.tmpl
deleted file mode 100644
index 84b7add47..000000000
--- a/extensions/MozReview/template/en/default/moz_review/table.html.tmpl
+++ /dev/null
@@ -1,28 +0,0 @@
-[%# 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.
- #%]
-
-
-
-
-
Submitter
-
Diff
-
Changes
-
Open Issues
-
Last Updated
-
-
-
-
-
Loading...
-
-
-
Error loading review requests:
-
-
-
-
diff --git a/extensions/MozReview/web/js/mozreview.js b/extensions/MozReview/web/js/mozreview.js
deleted file mode 100644
index 6fe51f53b..000000000
--- a/extensions/MozReview/web/js/mozreview.js
+++ /dev/null
@@ -1,134 +0,0 @@
-/* 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.
- */
-
-var MozReview = {};
-
-MozReview.getReviewRequest = function() {
- var hostUrl = $('.mozreview-requests').data('mozreviewUrl');
- var tr = $('
');
- var td = $('
');
- var link = $('');
-
- var rrSummaryApiUrl = hostUrl +
- 'api/extensions/mozreview.extension.MozReviewExtension/summary/?bug=' +
- BUGZILLA.bug_id;
- var rrUiBaseUrl = hostUrl + 'r/';
-
- function rrUrl(rrId) {
- return rrUiBaseUrl + rrId + '/';
- }
-
- function rrDiffUrl(rrId) {
- return rrUrl(rrId) + 'diff/#index_header';
- }
-
- function humanizedInt(i) {
- if (i > 1000) {
- return (i / 1000).toFixed(1) + 'k';
- } else {
- return '' + i;
- }
- }
-
- function rrCommitRow(rr, firstCommit) {
- var trCommit = tr.clone();
- var tdSubmitter = td.clone();
- var tdSummary = td.clone();
- var diffLink = link.clone();
- var diffStat = '';
-
- if (firstCommit) {
- tdSubmitter.text(rr.submitter);
- }
-
- tdSummary.addClass('mozreview-summary');
- diffLink.attr('href', rrDiffUrl(rr.id));
- diffLink.text(rr.summary);
- tdSummary.append(diffLink);
-
- if (rr.diff.insert > 0) {
- diffStat = '+' + humanizedInt(rr.diff.insert);
- }
-
- if (rr.diff.delete > 0) {
- if (diffStat.length > 0) {
- diffStat += ' / ';
- }
- diffStat += '-' + humanizedInt(rr.diff.delete);
- }
-
- trCommit.append(
- tdSubmitter,
- tdSummary,
- td.clone().text(diffStat)
- .addClass('mozreview-diffstat'),
- td.clone().text(rr.issue_open_count)
- .addClass('mozreview-open-issues'),
- td.clone().text(timeAgo(new Date(rr.last_updated)))
- );
-
- if (rr.status == "discarded") {
- $('.mozreview-hide-discarded-row').removeClass('bz_default_hidden');
- trCommit.addClass('bz_default_hidden mozreview-discarded-request');
- }
-
- return trCommit;
- }
-
- $('.mozreview-hide-discarded-link').click(function(event) {
- event.preventDefault();
- if ($('.bz_default_hidden.mozreview-discarded-request').length) {
- $('.mozreview-discarded-request').removeClass('bz_default_hidden');
- $('.mozreview-discarded-action').text('Hide');
- } else {
- $('.mozreview-discarded-request').addClass('bz_default_hidden');
- $('.mozreview-discarded-action').text('Show');
- }
- });
-
- var tbody = $('tbody.mozreview-request');
-
- function displayLoadError(errStr) {
- var errRow = tbody.find('.mozreview-loading-error-row');
- errRow.find('.mozreview-load-error-string').text(errStr);
- errRow.removeClass('bz_default_hidden');
- }
-
- $.getJSON(rrSummaryApiUrl, function(data) {
- var family, parent, i, j;
-
- if (data.review_request_summaries.length === 0) {
- displayLoadError('none returned from server');
- } else {
- for (i = 0; i < data.review_request_summaries.length; i++) {
- family = data.review_request_summaries[i];
- for (j = 0; j < family.children.length; j++) {
- tbody.append(rrCommitRow(family.children[j], j == 0));
- }
- }
- }
-
- tbody.find('.mozreview-loading-row').addClass('bz_default_hidden');
- }).fail(function(jqXHR, textStatus, errorThrown) {
- var errStr;
- if (jqXHR.responseJSON && jqXHR.responseJSON.err &&
- jqXHR.responseJSON.err.msg) {
- errStr = jqXHR.responseJSON.err.msg;
- } else if (errorThrown) {
- errStr = errorThrown;
- } else {
- errStr = 'unknown';
- }
- displayLoadError(errStr);
- tbody.find('.mozreview-loading-row').addClass('bz_default_hidden');
- });
-};
-
-$().ready(function() {
- MozReview.getReviewRequest();
-});
diff --git a/extensions/MozReview/web/style/attachment.css b/extensions/MozReview/web/style/attachment.css
deleted file mode 100644
index 474bf466e..000000000
--- a/extensions/MozReview/web/style/attachment.css
+++ /dev/null
@@ -1,13 +0,0 @@
-/* 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. */
-
-.mozreview-ad {
- background-color: #fff9db;
- color: #666458;
- padding: 5px;
- margin-bottom: 10px;
-}
diff --git a/extensions/MozReview/web/style/mozreview.css b/extensions/MozReview/web/style/mozreview.css
deleted file mode 100644
index a2263fc11..000000000
--- a/extensions/MozReview/web/style/mozreview.css
+++ /dev/null
@@ -1,79 +0,0 @@
-/* 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. */
-
-.mozreview-table {
- background: #fff;
- border: none;
- border-collapse: collapse;
- border-bottom: 1px solid rgba(0, 0, 0, 0.2);
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
-}
-
-.mozreview-table th {
- text-align: left;
- padding: 4px;
-}
-
-.mozreview-table td {
- vertical-align: middle !important;
- padding: 4px !important;
-}
-
-.mozreview-table thead, .mozreview-table tfoot {
- background-color: #eee;
- color: #404040;
-}
-
-.mozreview-requests {
- background: #fff;
- border: none;
- border-collapse: collapse;
-}
-
-.mozreview-requests th {
- padding: 2px;
-}
-
-.mozreview-requests td {
- padding: 2px;
-}
-
-.mozreview-requests .mozreview-summary {
- text-align: left;
-}
-
-.mozreview-requests .mozreview-open-issues {
- text-align: center;
-}
-
-.mozreview-requests .mozreview-diffstat {
- text-align: center;
- white-space: nowrap;
-}
-
-/* bug-modal specific */
-
-#module-mozreview-requests .module-content {
- padding: 0;
-}
-
-.bug_modal .mozreview-table {
- width: 100%;
-}
-
-.bug_modal .mozreview-request td {
- padding-left: 8px;
-}
-
-.bug_modal .mozreview-requests th {
- text-align: left;
- padding-left: 8px;
-}
-
-.bug_modal .mozreview-hide-discarded-row {
- padding: 4px;
-}
diff --git a/extensions/Push/lib/Connector/ReviewBoard.pm b/extensions/Push/lib/Connector/ReviewBoard.pm
deleted file mode 100644
index 1c657a728..000000000
--- a/extensions/Push/lib/Connector/ReviewBoard.pm
+++ /dev/null
@@ -1,178 +0,0 @@
-# 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.
-
-package Bugzilla::Extension::Push::Connector::ReviewBoard;
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use base 'Bugzilla::Extension::Push::Connector::Base';
-
-use Bugzilla::Bug;
-use Bugzilla::BugMail;
-use Bugzilla::Component;
-use Bugzilla::Constants;
-use Bugzilla::Extension::Push::Constants;
-use Bugzilla::Extension::Push::Util;
-use Bugzilla::Group;
-use Bugzilla::Product;
-use Bugzilla::User;
-use Bugzilla::Util qw( trim );
-
-use constant RB_CONTENT_TYPE => 'text/x-review-board-request';
-use constant AUTOMATION_USER => 'automation@bmo.tld';
-
-sub options {
- return (
- {
- name => 'product',
- label => 'Product to create bugs in',
- type => 'string',
- default => 'Developer Services',
- required => 1,
- validate => sub {
- Bugzilla::Product->new({ name => $_[0] })
- || die "Invalid Product ($_[0])\n";
- },
- },
- {
- name => 'component',
- label => 'Component to create bugs in',
- type => 'string',
- default => 'MozReview',
- required => 1,
- validate => sub {
- my ($component, $config) = @_;
- my $product = Bugzilla::Product->new({ name => $config->{product} })
- || die "Invalid Product (" . $config->{product} . ")\n";
- Bugzilla::Component->new({ product => $product, name => $component })
- || die "Invalid Component ($component)\n";
- },
- },
- {
- name => 'version',
- label => "The bug's version",
- type => 'string',
- default => 'Production',
- required => 1,
- validate => sub {
- my ($version, $config) = @_;
- my $product = Bugzilla::Product->new({ name => $config->{product} })
- || die "Invalid Product (" . $config->{product} . ")\n";
- Bugzilla::Version->new({ product => $product, name => $version })
- || die "Invalid Version ($version)\n";
- },
- },
- {
- name => 'group',
- label => 'Security group',
- type => 'string',
- default => 'mozilla-employee-confidential',
- required => 1,
- validate => sub {
- Bugzilla::Group->new({ name => $_[0] })
- || die "Invalid Group ($_[0])\n";
- },
- },
- {
- name => 'cc',
- label => 'Comma separated list of users to CC',
- type => 'string',
- default => '',
- required => 1,
- validate => sub {
- foreach my $login (map { trim($_) } split(',', $_[0])) {
- Bugzilla::User->new({ name => $login })
- || die "Invalid User ($login)\n";
- }
- },
- },
- );
-}
-
-sub should_send {
- my ($self, $message) = @_;
-
- if ($message->routing_key =~ /^(?:attachment|bug)\.modify:.*\bis_private\b/) {
- my $payload = $message->payload_decoded();
- my $target = $payload->{event}->{target};
-
- if ($target ne 'bug' && exists $payload->{$target}->{bug}) {
- return 0 if $payload->{$target}->{bug}->{is_private};
- return 0 if $payload->{$target}->{content_type} ne RB_CONTENT_TYPE;
- }
-
- return $payload->{$target}->{is_private} ? 1 : 0;
- }
- else {
- # We're not interested in the message.
- return 0;
- }
-}
-
-sub send {
- my ($self, $message) = @_;
- my $logger = Bugzilla->push_ext->logger;
- my $config = $self->config;
-
- eval {
- my $payload = $message->payload_decoded();
- my $target = $payload->{event}->{target};
-
- # load attachments
- my $bug_id = $target eq 'bug' ? $payload->{bug}->{id} : $payload->{attachment}->{bug}->{id};
- my $attach_id = $target eq 'attachment' ? $payload->{attachment}->{id} : undef;
- Bugzilla->set_user(Bugzilla::User->super_user);
- my $bug = Bugzilla::Bug->new({ id => $bug_id, cache => 1 });
- Bugzilla->logout;
-
- # create a bug if there are any mozreview attachments
- my @reviews = grep { $_->contenttype eq RB_CONTENT_TYPE } @{ $bug->attachments };
- if (@reviews) {
-
- # build comment
- my $comment = $target eq 'bug'
- ? "Bug $bug_id has MozReview reviews and is no longer public."
- : "MozReview attachment $attach_id on Bug $bug_id is no longer public.";
- $comment .= "\n\n";
- foreach my $attachment (@reviews) {
- $comment .= $attachment->data . "\n";
- }
-
- # create bug
- my $user = Bugzilla::User->new({ name => AUTOMATION_USER, cache => 1 });
- die "Invalid User: " . AUTOMATION_USER . "\n" unless $user;
- Bugzilla->set_user($user);
- my $new_bug = Bugzilla::Bug->create({
- short_desc => "[SECURITY] Bug $bug_id is no longer public",
- product => $config->{product},
- component => $config->{component},
- bug_severity => 'normal',
- groups => [ map { trim($_) } split(',', $config->{group}) ],
- op_sys => 'Unspecified',
- rep_platform => 'Unspecified',
- version => $config->{version},
- cc => [ map { trim($_) } split(',', $config->{cc}) ],
- comment => $comment,
- });
- Bugzilla::BugMail::Send($new_bug->id, { changer => Bugzilla->user });
- Bugzilla->logout;
-
- $logger->info("Created bug " . $new_bug->id);
- }
- };
- my $error = $@;
- Bugzilla->logout;
- if ($error) {
- return (PUSH_RESULT_TRANSIENT, clean_error($error));
- }
-
- return PUSH_RESULT_OK;
-}
-
-1;
diff --git a/extensions/Push/t/ReviewBoard.t b/extensions/Push/t/ReviewBoard.t
deleted file mode 100644
index c752e34ef..000000000
--- a/extensions/Push/t/ReviewBoard.t
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/usr/bin/perl -T
-# 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.
-use strict;
-use warnings;
-use lib qw( . lib local/lib/perl5 );
-
-use Test::More;
-use Bugzilla;
-use Bugzilla::Extension;
-use Bugzilla::Attachment;
-use Scalar::Util 'blessed';
-
-BEGIN {
- eval {
- require Test::LWP::UserAgent;
- require Test::MockObject;
- };
- if ($@) {
- plan skip_all =>
- 'Tests require Test::LWP::UserAgent and Test::MockObject';
- exit;
- }
-}
-
-BEGIN {
- Bugzilla->extensions; # load all of them
- use_ok 'Bugzilla::Extension::Push::Connector::ReviewBoard::Client';
- use_ok 'Bugzilla::Extension::Push::Constants';
-}
-
-my ($push) = grep { blessed($_) eq 'Bugzilla::Extension::Push' } @{Bugzilla->extensions };
-my $connectors = $push->_get_instance->connectors;
-my $con = $connectors->by_name('ReviewBoard');
-
-my $ua_204 = Test::LWP::UserAgent->new;
-$ua_204->map_response(
- qr{https://reviewboard-dev\.allizom\.org/api/review-requests/\d+},
- HTTP::Response->new('204'));
-
-my $ua_404 = Test::LWP::UserAgent->new;
-$ua_404->map_response(
- qr{https://reviewboard-dev\.allizom\.org/api/review-requests/\d+},
- HTTP::Response->new('404', undef, undef, q[{ "err": { "code": 100, "msg": "Object does not exist" }, "stat": "fail" }]));
-
-# forbidden
-my $ua_403 = Test::LWP::UserAgent->new;
-$ua_403->map_response(
- qr{https://reviewboard-dev\.allizom\.org/api/review-requests/\d+},
- HTTP::Response->new('403', undef, undef, q[ {"err":{"code":101,"msg":"You don't have permission for this"},"stat":"fail"}]));
-
-# not logged in
-my $ua_401 = Test::LWP::UserAgent->new;
-$ua_401->map_response(
- qr{https://reviewboard-dev\.allizom\.org/api/review-requests/\d+},
- HTTP::Response->new('401', undef, undef, q[ { "err": { "code": 103, "msg": "You are not logged in" }, "stat": "fail" } ]));
-
-# not logged in
-my $ua_500 = Test::LWP::UserAgent->new;
-$ua_500->map_response(
- qr{https://reviewboard-dev\.allizom\.org/api/review-requests/\d+},
- HTTP::Response->new('500'));
-
-$con->client->{useragent} = $ua_204;
-$con->config->{base_uri} = 'https://reviewboard-dev.allizom.org';
-$con->client->{base_uri} = 'https://reviewboard-dev.allizom.org';
-
-{
- my $msg = message(
- event => {
- routing_key => 'attachment.modify:is_private',
- target => 'attachment',
- },
- attachment => {
- is_private => 1,
- content_type => 'text/plain',
- bug => { id => 1, is_private => 0 },
- },
- );
-
- ok(not($con->should_send($msg)), "text/plain message should not be sent");
-}
-
-my $data = slurp("extensions/Push/t/rblink.txt");
-Bugzilla::User::DEFAULT_USER->{userid} = 42;
-Bugzilla->set_user(Bugzilla::User->super_user);
-diag " " . Bugzilla::User->super_user->id;
-
-my $dbh = Bugzilla->dbh;
-$dbh->bz_start_transaction;
-my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
-my $bug = Bugzilla::Bug->new({id => 9000});
-my $attachment = Bugzilla::Attachment->create({
- bug => $bug,
- creation_ts => $timestamp,
- data => $data,
- attach_size => length($data),
- description => "rblink.txt",
- filename => "rblink.txt",
- isprivate => 1,
- ispatch => 0,
- mimetype => 'text/x-review-board-request'
-});
-diag "".$attachment->id;
-$dbh->bz_commit_transaction;
-
-{
- my $msg = message(
- event => {
- routing_key => 'attachment.modify:cc,is_private',
- target => 'attachment',
- },
- attachment => {
- id => $attachment->id,
- is_private => 1,
- content_type => 'text/x-review-board-request',
- bug => { id => $bug->id, is_private => 0 },
- },
- );
- ok($con->should_send($msg), "rb attachment should be sent");
-
- {
- my ($rv, $err) = $con->send($msg);
- is($rv, PUSH_RESULT_OK, "good push result");
- diag $err if $err;
- }
-
- {
- local $con->client->{useragent} = $ua_404;
- my ($rv, $err) = $con->send($msg);
- is($rv, PUSH_RESULT_OK, "good push result for 404");
- diag $err if $err;
- }
-
-
- {
- local $con->client->{useragent} = $ua_403;
- my ($rv, $err) = $con->send($msg);
- is($rv, PUSH_RESULT_TRANSIENT, "transient error on 403");
- diag $err if $err;
- }
-
-
- {
- local $con->client->{useragent} = $ua_401;
- my ($rv, $err) = $con->send($msg);
- is($rv, PUSH_RESULT_TRANSIENT, "transient error on 401");
- diag $err if $err;
- }
-
- {
- local $con->client->{useragent} = $ua_500;
- my ($rv, $err) = $con->send($msg);
- is($rv, PUSH_RESULT_TRANSIENT, "transient error on 500");
- diag $err if $err;
- }
-}
-
-{
- my $msg = message(
- event => {
- routing_key => 'bug.modify:is_private',
- target => 'bug',
- },
- bug => {
- is_private => 1,
- id => $bug->id,
- },
- );
-
- ok($con->should_send($msg), "rb attachment should be sent");
- my ($rv, $err) = $con->send($msg);
- is($rv, PUSH_RESULT_OK, "good push result");
-
- {
- local $con->client->{useragent} = $ua_404;
- my ($rv, $err) = $con->send($msg);
- is($rv, PUSH_RESULT_OK, "good push result for 404");
- }
-
- {
- local $con->client->{useragent} = $ua_403;
- my ($rv, $err) = $con->send($msg);
- is($rv, PUSH_RESULT_TRANSIENT, "transient error on 404");
- diag $err if $err;
- }
-
-
- {
- local $con->client->{useragent} = $ua_401;
- my ($rv, $err) = $con->send($msg);
- is($rv, PUSH_RESULT_TRANSIENT, "transient error on 401");
- diag $err if $err;
- }
-
- {
- local $con->client->{useragent} = $ua_401;
- my ($rv, $err) = $con->send($msg);
- is($rv, PUSH_RESULT_TRANSIENT, "transient error on 401");
- diag $err if $err;
- }
-}
-
-sub message {
- my $msg_data = { @_ };
-
- return Test::MockObject->new
- ->set_always( routing_key => $msg_data->{event}{routing_key} )
- ->set_always( payload_decoded => $msg_data );
-}
-
-sub slurp {
- my $file = shift;
- local $/ = undef;
- open my $fh, '<', $file or die "unable to open $file";
- my $s = readline $fh;
- close $fh;
- return $s;
-}
-
-done_testing;
diff --git a/scripts/issue-api-key.pl b/scripts/issue-api-key.pl
index 810b7e17e..e4cc1cdd0 100755
--- a/scripts/issue-api-key.pl
+++ b/scripts/issue-api-key.pl
@@ -33,10 +33,6 @@ my $params = {
api_key => $given_api_key,
};
-if ($description && $description eq 'mozreview') {
- $params->{app_id} = Bugzilla->params->{mozreview_app_id} // '';
-}
-
if ($given_api_key) {
$api_key = Bugzilla::User::APIKey->create_special($params);
} else {
diff --git a/template/en/default/account/prefs/apikey.html.tmpl b/template/en/default/account/prefs/apikey.html.tmpl
index cdbee848b..c4b4074c1 100644
--- a/template/en/default/account/prefs/apikey.html.tmpl
+++ b/template/en/default/account/prefs/apikey.html.tmpl
@@ -34,25 +34,15 @@ here.
Revoked
- [%# because mozreview api-keys only work for the mozreview api, we hide the
- # key and prevent renaming #%]
[% FOREACH api_key IN api_keys %]
- [% IF api_key.is_mozreview %]
- hidden
- [% ELSE %]
- [% api_key.api_key FILTER html %]
- [% END %]
+ [% api_key.api_key FILTER html %]
- [% IF api_key.is_mozreview %]
- MozReview
- [% ELSE %]
-
- [% END %]
+
+
+
diff --git a/extensions/SecureMail/template/en/default/hook/admin/groups/edit-field.html.tmpl b/extensions/SecureMail/template/en/default/hook/admin/groups/edit-field.html.tmpl
index 253fed29e..7aaf35d7d 100644
--- a/extensions/SecureMail/template/en/default/hook/admin/groups/edit-field.html.tmpl
+++ b/extensions/SecureMail/template/en/default/hook/admin/groups/edit-field.html.tmpl
@@ -11,7 +11,7 @@
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
- # Portions created by the Initial Developer are Copyright (C) 2008 the
+ # Portions created by the Initial Developer are Copyright (C) 2008 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Max Kanat-Alexander
diff --git a/extensions/SecureMail/template/en/default/hook/admin/users/userdata-end.html.tmpl b/extensions/SecureMail/template/en/default/hook/admin/users/userdata-end.html.tmpl
index e5e299ef9..cf0ec3e03 100644
--- a/extensions/SecureMail/template/en/default/hook/admin/users/userdata-end.html.tmpl
+++ b/extensions/SecureMail/template/en/default/hook/admin/users/userdata-end.html.tmpl
@@ -14,7 +14,7 @@
[% otheruser.public_key ? "Yes" : "No" %]
-
+
Member of Secure Mail Group:
diff --git a/extensions/SecureMail/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/SecureMail/template/en/default/hook/global/user-error-errors.html.tmpl
index 46b093674..507874fe4 100644
--- a/extensions/SecureMail/template/en/default/hook/global/user-error-errors.html.tmpl
+++ b/extensions/SecureMail/template/en/default/hook/global/user-error-errors.html.tmpl
@@ -11,7 +11,7 @@
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is the Mozilla Corporation.
- # Portions created by the Initial Developer are Copyright (C) 2008 the
+ # Portions created by the Initial Developer are Copyright (C) 2008 the
# Initial Developer. All Rights Reserved.
#
# Contributor(s): Max Kanat-Alexander
@@ -20,8 +20,8 @@
[% IF error == "securemail_invalid_key" %]
[% title = "Invalid Public Key" %]
We were unable to read the public key that you entered. Make sure
- that you are entering either an ASCII-armored PGP/GPG public key,
- including the "BEGIN PGP PUBLIC KEY BLOCK" and "END PGP PUBLIC KEY BLOCK"
+ that you are entering either an ASCII-armored PGP/GPG public key,
+ including the "BEGIN PGP PUBLIC KEY BLOCK" and "END PGP PUBLIC KEY BLOCK"
lines, or a PEM format (Base64-encoded X.509) S/MIME key, including the
BEGIN CERTIFICATE and END CERTIFICATE lines.
[% errstr FILTER html %]
[% END %]
diff --git a/extensions/SecureMail/template/en/default/pages/securemail/help.html.tmpl b/extensions/SecureMail/template/en/default/pages/securemail/help.html.tmpl
index 928c7f1d4..378d007f0 100644
--- a/extensions/SecureMail/template/en/default/pages/securemail/help.html.tmpl
+++ b/extensions/SecureMail/template/en/default/pages/securemail/help.html.tmpl
@@ -24,8 +24,8 @@
title = "SecureMail Help"
%]
-[% terms.Bugzilla %] considers certain groups as "secure". If a [% terms.bug %] is in one of those groups, [% terms.Bugzilla %] will not send unencrypted
-email about it. To receive encrypted email rather than just a "something changed" placeholder, you must provide either
+[% terms.Bugzilla %] considers certain groups as "secure". If a [% terms.bug %] is in one of those groups, [% terms.Bugzilla %] will not send unencrypted
+email about it. To receive encrypted email rather than just a "something changed" placeholder, you must provide either
a S/MIME or a GPG/PGP key on the SecureMail preferences tab.
-
@@ -239,16 +239,16 @@ document.write('Users watching you:
[% IF watchers.size %]
@@ -294,7 +294,7 @@ You are currently not watching any users.
You can specify a list of [% terms.bugs %] from which you never want to get
any email notification of any kind by adding their ID(s) as a comma-separated
- list. Removing [% terms.abug %] by selecting it from the current ignored list
+ list. Removing [% terms.abug %] by selecting it from the current ignored list
will re-enable email notifications for the [% terms.bug %].
[% IF user.bugs_ignored.size %]
@@ -324,5 +324,5 @@ You are currently not watching any users.
[% END %]
Add [% terms.bugs %]:
-
diff --git a/template/en/default/account/prefs/permissions.html.tmpl b/template/en/default/account/prefs/permissions.html.tmpl
index d3c787b07..a4597205c 100644
--- a/template/en/default/account/prefs/permissions.html.tmpl
+++ b/template/en/default/account/prefs/permissions.html.tmpl
@@ -85,7 +85,7 @@
[% IF user.in_group('bz_sudoers') %]
- You are a member of the bz_sudoers group, so you can
+ You are a member of the bz_sudoers group, so you can
impersonate someone else.
[% END %]
diff --git a/template/en/default/account/prefs/prefs.html.tmpl b/template/en/default/account/prefs/prefs.html.tmpl
index ec24eb100..631b08a10 100644
--- a/template/en/default/account/prefs/prefs.html.tmpl
+++ b/template/en/default/account/prefs/prefs.html.tmpl
@@ -25,11 +25,11 @@
# description: string. Description of the tab (used in tab title).
# saveable: boolean. True if tab has a form which can be submitted.
# True if user is not receiving self-generated mail.
- # Note: For each tab name, a template "prefs/${tab.name}.tmpl" must exist,
+ # Note: For each tab name, a template "prefs/${tab.name}.tmpl" must exist,
# and its interface must be fulfilled.
# current_tab: A direct reference to one of the hashes in the tabs list.
# This tab will be displayed.
- # changes_saved: boolean/string. True if the CGI processed form data before
+ # changes_saved: boolean/string. True if the CGI processed form data before
# displaying anything, and can contain an optional custom
# message if required (which Perl still evaluates as True).
# dont_show_button: boolean. Prevent the display of the "Submit Changes" button.
@@ -134,7 +134,7 @@
[% END %]
-[% PROCESS "account/prefs/${current_tab.name}.html.tmpl"
+[% PROCESS "account/prefs/${current_tab.name}.html.tmpl"
IF current_tab.name.defined %]
[% IF current_tab.saveable %]
diff --git a/template/en/default/account/prefs/saved-searches.html.tmpl b/template/en/default/account/prefs/saved-searches.html.tmpl
index 426b593dc..e611aa682 100644
--- a/template/en/default/account/prefs/saved-searches.html.tmpl
+++ b/template/en/default/account/prefs/saved-searches.html.tmpl
@@ -43,7 +43,7 @@
Your saved searches are as follows:
-
+
Search
@@ -82,7 +82,7 @@
-
@@ -114,7 +114,7 @@
[% END %]
- Don't share
[% FOREACH group = queryshare_groups %]
[% END %]
@@ -160,7 +160,7 @@
[% IF user.queries_available.size %]
You may use these searches saved and shared by others:
-
+
Search
@@ -197,7 +197,7 @@
[% q.name FILTER uri %]">Edit
-
-[% PROCESS global/footer.html.tmpl %]
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/admin/classifications/add.html.tmpl b/template/en/default/admin/classifications/add.html.tmpl
index 1a6941f67..90b15d539 100644
--- a/template/en/default/admin/classifications/add.html.tmpl
+++ b/template/en/default/admin/classifications/add.html.tmpl
@@ -34,6 +34,6 @@
-[% PROCESS admin/classifications/footer.html.tmpl %]
+[% PROCESS admin/classifications/footer.html.tmpl %]
-[% PROCESS global/footer.html.tmpl %]
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/admin/classifications/del.html.tmpl b/template/en/default/admin/classifications/del.html.tmpl
index 5a3800f7a..ffd7d2f02 100644
--- a/template/en/default/admin/classifications/del.html.tmpl
+++ b/template/en/default/admin/classifications/del.html.tmpl
@@ -58,6 +58,6 @@
-[% PROCESS admin/classifications/footer.html.tmpl %]
+[% PROCESS admin/classifications/footer.html.tmpl %]
-[% PROCESS global/footer.html.tmpl %]
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/admin/classifications/edit-common.html.tmpl b/template/en/default/admin/classifications/edit-common.html.tmpl
index e0db0089f..b839c9384 100644
--- a/template/en/default/admin/classifications/edit-common.html.tmpl
+++ b/template/en/default/admin/classifications/edit-common.html.tmpl
@@ -24,7 +24,7 @@
-[% PROCESS global/footer.html.tmpl %]
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/admin/components/confirm-delete.html.tmpl b/template/en/default/admin/components/confirm-delete.html.tmpl
index a3dae68bb..60b08b430 100644
--- a/template/en/default/admin/components/confirm-delete.html.tmpl
+++ b/template/en/default/admin/components/confirm-delete.html.tmpl
@@ -49,7 +49,7 @@ from '[% product.name FILTER html %]' product
Default assignee:
[% comp.default_assignee.login FILTER html %]
-
+
[% IF Param('useqacontact') %]
@@ -103,23 +103,23 @@ from '[% product.name FILTER html %]' product
Confirmation
-
+
[% IF comp.bug_count %]
[% IF !Param("allowbugdeletion") %]
Sorry, there
- [% IF comp.bug_count > 1 %]
- are [% comp.bug_count %] [%+ terms.bugs %]
+ [% IF comp.bug_count > 1 %]
+ are [% comp.bug_count %] [%+ terms.bugs %]
[% ELSE %]
- is [% comp.bug_count %] [%+ terms.bug %]
+ is [% comp.bug_count %] [%+ terms.bug %]
[% END %]
- outstanding for this component. You must reassign
+ outstanding for this component. You must reassign
[% IF comp.bug_count > 1 %]
- those [% terms.bugs %]
+ those [% terms.bugs %]
[% ELSE %]
that [% terms.bug %]
[% END %]
@@ -130,8 +130,8 @@ from '[% product.name FILTER html %]' product
- There [% IF comp.bug_count > 1 %]
- are [% comp.bug_count %] [%+ terms.bugs %]
+ There [% IF comp.bug_count > 1 %]
+ are [% comp.bug_count %] [%+ terms.bugs %]
[% ELSE %]
is 1 [% terms.bug %]
[% END %]
@@ -147,7 +147,7 @@ from '[% product.name FILTER html %]' product
[% IF comp.bug_count == 0 || Param('allowbugdeletion') %]
Do you really want to delete this component?
-
+
-
+
[% PROCESS "admin/products/footer.html.tmpl"
- no_add_product_link = 1
+ no_add_product_link = 1
no_edit_product_link = 1 %]
[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/admin/products/footer.html.tmpl b/template/en/default/admin/products/footer.html.tmpl
index 78e1864a7..542a526df 100644
--- a/template/en/default/admin/products/footer.html.tmpl
+++ b/template/en/default/admin/products/footer.html.tmpl
@@ -17,7 +17,7 @@
# product: Bugzilla::Product Object; the product
#
# classification: Bugzilla::Classification object ; If classifications
- # are enabled, then this is the currently
+ # are enabled, then this is the currently
# selected classification
#
# no_XXX_link: boolean; if defined, then don't show the corresponding
@@ -35,7 +35,7 @@
[% classification_url_part_start = BLOCK %]classification=
[%- classification.name FILTER uri %]
[% END %]
- [% classification_text = BLOCK %]
+ [% classification_text = BLOCK %]
of classification '[% classification.name FILTER html %]'
[% END %]
[% END %]
@@ -58,8 +58,8 @@
[% END %]
[% IF product && !no_edit_product_link %]
- Edit product
'[% product.name FILTER html %]'.
@@ -68,7 +68,7 @@
[%# Edit other products (in a classification if specified): %]
[% UNLESS no_edit_other_products_link %]
- Edit other products
[% classification_text %].
diff --git a/template/en/default/admin/products/groupcontrol/confirm-edit.html.tmpl b/template/en/default/admin/products/groupcontrol/confirm-edit.html.tmpl
index f9c836980..05abc5fdb 100644
--- a/template/en/default/admin/products/groupcontrol/confirm-edit.html.tmpl
+++ b/template/en/default/admin/products/groupcontrol/confirm-edit.html.tmpl
@@ -27,7 +27,7 @@
[% PROCESS global/header.html.tmpl title = title %]
[% FOREACH group = mandatory_groups %]
-group '[% group.name FILTER html %]' impacts [% group.count %]
+group '[% group.name FILTER html %]' impacts [% group.count %]
[%+ terms.bugs %] for
which the group is newly mandatory and will be added.
[% END %]
diff --git a/template/en/default/admin/products/groupcontrol/edit.html.tmpl b/template/en/default/admin/products/groupcontrol/edit.html.tmpl
index 8c634ebfe..027c80172 100644
--- a/template/en/default/admin/products/groupcontrol/edit.html.tmpl
+++ b/template/en/default/admin/products/groupcontrol/edit.html.tmpl
@@ -23,8 +23,8 @@
[% title = BLOCK %]
Edit Group Controls for [% product.name FILTER html %]
[% END %]
-[% PROCESS global/header.html.tmpl
- title = title
+[% PROCESS global/header.html.tmpl
+ title = title
%]
[% g.bug_count FILTER html %] [%+ terms.bugs %] added
[% END %]
diff --git a/template/en/default/admin/products/list-classifications.html.tmpl b/template/en/default/admin/products/list-classifications.html.tmpl
index 161cc4b5b..94f19f108 100644
--- a/template/en/default/admin/products/list-classifications.html.tmpl
+++ b/template/en/default/admin/products/list-classifications.html.tmpl
@@ -28,17 +28,17 @@
%]
[% columns = [
- {
+ {
name => "name"
heading => "Edit products of..."
contentlink => 'editproducts.cgi?classification=%%name%%'
},
- {
+ {
name => "description"
heading => "Description"
allow_html_content => 1
},
- {
+ {
name => "product_count"
align => "right"
heading => "Product Count"
diff --git a/template/en/default/admin/products/list.html.tmpl b/template/en/default/admin/products/list.html.tmpl
index 0641c6283..dceeefed6 100644
--- a/template/en/default/admin/products/list.html.tmpl
+++ b/template/en/default/admin/products/list.html.tmpl
@@ -14,10 +14,10 @@
#%]
[%# INTERFACE:
- # products: array of Bugzilla::Product objects
+ # products: array of Bugzilla::Product objects
#
# classification: Bugzilla::Classification object; If classifications
- # are enabled, then this is
+ # are enabled, then this is
# the currently selected classification
# showbugcounts: boolean; true if bug counts should be included in the table
#%]
@@ -28,7 +28,7 @@
[% classification_url_part = BLOCK %]&classification=
[%- classification.name FILTER uri %]
[%- END %]
- [% classification_title = BLOCK %]
+ [% classification_title = BLOCK %]
in classification '[% classification.name FILTER html %]'
[% END %]
[% END %]
@@ -38,17 +38,17 @@
%]
[% columns = [
- {
+ {
name => "name"
heading => "Edit product..."
contentlink => 'editproducts.cgi?action=edit&product=%%name%%'
},
- {
+ {
name => "description"
heading => "Description"
allow_html_content => 1
},
- {
+ {
name => "is_active"
heading => "Open For New $terms.Bugs"
yesno_field => 1
diff --git a/template/en/default/admin/products/updated.html.tmpl b/template/en/default/admin/products/updated.html.tmpl
index d93022a6e..5ddea6675 100644
--- a/template/en/default/admin/products/updated.html.tmpl
+++ b/template/en/default/admin/products/updated.html.tmpl
@@ -32,7 +32,7 @@
[% END %]
[% END %]
-[% title = BLOCK %]Updating Product '[% product.name FILTER html %]'
+[% title = BLOCK %]Updating Product '[% product.name FILTER html %]'
[% classification_text FILTER none %][% END %]
[% PROCESS global/header.html.tmpl
title = title
@@ -63,7 +63,7 @@
[% IF product.is_active %]
open for
[% ELSE %]
- closed to
+ closed to
[% END %]
new [% terms.bugs %].
@@ -79,15 +79,15 @@
[% IF changes.allows_unconfirmed.defined %]
[% IF product.allows_unconfirmed %]
- The product now allows the
+ The product now allows the
[%+ display_value('bug_status', 'UNCONFIRMED') FILTER html %] status.
[% ELSE %]
- The product no longer allows the
+ The product no longer allows the
[%+ display_value('bug_status', 'UNCONFIRMED') FILTER html %] status.
- Note that any
+ Note that any
- [%- terms.bugs %] that currently have the
+ [%- product.name FILTER uri %]&bug_status=UNCONFIRMED">
+ [%- terms.bugs %] that currently have the
[%+ display_value('bug_status', 'UNCONFIRMED') FILTER html %] status
will remain in that status until they are edited.
[% END %]
diff --git a/template/en/default/admin/settings/edit.html.tmpl b/template/en/default/admin/settings/edit.html.tmpl
index eeb6c3203..23c8fdbce 100644
--- a/template/en/default/admin/settings/edit.html.tmpl
+++ b/template/en/default/admin/settings/edit.html.tmpl
@@ -96,7 +96,7 @@ page, and the Default Value will automatically apply to everyone.
-
+
[% ELSE %]
There are no preferences to edit.
diff --git a/template/en/default/admin/sudo.html.tmpl b/template/en/default/admin/sudo.html.tmpl
index e88ae2617..24b934732 100644
--- a/template/en/default/admin/sudo.html.tmpl
+++ b/template/en/default/admin/sudo.html.tmpl
@@ -17,7 +17,7 @@
#
# Contributor(s): A. Karl Kornel
#%]
-
+
[% PROCESS global/variables.none.tmpl %]
[% PROCESS global/header.html.tmpl
@@ -26,28 +26,28 @@
style_urls = ['skins/standard/admin.css']
doc_section = "useradmin.html#impersonatingusers"
%]
-
+
[% DEFAULT target_login = "" %]
- The sudo feature of [% terms.Bugzilla %] allows you to impersonate a
- user for a short time While an sudo session is in progress, every action you
- perform will be taking place as if you had logged in as the user whom will be
+ The sudo feature of [% terms.Bugzilla %] allows you to impersonate a
+ user for a short time While an sudo session is in progress, every action you
+ perform will be taking place as if you had logged in as the user whom will be
impersonating.
- This is a very powerful feature; you should be very careful while using it.
+ This is a very powerful feature; you should be very careful while using it.
Your actions may be logged more carefully than normal.
- To begin,
+ To begin,
[% IF Param('usemenuforusers') %]
- select
+ select
[% ELSE %]
- enter the login of
+ enter the login of
[% END %]
:
[% INCLUDE global/userselect.html.tmpl
@@ -58,39 +58,39 @@
size => 30
%]
-
+
[% IF !Param('usemenuforusers') %]
The username must be entered exactly. No matching will be performed.
[% END %]
-
+
Next, please take a moment to explain
-
+
The message you enter here will be sent to the impersonated user by email.
- You may leave this empty if you wish, but they will still know that you
+ You may leave this empty if you wish, but they will still know that you
are impersonating them.
-
+
[% IF user.authorizer.can_login %]
Finally, enter :
- This is done for two reasons. First of all, it is done to reduce
- the chances of someone doing large amounts of damage using your
- already-logged-in account. Second, it is there to force you to take the
+ This is done for two reasons. First of all, it is done to reduce
+ the chances of someone doing large amounts of damage using your
+ already-logged-in account. Second, it is there to force you to take the
time to consider if you really need to use this feature.
[% END %]
-
+
Click the button to begin the session:
diff --git a/template/en/default/admin/table.html.tmpl b/template/en/default/admin/table.html.tmpl
index 69fae3dac..f96688b2c 100644
--- a/template/en/default/admin/table.html.tmpl
+++ b/template/en/default/admin/table.html.tmpl
@@ -21,8 +21,8 @@
[%# INTERFACE:
#
- # columns:
- # array of hashes representing the columns in the table.
+ # columns:
+ # array of hashes representing the columns in the table.
# Each hash contains data for a single column. Hash keys:
# name: Name of the field in the data param
# heading: The text to print at the header cell
@@ -30,11 +30,11 @@
# Expressions of format %%xxx%% are replaced with value
# with the key xxx in data hash of the current row.
# content: If specified, the content of this variable is used
- # instead of the data pulled from the current row.
+ # instead of the data pulled from the current row.
# NOTE: This value is only partially HTML filtered!
- # content_use_field: If defined and true, then each value in the
+ # content_use_field: If defined and true, then each value in the
# column corresponds with a key in the
- # field_descs field, and that value from the
+ # field_descs field, and that value from the
# field_descs hash will be used instead of "content."
# See fieldvalues/select-field for an example of use.
# This content WILL be HTML-filtered in this case.
@@ -69,7 +69,7 @@
# against. The second hash then again points to another hash. Within this
# third hash (3), the keys represent values to match against. The item
# contains a fourth hash (4) specifying overridden values.
- #
+ #
# Each column value mentioned in the 'columns' documentation above
# can be overwritten (apart from name and heading). To override a
# table-cell value 'xxx', specify a new 'xxx' value, and specify a
@@ -123,7 +123,7 @@
[%# Are there any specific overrides for this column? %]
[% FOREACH match_field = overrides.${c.name}.keys %]
-
+
[% override = overrides.${c.name}.${match_field}.${row.$match_field} %]
[% NEXT UNLESS override %]
@@ -153,7 +153,7 @@
[% END %]
[% END %]
-
+
[% IF content_use_field && field_descs.exists(row.${c.name}) %]
[% colname = row.${c.name} %]
[% field_descs.${colname} FILTER html %]
@@ -174,11 +174,11 @@
[% END %]
[% END %]
[% END %]
-
+
[% IF contentlink %]
[% END %]
-
+
[% END %]
diff --git a/template/en/default/admin/users/search.html.tmpl b/template/en/default/admin/users/search.html.tmpl
index b9dbccb36..a6994ac3f 100644
--- a/template/en/default/admin/users/search.html.tmpl
+++ b/template/en/default/admin/users/search.html.tmpl
@@ -21,7 +21,7 @@
# id: group id
# name: group name
#%]
-
+
[% PROCESS global/header.html.tmpl
title = "Search users"
diff --git a/template/en/default/admin/users/userdata.html.tmpl b/template/en/default/admin/users/userdata.html.tmpl
index c4ab07010..32cc43f10 100644
--- a/template/en/default/admin/users/userdata.html.tmpl
+++ b/template/en/default/admin/users/userdata.html.tmpl
@@ -24,7 +24,7 @@
[% IF editusers %]
-
[% IF editform %]
[% IF !otheruser.in_group('bz_sudo_protect') %]
diff --git a/template/en/default/admin/versions/confirm-delete.html.tmpl b/template/en/default/admin/versions/confirm-delete.html.tmpl
index 39091d5fc..64d931cb1 100644
--- a/template/en/default/admin/versions/confirm-delete.html.tmpl
+++ b/template/en/default/admin/versions/confirm-delete.html.tmpl
@@ -67,16 +67,16 @@
[% IF version.bug_count %]
Sorry, there
- [% IF version.bug_count > 1 %]
- are [% version.bug_count FILTER none %] [%+ terms.bugs %]
+ [% IF version.bug_count > 1 %]
+ are [% version.bug_count FILTER none %] [%+ terms.bugs %]
[% ELSE %]
- is [% version.bug_count FILTER none %] [%+ terms.bug %]
+ is [% version.bug_count FILTER none %] [%+ terms.bug %]
[% END %]
- outstanding for this version. You must move
+ outstanding for this version. You must move
[% IF version.bug_count > 1 %]
- those [% terms.bugs %]
+ those [% terms.bugs %]
[% ELSE %]
that [% terms.bug %]
[% END %]
@@ -85,7 +85,7 @@
[% ELSE %]
Do you really want to delete this version?
-
+
@@ -98,4 +98,4 @@
[% PROCESS admin/versions/footer.html.tmpl %]
-[% PROCESS global/footer.html.tmpl %]
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/admin/versions/create.html.tmpl b/template/en/default/admin/versions/create.html.tmpl
index 2b75dabeb..3529c3238 100644
--- a/template/en/default/admin/versions/create.html.tmpl
+++ b/template/en/default/admin/versions/create.html.tmpl
@@ -22,7 +22,7 @@
# product: object; Bugzilla::Product object representing the product to
# which the version is being created for
#%]
-
+
[% title = BLOCK %]Add Version to Product '[% product.name FILTER html %]'[% END %]
[% subheader = BLOCK %]This page allows you to add a new version to product
'[% product.name FILTER html %]'.[% END %]
diff --git a/template/en/default/admin/versions/footer.html.tmpl b/template/en/default/admin/versions/footer.html.tmpl
index ae26e5744..6c94b9ce1 100644
--- a/template/en/default/admin/versions/footer.html.tmpl
+++ b/template/en/default/admin/versions/footer.html.tmpl
@@ -38,11 +38,11 @@
[% UNLESS no_add_version_link %]
Add a version.
+ [%- product.name FILTER uri %]">Add a version.
[% END %]
[% IF version.name && !no_edit_version_link %]
- Edit version '[% product.name FILTER html %]'.
[% END %]
- Edit product '[% product.name FILTER html %]'.
diff --git a/template/en/default/admin/versions/list.html.tmpl b/template/en/default/admin/versions/list.html.tmpl
index 69435d220..f77b7e870 100644
--- a/template/en/default/admin/versions/list.html.tmpl
+++ b/template/en/default/admin/versions/list.html.tmpl
@@ -41,7 +41,7 @@
[% columns = [
- {
+ {
name => "name"
heading => "Edit version..."
contentlink => edit_contentlink
diff --git a/template/en/default/admin/versions/select-product.html.tmpl b/template/en/default/admin/versions/select-product.html.tmpl
index 7fded475e..ccb46a193 100644
--- a/template/en/default/admin/versions/select-product.html.tmpl
+++ b/template/en/default/admin/versions/select-product.html.tmpl
@@ -32,14 +32,14 @@
%]
[% columns = [
- {
+ {
name => "name"
heading => "Edit versions of..."
- contentlink => "editversions.cgi?product=%%name%%"
+ contentlink => "editversions.cgi?product=%%name%%"
},
- {
+ {
name => "description"
- heading => "Description"
+ heading => "Description"
allow_html_content => 1
}
]
diff --git a/template/en/default/attachment/diff-file.html.tmpl b/template/en/default/attachment/diff-file.html.tmpl
index d510b5a5e..7bd04160a 100644
--- a/template/en/default/attachment/diff-file.html.tmpl
+++ b/template/en/default/attachment/diff-file.html.tmpl
@@ -68,7 +68,7 @@ incremental_restore()
[% END %]
[% IF section.old_lines > 1 %]
- Lines [% section.old_start %]-[% section.old_start +
+ Lines [% section.old_start %]-[% section.old_start +
section.old_lines - 1 %]
[% ELSE %]
Line [% section.old_start %]
@@ -77,7 +77,7 @@ incremental_restore()
[% END %]
[% section.func_info FILTER html IF section.func_info %]
- [% END %]
+ [% END %]