diff options
Diffstat (limited to 'extensions/MozProjectReview')
13 files changed, 1521 insertions, 0 deletions
diff --git a/extensions/MozProjectReview/Config.pm b/extensions/MozProjectReview/Config.pm new file mode 100644 index 000000000..5a9d2b730 --- /dev/null +++ b/extensions/MozProjectReview/Config.pm @@ -0,0 +1,19 @@ +# 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::MozProjectReview; + +use strict; + +use constant NAME => 'MozProjectReview'; + +use constant REQUIRED_MODULES => [ +]; + +use constant OPTIONAL_MODULES => [ +]; + +__PACKAGE__->NAME; diff --git a/extensions/MozProjectReview/Extension.pm b/extensions/MozProjectReview/Extension.pm new file mode 100644 index 000000000..4f132af21 --- /dev/null +++ b/extensions/MozProjectReview/Extension.pm @@ -0,0 +1,284 @@ +# 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::MozProjectReview; + +use strict; + +use base qw(Bugzilla::Extension); + +use Bugzilla::User; +use Bugzilla::Group; +use Bugzilla::Error; +use Bugzilla::Constants; + +our $VERSION = '0.01'; + +# these users will be cc'd to the parent bug when the corresponding child bug +# is created, as well as the child bug. +our %auto_cc = ( + 'legal' => ['liz@mozilla.com'], + 'sec-review' => ['curtisk@mozilla.com'], + 'finance' => ['waoieong@mozilla.com', 'mcristobal@mozilla.com', 'echoe@mozilla.com'], + 'privacy-vendor' => ['smartin@mozilla.com'], + 'privacy-project' => ['ahua@mozilla.com'], + 'privacy-tech' => ['ahua@mozilla.com'], + 'policy-business-partner' => ['smartin@mozilla.com'] +); + +sub post_bug_after_creation { + my ($self, $args) = @_; + my $vars = $args->{'vars'}; + my $bug = $vars->{'bug'}; + my $timestamp = $args->{'timestamp'}; + my $user = Bugzilla->user; + my $params = Bugzilla->input_params; + my $template = Bugzilla->template; + + return if !($params->{format} + && $params->{format} eq 'moz-project-review' + && $bug->component eq 'Project Review'); + + # do a match if applicable + Bugzilla::User::match_field({ + 'legal_cc' => { 'type' => 'multi' } + }); + + my ($do_sec_review, $do_legal, $do_finance, $do_privacy_vendor, + $do_privacy_tech, $do_privacy_policy); + + if ($params->{'mozilla_data'} eq 'Yes') { + $do_legal = 1; + $do_privacy_policy = 1; + $do_privacy_tech = 1; + $do_sec_review = 1; + } + + if ($params->{'separate_party'} eq 'Yes') { + if ($params->{'relationship_type'} ne 'Hardware Purchase') { + $do_legal = 1; + } + + if ($params->{'data_access'} eq 'Yes') { + $do_privacy_policy = 1; + $do_legal = 1; + $do_sec_review = 1; + } + + if ($params->{'data_access'} eq 'Yes' + && $params->{'privacy_policy_vendor_user_data'} eq 'Yes') + { + $do_privacy_vendor = 1; + } + + if ($params->{'vendor_cost'} eq '> $25,000' + || ($params->{'vendor_cost'} eq '<= $25,000' + && $params->{'po_needed'} eq 'Yes')) + { + $do_finance = 1; + } + } + + my ($sec_review_bug, $legal_bug, $finance_bug, $privacy_vendor_bug, + $privacy_tech_bug, $privacy_policy_bug, $error, @dep_comment, + @dep_errors, @send_mail); + + # Common parameters always passed to _file_child_bug + # bug_data and template_suffix will be different for each bug + my $child_params = { + parent_bug => $bug, + template_vars => $vars, + dep_comment => \@dep_comment, + dep_errors => \@dep_errors, + send_mail => \@send_mail, + }; + + if ($do_sec_review) { + $child_params->{'bug_data'} = { + short_desc => 'Security Review: ' . $bug->short_desc, + product => 'mozilla.org', + component => 'Security Assurance: Review Request', + bug_severity => 'normal', + groups => [ 'mozilla-employee-confidential' ], + op_sys => 'All', + rep_platform => 'All', + version => 'other', + blocked => $bug->bug_id, + }; + $child_params->{'template_suffix'} = 'sec-review'; + _file_child_bug($child_params); + } + + if ($do_legal) { + my $component = 'General'; + + if ($params->{separate_party} eq 'Yes' + && $params->{relationship_type}) + { + $component = ($params->{relationship_type} eq 'Other' + || $params->{relationship_type} eq 'Hardware Purchase') + ? 'General' + : $params->{relationship_type}; + } + + my $legal_summary = "Legal Review: "; + $legal_summary .= $params->{legal_other_party} . " - " if $params->{legal_other_party}; + $legal_summary .= $bug->short_desc; + + $child_params->{'bug_data'} = { + short_desc => $legal_summary, + product => 'Legal', + component => $component, + bug_severity => 'normal', + priority => '--', + groups => [ 'legal' ], + op_sys => 'All', + rep_platform => 'All', + version => 'unspecified', + blocked => $bug->bug_id, + cc => $params->{'legal_cc'}, + }; + $child_params->{'template_suffix'} = 'legal'; + _file_child_bug($child_params); + } + + if ($do_finance) { + $child_params->{'bug_data'} = { + short_desc => 'Finance Review: ' . $bug->short_desc, + product => 'Finance', + component => 'Purchase Request Form', + bug_severity => 'normal', + priority => '--', + groups => [ 'finance' ], + op_sys => 'All', + rep_platform => 'All', + version => 'unspecified', + blocked => $bug->bug_id, + }; + $child_params->{'template_suffix'} = 'finance'; + _file_child_bug($child_params); + } + + if ($do_privacy_tech) { + $child_params->{'bug_data'} = { + short_desc => 'Privacy-Technical Review: ' . $bug->short_desc, + product => 'mozilla.org', + component => 'Security Assurance: Review Request', + bug_severity => 'normal', + priority => '--', + keywords => 'privacy-review-needed', + groups => [ 'mozilla-employee-confidential' ], + op_sys => 'All', + rep_platform => 'All', + version => 'other', + blocked => $bug->bug_id, + }; + $child_params->{'template_suffix'} = 'privacy-tech'; + _file_child_bug($child_params); + } + + if ($do_privacy_policy) { + $child_params->{'bug_data'} = { + short_desc => 'Privacy-Policy Review: ' . $bug->short_desc, + product => 'Privacy', + component => 'Product Review', + bug_severity => 'normal', + priority => '--', + groups => [ 'mozilla-employee-confidential' ], + op_sys => 'All', + rep_platform => 'All', + version => 'unspecified', + blocked => $bug->bug_id, + }; + $child_params->{'template_suffix'} = 'privacy-policy'; + _file_child_bug($child_params); + } + + if ($do_privacy_vendor) { + $child_params->{'bug_data'} = { + short_desc => 'Privacy / Vendor Review: ' . $bug->short_desc, + product => 'Privacy', + component => 'Vendor Review', + bug_severity => 'normal', + priority => '--', + groups => [ 'mozilla-employee-confidential' ], + op_sys => 'All', + rep_platform => 'All', + version => 'unspecified', + blocked => $bug->bug_id, + }; + $child_params->{'template_suffix'} = 'privacy-vendor'; + _file_child_bug($child_params); + } + + if (scalar @dep_errors) { + warn "[Bug " . $bug->id . "] Failed to create additional moz-project-review bugs:\n" . + join("\n", @dep_errors); + $vars->{'message'} = 'moz_project_review_creation_failed'; + } + + if (scalar @dep_comment) { + my $comment = join("\n", @dep_comment); + if (scalar @dep_errors) { + $comment .= "\n\nSome errors occurred creating dependent bugs and have been recorded"; + } + $bug->add_comment($comment); + $bug->update($bug->creation_ts); + } + + foreach my $bug_id (@send_mail) { + Bugzilla::BugMail::Send($bug_id, { changer => Bugzilla->user }); + } +} + +sub _file_child_bug { + my ($params) = @_; + my ($parent_bug, $template_vars, $template_suffix, $bug_data, $dep_comment, $dep_errors, $send_mail) + = @$params{qw(parent_bug template_vars template_suffix bug_data dep_comment dep_errors send_mail)}; + + my $old_error_mode = Bugzilla->error_mode; + Bugzilla->error_mode(ERROR_MODE_DIE); + + my $new_bug; + eval { + my $comment; + my $full_template = "bug/create/comment-moz-project-review-$template_suffix.txt.tmpl"; + Bugzilla->template->process($full_template, $template_vars, \$comment) + || ThrowTemplateError(Bugzilla->template->error()); + $bug_data->{'comment'} = $comment; + if (exists $auto_cc{$template_suffix}) { + $bug_data->{'cc'} = $auto_cc{$template_suffix}; + } + if ($new_bug = Bugzilla::Bug->create($bug_data)) { + my $set_all = { + dependson => { add => [ $new_bug->bug_id ] } + }; + if (exists $auto_cc{$template_suffix}) { + $set_all->{'cc'} = { add => $auto_cc{$template_suffix} }; + } + $parent_bug->set_all($set_all); + $parent_bug->update($parent_bug->creation_ts); + } + }; + + if ($@ || !($new_bug && $new_bug->{'bug_id'})) { + push(@$dep_comment, "Error creating $template_suffix review bug"); + push(@$dep_errors, "$template_suffix : $@") if $@; + # Since we performed Bugzilla::Bug::create in an eval block, we + # need to manually rollback the commit as this is not done + # in Bugzilla::Error automatically for eval'ed code. + Bugzilla->dbh->bz_rollback_transaction(); + } + else { + push(@$send_mail, $new_bug->id); + push(@$dep_comment, "Bug " . $new_bug->id . " - " . $new_bug->short_desc); + } + + undef $@; + Bugzilla->error_mode($old_error_mode); +} + +__PACKAGE__->NAME; diff --git a/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-finance.txt.tmpl b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-finance.txt.tmpl new file mode 100644 index 000000000..eaa626a7e --- /dev/null +++ b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-finance.txt.tmpl @@ -0,0 +1,30 @@ +[%# 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 Bugzilla %] +[% cgi = Bugzilla.cgi %] + +[% PROCESS "bug/create/comment-moz-project-review.txt.tmpl" %] + +Finance Questions: + +Vendor: [% cgi.param('finance_purchase_vendor') %] +Is this line item in budget?: +[%+ cgi.param('finance_purchase_inbudget') %] +What is the purchase for?: +[%+ cgi.param('finance_purchase_what') %] +Why is the purchase needed?: +[%+ cgi.param('finance_purchase_why') %] +What is the risk if not purchased?: +[%+ cgi.param('finance_purchase_risk') %] +What is the alternative?: +[%+ cgi.param('finance_purchase_alternative') %] +What is the urgency?: [% cgi.param('finance_purchase_urgency') %] +What is the shipping address?: +[%+ cgi.param('finance_shipment_address') %] +Total Cost: [% cgi.param('finance_purchase_cost') %] diff --git a/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-legal.txt.tmpl b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-legal.txt.tmpl new file mode 100644 index 000000000..9856736d1 --- /dev/null +++ b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-legal.txt.tmpl @@ -0,0 +1,51 @@ +[%# 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 Bugzilla %] +[% cgi = Bugzilla.cgi %] + +[% PROCESS "bug/create/comment-moz-project-review.txt.tmpl" %] + +Legal Questions: + +Priority: [% cgi.param('legal_priority') %] +Time Frame For Completion of Legal Portion?: [% cgi.param('legal_timeframe') %] +Other Party: [% cgi.param('legal_other_party') %] +What help do you need from Legal?: +[%+ cgi.param('legal_help_from_legal') %] +[% IF cgi.param('legal_vendor_services_where') %] +Vendor Services from Where: +[% IF cgi.param('legal_vendor_services_where') == 'A single country' %] +[%- cgi.param('legal_vendor_single_country') %] +[% ELSE %] +[%- cgi.param('legal_vendor_services_where') %] +[% END %] +[% END %] +[% IF cgi.param('separate_party') == 'Yes' && cgi.param('relationship_type') == 'Vendor/Services' %] +SOW Details: +Legal Vendor Name: [% cgi.param('legal_sow_vendor_name') %] +Vendor Address: +[%+ cgi.param('legal_sow_vendor_address') %] +Vendor Email for Notices: [% cgi.param('legal_sow_vendor_email') %] +Mozilla Contact: [% cgi.param('legal_sow_vendor_mozcontact') %] +Vendor Contact and Email Address: [% cgi.param('legal_sow_vendor_contact') %] +Description of Services: +[%+ cgi.param('legal_sow_vendor_services') %] +Description of Deliverables: +[%+ cgi.param('legal_sow_vendor_deliverables') %] +Start Date: [% cgi.param('legal_sow_start_date') %] +End Date: [% cgi.param('legal_sow_end_date') %] +Rate of Pay: [% cgi.param('legal_sow_vendor_payment') %] +Basis for Payment: [% cgi.param('legal_sow_vendor_payment_basis') %] +Average/Maximum Hours: [% cgi.param('legal_sow_vendor_hours') %] +Payment Schedule: [% cgi.param('legal_sow_vendor_payment_schedule') %] +Total Not to Exceed Amount: [% cgi.param('legal_sow_vendor_total_max') %] +Special Terms: +[%+ cgi.param('legal_sow_vendor_special_terms') %] +Product Line: [% cgi.param('legal_sow_vendor_product_line') %] +[% END %] diff --git a/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-privacy-policy.txt.tmpl b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-privacy-policy.txt.tmpl new file mode 100644 index 000000000..ff3f5adb6 --- /dev/null +++ b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-privacy-policy.txt.tmpl @@ -0,0 +1,17 @@ +[%# 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 Bugzilla %] +[% cgi = Bugzilla.cgi %] + +[% PROCESS "bug/create/comment-moz-project-review.txt.tmpl" %] + +Is there a privacy policy for this new feature/product?: +[%+ cgi.param('privacy_policy_project_link') %] +What assistance do you need from the privacy team (if any)?: +[%+ cgi.param('privacy_policy_project_assistance') %] diff --git a/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-privacy-tech.txt.tmpl b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-privacy-tech.txt.tmpl new file mode 100644 index 000000000..7b72cf1bc --- /dev/null +++ b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-privacy-tech.txt.tmpl @@ -0,0 +1,12 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% USE Bugzilla %] +[% cgi = Bugzilla.cgi %] + +[% PROCESS "bug/create/comment-moz-project-review.txt.tmpl" %] diff --git a/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-privacy-vendor.txt.tmpl b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-privacy-vendor.txt.tmpl new file mode 100644 index 000000000..eaf9f12e3 --- /dev/null +++ b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-privacy-vendor.txt.tmpl @@ -0,0 +1,16 @@ +[%# 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 Bugzilla %] +[% cgi = Bugzilla.cgi %] + +[% PROCESS "bug/create/comment-moz-project-review.txt.tmpl" %] + +Privacy Policy: [% cgi.param('privacy_policy_vendor_user_data') %] +Vendor's Privacy Policy: [% cgi.param('privacy_policy_vendor_link') %] +Privacy Questionnaire: [% cgi.param('privacy_policy_vendor_questionnaire') %] diff --git a/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-sec-review.txt.tmpl b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-sec-review.txt.tmpl new file mode 100644 index 000000000..029f6df48 --- /dev/null +++ b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review-sec-review.txt.tmpl @@ -0,0 +1,20 @@ +[%# 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 Bugzilla %] +[% cgi = Bugzilla.cgi %] + +[% PROCESS "bug/create/comment-moz-project-review.txt.tmpl" %] + +Security Review Questions: + +Affects Products: [% cgi.param('sec_affects_products') %] +Review Due Date: [% cgi.param('sec_review_date') %] +Review Invitees: [% cgi.param('sec_review_invitees') %] +Extra Information: +[%+ cgi.param('sec_review_extra') %] diff --git a/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review.txt.tmpl b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review.txt.tmpl new file mode 100644 index 000000000..07d5fa5ad --- /dev/null +++ b/extensions/MozProjectReview/template/en/default/bug/create/comment-moz-project-review.txt.tmpl @@ -0,0 +1,33 @@ +[%# 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 Bugzilla %] +[% cgi = Bugzilla.cgi %] + +Initial Questions: + +Project/Feature Name: [% cgi.param('short_desc') %] +Tracking [% terms.Bug %] ID:[% cgi.param('tracking_id') %] +Description: +[%+ cgi.param('description') %] +Additional Information: +[%+ cgi.param('additional') %] +Key Initiative: [% cgi.param('key_initiative') == 'Other' + ? cgi.param('key_initiative_other') + : cgi.param('key_initiative') %] +Release Date: [% cgi.param('release_date') %] +Project Status: [% cgi.param('project_status') %] +Mozilla Data: [% cgi.param('mozilla_data') %] +Mozilla Related: [% cgi.param('mozilla_related') %] +Separate Party: [% cgi.param('separate_party') %] +[% IF cgi.param('separate_party') == 'Yes' %] +Type of Relationship: [% cgi.param('relationship_type') %] +Data Access: [% cgi.param('data_access') %] +Privacy Policy: [% cgi.param('privacy_policy') %] +Vendor Cost: [% cgi.param('vendor_cost') %] +[% END %] diff --git a/extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl b/extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl new file mode 100644 index 000000000..0dd3da5a8 --- /dev/null +++ b/extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl @@ -0,0 +1,711 @@ +[%# 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. + #%] + +[% PROCESS global/variables.none.tmpl %] + +[% PROCESS global/header.html.tmpl + title = "Mozilla Project Review" + style_urls = [ 'extensions/MozProjectReview/web/style/moz_project_review.css' ] + javascript_urls = [ 'js/field.js', 'js/util.js', + 'extensions/MozProjectReview/web/js/moz_project_review.js' ] + yui = [ 'autocomplete', 'calendar' ] +%] + +<p> + <strong>Please use this form for submitting a Mozilla Project Review</strong> + If you have a [% terms.bug %] to file, go <a href="enter_bug.cgi">here</a>. +</p> + +<p> + (<span class="required_star">*</span> = + <span class="required_explanation">Required Field</span>) +</p> + +<form method="post" action="post_bug.cgi" id="mozProjectForm" enctype="multipart/form-data" + onSubmit="return MPR.validateAndSubmit();"> + <input type="hidden" id="product" name="product" value="mozilla.org"> + <input type="hidden" id="component" name="component" value="Project Review"> + <input type="hidden" id="rep_platform" name="rep_platform" value="All"> + <input type="hidden" id="op_sys" name="op_sys" value="All"> + <input type="hidden" id="priority" name="priority" value="--"> + <input type="hidden" id="version" name="version" value="other"> + <input type="hidden" id="format" name="format" value="moz-project-review"> + <input type="hidden" id="bug_severity" name="bug_severity" value="normal"> + <input type="hidden" id="token" name="token" value="[% token FILTER html %]"> + + <div id="initial_questions"> + <div class="header">Initial Questions</div> + + <div id="project_feature_summary_row" class="field_row"> + <span class="field_label required">Project/Feature Name:</span> + <span class="field_data"> + <div class="field_description">Be brief yet descriptive as possible. Include name of product, + feature, or name of vendor involved as well if appropriate.</div> + <input type="text" name="short_desc" id="short_desc" size="60" maxsize="255"> + </span> + </div> + + <div id="visibility_row" class="field_row"> + <span class="field_label required">Project Visibility:</span> + <span class="field_data"> + <div class="field_description"> + Whether project itself is a secret or not (dependent [% terms.bugs %], + e.g. Finance and Sec Review, will be made secure whatever you choose). + </div> + <select name="visibility" id="visibility"> + <option value="">Select One</option> + <option value="public">Public</option> + <option value="private">MoCo Confidentional</option> + </select> + </span> + </div> + + <div id="tracking_id_row" class="field_row"> + <span class="field_label">Tracking [% terms.Bug %] ID:</span> + <span class="field_data"> + <div class="field_description">Master tracking [% terms.bug %] number (if it exists)?</div> + <input type="text" name="tracking_id" id="tracking_id" size="60"> + </span> + </div> + + <div id="contacts_row" class="field_row"> + <span class="field_label required">Points of Contact:</span> + <span class="field_data"> + <div class="field_description">Who are the points of contact for this review?</div> + [% INCLUDE global/userselect.html.tmpl + id => "cc" + name => "cc" + value => "" + size => 60 + classes => ["bz_userfield"] + multiple => 5 + %] + </span> + </div> + + <div id="description_row" class="field_row"> + <span class="field_label required">Description:</span> + <span class="field_data"> + <div class="field_description">Please provide a short description of the feature / application / project / + business relationship (e.g. problem solved, use cases, etc.)</div> + <textarea name="description" id="description" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="additional_row" class="field_row"> + <span class="field_label">Additional Information:</span> + <span class="field_data"> + <div class="field_description">Please provide links to additional information (e.g. feature page, wiki) + if available and not yet included in feature description.)</div> + <textarea name="additional" id="additional" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="key_initiative_row" class="field_row"> + <span class="field_label required">Key Initiative:</span> + <span class="field_data"> + <div class="field_description">Which key initiative does this support?</div> + <select name="key_initiative" id="key_initiative"> + <option value="">Select One</option> + <option value="Firefox Desktop">Firefox Desktop</option> + <option value="Firefox Mobile">Firefox Mobile</option> + <option value="Firefox OS">Firefox OS</option> + <option value="Firefox Platform">Firefox Platform</option> + <option value="Marketplace / Apps">Marketplace / Apps</option> + <option value="Services: Persona">Services: Persona</option> + <option value="Services: WebRTC">Services: WebRTC</option> + <option value="Services: UP">Services: UP</option> + <option value="Services: Social API">Services: Social API</option> + <option value="Labs / Research / H3">Labs / Research / H3</option> + <option value="Business Support">Business Support</option> + <option value="Other">Other</option> + </select> + </span> + </div> + + <div id="key_initiative_other_row" class="field_row bz_default_hidden"> + <span class="field_label"> </span> + <span class="field_data"> + <input type="text" name="key_initiative_other" id="key_initiative_other" size="60"> + </span> + </div> + + <div id="release_date_row" class="field_row"> + <span class="field_label required">Release Date:</span> + <span class="field_data"> + <div class="field_description">What is your overall key release / launch date / go live date?</div> + <input name="release_date" size="20" id="release_date" value="" + onchange="updateCalendarFromField(this)"> + <button type="button" class="calendar_button" + id="button_calendar_release_date" + onclick="showCalendar('release_date')"> + <span>Calendar</span> + </button> + <div id="con_calendar_release_date"></div> + <script type="text/javascript"> + createCalendar('release_date') + </script> + </span> + </div> + + <div id="project_status_row" class="field_row"> + <span class="field_label required">Project Status:</span> + <span class="field_data"> + <div class="field_description">What is the current state of your project?</div> + <select name="project_status" id="project_status"> + <option value="">Select One</option> + <option value="future">Future project under discussion</option> + <option value="active">Active planning</option> + <option value="development">Development</option> + <option value="ready">Ready to launch/commit</option> + <option value="launched">Already launched/committed</option> + </select> + </span> + </div> + + <div id="mozilla_data_row" class="field_row"> + <span class="field_label required">Mozilla Data:</span> + <span class="field_data"> + <div class="field_description">Does this product/service/project access, interact with, or store Mozilla + (customer, contributor, user, employee) data? Example of such data includes + email addresses, first and last name, addresses, phone numbers, credit card data.)</div> + <select name="mozilla_data" id="mozilla_data"> + <option value="">Select One</option> + <option value="Yes">Yes</option> + <option value="No">No</option> + </select> + </span> + </div> + + <div id="mozilla_related_row" class="field_row"> + <span class="field_label">Mozilla Related:</span> + <span class="field_data"> + <div class="field_description">What Mozilla products/services/projects does this product/service/project + integrate with or relate to?</div> + <input type="text" name="mozilla_related" id="mozilla_related" size="60"> + </span> + </div> + + <div id="separate_party_row" class="field_row"> + <span class="field_label required">Separate Party:</span> + <span class="field_data"> + <div class="field_description">Hardware Purchases, + Vendor agreements, NDAs, Contracts etc</div> + <select name="separate_party" id="separate_party"> + <option value="">Select One</option> + <option value="Yes">Yes</option> + <option value="No">No</option> + </select> + </span> + </div> + + <div id="initial_separate_party_questions" class="bz_default_hidden"> + <div id="relation_type_row" class="field_row"> + <span class="field_label required">Type of Relationship:</span> + <span class="field_data"> + <div class="field_description">What type of relationship?</div> + <select name="relationship_type" id="relationship_type"> + <option value="">Select One</option> + <option value="Hardware Purchase">Hardware Purchase</option> + <option value="Vendor/Services">Vendor/Services</option> + <option value="Distribution/Bundling">Distribution/Bundling</option> + <option value="Search">Search</option> + <option value="NDA">NDA</option> + <option value="Other">Other</option> + </select> + </span> + </div> + + <div id="data_access_row" class="field_row"> + <span class="field_label required">Data Access:</span> + <span class="field_data"> + <div class="field_description">Will the other party have access to Mozilla (customer, contributor, user, + employee) data? (If this is for an NDA, choose no)</div> + <select name="data_access" id="data_access"> + <option value="">Select One</option> + <option value="Yes">Yes</option> + <option value="No">No</option> + </select> + </span> + </div> + + <div id="privacy_policy_row" class="field_row"> + <span class="field_label">Privacy Policy:</span> + <span class="field_data"> + <div class="field_description">What is the url for their privacy policy?</div> + <input type="text" name="privacy_policy" id="privacy_policy" size="60"> + </span> + </div> + + <div id="vendor_cost_row" class="field_row"> + <span class="field_label required">Vendor Cost:</span> + <span class="field_data"> + <div class="field_description">What is the anticipated cost of the vendor relationship? + (Entire Contract Cost, not monthly cost)</div> + <select name="vendor_cost" id="vendor_cost"> + <option value="">Select One</option> + <option value="N/A">N/A</option> + <option value="<= $25,000"><= $25,000</option> + <option value="> $25,000">> $25,000</option> + </select> + </span> + </div> + + <div id="po_needed_row" class="field_row bz_default_hidden"> + <span class="field_label required">PO Needed?:</span> + <span class="field_data"> + <select name="po_needed" id="po_needed"> + <option value="">Select One</option> + <option value="Yes">Yes</option> + <option value="No">No</option> + </select> + </span> + </div> + </div> + </div> + + <div id="sec_review_questions" class="bz_default_hidden"> + <div class="header">Security Review</div> + + <div id="sec_review_affects_products_row"> + <span class="field_label">Affects Products:</span> + <span class="field_data"> + <div class="field_description">Does this feature or code change affect Firefox, Thunderbird or any + product or service the Mozilla ships to end users?</div> + <select name="sec_affects_products" id="sec_affects_products"> + <option value="">Select One</option> + <option value="Yes">Yes</option> + <option value="No">No</option> + </select> + </span> + </div> + + <div id="sec_review_date_row" class="field_row"> + <span class="field_label">Review Due Date:</span> + <span class="field_data"> + <div class="field_description">When would you like the review to be completed? + (<a href="https://mail.mozilla.com/home/ckoenig@mozilla.com/Security%20Review.html" + target="_blank">more info</a>)</div> + <input name="sec_review_date" size="20" id="sec_review_date" value="" + onchange="updateCalendarFromField(this)"> + <button type="button" class="calendar_button" + id="button_calendar_sec_review_date" + onclick="showCalendar('sec_review_date')"> + <span>Calendar</span> + </button> + <div id="con_calendar_sec_review_date"></div> + <script type="text/javascript"> + createCalendar('sec_review_date') + </script> + </span> + </div> + + <div id="sec_review_invitees_row" class="field_row"> + <span class="field_label">Review Invitees:</span> + <span class="field_data"> + <div class="field_description">Whom should be invited to the review?</div> + <input type="text" name="sec_review_invitees" id="sec_review_invitees" size="60"> + </span> + </div> + + <div id="sec_review_extra_row" class="field_row"> + <span class="field_label">Extra Information:</span> + <span class="field_data"> + <div class="field_description">If you feel something is missing here or you would like to provide other + kind of feedback, feel free to do so here?</div> + <textarea name="sec_review_extra" id="sec_review_extra" rows="10" cols="80"></textarea> + </span> + </div> + </div> + + <div id="privacy_policy_project_questions" class="bz_default_hidden"> + <div class="header">Privacy (Policy/Project)</div> + + <div id="privacy_policy_project_link_row" class="field_row"> + <span class="field_label">Is there a privacy policy for<br>this new feature/product?:</span> + <span class="field_data"> + <div class="field_description">If yes, please enter a url to the policy.</div> + <input type="text" name="privacy_policy_project_link" id="privacy_policy_project_link" size="60"> + </span> + </div> + + <div id="privacy_policy_project_assistance_row" class="field_row"> + <span class="field_label required">What assistance do you need from the privacy team (if any)?:</span> + <span class="field_data"> + <textarea name="privacy_policy_project_assistance" id="privacy_policy_project_assistance" rows="10" cols="80"></textarea> + </span> + </div> + </div> + + <div id="privacy_policy_vendor_questions" class="bz_default_hidden"> + <div class="header">Privacy (Policy/Vendor)</div> + + <div id="privacy_policy_vendor_user_data_row" class="field_row"> + <span class="field_label">Privacy Policy:</span> + <span class="field_data"> + <div class="field_description">Will the vendor have access to Mozilla (customer, contributor, user, employee) data?</div> + <select name="privacy_policy_vendor_user_data" id="privacy_policy_vendor_user_data"> + <option value="">Select One</option> + <option value="Yes">Yes</option> + <option value="No">No</option> + </select> + </span> + </div> + + <div id="privacy_policy_vendor_extra" class="bz_default_hidden"> + <div id="privacy_policy_vendor_link_row" class="field_row"> + <span class="field_label">Vendor's Privacy Policy:</span> + <span class="field_data"> + <div class="field_description">Please provide link to vendor's privacy policy</div> + <input type="text" name="privacy_policy_vendor_link" id="privacy_policy_vendor_link" size="60"> + </span> + </div> + + <div id="privacy_policy_vendor_questionnaire_row" class="field_row"> + <span class="field_label">Privacy Questionnaire:</span> + <span class="field_data"> + <div class="field_description">Has vendor completed Mozilla Vendor Privacy Questionnaire?</div> + <select name="privacy_policy_vendor_questionnaire" id="privacy_policy_vendor_questionnaire"> + <option value="">Select One</option> + <option value="Yes">Yes</option> + <option value="No">No</option> + </select> + </span> + </div> + </div> + </div> + + <div id="legal_questions" class="bz_default_hidden"> + <div class="header">Legal</div> + + <div id="legal_priority_row" class="field_row"> + <span class="field_label required">Priority:</span> + <span class="field_data"> + <div class="field_description">Priority to your team</div> + <select name="legal_priority" id="legal_priority"> + <option value="">Select One</option> + <option value="high">High</option> + <option value="medium">Medium</option> + <option value="low">Low</option> + </select> + </span> + </div> + + <div id="legal_timeframe_row" class="field_row"> + <span class="field_label required">Time Frame For Completion<br>of Legal Portion?:</span> + <span class="field_data"> + <div class="field_description">What is the desired time frame to have the legal component/involvement completed.</div> + <select name="legal_timeframe" id="legal_timeframe"> + <option value="2 days">2 days</option> + <option value="a week">a week</option> + <option value="2-4 weeks">2-4 weeks</option> + <option value="will take a while but please start soon"> + will take a while but please start soon</option> + <option value="no rush" selected>no rush</option> + </select> + </span> + </div> + + <div id="legal_cc_row" class="field_row"> + <span class="field_label">Cc:</span> + <span class="field_data"> + [% INCLUDE global/userselect.html.tmpl + id => "legal_cc" + name => "legal_cc" + value => "" + size => 60 + classes => ["bz_userfield"] + multiple => 5 + %] + </span> + </div> + + <div id="legal_other_party_row" class="field_row"> + <span class="field_label">Other Party:</span> + <span class="field_data"> + <div class="field_description">Name of other party involved</div> + <input type="text" name="legal_other_party" id="legal_other_party" size="60"> + </span> + </div> + + <div id="legal_help_from_legal_row" class="field_row"> + <span class="field_label required">What help do you<br>need from Legal?</span> + <span class="field_data"> + <div class="field_description"> + Please explain specifically what help you need from Legal. If none, put "No Legal help needed."</div> + <textarea name="legal_help_from_legal" id="legal_help_from_legal" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="legal_sow_questions" class="bz_default_hidden"> + <div class=field_row"> + <span class="field_label">SOW Details:</span> + <span class="field_data"> + Please provide the following information for the SOW + </span> + </div> + + <div id="legal_sow_vendor_name_row" class="field_row"> + <span class="field_label required">Legal Vendor Name:</span> + <span class="field_data"> + <input type="text" name="legal_sow_vendor_name" id="legal_sow_vendor_name" size="60"> + </span> + </div> + + <div id="legal_sow_vendor_address_row" class="field_row"> + <span class="field_label required">Vendor Address:</span> + <span class="field_data"> + <textarea name="legal_sow_vendor_address" id="legal_sow_vendor_address" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="legal_sow_vendor_email_row" class="field_row"> + <span class="field_label required">Vendor Email for Notices:</span> + <span class="field_data"> + <input type="text" name="legal_sow_vendor_email" id="legal_sow_vendor_email" size="60"> + </span> + </div> + + <div id="legal_sow_vendor_mozcontact_row" class="field_row"> + <span class="field_label required">Main Mozilla Contact:</span> + <span class="field_data"> + [% INCLUDE global/userselect.html.tmpl + id => "legal_sow_vendor_mozcontact" + name => "legal_sow_vendor_mozcontact" + value => "" + size => 60 + classes => ["bz_userfield"] + multiple => 5 + %] + </span> + </div> + + <div id="legal_sow_vendor_contact_row" class="field_row"> + <span class="field_label required">Main Vendor Contact and Email:</span> + <span class="field_data"> + <input type="text" name="legal_sow_vendor_contact" id="legal_sow_vendor_contact" size="60"> + </span> + </div> + + <div id="legal_sow_vendor_services_row" class="field_row"> + <span class="field_label required">Vendor Services to be Provided:</span> + <span class="field_data"> + <textarea name="legal_sow_vendor_services" id="legal_sow_vendor_services" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="legal_sow_vendor_deliverables_row" class="field_row"> + <span class="field_label required">Description of Deliverables:</span> + <span class="field_data"> + <textarea name="legal_sow_vendor_deliverables" id="legal_sow_vendor_deliverables" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="legal_sow_start_date_row" class="field_row"> + <span class="field_label required">Start Date:</span> + <span class="field_data"> + <input name="legal_sow_start_date" size="20" id="legal_sow_start_date" value="" + onchange="updateCalendarFromField(this)"> + <button type="button" class="calendar_button" + id="button_calendar_legal_sow_start_date" + onclick="showCalendar('legal_sow_start_date')"> + <span>Calendar</span> + </button> + <div id="con_calendar_legal_sow_start_date"></div> + <script type="text/javascript"> + createCalendar('legal_sow_start_date') + </script> + </span> + </div> + + <div id="legal_sow_end_date_row" class="field_row"> + <span class="field_label required">End Date:</span> + <span class="field_data"> + <input name="legal_sow_end_date" size="20" id="legal_sow_end_date" value="" + onchange="updateCalendarFromField(this)"> + <button type="button" class="calendar_button" + id="button_calendar_legal_sow_end_date" + onclick="showCalendar('legal_sow_end_date')"> + <span>Calendar</span> + </button> + <div id="con_calendar_legal_sow_end_date"></div> + <script type="text/javascript"> + createCalendar('legal_sow_end_date') + </script> + </span> + </div> + + <div id="legal_sow_vendor_payment_row" class="field_row"> + <span class="field_label required">Rate of Pay:</span> + <span class="field_data"> + <div class="field_description">Include currency</div> + <input type="text" name="legal_sow_vendor_payment" id="legal_sow_vendor_payment" size="60"> + </span> + </div> + + <div id="legal_sow_vendor_payment_basis_row" class="field_row"> + <span class="field_label required">Basis for Payment:</span> + <span class="field_data"> + <div class="field_description">hourly, flat fee, per deliverable, etc.</div> + <input type="text" name="legal_sow_vendor_payment_basis" id="legal_sow_vendor_payment_basis" size="60"> + </span> + </div> + + <div id="legal_sow_vendor_hours_row" class="field_row"> + <span class="field_label">Average/Max Hours:</span> + <span class="field_data"> + <div class="field_description">If hourly, either average or maximum hours per week/month</div> + <input type="text" name="legal_sow_vendor_hours" id="legal_sow_vendor_hours" size="60"> + </span> + </div> + + <div id="legal_sow_vendor_payment_schedule_row" class="field_row"> + <span class="field_label required">Payment Schedule:</span> + <span class="field_data"> + <div class="field_description">"When will we make payments? E.g. every 30 days; half due up front, + half on completion; following acceptance of each deliverable, etc.</div> + <input type="text" name="legal_sow_vendor_payment_schedule" id="legal_sow_vendor_payment_schedule" size="60"> + </span> + </div> + + <div id="legal_sow_vendor_total_max_row" class="field_row"> + <span class="field_label required">Total Not to Exceed Amount:</span> + <span class="field_data"> + <input type="text" name="legal_sow_vendor_total_max" id="legal_sow_vendor_total_max" size="60"> + </span> + </div> + + <div id="legal_sow_vendor_special_terms_row" class="field_row"> + <span class="field_label">Any Special Terms:</span> + <span class="field_data"> + <textarea name="legal_sow_vendor_special_terms" id="legal_sow_vendor_special_terms" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="legal_sow_vendor_product_line_row" class="field_row"> + <span class="field_label required">Product Line:</span> + <span class="field_data"> + <select id="legal_sow_vendor_product_line" name="legal_sow_vendor_product_line"> + <option value="">Select One</option> + <option value="Firefox OS">Firefox OS</option> + <option value="Firefox Desktop">Firefox Desktop</option> + <option value="Firefox Mobile">Firefox Mobile</option> + <option value="Firefox Platform">Firefox Platform</option> + <option value="Marketplace/Apps">Marketplace/Apps</option> + <option value="Lab/Research">Lab/Research</option> + <option value="Services">Services</option> + <option value="Product Support">Product Support</option> + <option value="Corp Support">Corp Support</option> + </select> + </span> + </div> + </div> + + <div id="legal_vendor_services_where_row" class="field_row bz_default_hidden"> + <span class="field_label required">Vendor Services Location:</span> + <span class="field_data"> + <div class="field_description">Where will the services primarily be provided?</div> + <select name="legal_vendor_services_where" id="legal_vendor_services_where"> + <option value="">Select One</option> + <option value="U.S.">U.S.</option> + <option value="Europe">Europe</option> + <option value="Canada">Canada</option> + <option value="Global">Global</option> + <option value="Another region of the world">Another region of the world</option> + <option value="A single country">A single country</option> + </select> + <br> + <input class="bz_default_hidden" type="text" + name="legal_vendor_single_country" id="legal_vendor_single_country" size="60"> + </span> + </div> + </div> + + <div id="finance_questions" class="bz_default_hidden"> + <div class="header">Finance</div> + + <div id="finance_purchase_vendor_row" class="field_row"> + <span class="field_label required">Vendor:</span> + <span class="field_data"> + <input type="text" name="finance_purchase_vendor" maxsize="255" size="60" id="finance_purchase_vendor"> + </span> + </div> + + <div id="finance_purchase_inbudget_row" class="field_row"> + <span class="field_label required">Is this line item in budget?:</span> + <span class="field_data"> + <div class="field_description">If not, please explain purchase need and why not in budget.</div> + <textarea name="finance_purchase_inbudget" id="finance_purchase_inbudget" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="finance_purchase_what_row" class="field_row"> + <span class="field_label required">What is the purchase for?:</span> + <span class="field_data"> + <textarea name="finance_purchase_what" id="finance_purchase_what" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="finance_purchase_why_row" class="field_row"> + <span class="field_label required">Why is the purchase needed?:</span> + <span class="field_data"> + <textarea name="finance_purchase_why" id="finance_purchase_why" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="finance_purchase_risk_row" class="field_row"> + <span class="field_label required">What is the risk<br>if not purchased?:</span> + <span class="field_data"> + <textarea name="finance_purchase_risk" id="finance_purchase_risk" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="finance_purchase_alternative_row" class="field_row"> + <span class="field_label required">What is the alternative?:</span> + <span class="field_data"> + <textarea name="finance_purchase_alternative" id="finance_purchase_alternative" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="finance_purchase_urgency_row" class="field_row"> + <span class="field_label required">When do the items need<br>to be purchased by?:</span> + <span class="field_data"> + <select name="finance_purchase_urgency" id="finance_purchase_urgency"> + <option value="3 to 5 days">3 to 5 days</option> + <option value="7 to 10 days">7 to 10 days</option> + <option value="two weeks">two weeks</option> + <option value="no rush" selected>no rush</option> + </select> + </span> + </div> + + <div id="finance_shipment_address_row" class="field_row"> + <span class="field_label">What is the shipment address<br>(if applicable)?:</span> + <span class="field_data"> + <div class="field_description">Please enter the full address.</div> + <textarea name="finance_shipment_address" id="finance_shipment_address" rows="10" cols="80"></textarea> + </span> + </div> + + <div id="finance_purchase_cost_row" class="field_row"> + <span class="field_label required">Total Cost:</span> + <span class="field_data"> + <div class="field_description">Please include currency type (e.g. USD, EUR)</div> + <input type="text" name="finance_purchase_cost" id="finance_purchase_cost" size="60"> + </span> + </div> + </div> + + <input type="submit" id="commit" value="Submit Review"> +</form> + +<p> + Thanks for contacting us. You will be notified by email of any progress made in resolving your request. +</p> + +[% PROCESS global/footer.html.tmpl %] diff --git a/extensions/MozProjectReview/template/en/default/hook/global/messages-messages.html.tmpl b/extensions/MozProjectReview/template/en/default/hook/global/messages-messages.html.tmpl new file mode 100644 index 000000000..ac7c1f6c7 --- /dev/null +++ b/extensions/MozProjectReview/template/en/default/hook/global/messages-messages.html.tmpl @@ -0,0 +1,13 @@ +[%# 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 message_tag == "moz_project_review_creation_failed" %] + The parent [% terms.bug %] was created successfully, but creation of + the dependent [% terms.bugs %] failed. The error has been logged + and no further action is required at this time. +[% END %] diff --git a/extensions/MozProjectReview/web/js/moz_project_review.js b/extensions/MozProjectReview/web/js/moz_project_review.js new file mode 100644 index 000000000..22e79f707 --- /dev/null +++ b/extensions/MozProjectReview/web/js/moz_project_review.js @@ -0,0 +1,267 @@ +/* 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 Dom = YAHOO.util.Dom; +var Event = YAHOO.util.Event; + +var MPR = { + required_fields: { + "initial_questions": { + "short_desc": "Please enter a value for project or feature name in the initial questions section", + "visibility": "Please select a value for project visibility in the initial questions section", + "cc": "Please enter a value for points of contact in the initial questions section", + "key_initiative": "Please select a value for key initiative in the initial questions section", + "release_date": "Please enter a value for release date in the initial questions section", + "project_status": "Please select a value for project status in the initial questions section", + "mozilla_data": "Please select a value for mozilla data in the initial questions section", + "separate_party": "Please select a value for separate party in the initial questions section" + }, + "finance_questions": { + "finance_purchase_vendor": "Please enter a value for vendor in the finance questions section", + "finance_purchase_what": "Please enter a value for what in the finance questions section", + "finance_purchase_why": "Please enter a value for why in the finance questions section", + "finance_purchase_risk": "Please enter a value for risk in the finance questions section", + "finance_purchase_alternative": "Please enter a value for alternative in the finance questions section", + "finance_purchase_inbudget": "Please enter a value for in budget in the finance questions section", + "finance_purchase_urgency": "Please select a value for urgency in the finance questions section", + "finance_purchase_cost": "Please enter a value for total cost in the finance questions section" + }, + "legal_questions": { + "legal_priority": "Please select a value for priority in the legal questions section", + "legal_timeframe": "Please select a value for timeframe in the legal questions section", + "legal_help_from_legal": "Please describe the help needed from the Legal department" + }, + "legal_sow_questions": { + "legal_sow_vendor_name": "Please enter a value for SOW legal vendor name", + "legal_sow_vendor_address": "Please enter a value for SOW vendor address", + "legal_sow_vendor_email": "Please enter a value for SOW vendor email for notices", + "legal_sow_vendor_mozcontact": "Please enter a value for SOW Mozilla contact", + "legal_sow_vendor_contact": "Please enter a value for SOW vendor contact and email address", + "legal_sow_vendor_services": "Please enter a value for SOW vendor services description", + "legal_sow_vendor_deliverables": "Please enter a value for SOW vendor deliverables description", + "legal_sow_start_date": "Please enter a value for SOW vendor start date", + "legal_sow_end_date": "Please enter a value for SOW vendor end date", + "legal_sow_vendor_payment": "Please enter a value for SOW vendor payment amount", + "legal_sow_vendor_payment_basis": "Please enter a value for SOW vendor payment basis", + "legal_sow_vendor_payment_schedule": "Please enter a value for SOW vendor payment schedule", + "legal_sow_vendor_total_max": "Please enter a value for SOW vendor maximum total to be paid", + "legal_sow_vendor_product_line": "Please enter a value for SOW vendor product line" + }, + "privacy_policy_project_questions": { + "privacy_policy_project_assistance": "Please enter a value for any assistance needed in the privacy policy project questions section", + "privacy_policy_project_link": "Please enter a value for project link in the privacy policy project questions section" + } + }, + + select_inputs: [ + 'key_initiative', + 'project_status', + 'mozilla_data', + 'separate_party', + 'relationship_type', + 'data_access', + 'vendor_cost', + 'po_needed', + 'sec_affects_products', + 'privacy_policy_vendor_user_data', + 'privacy_policy_vendor_questionnaire', + 'legal_priority', + 'legal_sow_vendor_product_line', + 'legal_vendor_services_where', + 'finance_purchase_urgency' + ], + + init: function () { + // Bind the updateSections function to each of the inputs desired + for (var i = 0, l = this.select_inputs.length; i < l; i++) { + Event.on(this.select_inputs[i], 'change', MPR.updateSections); + } + MPR.updateSections(); + }, + + fieldValue: function (id) { + var field = Dom.get(id); + if (!field) return ''; + if (field.type == 'text' + || field.type == 'textarea') + { + return field.value; + } + return field.options[field.selectedIndex].value; + }, + + updateSections: function () { + // Sections that will be hidden/shown based on the input values + // Start out as all false except for initial questions which is always visible + var page_sections = { + initial_questions: true, + key_initiative_other_row: false, + initial_separate_party_questions: false, + finance_questions: false, + po_needed_row: false, + legal_questions: false, + legal_sow_questions: false, + legal_vendor_single_country: false, + legal_vendor_services_where_row: false, + sec_review_questions: false, + privacy_policy_project_questions: false, + privacy_policy_vendor_questions: false, + privacy_policy_vendor_extra: false + }; + + if (MPR.fieldValue('key_initiative') == 'Other') { + page_sections.key_initiative_other_row = true; + } + + if (MPR.fieldValue('mozilla_data') == 'Yes') { + page_sections.legal_questions = true; + page_sections.privacy_policy_project_questions = true; + page_sections.sec_review_questions = true; + } + + if (MPR.fieldValue('separate_party') == 'Yes') { + page_sections.initial_separate_party_questions = true; + + if (MPR.fieldValue('relationship_type') + && MPR.fieldValue('relationship_type') != 'Hardware Purchase') + { + page_sections.legal_questions = true; + } + + if (MPR.fieldValue('relationship_type') == 'Vendor/Services' + || MPR.fieldValue('relationship_type') == 'Distribution/Bundling') + { + page_sections.legal_sow_questions = true; + page_sections.legal_vendor_services_where_row = true; + } + + if (MPR.fieldValue('relationship_type') == 'Hardware Purchase') { + page_sections.finance_questions = true; + } + + if (MPR.fieldValue('data_access') == 'Yes') { + page_sections.legal_questions = true; + page_sections.sec_review_questions = true; + page_sections.privacy_policy_vendor_questions = true; + } + + if (MPR.fieldValue('vendor_cost') == '<= $25,000') { + page_sections.po_needed_row = true; + } + + if (MPR.fieldValue('po_needed') == 'Yes') { + page_sections.finance_questions = true; + } + + if (MPR.fieldValue('vendor_cost') == '> $25,000') { + page_sections.finance_questions = true; + } + } + + if (MPR.fieldValue('legal_vendor_services_where') == 'A single country') { + page_sections.legal_vendor_single_country = true; + } + + if (MPR.fieldValue('privacy_policy_vendor_user_data') == 'Yes') { + page_sections.privacy_policy_vendor_extra = true; + } + + // Toggle the individual page_sections + for (section in page_sections) { + MPR.toggleShowSection(section, page_sections[section]); + } + }, + + toggleShowSection: function (section, show) { + if (show) { + Dom.removeClass(section, 'bz_default_hidden'); + } + else { + Dom.addClass(section ,'bz_default_hidden'); + } + }, + + validateAndSubmit: function () { + var alert_text = ''; + var section = ''; + for (section in this.required_fields) { + if (!Dom.hasClass(section, 'bz_default_hidden')) { + var field = ''; + for (field in MPR.required_fields[section]) { + if (!MPR.isFilledOut(field)) { + alert_text += this.required_fields[section][field] + "\n"; + } + } + } + } + + // Special case checks + if (MPR.fieldValue('relationship_type') == 'Vendor/Services' + && MPR.fieldValue('legal_vendor_services_where') == '') + { + alert_text += "Please select a value for vendor services where\n"; + } + + if (MPR.fieldValue('relationship_type') == 'Vendor/Services' + && MPR.fieldValue('legal_vendor_services_where') == 'A single country' + && MPR.fieldValue('legal_vendor_single_country') == '') + { + alert_text += "Please select a value for vendor services where single country\n"; + } + + if (MPR.fieldValue('key_initiative') == 'Other') { + if (!MPR.isFilledOut('key_initiative_other')) { + alert_text += "Please enter a value for key initiative in the initial questions section\n"; + } + } + + if (MPR.fieldValue('separate_party') == 'Yes') { + if (!MPR.isFilledOut('relationship_type')) { + alert_text += "Please select a value for type of relationship\n"; + } + if (!MPR.isFilledOut('data_access')) { + alert_text += "Please select a value for data access\n"; + } + if (!MPR.isFilledOut('vendor_cost')) { + alert_text += "Please select a value for vendor cost\n"; + } + } + + if (MPR.fieldValue('vendor_cost') == '<= $25,000' + && MPR.fieldValue('po_needed') == '') + { + alert_text += "Please select whether a PO is needed or not\n"; + } + + if (alert_text) { + alert(alert_text); + return false; + } + + var visibility = MPR.fieldValue('visibility'); + if (visibility == 'private') { + var groups = document.createElement('input'); + groups.type = 'hidden'; + groups.name = 'groups'; + groups.value = 'mozilla-employee-confidential'; + Dom.get('mozProjectForm').appendChild(groups); + } + + return true; + }, + + //Takes a DOM element id and makes sure that it is filled out + isFilledOut: function (elem_id) { + var str = MPR.fieldValue(elem_id); + return str.length > 0 ? true : false; + } +}; + +Event.onDOMReady(function () { + MPR.init(); +}); diff --git a/extensions/MozProjectReview/web/style/moz_project_review.css b/extensions/MozProjectReview/web/style/moz_project_review.css new file mode 100644 index 000000000..cf1c3a8b8 --- /dev/null +++ b/extensions/MozProjectReview/web/style/moz_project_review.css @@ -0,0 +1,48 @@ +/* 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. */ + +.header { + width: 95%; + border-bottom: 1px solid rgb(116,126,147); + font-size: 1.5em; + color: rgb(102, 100, 88); + padding-bottom: 5px; + margin-bottom: 5px; + margin-top: 12px; +} + +.field_row { + width: 100%; + min-width: 700px; + clear: both; +} + +.field_label { + float: left; + width: 20%; +} + +.field_data { + float: left; + width: 75%; + margin-left: 5px; + margin-bottom: 5px; +} + +.field_description { + font-style: italic; + font-size: 90%; + color: rgb(102, 100, 88); +} + +span.required:before { + content: "* "; +} + +span.required:before, span.required_star { + color: red; +} |