[Bps-public-commit] r17542 - sd/trunk/lib/App/SD/Replica/rt

jesse at bestpractical.com jesse at bestpractical.com
Fri Jan 2 22:49:38 EST 2009


Author: jesse
Date: Fri Jan  2 22:49:38 2009
New Revision: 17542

Modified:
   sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm

Log:
* be better about translating rt status

Modified: sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm	(original)
+++ sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm	Fri Jan  2 22:49:38 2009
@@ -102,7 +102,7 @@
     $ticket->{$_} =~ s/ minutes$//
         for grep defined $ticket->{$_}, qw(TimeWorked TimeLeft TimeEstimated);
 
-    $ticket->{'Status'} =~ s/^(resolved|rejected)$/closed/;
+    $ticket->{'Status'} =~ $self->translate_status($ticket->{'Status'});
 
     # delete undefined and empty fields
     delete $ticket->{$_} for
@@ -234,9 +234,6 @@
     my %args = validate( @_, { txn => 1, ticket => 1, changeset => 1 } );
 
     $args{txn}->{'Type'} = 'Set';
-        for my $type(qw(NewValue OldValue)) {
-                $args{'txn'}->{$type} =~ s/^(resolved|rejected)$/closed/;
-        }
     return $self->_recode_txn_Set(%args);
 }
 
@@ -267,6 +264,9 @@
             $old = $1;
             $new = $current_queue;
         }
+    } elsif ( $field eq 'Status' ) {
+        $new = $self->translate_status($new);
+        $old = $self->translate_status($old); 
 
     } elsif ( $field eq 'Owner' ) {
         $new = $self->resolve_user_id_to( email_address => $new );
@@ -504,6 +504,16 @@
     started         => '_delete',
 );
 
+sub translate_status {
+    my $self = shift;
+    my $status = shift;
+
+    $status =~ s/^resolved$/closed/;
+    
+
+    return $status;
+}
+
 sub translate_prop_names {
     my $self      = shift;
     my $changeset = shift;



More information about the Bps-public-commit mailing list