From 8dee599211689f45c749366d52ef92fe8ee6d339 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Thu, 25 Jun 2020 12:45:15 -0400 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm | 6 +++--- Open-ILS/src/templates/opac/myopac/holds_curbside.tt2 | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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 %]