From: Llewellyn Marshall Date: Wed, 10 Aug 2022 13:33:17 +0000 (-0400) Subject: option to suspend hold X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=85fbd92f5833feb1db53eda1dd999721416d6f4b;p=working%2FEvergreen.git option to suspend hold --- 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 f77c1e0a8c..25261eb282 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1533,7 +1533,7 @@ sub load_place_hold { } else { $ctx->{default_sms_notify} = ''; } - if ($cgi->param('hold_suspend')) { + if ($cgi->param('hold_suspend') =~ /t/) { $ctx->{frozen} = 1; # TODO: Make this support other date formats, not just mm/dd/yyyy. # We should use a date input type on the forms once it is supported by Firefox. @@ -1548,6 +1548,23 @@ sub load_place_hold { } } } + elsif ($cgi->param('hold_suspend') =~ /p/) { + eval { + my $next_open_time = $e->json_query({ + from => [ + 'evergreen.find_next_open_time', + $cgi->param('pickup_lib') || $self->ctx->{search_ou}, + DateTime::Format::ISO8601->new() + ] + })->[0]; + my $dt = DateTime::Format::ISO8601->parse_datetime($next_open_time); + $ctx->{thaw_date} = $dt->ymd; + $ctx->{frozen} = 1; + }; + if ($@) { + $logger->warn("ignoring next_open_time when placing hold request"); + } + } # If we have a default pickup location, grab it diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 index b4dc99b897..8172036bfe 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 @@ -278,7 +278,11 @@ function maybeToggleNumCopies(obj) { [% IF ctx.hold_data.size > 0; %]
- + + + + +
[% END %] diff --git a/Open-ILS/src/templates/opac/parts/place_hold.tt2 b/Open-ILS/src/templates/opac/parts/place_hold.tt2 index 809def348c..4628c709cf 100644 --- a/Open-ILS/src/templates/opac/parts/place_hold.tt2 +++ b/Open-ILS/src/templates/opac/parts/place_hold.tt2 @@ -295,8 +295,12 @@ function maybeToggleNumCopies(obj) { alt="[% l('Suspend Hold Help') %]" title="[% l('A suspended hold will retain its place in the queue, but will not be fulfilled until it has been activated.') %]" />
- [% l('Yes') %] + [% l('No') %] +
+ [% l('Yes') %] [% l('Set activation date') %] +
+ [% l('Suspend until Pickup Library Open') %]