[Bps-public-commit] r19435 - in RT-Extension-SLA: html/Tools/Reports

ruz at bestpractical.com ruz at bestpractical.com
Mon May 4 21:50:44 EDT 2009


Author: ruz
Date: Mon May  4 21:50:43 2009
New Revision: 19435

Modified:
   RT-Extension-SLA/html/Tools/Reports/SLA.html
   RT-Extension-SLA/lib/RT/Extension/SLA/Report.pm

Log:
* cleanup debug code
* fix some bugs

Modified: RT-Extension-SLA/html/Tools/Reports/SLA.html
==============================================================================
--- RT-Extension-SLA/html/Tools/Reports/SLA.html	(original)
+++ RT-Extension-SLA/html/Tools/Reports/SLA.html	Mon May  4 21:50:43 2009
@@ -12,12 +12,13 @@
 </tr>
 
 % while ( my ($owner, $stats) = each %$result ) {
-    <tr><td><% $owner %><td>
+<tr>
+<td><% $owner %></td>
 % my $i = 1;
 % foreach ( map $stats->{ $_ }, grep $i++%2, @columns ) {
 <td><% $_ || 0 %></td>
 % }
-    </tr>
+</tr>
 % }
 </table>
 
@@ -34,10 +35,9 @@
 $tickets->FromSQL( $Query );
 $tickets->OrderByCols( {FIELD => 'id', ORDER => 'ASC'} );
 while ( my $ticket = $tickets->Next ) {
-    my $report = RT::Extension::SLA->Report( Ticket => $ticket );
+    my $report = RT::Extension::SLA->Report( $ticket );
     $summary->AddReport( $report );
 }
 
 my $result = $summary->Result;
-
 </%INIT>

Modified: RT-Extension-SLA/lib/RT/Extension/SLA/Report.pm
==============================================================================
--- RT-Extension-SLA/lib/RT/Extension/SLA/Report.pm	(original)
+++ RT-Extension-SLA/lib/RT/Extension/SLA/Report.pm	Mon May  4 21:50:43 2009
@@ -39,6 +39,8 @@
         }
         next unless $h;
 
+        $RT::Logger->debug( "Handling transaction #". $txn->id ." ($type, $field) of ticket #". $self->{'Ticket'}->id );
+
         $self->$h( Ticket => $self->{'Ticket'}, Transaction => $txn, State => $state );
     }
     return $self;
@@ -71,9 +73,6 @@
         DelWatcher => { Requestor => 'OnRequestorChange' },
     };
 
-    use Data::Dumper;
-    Test::More::diag( Dumper $cache );
-
     return $cache;
 } }
 
@@ -131,7 +130,10 @@
         $act->{'acted'} = $txn->CreatedObj->Unix;
     } else {
         unless ( $act ) {
-            die "not yet implemented";
+            $act = $args{'State'}->{'act'} = {};
+            $act->{'requestor'} = 0;
+            $act->{'acted'} = $txn->CreatedObj->Unix;
+            return;
         }
         unless ( $act->{'requestor'} ) {
             # check keep in loop
@@ -169,8 +171,6 @@
                 return;
             }
 
-            Test::More::diag( 'deadline '. $deadline .' '. Dumper( $args{'State'} ) );
-
             # repsonse
             my $failed = $txn->CreatedObj->Unix > $deadline? 1 : 0;
             my $owner = $args{'State'}->{'owner'} == $txn->Creator? 1 : 0;



More information about the Bps-public-commit mailing list