[Rt-commit] r3546 - in rt/branches/3.4-RELEASE: . html/SelfService
kevinr at bestpractical.com
kevinr at bestpractical.com
Thu Jul 28 14:51:35 EDT 2005
Author: kevinr
Date: Thu Jul 28 14:51:34 2005
New Revision: 3546
Modified:
rt/branches/3.4-RELEASE/ (props changed)
rt/branches/3.4-RELEASE/html/SelfService/Display.html
Log:
r6713 at SAD-GIRL-IN-SNOW: kevinr | 2005-07-28 14:50:47 -0400
RT-Ticket: 6892
RT-Status: resolved
RT-Update: correspond
* Applied patch from Hsin-Chan Chien to fix a bug with attachment uploading
in SelfService mode.
Modified: rt/branches/3.4-RELEASE/html/SelfService/Display.html
==============================================================================
--- rt/branches/3.4-RELEASE/html/SelfService/Display.html (original)
+++ rt/branches/3.4-RELEASE/html/SelfService/Display.html Thu Jul 28 14:51:34 2005
@@ -93,6 +93,30 @@
my @id = ( ref $id eq 'ARRAY' ) ? @{$id} : ($id);
my $Ticket = new RT::Ticket( $session{'CurrentUser'} );
+
+# store the uploaded attachment in session
+if ( $ARGS{'Attach'} ) { # attachment?
+ $session{'Attachments'} = {} unless defined $session{'Attachments'};
+
+ my $subject = "$ARGS{'Attach'}";
+
+ # since CGI.pm deutf8izes the magic field, we need to add it back.
+ Encode::_utf8_on($subject);
+
+ # strip leading directories
+ $subject =~ s#^.*[\\/]##;
+
+ my $attachment = MakeMIMEEntity(
+ Subject => $subject,
+ Body => "",
+ AttachmentFieldName => 'Attach'
+ );
+
+ $session{'Attachments'} =
+ { %{ $session{'Attachments'} || {} },
+ $ARGS{'Attach'} => $attachment };
+}
+
if ( $id[0] eq 'new' ) {
# {{{ Create a new ticket
@@ -110,28 +134,6 @@
$m->abort;
}
- # {{{ store the uploaded attachment in session
- if ( $ARGS{'Attach'} ) { # attachment?
- $session{'Attachments'} = {} unless defined $session{'Attachments'};
-
- my $subject = "$ARGS{'Attach'}";
-
- # since CGI.pm deutf8izes the magic field, we need to add it back.
- Encode::_utf8_on($subject);
-
- # strip leading directories
- $subject =~ s#^.*[\\/]##;
-
- my $attachment = MakeMIMEEntity(
- Subject => $subject,
- Body => "",
- AttachmentFieldName => 'Attach'
- );
-
- $session{'Attachments'} =
- { %{ $session{'Attachments'} || {} },
- $ARGS{'Attach'} => $attachment };
- }
( $Ticket, @results ) =
CreateTicket( Attachments => $session{'Attachments'}, %ARGS, Status => 'new' );
More information about the Rt-commit
mailing list