LP#1485374: Use server timezone when fetching circs for display user/miker/lp1485374-client-tz-squashed
authorMike Rylander <mrylander@gmail.com>
Fri, 11 Sep 2015 16:22:55 +0000 (12:22 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 11 Sep 2015 16:22:55 +0000 (12:22 -0400)
Methods used within the staff client that end up displaying circulations
should use the server timezone, as that is most appropriate for due-date
display.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index 3e438ce..912ebad 100644 (file)
@@ -60,7 +60,7 @@ sub retrieve_circ {
     my( $s, $c, $a, $i ) = @_;
     my $e = new_editor(authtoken => $a);
     return $e->event unless $e->checkauth;
-    my $circ = $e->retrieve_action_circulation($i) or return $e->event;
+    my $circ = $e->retrieve_action_circulation($i,{no_tz => 1}) or return $e->event;
     if( $e->requestor->id ne $circ->usr ) {
         return $e->event unless $e->allowed('VIEW_CIRCULATIONS');
     }
@@ -132,7 +132,7 @@ sub checkouts_by_user {
                     acn => ['record']
                 }
             }
-        ]);
+        ],{no_tz => 1});
 
         # un-flesh for consistency
         my $c = $circ->target_copy;
@@ -633,7 +633,7 @@ sub set_circ_due_date {
 
     my $e = new_editor(xact=>1, authtoken=>$auth);
     return $e->die_event unless $e->checkauth;
-    my $circ = $e->retrieve_action_circulation($circ_id)
+    my $circ = $e->retrieve_action_circulation($circ_id,{no_tz => 1})
         or return $e->die_event;
 
     return $e->die_event unless $e->allowed('CIRC_OVERRIDE_DUE_DATE', $circ->circ_lib);
@@ -785,7 +785,7 @@ sub view_circs {
     return $e->search_action_circulation([
         {target_copy => $copyid}, 
         {limit => $count, order_by => { circ => "xact_start DESC" }} 
-    ]);
+    ],{no_tz => 1});
 }
 
 
@@ -1091,7 +1091,7 @@ sub copy_details {
                 order_by => { circ => 'xact_start desc' }, 
                 limit => 1 
             }
-        ]
+        ],{no_tz => 1}
     )->[0];
 
 
@@ -1562,7 +1562,8 @@ sub fleshed_circ_retrieve {
                     acn => [ qw/ record / ],
                 }
             }
-        ]
+        ],
+       {no_tz => 1}
     ) or return $e->event;
     
     my $copy = $circ->target_copy;
index 61ef659..725118f 100644 (file)
@@ -727,7 +727,7 @@ sub mk_env {
 
             my $circ = $e->search_action_circulation([
                 {target_copy => $copy->id, checkin_time => undef}, $flesh
-            ])->[0];
+            ],{no_tz => 1})->[0];
 
             if($circ) {
                 $patron = $circ->usr;
@@ -1348,7 +1348,7 @@ sub do_checkout {
         unless $self->editor->create_action_circulation($self->circ);
 
     # refresh the circ to force local time zone for now
-    $self->circ($self->editor->retrieve_action_circulation($self->circ->id));
+    $self->circ($self->editor->retrieve_action_circulation($self->circ->id,{no_tz => 1}));
 
     if($self->limit_groups) {
         $self->editor->json_query({ from => ['action.link_circ_limit_groups', $self->circ->id, $self->limit_groups] });
@@ -3554,7 +3554,7 @@ sub checkin_flesh_events {
                         mbt => ['summary']
                     }
                 }
-            ])
+            ],{no_tz => 1})
         );
     }
 
@@ -3613,7 +3613,7 @@ sub do_renew {
         xact_finish => undef,
         checkin_time => undef,
         ($usrid ? (usr => $usrid) : ())
-    })->[0];
+    },{no_tz => 1})->[0];
 
     return $self->bail_on_events($self->editor->event) unless $circ;