1 [% PROCESS "opac/parts/misc_util.tt2";
2 PROCESS "opac/parts/hold_error_messages.tt2";
3 PROCESS "opac/parts/metarecord_hold_filters.tt2";
6 // Toggle the activation date input and check the suspend checkbox.
7 // If JavaScript is disabled, the CSS will handle the former, but
8 // the latter will not happen.
9 function toggleActivationDate() {
10 var cb = document.getElementById("hold_suspend");
11 var block = document.getElementById("toggled-block-suspend");
12 var anchor = document.getElementById("actDateToggle");
13 var actText = "[%- l('Hide activation date') -%]";
14 var inActText = "[%- l('Set activation date') -%]";
15 // Check for not equal to block so it works on first click.
16 if (block.style.display != "block") {
17 block.style.display = "block";
18 anchor.innerHTML = "<i class='fas fa-calendar' aria-hidden='true'></i> " + actText;
19 if (cb.checked != true) cb.checked = true;
21 block.style.display = "none";
22 anchor.innerHTML = "<i class='fas fa-calendar' aria-hidden='true'></i> " + inActText;
24 // Prevent the href from being followed, thus overriding the CSS.
28 // Maybe enable or disable the num_copies select when the user selects
29 // or deselects a part.
30 function maybeToggleNumCopies(obj) {
31 var numCopies = document.getElementById("num_copies");
32 // Only if numCopies exists.
35 if (obj.type == 'radio') {
36 if (obj.checked) objValue = obj.value;
41 if (objValue && objValue != '') {
42 if (numCopies.value != '1') numCopies.value = '1';
43 if (!numCopies.disabled) numCopies.disabled = true;
45 if (numCopies.disabled) numCopies.disabled = false;
50 <div class='container'>
52 <h3>[% l('Place Hold') %]</h3>
54 [% some_holds_allowed = -1 %]
56 <!-- loop through the holds and display status of request where appropriate -->
57 [% FOR hdata IN ctx.hold_data;
58 attrs = {marc_xml => hdata.marc_xml};
59 PROCESS get_marc_attrs args=attrs;
60 this_hold_disallowed = 0;
62 IF CGI.param('hold_type') == 'M';
63 IF hdata.metarecord_filters.formats.size == 0;
64 this_hold_disallowed = 1;
65 # if this is the first hold and it's disallowed,
66 # assume all holds are, until we proven otherwise
67 SET some_holds_allowed = 0 IF some_holds_allowed == -1;
68 ELSE; some_holds_allowed = 1; END;
72 <form method="post" name="PlaceHold" onsubmit="return validateHoldForm()" >
73 <input type="hidden" name="hold_type" value="[% CGI.param('hold_type') | html %]" />
75 redirect = CGI.param('hold_source_page') || CGI.param('redirect_to') || CGI.referer;
76 # since we have to be logged in to get this far, return to a secure page
77 redirect = redirect.replace('^http:', 'https:')
79 <input type="hidden" name="redirect_to" value="[% redirect | html %]" />
80 <input type="hidden" name="hold_source_page" value="[% CGI.param('hold_source_page') | html %]" />
82 <!-- Adding hidden fields so that parameters are maintained in
83 searchbar throughout the place hold process. -->
84 <input type="hidden" name="locg" value="[% CGI.param('locg') | html %]" />
85 <input type="hidden" name="qtype" value="[% CGI.param('qtype') | html %]" />
86 <input type="hidden" name="query" value="[% CGI.param('query') | html %]" />
88 usr_barcode = CGI.param('usr_barcode') | html;
89 is_requestor = CGI.param('is_requestor');
91 IF is_requestor == '';
95 IF is_requestor == '0' && usr_barcode == ctx.staff_recipient.card.barcode;
100 [% IF ctx.is_staff %]
101 <p class="staff-hold">
102 <input type="radio" id="hold_usr_is_requestor_not"
103 onchange="staff_hold_usr_input_disabler(this);"
104 name="hold_usr_is_requestor" value="0"
106 <label for="hold_usr_is_requestor_not">
107 [% l("Place hold for patron by barcode:") %]
109 <input type="text" name="hold_usr" id="hold_usr_input"
110 aria-label="[% l('Barcode') %]"
111 value="[% usr_barcode | html %]"
112 onpaste="return debounce_barcode_change(event)"
113 onkeydown="return debounce_barcode_change(event)" autofocus />
114 <span id="patron_name"></span>
115 <span id="patron_usr_barcode_not_found" style="display: none">
116 [% l('Patron barcode was not found') %]
118 [% IF ctx.is_browser_staff %]
119 <button id="hold_usr_search" type="button" class="opac-button" style="display: none;">[% l('Patron Search') %]</button>
122 <input type="hidden" id="staff_barcode"
123 value="[% ctx.staff_recipient.card.barcode | html %]"/>
125 <input type="radio" id="hold_usr_is_requestor"
126 onchange="staff_hold_usr_input_disabler(this);"
127 name="hold_usr_is_requestor" value="1" />
128 <label for="hold_usr_is_requestor">
129 [% l("Place this hold for me ([_1] [_2])", ctx.user.first_given_name, ctx.user.family_name) | html %]
132 [% IF CGI.param('hold_type') == 'T' AND ctx.hold_subscriptions.size > 0 AND NOT CGI.param('from_basket') %]
134 <!-- request for a reading group / subscription -->
135 <input type="radio" id="hold_usr_is_subscription"
136 onchange="staff_hold_usr_input_disabler(this);"
137 name="hold_usr_is_requestor" value="2"
139 <label for="hold_usr_is_subscription">
140 [% l("Place hold for patron Hold Group:") %]
142 <select id='select_hold_subscription' name='hold_subscription'>
143 <option selected='selected' value=''>[% l('- Hold Groups -') %]</option>
144 [% FOR sub IN ctx.hold_subscriptions %]
145 <option value='[% sub.id %]'>[% sub.name | html %]</option>
151 <input id="override_blocks_subscription" name="override" type="checkbox" checked="checked"/>
152 [% l("Override all hold-blocking conditions possible?") %]
161 [% IF !this_hold_disallowed %]
162 <input type="hidden" name="hold_target" value="[% hdata.target.id | html %]" />
164 <div class='hold-items-list-title'>
165 <!-- If hold is for grouped formats/editions (metarecord), show short title - else, show complete title -->
166 [% IF CGI.param('hold_type') == 'M' %]
167 [% attrs.title | html %]
169 [% attrs.title_extended | html %]
172 [% IF hdata.parts AND !this_hold_disallowed %]
173 [% IF hdata.parts.size > 0 %]
174 <div class='hold-div'>
175 [% IF enable.radio.parts == 'true' %]
176 <span class='hold-span'><label for='select_hold_part'>[%
179 <div class='radio-parts-selection'>
180 [% IF !hdata.part_required %]
181 <span class='parts-radio-option'>
182 <input type='radio' name='part' value='' onchange='maybeToggleNumCopies(this);' required>[% l('All Parts') %]</span>
184 [% FOR part IN hdata.parts %]
185 <span class='parts-radio-option'><input type='radio' name='part' id=[% part.id %] value=[% part.id %] onchange='maybeToggleNumCopies(this);' required>
186 <label for=[% part.id %]>[% part.label | html %]</label></span>
190 <span style='font-weight: bold;'><label for='select_hold_part'>[%
191 hdata.part_required ? l('Select a Part:') : l('Select a Part (optional):')
193 <select id='select_hold_part' name='part' onchange='maybeToggleNumCopies(this);'>
194 [% IF !hdata.part_required %]
195 <option selected='selected' value=''>[% l('- All Parts -') %]</option>
197 [% FOR part IN hdata.parts %]
198 <option value='[% part.id %]'>[% part.label | html %]</option>
204 <input type='hidden' name='part' value=''/>
207 [% INCLUDE "opac/parts/multi_hold_select.tt2" IF NOT (this_hold_disallowed AND hdata.part_required); %]
212 [% IF this_hold_disallowed %]
214 <div class="mr_holds_no_formats">
215 [% l('This item does not have any formats available for holds placement') %]
220 [% IF !loop.last AND ctx.hold_data.size > 1 %]
221 <tr class="holds_item_row_separator"><td> </td></tr>
227 [% IF some_holds_allowed %]
230 [%- org_select_id = 'pickup_lib'; -%]
231 <label for="[% org_select_id %]" class="font-weight-bold">[%l('Pickup location:') %]</label>
232 [% PROCESS "opac/parts/org_selector.tt2";
233 INCLUDE build_org_selector name='pickup_lib'
234 value=ctx.default_pickup_lib id=org_select_id
235 can_have_vols_only=1 hold_pickup_lib=1 %]
238 <span class="font-weight-bold">[% l('Notify when hold is ready for pickup?') %]</span>
240 <div class="form-check m-2">
241 <input class="form-check-input" type="checkbox" value="t" id="email_notify" name="email_notify" [% IF !ctx.user.email %]disabled="true"[% ELSIF ctx.default_email_notify %]checked="checked"[% END %]>
242 <label class="form-check-label" for="email_notify">
243 [% l('Yes, by Email') %]
245 [% IF !ctx.user.email and !ctx.is_staff; l('<br>No configured Email address. See "My Account" for setting your Email address.'); ELSE; %] : <span id="email_address"><b>[% ctx.user.email %]</b></span>[% END %]
253 [%- IF allow_phone_notifications == 'true' %]
254 <div class="form-check m-2">
255 <input class="form-check-input" type="checkbox" id="phone_notify_checkbox" name="phone_notify_checkbox" [% IF ctx.default_phone_notify %]checked="checked"[% END %]>
256 <label class="form-check-label" for="phone_notify_checkbox">
257 [% l('Yes, by Phone') %]
262 <label>[% l('Phone Number:') %]<input type="text" class="form-control" name="phone_notify" [% setting = 'opac.default_phone';
263 IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]'
264 [%- ELSIF ctx.user.day_phone; %] value='[% ctx.user.day_phone | html %]' [% END %]/></label>
267 [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %]
268 <input class="hold-alert-method" type="checkbox" id="sms_notify_checkbox" name="sms_notify_checkbox"
269 [% IF ctx.default_sms_notify %]checked="checked"[% END %]/>
270 <label for="sms_notify_checkbox">[% l('Yes, by Text Messaging') %]</label><br/>
272 [% INCLUDE "opac/parts/sms_carrier_selector.tt2" %]<br/>
273 [% INCLUDE "opac/parts/sms_number_textbox.tt2" %]<br/>
279 [% IF ctx.hold_data.size > 0; %]
280 <div class="form-check m-2">
281 <input class="form-check-input" type="checkbox" value="t" id="hold_suspend" name="hold_suspend">
282 <label class="form-check-label" for="hold_suspend">
283 [% IF ctx.hold_data.size == 1;
284 l('Suspend this hold?');
286 l('Suspend these holds?');
288 <a href="#" aria-label="[% l('A suspended hold will retain its place in the queue, but will not be fulfilled until it has been activated.') %]" title="[% l('A suspended hold will retain its place in the queue, but will not be fulfilled until it has been activated.') %]" data-toggle="tooltip">
289 <i class="fas fa-question-circle" aria-hidden="true"></i>
298 <a class="btn btn-sm btn-action m-2" id="actDateToggle" href="#toggled-block-suspend" onclick="return toggleActivationDate();"><i class="fas fa-calendar" aria-hidden="true"></i> [% l('Set activation date') %]</a>
300 <blockquote id="toggled-block-suspend">
301 <label for="thaw_date">[% l('Activate on') %]
302 <div class="input-group date" data-provide="datepicker">
303 <input type="text" class="form-control" name="thaw_date" id="thaw_date" value="[% thaw_date | html %]" data-date-format="mm/dd/yyyy" />
304 <div class="input-group-addon">
305 <span class="glyphicon glyphicon-th"></span>
310 [% IF CGI.param('from_basket') %]
312 <div class="form-check m-2">
313 <input class="form-check-input" type="checkbox" value="" id="clear_cart" />
314 <label class="form-check-label" for="clear_cart">
315 [% l('Clear basket after holds are requested?') %]
319 [% IF NOT metarecords.disabled AND ctx.hold_data.size == 1 %]
320 [% IF CGI.param('hold_type') == 'T' AND hdata.record.metarecord AND !hdata.part_required %]
321 <!-- Grab the bre_id so that we can restore it if user accidentally clicks advanced options -->
322 [% bre_id = hdata.target.id %]
323 <a id='advanced_hold_link' class="btn btn-sm btn-link"
324 href="[% mkurl('', {hold_type => 'M', hold_target => hdata.record.metarecord.id, bre_id => bre_id}) %]"><i class="fas fa-cog" aria-hidden="true"></i>
325 [% l('Advanced Hold Options') %]</a>
327 [% IF CGI.param('hold_type') == 'M' AND CGI.param('bre_id') %]
328 <input type="hidden" name="bre_id" value="[% CGI.param('bre_id') %]" />
329 <a id='basic_hold_link' class="btn btn-sm btn-link"
330 href="[% mkurl('', {hold_target => CGI.param('bre_id'), hold_type => 'T'}) %]"><i class="fas fa-cog" aria-hidden="true"></i>
331 [% l('Basic Hold Options') %]</a>
333 [% IF hdata.metarecord_filters.formats.size OR # should this be size > 1
334 (hdata.metarecord_filters.langs.size && hdata.metarecord_filters.langs.size > 1);
335 PROCESS metarecord_hold_filters_selector hold_data=hdata;
339 <button id="place_hold_submit" type="submit" name="submit" class="btn btn-confirm" ><i class="fas fa-check"></i> [% l('Submit') %]</button>
340 [% END # some_holds_allowed %]
341 <button type="reset" name="cancel" onclick="window.location='[% redirect | html %]'" id="holds_cancel" class="btn btn-deny"><i class="fas fa-ban" aria-hidden="true"></i> [% l('Cancel') %]</button>