[% PROCESS "opac/parts/misc_util.tt2"; PROCESS "opac/parts/hold_error_messages.tt2"; PROCESS "opac/parts/metarecord_hold_filters.tt2"; %]

[% l('Place Hold') %]

[% some_holds_allowed = -1 %] [% FOR hdata IN ctx.hold_data; attrs = {marc_xml => hdata.marc_xml}; PROCESS get_marc_attrs args=attrs; this_hold_disallowed = 0; IF CGI.param('hold_type') == 'M'; IF hdata.metarecord_filters.formats.size == 0; this_hold_disallowed = 1; # if this is the first hold and it's disallowed, # assume all holds are, until we proven otherwise SET some_holds_allowed = 0 IF some_holds_allowed == -1; ELSE; some_holds_allowed = 1; END; END %] [% IF loop.first %]
[% redirect = CGI.param('hold_source_page') || CGI.param('redirect_to') || CGI.referer; # since we have to be logged in to get this far, return to a secure page redirect = redirect.replace('^http:', 'https:') %] [% usr_barcode = CGI.param('usr_barcode') | html; is_requestor = CGI.param('is_requestor'); IF is_requestor == ''; is_requestor = '0'; END; IF is_requestor == '0' && usr_barcode == ctx.staff_recipient.card.barcode; usr_barcode = ''; END; %] [% IF ctx.is_staff %]

[% IF ctx.is_browser_staff %] [% END %]

[% END %] [% END %] [% IF this_hold_disallowed %] [% END %] [% IF !loop.last AND ctx.hold_data.size > 1 %] [% END %] [% END %]
[% IF !this_hold_disallowed %] [% END %]
[% IF CGI.param('hold_type') == 'M' %] [% attrs.title | html %] [% ELSE %] [% attrs.title_extended | html %] [% END %]
[% IF hdata.parts AND !this_hold_disallowed %] [% IF hdata.parts.size > 0 %]
[% IF enable.radio.parts == 'true' %]
[% IF !hdata.part_required %] [% l('All Parts') %] [% END %] [% FOR part IN hdata.parts %] [% END %]
[% ELSE %] [% END %]
[% ELSE %] [% END %] [% END %] [% INCLUDE "opac/parts/multi_hold_select.tt2" IF NOT (this_hold_disallowed AND hdata.part_required); %] [% IF NOT metarecords.disabled AND ctx.hold_data.size == 1 %] [% IF CGI.param('hold_type') == 'T' AND hdata.record.metarecord AND !hdata.part_required %] [% bre_id = hdata.target.id %] [% l('Advanced Hold Options') %] [% END %] [% IF CGI.param('hold_type') == 'M' AND CGI.param('bre_id') %] [% l('Basic Hold Options') %] [% END %] [% IF hdata.metarecord_filters.formats.size OR # should this be size > 1 (hdata.metarecord_filters.langs.size && hdata.metarecord_filters.langs.size > 1); PROCESS metarecord_hold_filters_selector hold_data=hdata; END; END %]
[% l('This item does not have any formats available for holds placement') %]
[% IF some_holds_allowed %]

[%- org_select_id = 'pickup_lib'; -%] [% PROCESS "opac/parts/org_selector.tt2"; INCLUDE build_org_selector name='pickup_lib' value=ctx.default_pickup_lib id=org_select_id can_have_vols_only=1 hold_pickup_lib=1 %]

[% l('Notify when hold is ready for pickup?') %]


[% IF !ctx.user.email and !ctx.is_staff; l('No configured Email address. See "My Account" for setting your Email address.'); ELSE; l('Email Address:') %] [% ctx.user.email %][% END %]
[%- IF allow_phone_notifications == 'true' %]
[%- END -%] [% IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1 %]
[% INCLUDE "opac/parts/sms_carrier_selector.tt2" %]
[% INCLUDE "opac/parts/sms_number_textbox.tt2" %]
[% END %]
[% l('Suspend Hold Help') %]
[% l('Yes') %] [% l('Set activation date') %]
[% l('Enter date in MM/DD/YYYY format') %]

[% IF CGI.param('from_basket') %]
[% END %] [% END # some_holds_allowed %]