Bug 5179: Need to be able to put attachment on new bug - Patch by Marc Schumann <wurblzap@gmail.com> r=LpSolit a=justdave

git-svn-id: svn://10.0.0.236/trunk@200220 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
lpsolit%gmail.com
2006-06-17 23:24:36 +00:00
parent eba2e330c1
commit 68fd3a10ed
9 changed files with 670 additions and 452 deletions

View File

@@ -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};