From: Mike Rylander Date: Thu, 25 Jun 2020 16:45:15 +0000 (-0400) Subject: LP#1879983: Allow different granularities for the same date X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d5a4e43d9a2e74dea2371d65e3ee897d3a8ea44f;p=evergreen%2Fpines.git LP#1879983: Allow different granularities for the same date The times available for each date were unintentionally limited to just one org unit. This commit removes that restriction by storing the times available for a date as passed to the template separately for each org unit that has a curbside object, or is now requesting one. Signed-off-by: Mike Rylander Signed-off-by: Michele Morgan --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 201d1f4d28..b3e6672394 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1355,8 +1355,8 @@ sub handle_hold_update { ); } - if ($date and $org and !$ctx->{cs_times}{$date}) { - $ctx->{cs_times}{$date} = $circ->request( + if ($date and $org and !$ctx->{cs_times}{$org}{$date}) { + $ctx->{cs_times}{$org}{$date} = $circ->request( 'open-ils.curbside.times_for_date.atomic', $e->authtoken, $date, $org )->gather(1); @@ -1398,7 +1398,7 @@ sub load_myopac_holds { for my $cs (@{$holds_object->{curbsides}}) { if ($cs->slot) { my $dt = DateTime::Format::ISO8601->new->parse_datetime(clean_ISO8601($cs->slot))->strftime('%F'); - $ctx->{cs_times}{$dt} = $U->simplereq( + $ctx->{cs_times}{$cs->org}{$dt} = $U->simplereq( 'open-ils.curbside', 'open-ils.curbside.times_for_date.atomic', $e->authtoken, $dt, $cs->org ); diff --git a/Open-ILS/src/templates/opac/myopac/holds_curbside.tt2 b/Open-ILS/src/templates/opac/myopac/holds_curbside.tt2 index cf6b0f5f0c..1f8a24c2b5 100644 --- a/Open-ILS/src/templates/opac/myopac/holds_curbside.tt2 +++ b/Open-ILS/src/templates/opac/myopac/holds_curbside.tt2 @@ -102,10 +102,10 @@ [% IF appointment || cs_date; # checking times %] [% current_date = cs_date %] [% IF date_started_null && no_patron_input %]  - [% ELSIF appointment || ctx.cs_times.$current_date.size; # show a select %] + [% ELSIF appointment || ctx.cs_times.$lib.$current_date.size; # show a select %]