[% 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 %]
[% 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:') %] [% IF ctx.is_staff %]


[% END %] [% 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 this_hold_disallowed %] [% END %] [% IF !loop.last AND ctx.hold_data.size > 1 %] [% END %] [% END %]
[% IF !this_hold_disallowed %] [% END %]
[% attrs.title_extended | html %]
[% IF hdata.parts AND !this_hold_disallowed %] [% IF hdata.parts.size > 0 %]
[% ELSE %] [% END %] [% END %] [% IF NOT metarecords.disabled %] [% IF CGI.param('hold_type') == 'T' AND hdata.record.metarecord %] [% l('Advanced 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 %]

[% END # some_holds_allowed %]