diff options
author | Sebastin Santy <sebastinssanty@gmail.com> | 2017-07-03 21:41:09 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-07-07 00:19:20 +0200 |
commit | 3ae73efc60d570fc3f0e918be3889f0ae5a9f263 (patch) | |
tree | d8cfb21d3e5a8d2d3bce51949835b8b6e7686549 /new_bug.cgi | |
parent | 6f68125893590fc9de60185f5535bae12adbcb54 (diff) | |
download | bugzilla-3ae73efc60d570fc3f0e918be3889f0ae5a9f263.tar.gz bugzilla-3ae73efc60d570fc3f0e918be3889f0ae5a9f263.tar.xz |
Bug 1365345 - Modal Bug Entry Prototype
Diffstat (limited to 'new_bug.cgi')
-rw-r--r-- | new_bug.cgi | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/new_bug.cgi b/new_bug.cgi index ec67980b9..2a56550e6 100644 --- a/new_bug.cgi +++ b/new_bug.cgi @@ -43,8 +43,27 @@ my $cgi = Bugzilla->cgi; my $template = Bugzilla->template; my $vars = {}; -print $cgi->header(); +if (lc($cgi->request_method) eq 'post') { + my $token = $cgi->param('token'); + check_hash_token($token, ['new_bug']); + my $new_bug = Bugzilla::Bug->create({ + short_desc => $cgi->param('short_desc'), + product => $cgi->param('product'), + component => $cgi->param('component'), + bug_severity => 'normal', + groups => [], + op_sys => 'Unspecified', + rep_platform => 'Unspecified', + version => join(' ', split('_', $cgi->param('version'))), + cc => [], + comment => $cgi->param('comment'), + }); + delete_token($token); + print $cgi->redirect(correct_urlbase() . 'show_bug.cgi?id='.$new_bug->bug_id); +} else { + print $cgi->header(); $template->process("bug/new_bug.html.tmpl", $vars) - or ThrowTemplateError($template->error()); + or ThrowTemplateError($template->error()); +} |