1 [% PROCESS "opac/parts/misc_util.tt2";
2 PROCESS "opac/parts/hold_error_messages.tt2";
7 <!-- TODO: CSS for big/strong-->
10 function disable_submit() {
11 var submit_element = document.getElementById("place_hold_submit");
12 submit_element.disabled = true;
17 <div id='holds_box' class='container'>
19 <h3>[% l('Place Hold') %]</h3>
21 <form method="post" onsubmit="return disable_submit();">
22 <input type="hidden" name="override" value="1" />
23 [% FOR k IN ctx.orig_params.keys %]
24 <input type="hidden" name="[% k %]" value="[% ctx.orig_params.$k | html %]" />
27 <table id='hold-items-list'>
29 [% FOR hdata IN ctx.hold_data;
30 attrs = {marc_xml => hdata.marc_xml};
31 PROCESS get_marc_attrs args=attrs %]
36 IF hdata.could_override || hdata.hold_local_alert;
37 override_possible = 1;
43 type="checkbox" name="hold_target" value="[% hdata.target.id | html %]"
50 <input type='hidden' name='part' value='[% hdata.selected_part || '' %]'/>
53 [% IF hdata.hold_success %]
55 <h5 class="success"><i class="fas fa-check-circle"></i> [% l("Hold was successfully placed for: "); %]</h5>
57 title = attrs.title_extended;
58 IF hdata.selected_part AND hdata.parts AND hdata.parts.size > 0;
59 FOREACH part IN hdata.parts;
60 IF hdata.selected_part == part.id;
61 title = l('[_1] ([_2])', title, part.label);
68 <div class='hold-items-list-title'><p>[% title | html %]</p></div>
72 [% l("Hold is suspended") %]
73 [% IF hdata.thaw_date %]
75 [% l("Reactivate on [_1]", date.format(ctx.parse_datetime(hdata.thaw_date), DATE_FORMAT));
82 window.addEventListener(
85 setTimeout( // we want this to run _after_ other onload handlers (such as from eframe.js)
88 if (typeof xulG != 'undefined' && xulG.opac_hold_placed) {
89 xulG.opac_hold_placed([% hdata.hold_success %]);
92 alert('Error updating Work Log with hold placement: ' + E);
102 [% ELSIF hdata.hold_failed; any_failures = 1 %]
104 <div><big><strong class="danger"><i class="fas fa-times-circle"></i> [% l("Hold was not successfully placed"); %]</strong></big></div>
105 [% IF hdata.hold_local_block %]
106 <div>[% l("There is already a copy available at your local library.") %]</div>
107 [% ELSIF hdata.hold_failed_event || hdata.hold_local_alert %]
109 <span class='hold-items-list-problem'>[% l('Problem:') %]</span>
110 <span title="[% hdata.hold_failed_event.textcode | html %]">
112 fail_part_key = hdata.hold_failed_event.payload.fail_part;
113 event_key = hdata.hold_failed_event.textcode;
117 l("All available copies are temporarily unavailable at your pickup library. Placing this hold could result in longer wait times.") :
118 EVENT_MSG_MAP.$event_key ||
119 FAIL_PART_MSG_MAP.$fail_part_key ||
120 (hdata.hold_failed_event.desc ? l(hdata.hold_failed_event.desc) : '') ||
121 hdata.hold_failed_event.payload.fail_part ||
122 hdata.hold_failed_event.textcode ||
123 (hdata.hold_local_alert ?
124 l("There is already a copy available at your local library.") :
125 l("Unknown problem"))) | html
127 [% IF event_key == 'PERM_FAILURE' %]
128 <div>[% l('Permission: "[_1]"', hdata.hold_failed_event.ilsperm) | html %]</div>
131 [% IF hdata.hold_copy_available %]
132 <p>[% l('Find a copy in the shelving location, "[_1]."', locname) | html %]</p>
142 [% IF override_possible %]
145 <div class='big-strong'>
146 [% |l %]You have permission to override some of the failed holds. Click Submit to override and place your hold on the selected items.[% END %]
149 <button id="place_hold_submit" type="submit" name="submit" class="btn btn-confirm"><i class="fas fa-save" aria-hidden="true"></i> [% l('Submit') %]</button>
153 [% IF any_failures OR ctx.general_hold_error %]
154 <span><a class="btn btn-confirm" href="[% CGI.param('redirect_to') || CGI.referer | html %]"><i class="fas fa-arrow-circle-left" aria-hidden="true"></i> [% l('Back To Search') %]</a></span>
155 <a class="btn btn-deny" href="[% CGI.param('redirect_to') || CGI.referer | html %]"><i class="fas fa-times" aria-hidden="true"></i> [% l('Cancel') %]</a>
157 <div class='hold_success_links'>
158 <span><a class="btn btn-confirm" href="[% CGI.param('redirect_to') || CGI.referer | html %]"><i class="fas fa-arrow-circle-left" aria-hidden="true"></i> [% l('Back To Search') %]</a></span>
159 [% IF ctx.is_staff %]
160 [% IF CGI.param('hold_type') == 'C';
161 hold_type_label = l('copy');
162 ELSIF CGI.param('hold_type') == 'V';
163 hold_type_label = l('volume');
165 hold_type_label = l('title');
167 <span><a href="[% mkurl(ctx.opac_root _ '/place_hold', {hold_source_page => CGI.param('hold_source_page'), bre_id => CGI.param('bre_id')}) %]">
168 [% l('Place another hold for this ') %] [% hold_type_label %]</a>