[Rt-commit] r4025 - in rtir/branches/1.9-EXPERIMENTAL: . html/RTIR/Report

ruz at bestpractical.com ruz at bestpractical.com
Thu Nov 3 16:46:55 EST 2005


Author: ruz
Date: Thu Nov  3 16:46:55 2005
New Revision: 4025

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Report/BulkReject.html
Log:
 r259 at cubic-pc:  cubic | 2005-11-03 16:49:27 +0300
  r252 at cubic-pc:  cubic | 2005-11-03 16:46:25 +0300
  * results reporting changes
 


Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Report/BulkReject.html
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Report/BulkReject.html	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Report/BulkReject.html	Thu Nov  3 16:46:55 2005
@@ -80,12 +80,14 @@
         $t->Load( $id );
         unless( $t->id ) {
             push @tempresults, [ $id, loc("Couldn't load ticket.") ];
+            push @tempresults, [ $id, loc("Skipped.") ];
             next;
         }
         $id = $t->id;
 
         unless( $t->FirstCustomFieldValue('_RTIR_State') eq 'new' ) {
             push @tempresults, [ $id, loc("Only new reports may be rejected.") ];
+            push @tempresults, [ $id, loc("Skipped.") ];
             next;
         }
 
@@ -97,22 +99,24 @@
                 $id,
                 loc("You may not reject tickets that belong to another user."),
             ];
+            push @tempresults, [ $id, loc("Skipped.") ];
             next;
         }
 
         if ( $t->Owner != $session{'CurrentUser'}->id &&
              $t->Owner == $RT::Nobody->id ) {
-            my $action = $ARGS{'Action'} = 'Take';
-            push @tempresults, [ $id, loc("Action: ") . $ARGS{'Action'} ];
-            my ( $res, $msg ) = $t->$action();
-            push( @tempresults, [ $id, $msg ] );
+            my ( $res, $msg ) = $t->Take;
+            unless( $res ) {
+                push( @tempresults, [ $id, loc("Couldn't take ticket: [_1]", $msg) ] );
+            } else {
+                push( @tempresults, [ $id, loc("Took ticket.") ] );
+                push( @tempresults, [ $id, $msg ] ) if $msg;
+            }
         }
 
         my $oldstate = $t->FirstCustomFieldValue('_RTIR_State');
         
-        push @tempresults,
-             map { [ $id, $_ ] }
-             ProcessTicketBasics( ARGSRef => \%ARGS, TicketObj => $t );
+        push @tempresults, ProcessTicketBasics( ARGSRef => \%ARGS, TicketObj => $t );
 
         my $newstate = $t->FirstCustomFieldValue('_RTIR_State');
         if ( $newstate ne $oldstate ) {
@@ -120,7 +124,7 @@
                  [ $id, loc("State changed from [_1] to [_2]", $oldstate, $newstate ) ];
         }
     }
-    push @results, map { loc( "Ticket [_1]: [_2]", $_->[0], $_->[1] ) }
+    push @results, map { ref($_)? loc( "Ticket [_1]: [_2]", $_->[0], $_->[1] ): $_ }
                    @tempresults;
     # force redo search if we changed state
     $session{'tickets'}->RedoSearch;


More information about the Rt-commit mailing list