} 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.
}
}
}
+ 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
[% IF ctx.hold_data.size > 0; %]
<div class="form-check m-2">
- <input class="form-check-input" type="checkbox" value="t" id="hold_suspend" name="hold_suspend">
+ <input class="form-check-input" type="radio" value="t" id="no_hold_suspend" name="hold_suspend" />
+ <label class="form-check-label" for="no_hold_suspend">
+ [% l('Do not suspend this hold'); %]
+ </label>
+ <input class="form-check-input" type="radio" value="t" id="hold_suspend" name="hold_suspend" />
<label class="form-check-label" for="hold_suspend">
[% IF ctx.hold_data.size == 1;
l('Suspend this hold?');
<i class="fas fa-question-circle" aria-hidden="true"></i>
</a>
</label>
+ <input class="form-check-input" type="radio" value="p" id="auto_hold_suspend" name="hold_suspend" checked />
+ <label class="form-check-label" for="auto_hold_suspend">
+ [% l('Suspend until Pickup Library Open'); %]
+ </label>
</div>
[% END %]
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.') %]" />
<br/>
- <input type="checkbox" name="hold_suspend" id="hold_suspend" value="t"/> [% l('Yes') %]
+ <input type="radio" name="hold_suspend" value="f"/> [% l('No') %]
+ <br/>
+ <input type="radio" name="hold_suspend" value="t"/> [% l('Yes') %]
<a id="actDateToggle" href="#toggled-block-suspend" onclick="return toggleActivationDate();">[% l('Set activation date') %]</a>
+ <br/>
+ <input type="radio" name="hold_suspend" value="p" checked /> [% l('Suspend until Pickup Library Open') %]
</blockquote>
<blockquote id="toggled-block-suspend">
<label for="thaw_date">[% l('Activate on') %]</label>