[% PROCESS "opac/parts/misc_util.tt2"; PROCESS "opac/parts/hold_error_messages.tt2"; override_possible = 0; %]

[% l('Place Hold') %]

[% FOR k IN ctx.orig_params.keys %] [% END %] [% FOR hdata IN ctx.hold_data; attrs = {marc_xml => hdata.marc_xml}; PROCESS get_marc_attrs args=attrs %] [% END %]
[% override = 0; IF hdata.could_override || hdata.hold_local_alert; override_possible = 1; override = 1; END; %]
[% attrs.title_extended | html %]
[% IF hdata.hold_success %]
[% l("Hold was successfully placed"); %]
[% ELSIF hdata.hold_failed %]
[% l("Hold was not successfully placed"); %]
[% IF hdata.hold_local_block %]
[% l("There is already a copy available at your local library.") %]
[% ELSIF hdata.hold_failed_event || hdata.hold_local_alert %]
[% l('Problem:') %] [% fail_part_key = hdata.hold_failed_event.payload.fail_part; event_key = hdata.hold_failed_event.textcode; # display: l(FAIL_PART_MSG_MAP.$fail_part_key) || l(EVENT_MSG_MAP.$event_key) || l(hdata.hold_failed_event.desc) || hdata.hold_failed_event.payload.fail_part || hdata.hold_failed_event.textcode || (hdata.hold_local_alert ? l("There is already a copy available at your local library.") : l("Unknown problem")) | html %] [% IF event_key == 'PERM_FAILURE' %]
[% l('Permission: "[_1]"', hdata.hold_failed_event.ilsperm) | html %]
[% END %]
[% IF hdata.hold_copy_available %]

[% l('Find a copy in the shelving location, "[_1]."', locname) | html %]

[% END %]
[% END; END %]
[% IF override_possible %]

[% |l %]You have permission to override some of the failed holds.
Click Submit to override and place your hold on the selected items.[% END %]
[% END %] [% l('Cancel') %]