1 [% PROCESS "opac/parts/misc_util.tt2";
2 PROCESS "opac/parts/hold_error_messages.tt2";
7 <!-- TODO: CSS for big/strong-->
9 <div id='holds_box' class='canvas' style='margin-top: 6px;'>
10 <h1>[% l('Place Hold') %]</h1>
13 <input type="hidden" name="override" value="1" />
14 [% FOR k IN ctx.orig_params.keys %]
15 <input type="hidden" name="[% k %]" value="[% ctx.orig_params.$k | html %]" />
18 <table id='hold-items-list'>
20 [% FOR hdata IN ctx.hold_data;
21 attrs = {marc_xml => hdata.marc_xml};
22 PROCESS get_marc_attrs args=attrs %]
27 IF hdata.could_override || hdata.hold_local_alert;
28 override_possible = 1;
33 type="checkbox" name="hold_target" value="[% hdata.target.id | html %]"
34 [% IF override %] checked='checked' [% ELSE %] disabled='disabled' [% END %]/>
38 title = attrs.title_extended;
39 IF hdata.selected_part AND hdata.parts AND hdata.parts.size > 0;
40 FOREACH part IN hdata.parts;
41 IF hdata.selected_part == part.id;
42 title = l('[_1] ([_2])', title, part.label);
48 <div class='hold-items-list-title'>[% title | html %]</div>
50 <input type='hidden' name='part' value='[% hdata.selected_part || '' %]'/>
53 [% IF hdata.hold_success %]
55 <div class='success'>[% l("Hold was successfully placed"); %]</div>
59 [% l("Hold is suspended") %]
60 [% IF hdata.thaw_date %]
62 [% l("Reactivate on [_1]", date.format(ctx.parse_datetime(hdata.thaw_date), DATE_FORMAT));
69 window.addEventListener(
72 setTimeout( // we want this to run _after_ other onload handlers (such as from eframe.js)
75 if (typeof xulG != 'undefined' && xulG.opac_hold_placed) {
76 xulG.opac_hold_placed([% hdata.hold_success %]);
79 alert('Error updating Work Log with hold placement: ' + E);
89 [% ELSIF hdata.hold_failed; any_failures = 1 %]
91 <div><big><strong>[% l("Hold was not successfully placed"); %]</strong></big></div>
92 [% IF hdata.hold_local_block %]
93 <div>[% l("There is already a copy available at your local library.") %]</div>
94 [% ELSIF hdata.hold_failed_event || hdata.hold_local_alert %]
96 <span class='hold-items-list-problem'>[% l('Problem:') %]</span>
97 <span title="[% hdata.hold_failed_event.textcode | html %]">
99 fail_part_key = hdata.hold_failed_event.payload.fail_part;
100 event_key = hdata.hold_failed_event.textcode;
104 l("All available copies are temporarily unavailable at your pickup library. Placing this hold could result in longer wait times.") :
105 EVENT_MSG_MAP.$event_key ||
106 FAIL_PART_MSG_MAP.$fail_part_key ||
107 (hdata.hold_failed_event.desc ? l(hdata.hold_failed_event.desc) : '') ||
108 hdata.hold_failed_event.payload.fail_part ||
109 hdata.hold_failed_event.textcode ||
110 (hdata.hold_local_alert ?
111 l("There is already a copy available at your local library.") :
112 l("Unknown problem"))) | html
114 [% IF event_key == 'PERM_FAILURE' %]
115 <div>[% l('Permission: "[_1]"', hdata.hold_failed_event.ilsperm) | html %]</div>
118 [% IF hdata.hold_copy_available %]
119 <p>[% l('Find a copy in the shelving location, "[_1]."', locname) | html %]</p>
129 [% IF override_possible %]
132 <div class='big-strong'>
133 [% |l %]You have permission to override some of the failed holds. Click Submit to override and place your hold on the selected items.[% END %]
135 <span style='padding-right: 10px;'>
136 <input type="submit" name="submit" value="[% l('Submit') %]"
137 title="[% l('Submit') %]" alt="[% l('Submit') %]"
138 class="opac-button" />
142 [% IF any_failures OR ctx.general_hold_error %]
143 <a href="[% CGI.param('redirect_to') || CGI.referer | html %]">[% l('Cancel') %]</a>
145 <div class='hold_success_links'>
146 <span><a href="[% CGI.param('redirect_to') || CGI.referer | html %]">[% l('Continue') %]</a></span>
147 [% IF ctx.is_staff %]
148 [% IF CGI.param('hold_type') == 'C';
149 hold_type_label = l('copy');
150 ELSIF CGI.param('hold_type') == 'V';
151 hold_type_label = l('volume');
153 hold_type_label = l('title');
155 <span><a href="[% mkurl(ctx.opac_root _ '/place_hold', {hold_source_page => CGI.param('hold_source_page'), bre_id => CGI.param('bre_id')}) %]">
156 [% l('Place another hold for this ') %] [% hold_type_label %]</a>