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 %]
139 [% IF !this_hold_disallowed %]
140 <input type="hidden" name="hold_target" value="[% hdata.target.id | html %]" />
142 <div class='hold-items-list-title'>
143 <!-- If hold is for grouped formats/editions (metarecord), show short title - else, show complete title -->
144 [% IF CGI.param('hold_type') == 'M' %]
145 [% attrs.title | html %]
147 [% attrs.title_extended | html %]
150 [% IF hdata.parts AND !this_hold_disallowed %]
151 [% IF hdata.parts.size > 0 %]
152 <div class='hold-div'>
153 [% IF enable.radio.parts == 'true' %]
154 <span class='hold-span'><label for='select_hold_part'>[%
157 <div class='radio-parts-selection'>
158 [% IF !hdata.part_required %]
159 <span class='parts-radio-option'>
160 <input type='radio' name='part' value='' onchange='maybeToggleNumCopies(this);' required>[% l('All Parts') %]</span>
162 [% FOR part IN hdata.parts %]
163 <span class='parts-radio-option'><input type='radio' name='part' id=[% part.id %] value=[% part.id %] onchange='maybeToggleNumCopies(this);' required>
164 <label for=[% part.id %]>[% part.label | html %]</label></span>
168 <span style='font-weight: bold;'><label for='select_hold_part'>[%
169 hdata.part_required ? l('Select a Part:') : l('Select a Part (optional):')
171 <select id='select_hold_part' name='part' onchange='maybeToggleNumCopies(this);'>
172 [% IF !hdata.part_required %]
173 <option selected='selected' value=''>[% l('- All Parts -') %]</option>
175 [% FOR part IN hdata.parts %]
176 <option value='[% part.id %]'>[% part.label | html %]</option>
182 <input type='hidden' name='part' value=''/>
185 [% INCLUDE "opac/parts/multi_hold_select.tt2" IF NOT (this_hold_disallowed AND hdata.part_required); %]
190 [% IF this_hold_disallowed %]
192 <div class="mr_holds_no_formats">
193 [% l('This item does not have any formats available for holds placement') %]
198 [% IF !loop.last AND ctx.hold_data.size > 1 %]
199 <tr class="holds_item_row_separator"><td> </td></tr>
205 [% IF some_holds_allowed %]
208 [%- org_select_id = 'pickup_lib'; -%]
209 <label for="[% org_select_id %]" class="font-weight-bold">[%l('Pickup location:') %]</label>
210 [% PROCESS "opac/parts/org_selector.tt2";
211 INCLUDE build_org_selector name='pickup_lib'
212 value=ctx.default_pickup_lib id=org_select_id
213 can_have_vols_only=1 hold_pickup_lib=1 %]
216 <span class="font-weight-bold">[% l('Notify when hold is ready for pickup?') %]</span>
218 <div class="form-check m-2">
219 <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 %]>
220 <label class="form-check-label" for="email_notify">
221 [% l('Yes, by Email') %]
223 [% 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 %]
231 [%- IF allow_phone_notifications == 'true' %]
232 <div class="form-check m-2">
233 <input class="form-check-input" type="checkbox" id="phone_notify_checkbox" name="phone_notify_checkbox" [% IF ctx.default_phone_notify %]checked="checked"[% END %]>
234 <label class="form-check-label" for="phone_notify_checkbox">
235 [% l('Yes, by Phone') %]
240 <label>[% l('Phone Number:') %]<input type="text" class="form-control" name="phone_notify" [% setting = 'opac.default_phone';
241 IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]'
242 [%- ELSIF ctx.user.day_phone; %] value='[% ctx.user.day_phone | html %]' [% END %]/></label>
245 [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %]
246 <input class="hold-alert-method" type="checkbox" id="sms_notify_checkbox" name="sms_notify_checkbox"
247 [% IF ctx.default_sms_notify %]checked="checked"[% END %]/>
248 <label for="sms_notify_checkbox">[% l('Yes, by Text Messaging') %]</label><br/>
250 [% INCLUDE "opac/parts/sms_carrier_selector.tt2" %]<br/>
251 [% INCLUDE "opac/parts/sms_number_textbox.tt2" %]<br/>
257 [% IF ctx.hold_data.size > 0; %]
258 <div class="form-check m-2">
259 <input class="form-check-input" type="checkbox" value="t" id="hold_suspend" name="hold_suspend">
260 <label class="form-check-label" for="hold_suspend">
261 [% IF ctx.hold_data.size == 1;
262 l('Suspend this hold?');
264 l('Suspend these holds?');
266 <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">
267 <i class="fas fa-question-circle" aria-hidden="true"></i>
276 <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>
278 <blockquote id="toggled-block-suspend">
279 <label for="thaw_date">[% l('Activate on') %]
280 <div class="input-group date" data-provide="datepicker">
281 <input type="text" class="form-control" name="thaw_date" id="thaw_date" value="[% thaw_date | html %]" data-date-format="mm/dd/yyyy" />
282 <div class="input-group-addon">
283 <span class="glyphicon glyphicon-th"></span>
288 [% IF CGI.param('from_basket') %]
290 <div class="form-check m-2">
291 <input class="form-check-input" type="checkbox" value="" id="clear_cart" />
292 <label class="form-check-label" for="clear_cart">
293 [% l('Clear basket after holds are requested?') %]
297 [% IF NOT metarecords.disabled AND ctx.hold_data.size == 1 %]
298 [% IF CGI.param('hold_type') == 'T' AND hdata.record.metarecord AND !hdata.part_required %]
299 <!-- Grab the bre_id so that we can restore it if user accidentally clicks advanced options -->
300 [% bre_id = hdata.target.id %]
301 <a id='advanced_hold_link' class="btn btn-sm btn-link"
302 href="[% mkurl('', {hold_type => 'M', hold_target => hdata.record.metarecord.id, bre_id => bre_id}) %]"><i class="fas fa-cog" aria-hidden="true"></i>
303 [% l('Advanced Hold Options') %]</a>
305 [% IF CGI.param('hold_type') == 'M' AND CGI.param('bre_id') %]
306 <input type="hidden" name="bre_id" value="[% CGI.param('bre_id') %]" />
307 <a id='basic_hold_link' class="btn btn-sm btn-link"
308 href="[% mkurl('', {hold_target => CGI.param('bre_id'), hold_type => 'T'}) %]"><i class="fas fa-cog" aria-hidden="true"></i>
309 [% l('Basic Hold Options') %]</a>
311 [% IF hdata.metarecord_filters.formats.size OR # should this be size > 1
312 (hdata.metarecord_filters.langs.size && hdata.metarecord_filters.langs.size > 1);
313 PROCESS metarecord_hold_filters_selector hold_data=hdata;
317 <button id="place_hold_submit" type="submit" name="submit" class="btn btn-confirm" ><i class="fas fa-check"></i> [% l('Submit') %]</button>
318 [% END # some_holds_allowed %]
319 <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>