[Rt-commit] r13456 - in rt/3.8/trunk: . share/html/Ticket

alexmv at bestpractical.com alexmv at bestpractical.com
Fri Jun 20 13:43:35 EDT 2008


Author: alexmv
Date: Fri Jun 20 13:43:35 2008
New Revision: 13456

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/lib/RT/Interface/Web.pm
   rt/3.8/trunk/share/html/Ticket/Display.html

Log:
 r33297 at kohr-ah:  chmrr | 2008-06-20 13:43:04 -0400
  * Unify UpdateTimeWorked adjustment into ProcessUpdateMessage


Modified: rt/3.8/trunk/lib/RT/Interface/Web.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Interface/Web.pm	(original)
+++ rt/3.8/trunk/lib/RT/Interface/Web.pm	Fri Jun 20 13:43:35 2008
@@ -242,6 +242,9 @@
     my $html    = ( ( $args{ContentType} || '' ) eq "text/html" );
     my $sigonly = $args{StripSignature};
 
+    # Save us from undef warnings
+    return '' unless defined $content;
+
     # Make the content have no 'weird' newlines in it
     $content =~ s/\r+\n/\n/g;
 
@@ -600,20 +603,26 @@
         delete $args{ARGSRef}->{'UpdateAttachments'};
     }
 
-    if ( defined $args{ARGSRef}->{'UpdateContent'} ) {
-        $args{ARGSRef}->{UpdateContent} = RT::Interface::Web::StripContent(
-            Content        => $args{ARGSRef}->{UpdateContent},
-            ContentType    => $args{ARGSRef}->{UpdateContentType},
-            StripSignature => $args{SkipSignatureOnly},
-            CurrentUser    => $args{'TicketObj'}->CurrentUser,
-        );
-    }
+    # Strip the signature
+    $args{ARGSRef}->{UpdateContent} = RT::Interface::Web::StripContent(
+        Content        => $args{ARGSRef}->{UpdateContent},
+        ContentType    => $args{ARGSRef}->{UpdateContentType},
+        StripSignature => $args{SkipSignatureOnly},
+        CurrentUser    => $args{'TicketObj'}->CurrentUser,
+    );
 
-    return ()
-        unless $args{ARGSRef}->{'UpdateTimeWorked'}
-        || $args{ARGSRef}->{'UpdateAttachments'}
-        || ( defined $args{ARGSRef}->{'UpdateContent'}
-        && length $args{ARGSRef}->{'UpdateContent'} );
+    # If, after stripping the signature, we have no message, move the
+    # UpdateTimeWorked into adjusted TimeWorked, so that a later
+    # ProcessBasics can deal -- then bail out.
+    if ( not $args{ARGSRef}->{'UpdateAttachments'}
+        and not length $args{ARGSRef}->{'UpdateContent'} )
+    {
+        if ( $args{ARGSRef}->{'UpdateTimeWorked'} ) {
+            $args{ARGSRef}->{TimeWorked} = $args{TicketObj}->TimeWorked
+                + delete $args{ARGSRef}->{'UpdateTimeWorked'};
+        }
+        return;
+    }
 
     if ( $args{ARGSRef}->{'UpdateSubject'} eq $args{'TicketObj'}->Subject ) {
         $args{ARGSRef}->{'UpdateSubject'} = undef;

Modified: rt/3.8/trunk/share/html/Ticket/Display.html
==============================================================================
--- rt/3.8/trunk/share/html/Ticket/Display.html	(original)
+++ rt/3.8/trunk/share/html/Ticket/Display.html	Fri Jun 20 13:43:35 2008
@@ -141,24 +141,15 @@
             ARGSRef => \%ARGS, 
             Actions => \@Actions);
     
-    $ARGS{'UpdateContent'} =~ s/\r\n/\n/g if defined $ARGS{'UpdateContent'};
-    my $signature = $session{'CurrentUser'}->UserObj->Signature || '';
-    if ( $ARGS{'UpdateTimeWorked'} || (
-        defined $ARGS{'UpdateContent'}
-        && $ARGS{'UpdateContent'} ne ''
-        && $ARGS{'UpdateContent'} ne "-- \n" . $signature ))
-    {
-        $ARGS{UpdateAttachments} = $session{'Attachments'};
-        push @Actions, ProcessUpdateMessage(
-            ARGSRef   => \%ARGS,
-            Actions   => \@Actions,
-            TicketObj => $TicketObj,
+    $ARGS{UpdateAttachments} = $session{'Attachments'};
+    push @Actions,
+        ProcessUpdateMessage(
+        ARGSRef   => \%ARGS,
+        Actions   => \@Actions,
+        TicketObj => $TicketObj,
         );
-	    delete $session{'Attachments'};
-    } elsif ( $ARGS{'UpdateTimeWorked'} ) {
-        # Add UpdateTimeWorked to TimeWorked (processed below with ProcessTicketBasics)
-        $ARGS{'TimeWorked'} = $TicketObj->TimeWorked + $ARGS{'UpdateTimeWorked'};
-    }
+    delete $session{'Attachments'};
+
     #Process status updates
     push @Actions, ProcessTicketWatchers(ARGSRef => \%ARGS, TicketObj => $TicketObj );
     push @Actions, ProcessTicketBasics(   ARGSRef => \%ARGS, TicketObj => $TicketObj );


More information about the Rt-commit mailing list