[% PROCESS "opac/parts/header.tt2"; PROCESS "opac/parts/misc_util.tt2"; PROCESS "opac/parts/hold_status.tt2"; PROCESS "opac/parts/hold_notify.tt2"; PROCESS "opac/parts/myopac/column_sort_support.tt2"; WRAPPER "opac/parts/myopac/base.tt2"; myopac_page = "holds_curbside"; %]

[% l('Curbside Pickup') %]

[% IF ctx.curbside_pickup_libs.size > 0 %] [% END %] [% IF ebook_api.enabled == 'true' %] [% END %]
[% l("Curbside Pickup Appointments") %]
[% l('Pickup Location') %] [% l('Date') %] [% l('Time') %] [% l('Arrival Notes (vehicle description, etc)') %] [% l('Action') %]





[% FOR lib IN ctx.curbside_pickup_libs; cs_slot = ''; cs_slot_id = ''; cs_date = ''; cs_time = ''; cs_notes = ''; cs_org = ctx.cs_org; IF cs_org == lib; cs_slot = ctx.cs_slot; cs_slot_id = ctx.cs_slot_id; cs_date = ctx.cs_date; cs_time = ctx.cs_time; cs_notes = ctx.cs_notes; END; appointment = ctx.curbside_appointments.$lib; IF appointment; cs_slot = appointment; cs_slot_id = appointment.id; IF appointment.slot; cs_date = date.format(ctx.parse_datetime(appointment.slot),'%F'); END; IF appointment.slot; cs_time = date.format(ctx.parse_datetime(appointment.slot),'%T'); END; cs_notes = appointment.notes; END %]
[% disable_me = 0 %] [% no_patron_input = 0 %] [% date_started_null = 0 %] [% IF appointment && appointment.arrival; disable_me = 1; END %] [% IF ctx.get_org_setting(lib, 'circ.curbside.disable_patron_input'); no_patron_input = 1; END %] [% ctx.get_aou(lib).name | html %]
[% l('Phone:')%] [% ctx.get_aou(lib).phone | html %]
[% IF !cs_date; tmp_cs_date = date.format(date.now, '%F'); date_started_null = 1; %] [% ELSE; tmp_cs_date = cs_date; END %] [% IF cs_date %][% END %] [% IF no_patron_input && date_started_null; %]  [% ELSE; %][% END %] [% IF appointment || cs_date; # checking times %] [% current_date = cs_date %] [% IF date_started_null && no_patron_input %]  [% ELSIF appointment || ctx.cs_times.$lib.$current_date.size; # show a select %] [% ELSE %] [% l('No times available') %]
[% END %] [% ELSE %] [% IF !no_patron_input; %][% l('Select a date') %][% END %] [% END %]
[% IF cs_date; # show the notes box %] [% ELSE %]   [% END %] [% disable_arrival_button = 1; # assume arrival is not yet allowed IF appointment && appointment.slot; stime = date.format(ctx.parse_datetime(appointment.slot), '%s'); now_time = date.format(date.now, '%s'); IF now_time >= stime; disable_arrival_button = 0; # if 'now' is after the slot time, allow arrival END; END %] [% IF no_patron_input %] [% l('Please contact the library to schedule, change, or cancel your appointment.') %] [% ELSIF appointment.staged && !appointment.arrival; # relevant submit action %]
[% ELSIF appointment.arrival %] [% ELSIF appointment.slot %]

[% ELSIF cs_date %]
[% ELSE %] [% END %]





[% END %]
[% END %]