From d0a14d8b266ca9e87e922d19427e1d252cd86cd4 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 13 Apr 2015 18:23:31 +0100 Subject: Bug 1148490: Custom Budget Request form for FSA program --- .htaccess | 1 + .../default/bug/create/comment-fsa-budget.txt.tmpl | 35 +++ .../default/bug/create/create-fsa-budget.html.tmpl | 249 +++++++++++++++++++++ 3 files changed, 285 insertions(+) create mode 100644 extensions/BMO/template/en/default/bug/create/comment-fsa-budget.txt.tmpl create mode 100644 extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl diff --git a/.htaccess b/.htaccess index ad5c05572..c71b5c541 100644 --- a/.htaccess +++ b/.htaccess @@ -84,6 +84,7 @@ RewriteRule ^form[\.:]screen[\.:]share[\.:]whitelist$ enter_bug.cgi?product=Fire RewriteRule ^form[\.:]webops[\.\-:]request$ enter_bug.cgi?product=Infrastructure+\%26+Operations&format=webops-request [QSA] RewriteRule ^form[\.:]data[\.\-:]compliance$ enter_bug.cgi?product=Data+Compliance&format=data-compliance [QSA] RewriteRule ^form[\.:]third[\.\-:]party$ enter_bug.cgi?product=Marketing&format=third-party-apps [QSA] +RewriteRule ^form[\.:]fsa[\.:]budget$ enter_bug.cgi?product=FSA&format=fsa-budget [QSA] RewriteRule ^rest/(.*)$ rest.cgi/$1 [NE] RewriteRule ^(?:latest|1\.2|1\.3)/(.*)$ extensions/BzAPI/bin/rest.cgi/$1 [NE] RewriteRule ^bzapi/(.*)$ extensions/BzAPI/bin/rest.cgi/$1 [NE] diff --git a/extensions/BMO/template/en/default/bug/create/comment-fsa-budget.txt.tmpl b/extensions/BMO/template/en/default/bug/create/comment-fsa-budget.txt.tmpl new file mode 100644 index 000000000..d620aad2a --- /dev/null +++ b/extensions/BMO/template/en/default/bug/create/comment-fsa-budget.txt.tmpl @@ -0,0 +1,35 @@ +[%# 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 %] + +Requester info: + +Requester: [% cgi.param('firstname') %] [%+ cgi.param('lastname') %] +Profile page: [% cgi.param('profilepage') %] +Event page: [% cgi.param('eventpage') %] +Position: [% cgi.param('position') %] +Country You Reside: [% cgi.param('country') %] +Advance payment needed: [% IF cgi.param('advancepayment') %]Yes[% ELSE %]No[% END %] + +Budget breakdown: + +Total amount requested in $USD: [% cgi.param('budgettotal') %] +Costs per service: +Service 1: [% cgi.param('service1') %] Cost: [% cgi.param('cost1') %] +Service 2: [% cgi.param('service2') %] Cost: [% cgi.param('cost2') %] +Service 3: [% cgi.param('service3') %] Cost: [% cgi.param('cost3') %] +Service 4: [% cgi.param('service4') %] Cost: [% cgi.param('cost4') %] +Service 5: [% cgi.param('service5') %] Cost: [% cgi.param('cost5') %] + +Additional costs: +[%+ cgi.param('costadditional') %] + +[%+ cgi.param("comment") IF cgi.param("comment") %] + diff --git a/extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl new file mode 100644 index 000000000..d79db2ab2 --- /dev/null +++ b/extensions/BMO/template/en/default/bug/create/create-fsa-budget.html.tmpl @@ -0,0 +1,249 @@ +[%# 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 %] + +[% inline_style = BLOCK %] +#fsa_form { + width: 60%; +} +#fsa_form .required:after { + content: " *"; + color: red; +} +#fsa_form .field_label { + text-align: left; + font-weight: bold; +} +#fsa_form .field_desc, +#fsa_form .head_desc { + word-wrap: normal; +} +#fsa_form .head_desc { + font-size: 1.5em; + padding-bottom: .5em; +} +#fsa_form .form_section { + margin-bottom: 1em; +} +.yui-calcontainer { + z-index: 2; +} +[% END %] + +[% inline_javascript = BLOCK %] +function trySubmit() { + var firstname = document.getElementById('firstname').value; + var lastname = document.getElementById('lastname').value; + var eventpage = document.getElementById('eventpage').value; + var shortdesc = 'Budget Request - ' + firstname + ' ' + lastname + ' - ' + eventpage; + document.getElementById('short_desc').value = shortdesc; + return true; +} + +function validateAndSubmit() { + var alert_text = ''; + if (!isFilledOut('firstname')) alert_text += "Please enter your first name\n"; + if (!isFilledOut('lastname')) alert_text += "Please enter your last name\n"; + if (!isFilledOut('profilepage')) alert_text += "Please enter your profile page.\n"; + if (!isFilledOut('eventpage')) alert_text += "Please enter an event page address.\n"; + if (!isFilledOut('cf_due_date')) alert_text += "Please enter an event date.\n"; + if (!isFilledOut('position')) alert_text += "Please enter a value for position.\n"; + if (!isFilledOut('country')) alert_text += "Please enter a valid value for country.\n"; + if (!isFilledOut('budgettotal')) alert_text += "Please enter the total budget for the event.\n"; + if (!isFilledOut('service1') || !isFilledOut('cost1')) alert_text += "Please enter at least one service and cost value.\n"; + + //Everything required is filled out..try to submit the form! + if (alert_text == '') { + return trySubmit(); + } + + //alert text, stay here on the pagee + alert(alert_text); + return false; +} +[% END %] + +[% PROCESS global/header.html.tmpl + title = "FSA Budget Request Form" + generate_api_token = 1 + style = inline_style + style_urls = [ 'skins/standard/enter_bug.css' ] + javascript = inline_javascript + javascript_urls = [ 'extensions/BMO/web/js/form_validate.js', + 'js/util.js', + 'js/field.js' ] + yui = [ 'calendar' ] +%] + +

FSA Budget Request Form

+ +

+ * - Required Fields +

+ +
+ + + + + + + + + + + + +
+
+ First Name +
+ +
+ +
+
+ Last Name +
+ +
+ +
+
+ Mozillians Profile Page +
+ +
+ +
+
+ Event Page +
+ +
+ +
+
+ Event Date +
+ + +
+ +
+ +
+
+ What is your position? +
+ +
+ +
+
+ Country You Reside: +
+ +
+ +
+
+ Is advance payment needed? + +
+
+ +
Budget Request
+ +
+
+ Total amount requested in $USD +
+ +
+ +
+
+ Costs per service: +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Service 1:Cost 1:
Service 2:Cost 2:
Service 3:Cost 3:
Service 4:Cost 4:
Service 5:Cost 5:
+
+ +
+
+ Additional costs: +
+ +
+ +
+
+ Additional comments: +
+ +
+ +

+ +

+ +
+ +

+ Thanks for contacting us. +

+ +[% PROCESS global/footer.html.tmpl %] -- cgit v1.2.3-24-g4f1b