From: Mike Rylander Date: Fri, 11 Sep 2015 16:22:55 +0000 (-0400) Subject: LP#1485374: Use server timezone when fetching circs for display X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fmiker%2Flp1485374-client-tz-squashed;p=working%2FEvergreen.git LP#1485374: Use server timezone when fetching circs for display 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 --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm index 3e438ce69c..912ebad398 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm @@ -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; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index 61ef659223..725118fa1a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -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;