From cae57f72c1bc2735149a8256c91852d59b741462 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 29 Jan 2013 01:55:09 +0800 Subject: Bug 833369: Create a Documentation Request bugzilla form --- .htaccess | 4 +- extensions/BMO/Extension.pm | 11 +- .../en/default/bug/create/comment-doc.txt.tmpl | 19 +++ .../en/default/bug/create/create-doc.html.tmpl | 155 +++++++++++++++++++++ 4 files changed, 186 insertions(+), 3 deletions(-) create mode 100644 extensions/BMO/template/en/default/bug/create/comment-doc.txt.tmpl create mode 100644 extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl diff --git a/.htaccess b/.htaccess index e7c65bdc8..4d948b6a5 100644 --- a/.htaccess +++ b/.htaccess @@ -42,6 +42,8 @@ RewriteRule ^form[\.:]reps[\.:]budget$ enter_bug.cgi?product=Mozilla+Reps&format RewriteRule ^form[\.:]reps[\.:]swag$ enter_bug.cgi?product=Mozilla+Reps&format=remo-swag RewriteRule ^form[\.:]reps[\.:]payment$ page.cgi?id=remo-form-payment.html RewriteRule ^form[\.:]employee[\.\-:]incident$ enter_bug.cgi?product=mozilla.org&format=employee-incident -RewriteRule ^form[\.:]brownbag$ enter_bug.cgi?product=Air\ Mozilla&format=brownbag +RewriteRule ^form[\.:]brownbag$ enter_bug.cgi?product=Air+Mozilla&format=brownbag RewriteRule ^form[\.:]finance$ enter_bug.cgi?product=Finance&format=finance RewriteRule ^form[\.:]privacy[\.\-:]data$ enter_bug.cgi?product=Privacy&format=privacy-data +RewriteRule ^form[\.:]moz[\.\-:]project[\.\-:]review$ enter_bug.cgi?product=mozilla.org&format=moz-project-review +RewriteRule ^form[\.:]docs?$ enter_bug.cgi?product=Developer+Documentation&format=doc diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index 84d04b0f8..186a83f73 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -28,6 +28,7 @@ use base qw(Bugzilla::Extension); use Bugzilla::Field; use Bugzilla::Constants; use Bugzilla::Status; +use Bugzilla::Product; use Bugzilla::User; use Bugzilla::User::Setting; use Bugzilla::Util qw(html_quote trick_taint trim datetime_from detaint_natural); @@ -123,18 +124,24 @@ sub template_before_process { $vars->{'columns_sortkey'} = \%columns_sortkey; } - elsif ($file =~ /^bug\/create\/create[\.-]/) { + elsif ($file =~ /^bug\/create\/create[\.-](.*)/) { + my $format = $1; if (!$vars->{'cloned_bug_id'}) { # Allow status whiteboard values to be bookmarked $vars->{'status_whiteboard'} = Bugzilla->cgi->param('status_whiteboard') || ""; } - + # Purpose: for pretty product chooser $vars->{'format'} = Bugzilla->cgi->param('format'); # Data needed for "this is a security bug" checkbox $vars->{'sec_groups'} = \%product_sec_groups; + + if ($format eq 'doc.html.tmpl') { + my $versions = Bugzilla::Product->new({ name => 'Core' })->versions; + $vars->{'versions'} = [ reverse @$versions ]; + } } diff --git a/extensions/BMO/template/en/default/bug/create/comment-doc.txt.tmpl b/extensions/BMO/template/en/default/bug/create/comment-doc.txt.tmpl new file mode 100644 index 000000000..3b706476c --- /dev/null +++ b/extensions/BMO/template/en/default/bug/create/comment-doc.txt.tmpl @@ -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. + #%] + +[% USE Bugzilla %] +[% cgi = Bugzilla.cgi +%] +:: Developer Documentation Request + + Request Type: [% cgi.param("type") %] + Gecko Version: [% cgi.param("gecko") %] + +:: Details + +[%+ cgi.param("details") %] + diff --git a/extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl new file mode 100644 index 000000000..c01d35401 --- /dev/null +++ b/extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl @@ -0,0 +1,155 @@ +[%# 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 %] +#doc_form th { + text-align: right; +} + +#short_desc, #details { + width: 100%; +} +[% END %] + +[% inline_javascript = BLOCK %] +function validateAndSubmit() { + var alert_text = ''; + if (!isFilledOut('type')) alert_text += 'Please select the "Request Type".\n'; + if (!isFilledOut('short_desc')) alert_text += 'Please enter a "Summary".\n'; + if (!isFilledOut('gecko')) alert_text += 'Please select the "Gecko Version".\n'; + if (!isFilledOut('details')) alert_text += 'Please enter some "Details".\n'; + if (alert_text != '') { + alert(alert_text); + return false; + } + return true; +} +[% END %] + +[% PROCESS global/header.html.tmpl + title = "Developer Documentation Request" + style = inline_style + javascript = inline_javascript + javascript_urls = [ 'extensions/BMO/web/js/form_validate.js', + 'js/field.js', 'js/util.js' ] +%] + +

Developer Documentation Request

+ +

+ Use this form to request new documentation or corrections to existing documentation.
+ All fields except for the Development [% terms.Bug %] are mandatory. +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Request Type + +
Topic + +
Summary + Please provide a brief summary of what documentation you're requesting, or + what problem you're reporting in existing documentation:
+ +
Gecko Version + +
Details + +
Development [% terms.Bug %] + + Optional — Corresponding development [% terms.bug %]. +
Urgency + +
+ Due to the volume of requests, the documentation team can't commit to + meeting specific deadlines for given documentation requests, but we will do + our best. +
 
 
+
+ +[% PROCESS global/footer.html.tmpl %] -- cgit v1.2.3-24-g4f1b