import rt 3.0.12
[freeside.git] / rt / html / Ticket / ModifyAll.html
index 1163f3f..1d0500d 100644 (file)
@@ -76,7 +76,7 @@
   </tr>
   <tr>
     <td class="label"><&|/l&>Subject</&>:</td>
-    <td class="entry"><input name="UpdateSubject" size=60 value=""></td>
+    <td class="entry"><input name="UpdateSubject" size=60 value="<%$Ticket->Subject%>"></td>
   </tr>
   <tr>
     <td class="label"><&|/l&>Attach</&>:</td>
@@ -119,13 +119,29 @@ unless ($OnlySearchForPeople) {
     @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
     @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
 
-    $ARGS{'UpdateContent'} =~ s/\r\n/\n/g;
-
-    if ($ARGS{'UpdateContent'} && 
-       $ARGS{'UpdateContent'} ne '' && 
+    if ($ARGS{'UpdateAttachment'}) {
+        my $subject = "$ARGS{'UpdateAttachment'}";
+        # 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 => 'UpdateAttachment'
+        );
+       delete $ARGS{'UpdateAttachment'};
+       $ARGS{'UpdateAttachments'}->{ $subject } = $attachment;
+    }
+
+    $ARGS{'UpdateContent'} =~ s/\r+\n/\n/g;
+
+    if ($ARGS{'UpdateAttachments'} || (
+        $ARGS{'UpdateContent'} &&
        $ARGS{'UpdateContent'} ne  "-- \n" . 
                                $session{'CurrentUser'}->UserObj->Signature
-       ) {
+       )) {
         ProcessUpdateMessage(TicketObj => $Ticket, 
                              ARGSRef=>\%ARGS, 
                               Actions=>\@results);