[Rt-commit] r2626 - in rt/branches/3.4-RELEASE: . html/SelfService

jesse at bestpractical.com jesse at bestpractical.com
Thu Apr 14 16:36:14 EDT 2005


Author: jesse
Date: Thu Apr 14 16:36:14 2005
New Revision: 2626

Modified:
   rt/branches/3.4-RELEASE/   (props changed)
   rt/branches/3.4-RELEASE/html/SelfService/Display.html
Log:
 r12790 at hualien:  jesse | 2005-04-14 15:07:03 -0400
 * Fix support for uploading attachmends in selfservice.  -- HC Chien


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 Apr 14 16:36:14 2005
@@ -103,6 +103,29 @@
         $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' );
 
@@ -147,29 +170,6 @@
         push @results, "$msg";
     }
 
-    # {{{ 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 (


More information about the Rt-commit mailing list