summaryrefslogtreecommitdiffstats
path: root/new_bug.cgi
diff options
context:
space:
mode:
authorSebastin Santy <sebastinssanty@gmail.com>2017-07-06 02:01:45 +0200
committerDylan William Hardison <dylan@hardison.net>2017-07-07 00:19:21 +0200
commit6f06744ccc95232300ee53ead82166e60c84351c (patch)
tree5ebf4ea1962a2a2ccfc7378e70e8fe4af8a588e2 /new_bug.cgi
parent37722eca39874bb6abdcd120e3e458bd62dea62b (diff)
downloadbugzilla-6f06744ccc95232300ee53ead82166e60c84351c.tar.gz
bugzilla-6f06744ccc95232300ee53ead82166e60c84351c.tar.xz
Bug 1365345 - Modal Bug Entry Prototype
Diffstat (limited to 'new_bug.cgi')
-rw-r--r--new_bug.cgi21
1 files changed, 20 insertions, 1 deletions
diff --git a/new_bug.cgi b/new_bug.cgi
index 0c816de2c..fd4b5520a 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 => scalar($cgi->param('short_desc')),
+ product => scalar($cgi->param('product')),
+ component => scalar($cgi->param('component')),
+ bug_severity => 'normal',
+ groups => [],
+ op_sys => 'Unspecified',
+ rep_platform => 'Unspecified',
+ version => join(' ', split('_', scalar($cgi->param('version')))),
+ cc => [],
+ comment => scalar($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());
+}