diff options
author | lpsolit%gmail.com <> | 2006-06-18 08:24:34 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2006-06-18 08:24:34 +0200 |
commit | 05fe02cdd0cf84e61df2f89afec751c279d30f35 (patch) | |
tree | bc942082af5b4611ad278b506ff6eccb0b5e309d /post_bug.cgi | |
parent | 0d2869cdc8bf59db57e80e7e3a0c0c377fc0ffb5 (diff) | |
download | bugzilla-05fe02cdd0cf84e61df2f89afec751c279d30f35.tar.gz bugzilla-05fe02cdd0cf84e61df2f89afec751c279d30f35.tar.xz |
Bug 5179: Need to be able to put attachment on new bug - Patch by Marc Schumann <wurblzap@gmail.com> r=LpSolit a=justdave
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-x | post_bug.cgi | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/post_bug.cgi b/post_bug.cgi index 5f3f91c3b..99b6e533b 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -22,12 +22,14 @@ # Dan Mosedale <dmose@mozilla.org> # Joe Robins <jmrobins@tgix.com> # Gervase Markham <gerv@gerv.net> +# Marc Schumann <wurblzap@gmail.com> use strict; use lib qw(.); require "globals.pl"; use Bugzilla; +use Bugzilla::Attachment; use Bugzilla::Constants; use Bugzilla::Util; use Bugzilla::Bug; @@ -546,6 +548,21 @@ $dbh->do("UPDATE bugs SET creation_ts = ? WHERE bug_id = ?", $dbh->bz_unlock_tables(); +# Add an attachment if requested. +if (defined($cgi->upload('data')) || $cgi->param('attachurl')) { + $cgi->param('isprivate', $cgi->param('commentprivacy')); + Bugzilla::Attachment->insert_attachment_for_bug(!THROW_ERROR, + $id, $user, $timestamp, + \$vars) + || ($vars->{'message'} = 'attachment_creation_failed'); + + # Determine if Patch Viewer is installed, for Diff link + eval { + require PatchReader; + $vars->{'patchviewerinstalled'} = 1; + }; +} + # Email everyone the details of the new bug $vars->{'mailrecipients'} = {'changer' => $user->login}; |