[Bps-public-commit] SD branch, master, updated. 0.70-39-g5ca458f

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Sep 4 02:47:12 EDT 2009


The branch, master has been updated
       via  5ca458f9445831b4d7a2569742b5720fab6757c2 (commit)
      from  e5d18062eeeaa00aaab8b06a35ee2302fedc26d6 (commit)

Summary of changes:
 lib/App/SD/Replica/lighthouse.pm |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 5ca458f9445831b4d7a2569742b5720fab6757c2
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Sep 4 14:47:07 2009 +0800

    lighthouse replica: get_txn_list_by_date need handle attachments too.

diff --git a/lib/App/SD/Replica/lighthouse.pm b/lib/App/SD/Replica/lighthouse.pm
index 8b15c36..c775be0 100644
--- a/lib/App/SD/Replica/lighthouse.pm
+++ b/lib/App/SD/Replica/lighthouse.pm
@@ -90,8 +90,25 @@ sub get_txn_list_by_date {
             creator => $_->creator_name,
             created => $_->created_at->epoch,
         }
-      }
-      @{ $ticket_obj->versions };
+    } @{ $ticket_obj->versions };
+
+    if ( $ticket_obj->attachments ) {
+        my $user = Net::Lighthouse::User->new(
+            map { $_ => $self->sync_source->lighthouse->$_ }
+              grep { $self->sync_source->lighthouse->$_ }
+              qw/account email password token/
+        );
+        for my $att ( @{ $ticket_obj->attachments } ) {
+            $user->load( $att->uploader_id );
+            push @txns,
+              {
+                id      => $att->id,
+                creator => $user->name,
+                created => $att->created_at->epoch,
+              };
+        }
+        @txns = sort { $a->created <=> $b->created } @txns;
+    }
     return @txns;
 }
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list