Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'origin/master' into production
* origin/master:
  Bug 1313766 - Bugzilla::Bug->send_changes() should not output HTML directly
  Revert "Bug 1313766 - Bugzilla::Bug->send_changes() should not output HTML directly"
  Bug 1321592 - Update Bugzilla Etiquette and add Abuse Policy
  Bug 1322271 - Tooltip for "Priority" field should explain that P1 is highest priority etc
  Bug 1313766 - Bugzilla::Bug->send_changes() should not output HTML directly
  Bug 1323595 - Update to form for Recruiting Product
  Bug 1323244 - Make the link to Mozilla Community Participation Guidelines not participate in keyboard navigation; r=dkl
  • Loading branch information
dklawren committed Dec 20, 2016
2 parents c599787 + 574643a commit f0f0694
Show file tree
Hide file tree
Showing 12 changed files with 325 additions and 239 deletions.
52 changes: 22 additions & 30 deletions Bugzilla/Bug.pm
Expand Up @@ -1331,13 +1331,13 @@ sub remove_from_db {
#####################################################################

sub send_changes {
my ($self, $changes, $vars) = @_;

my ($self, $changes) = @_;
my @results;
my $user = Bugzilla->user;

my $old_qa = $changes->{'qa_contact'}
my $old_qa = $changes->{'qa_contact'}
? $changes->{'qa_contact'}->[0] : '';
my $old_own = $changes->{'assigned_to'}
my $old_own = $changes->{'assigned_to'}
? $changes->{'assigned_to'}->[0] : '';
my $old_cc = $changes->{cc}
? $changes->{cc}->[0] : '';
Expand All @@ -1349,15 +1349,15 @@ sub send_changes {
changer => $user,
);

my $recipient_count = _send_bugmail(
{ id => $self->id, type => 'bug', forced => \%forced }, $vars);
push @results, _send_bugmail(
{ id => $self->id, type => 'bug', forced => \%forced });

# If the bug was marked as a duplicate, we need to notify users on the
# other bug of any changes to that bug.
my $new_dup_id = $changes->{'dup_id'} ? $changes->{'dup_id'}->[1] : undef;
if ($new_dup_id) {
$recipient_count += _send_bugmail(
{ forced => { changer => $user }, type => "dupe", id => $new_dup_id }, $vars);
push @results, _send_bugmail(
{ forced => { changer => $user }, type => "dupe", id => $new_dup_id });
}

# If there were changes in dependencies, we need to notify those
Expand All @@ -1376,7 +1376,7 @@ sub send_changes {

foreach my $id (@{ $self->blocked }) {
$params->{id} = $id;
$recipient_count += _send_bugmail($params, $vars);
push @results, _send_bugmail($params);
}
}
}
Expand All @@ -1394,37 +1394,28 @@ sub send_changes {
delete $changed_deps{''};

foreach my $id (sort { $a <=> $b } (keys %changed_deps)) {
$recipient_count += _send_bugmail(
{ forced => { changer => $user }, type => "dep", id => $id }, $vars);
push @results, _send_bugmail(
{ forced => { changer => $user }, type => "dep", id => $id });
}

# Sending emails for the referenced bugs.
foreach my $ref_bug_id (uniq @{ $self->{see_also_changes} || [] }) {
$recipient_count += _send_bugmail(
{ forced => { changer => $user }, id => $ref_bug_id }, $vars);
push @results, _send_bugmail(
{ forced => { changer => $user }, id => $ref_bug_id });
}

return $recipient_count;
return \@results;
}

sub _send_bugmail {
my ($params, $vars) = @_;
my ($params) = @_;

require Bugzilla::BugMail;

my $results =
my $sent_bugmail =
Bugzilla::BugMail::Send($params->{'id'}, $params->{'forced'}, $params);

if (Bugzilla->usage_mode == USAGE_MODE_BROWSER) {
my $template = Bugzilla->template;
$vars->{$_} = $params->{$_} foreach keys %$params;
$vars->{'sent_bugmail'} = $results;
$template->process("bug/process/results.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
$vars->{'header_done'} = 1;
}

return scalar @{ $results->{sent} };
return { params => $params, sent_bugmail => $sent_bugmail };
}

#####################################################################
Expand Down Expand Up @@ -2778,10 +2769,11 @@ sub _set_product {
if (%vars) {
$vars{product} = $product;
$vars{bug} = $self;
my $template = Bugzilla->template;
$template->process("bug/process/verify-new-product.html.tmpl",
\%vars) || ThrowTemplateError($template->error());
exit;
require Bugzilla::Error::Template;
die Bugzilla::Error::Template->new(
file => "bug/process/verify-new-product.html.tmpl",
vars => \%vars
);
}
}
else {
Expand Down
26 changes: 26 additions & 0 deletions Bugzilla/Error/Template.pm
@@ -0,0 +1,26 @@
# 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::Error::Template;

use 5.10.1;
use strict;
use warnings;
use Moo;

has 'file' => (
is => 'ro',
required => 1,
);

has 'vars' => (
is => 'ro',
default => sub { {} },
);


1;
113 changes: 69 additions & 44 deletions extensions/BMO/template/en/default/account/create.html.tmpl
Expand Up @@ -17,11 +17,12 @@
#
# Contributor(s): Gervase Markham <gerv@gerv.net>
# Byron Jones <glob@mozilla.com>
# Emma Humphries <emma@mozilla.com>
#%]

[%# INTERFACE
# none
#
#
# Param("maintainer") is used to display the maintainer's email.
# Param("emailsuffix") is used to pre-fill the email field.
#%]
Expand All @@ -40,11 +41,12 @@
<script type="text/javascript">
function onSubmit() {
var email = document.getElementById('login').value;
var agreed = document.getElementById('agree').checked;
if (email == '') {
alert('You must enter your email address.');
return false;
}
var isValid =
var isValid =
email.match(/@/)
&& email.match(/@.+\./)
&& !email.match(/\.$/)
Expand All @@ -59,6 +61,13 @@ function onSubmit() {
);
return false;
}
if (!agreed) {
alert(
"You must agree to [% terms.Bugzilla %] etiquette, Mozilla's participation " +
"guidelines, and the anti-abuse policy."
);
return false;
}
return true;
}
</script>
Expand Down Expand Up @@ -110,52 +119,69 @@ function onSubmit() {
<h2 class="column-header">I want to help</h2>

<div id="right-blurb">
<p>
Great! There are three things to know and do:
</p>
<ol>
<li>
Please consider reading our
<a href="https://developer.mozilla.org/en/Bug_writing_guidelines" target="_blank">[% terms.bug %]-writing guidelines</a>.
</li>
<li>
[% terms.Bugzilla %] is a public place. Your comments and other activities
on [% terms.bugs %] will generally be publicly visible, and your email address will be
accessible through public APIs and will be visible to all logged-in users
of [% terms.Bugzilla %]. Some people use an
<a href="http://email.about.com/od/freeemailreviews/tp/free_email.htm"
target="_blank">alternative email address</a> for this reason.
See Mozilla's <a href="https://www.mozilla.org/en-US/privacy/websites/"
target="_blank">Websites, Communications & Cookies Privacy Notice</a> for
more information on our privacy policies.
</li>
<li>
When using [% terms.Bugzilla %] to submit patches, comments, code, and any other content,
you agree to our policies on open source licensing and content submission. See Mozilla’s
<a href="https://www.mozilla.org/en-US/about/legal/terms/mozilla/" target="_blank">Websites
and Communications Terms of Use</a> for more information.
</li>
<li>
Please give us an email address you want to use. Once we confirm that it works,
you'll be asked to set a password and then you can start filing [% terms.bugs %] and helping fix them.
</li>
</ol>
<p>
Great! There are five things to know and do:
</p>
<ol>
<li>
Please read our
<a href="https://developer.mozilla.org/en/Bug_writing_guidelines" target="_blank">[% terms.bug %]-writing guidelines</a>.
</li>
<li>
[% terms.Bugzilla %] is a public place. Your comments and other activities
on [% terms.bugs %] will generally be publicly visible, and your email address will be
accessible through public APIs and will be visible to all logged-in users
of [% terms.Bugzilla %]. Some people use an
<a href="http://email.about.com/od/freeemailreviews/tp/free_email.htm"
target="_blank">alternative email address</a> for this reason.
See Mozilla's <a href="https://www.mozilla.org/privacy/websites/"
target="_blank">Websites, Communications & Cookies Privacy Notice</a> for
more information on our privacy policies.
</li>
<li>
When using [% terms.Bugzilla %] to submit patches, comments, code, and any other content,
you agree to our policies on open source licensing and content submission. See Mozilla’s
<a href="https://www.mozilla.org/about/legal/terms/mozilla/" target="_blank">Websites
and Communications Terms of Use</a> for more information.
</li>
<li>
Your understand that your conduct on this site is subject to both <a href="page.cgi?id=etiquette.html">[% terms.Bugzilla %] etiquette</a>,
and <a href="https://www.mozilla.org/about/governance/policies/participation/">Mozilla's participation guidelines</a>,
and in turn are governed by our <a href="page.cgi?id=anti-abuse.html">anti-abuse policy</a>. By creating an account,
you agree to abide by them.
</li>
<li>
Please give us an email address you want to use. Once we confirm that it works,
you'll be asked to set a password and then you can start filing [% terms.bugs %] and helping fix them.
</li>
</ol>
</div>

<h2 class="column-header">Create an account</h2>

<form method="post" action="createaccount.cgi" onsubmit="return onSubmit()">
<table id="create-account-form">
<tr>
<td class="label">Email Address:</td>
<td>
<input size="35" id="login" name="login" placeholder="you@example.com">[% Param('emailsuffix') FILTER html %]</td>
<td>
<input type="hidden" id="token" name="token" value="[% issue_hash_token(['create_account']) FILTER html %]">
<input type="submit" value="Create Account">
</td>
</tr>
</table>
<table id="create-account-form">
<tr>
<td class="label">Email Address:</td>
<td>
<input size="35" id="login" name="login" placeholder="you@example.com">[% Param('emailsuffix') FILTER html %]
</td>
</tr>
</table>
<table>
<tr>
<td valign="top"><input type="checkbox" id="agree" value="agreed"></td>
<td>
I have read <a href="page.cgi?id=etiquette.html">[% terms.Bugzilla %] etiquette</a>
and <a href="https://www.mozilla.org/about/governance/policies/participation/">Mozilla's participation guidelines</a>
and agree to abide by them, and
I acknowledge, and have read the <a href="page.cgi?id=anti-abuse.html">anti-abuse policy</a>.
</td>
</tr>
</table>
<br>
<input type="hidden" id="token" name="token" value="[% issue_hash_token(['create_account']) FILTER html %]">
<input type="submit" value="Create Account">
</form>

[% Hook.process('additional_methods') %]
Expand Down Expand Up @@ -186,4 +212,3 @@ function onSubmit() {
</td>
</tr>
[% END %]

Expand Up @@ -13,11 +13,10 @@
"1002 - Participation"
"1003 - Office of CIO"
"1005 - Corp Consolidation & Elimination"
"1006 - The Development Center"
"1010 - Office of CTO"
"1006 - Taipei Development Center"
"1010 - Emerging Technologies"
"1011 - Research"
"1012 - Tech Evangelism"
"1013 - Advanced Technology Lab"
"1014 - Technology Strategy"
"1020 - Chief of Staff"
"1100 - Policy"
Expand All @@ -31,53 +30,38 @@
"1320 - People Operations"
"1340 - People"
"1350 - Recruiting"
"1360 - Metrics"
"1370 - Organization Strategy"
"1400 - IT and Network"
"1410 - Infrastructure Eng & Ops (Infra)"
"1410 - Infrastructure Eng and Ops (Infra)"
"1420 - Enterprise Information Security (EIS)"
"1430 - End User Services (EUS)"
"1440 - Enterprise Applications & Services (EApps)"
"1500 - General Content Services"
"1501 - Engineering"
"1502 - Sales"
"1503 - Product"
"1440 - Enterprise Applications and Services (EApps)"
"2000 - General Marketing"
"2200 - Mar Com"
"2300 - Lifecycle Marketing"
"2320 - Developer Marketing"
"2400 - Brand Engagement"
"2500 - Marketing Operations"
"2700 - Product Marketing"
"5000 - Firefox"
"5010 - Advanced Technology"
"5500 - Product Engineering"
"5510 - Firefox Platform Engineering"
"5650 - Services Engineering"
"5660 - Production Cloud Infrastructure"
"5670 - Development Cloud Infrastructure"
"5680 - Firefox Platform Operations"
"5700 - Firefox UX"
"5000 - Firefox"
"5800 - Product Management"
"5900 - Program Management"
"5660 - Production Cloud Infrastructure"
"5670 - Development Cloud Infrastructure"
"6000 - Mobile"
"6110 - Firefox OS Engineering I"
"6140 - Firefox OS Automation"
"6150 - Firefox OS Engineering Program Management"
"6160 - Firefox OS QA"
"6200 - Firefox OS Product Management"
"6220 - Firefox OS Product Marketing"
"6300 - Firefox OS UX"
"6500 - Mobile Business Development"
"7000 - Mobile Planning and Ecosystem"
"7110 - Mobile Partner Engineering"
"7120 - Mobile Planning"
"7130 - Mobile Apps Engineering"
"7150 - Mobile Partners Contents"
"7200 - Mobile Ecosystem Program Management"
"7220 - Mobile Partner Products"
"7500 - Reviews and Community"
"8000 - Engineering Platform"
"8200 - Platform Operations"
"8750 - Localization (l10n)"
"8800 - Product Management"
"8900 - Platform Engineering"
"6000 - Connected Devices"
"6110 - Connected Devices Engineering"
"6150 - Connected Devices Program Management"
"6200 - Connected Devices Product Management"
"6600 - Connected Devices Strategy and Insights"
"6650 - Connected Devices Design"
"6700 - Connected Devices Business Operations"
"6750 - Connected Devices Product/UX"
"900 - Mozilla Foundation"
"901 - MoFo NSF"
];
Expand Down

0 comments on commit f0f0694

Please sign in to comment.