summaryrefslogtreecommitdiffstats
path: root/extensions/MozReview/Extension.pm
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/MozReview/Extension.pm')
-rw-r--r--extensions/MozReview/Extension.pm30
1 files changed, 19 insertions, 11 deletions
diff --git a/extensions/MozReview/Extension.pm b/extensions/MozReview/Extension.pm
index 2287a2136..ab7afb18a 100644
--- a/extensions/MozReview/Extension.pm
+++ b/extensions/MozReview/Extension.pm
@@ -22,25 +22,33 @@ sub template_before_process {
my $vars = $args->{'vars'};
return unless (($file eq 'bug/show-header.html.tmpl' ||
- $file eq 'bug/edit.html.tmpl') &&
+ $file eq 'bug/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) {
- my @rrids;
- my $attachments = Bugzilla::Attachment->get_attachments_by_bug($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 @rrids;
+ my $attachments = Bugzilla::Attachment->get_attachments_by_bug($bug);
- foreach my $attachment (@$attachments) {
- if ($attachment->contenttype eq 'text/x-review-board-request' &&
- !$attachment->isobsolete) {
- push @rrids, ($attachment->data =~ m#/r/(\d+)/?$#);
+ foreach my $attachment (@$attachments) {
+ if ($attachment->contenttype eq 'text/x-review-board-request'
+ && !$attachment->isobsolete) {
+ push @rrids, ($attachment->data =~ m#/r/(\d+)/?$#);
+ }
}
- }
- if (scalar @rrids) {
- $vars->{'mozreview'} = 1;
- $vars->{'review_request_ids'} = \@rrids;
+ if (scalar @rrids) {
+ $vars->{'mozreview'} = 1;
+ $vars->{'review_request_ids'} = \@rrids;
+ }
}
}
}