From 1c8be07596083d3b8009c7d08af8c0287dee73a1 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 --- 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 067fd78791..0d68130f2c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1041,8 +1041,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); @@ -1084,7 +1084,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 %]