1 [% PROCESS "opac/parts/header.tt2";
2 PROCESS "opac/parts/misc_util.tt2";
3 PROCESS "opac/parts/hold_status.tt2";
4 PROCESS "opac/parts/hold_notify.tt2";
5 PROCESS "opac/parts/myopac/column_sort_support.tt2";
6 WRAPPER "opac/parts/myopac/base.tt2";
8 myopac_page = "holds_curbside";
10 limit = (ctx.holds_limit.defined) ? ctx.holds_limit : 0;
11 offset = (ctx.holds_offset.defined) ? ctx.holds_offset : 0;
12 count = (ctx.holds_ids.size.defined) ? ctx.holds_ids.size : 0;
14 <h3> [% l("Curbside Pickup Appointments") %]</h3>
19 [% IF offset != 0 %]<a href='[% mkurl('holds', {limit => limit,offset => (offset - limit)}) %]'
20 ><span class="np_nav_link classic_link btn btn-action">◄[% l('Previous') %]</span></a> [% END %]
22 [% IF offset > 0 || count > limit; curpage = 0; WHILE curpage * limit < count; IF curpage * limit == offset; %]
23 <span class="np_nav_link classic_link btn btn-action disabled">[% curpage + 1 %]</span>
26 <a href='[% mkurl('holds', {limit => limit, offset => (curpage * limit)}) %]' class="np_nav_link classic_link btn btn-action">[% curpage + 1 %]</a>
27 [%- END; curpage = curpage + 1; END; END %]
28 <span style="padding-left:5px;" class='error'>
29 [% IF ctx.hold_suspend_post_capture; l('One or more holds could not be suspended because the item is at (or en route to) the pickup library.'); END; %]
32 [% IF count > limit + offset %]<a href='[% mkurl('holds', {limit => limit, offset => (offset + limit)}) %]'
33 ><span class="np_nav_link classic_link btn btn-action">[% l('Next') %]►</span></a>[% END %]
37 [% IF ctx.holds.size && ctx.holds.size < 1 %]
38 <div class="warning_box">[% l('No holds found.') %]</div>
41 [% FOR lib IN ctx.curbside_pickup_libs;
51 cs_slot = ctx.cs_slot;
52 cs_slot_id = ctx.cs_slot_id;
53 cs_date = ctx.cs_date;
54 cs_time = ctx.cs_time;
55 cs_notes = ctx.cs_notes;
58 appointment = ctx.curbside_appointments.$lib;
60 cs_slot = appointment;
61 cs_slot_id = appointment.id;
62 IF appointment.slot; cs_date = date.format(ctx.parse_datetime(appointment.slot),'%F'); END;
63 IF appointment.slot; cs_time = date.format(ctx.parse_datetime(appointment.slot),'%T'); END;
64 cs_notes = appointment.notes;
66 <form class="egtr" method="POST">
67 <input type="hidden" name="action" value="curbside"/>
68 <input type="hidden" name="cs_slot_id" value="[% appointment.id %]"/>
69 <table class="table table-bordered miniTable curbsideApptTable w-100 my-3">
71 <th>[% l('Pickup Location') %]</th>
72 <th>[% l('Date') %]</th>
73 <th>[% l('Time') %]</th>
74 <th>[% l('Arrival Notes') %]
75 <a href="#" title="" data-toggle="tooltip" data-original-title="Vehicle Description, etc.">
76 <i class="fas fa-question-circle" aria-hidden="true"></i>
79 <th>[% l('Action') %]</th>
83 [% no_patron_input = 0 %]
84 [% date_started_null = 0 %]
85 [% IF appointment && appointment.arrival; disable_me = 1; END %]
86 [% IF ctx.get_org_setting(lib, 'circ.curbside.disable_patron_input'); no_patron_input = 1; END %]
88 [% ctx.get_aou(lib).name | html %]<br/>
89 [% l('Phone:')%] [% ctx.get_aou(lib).phone | html %]
90 <input type="hidden" name="cs_org" value="[% lib %]"/>
93 [% IF !cs_date || ( date.format(cs_date _ ' 12:00:00', '%Y%m%d') < date.format(date.now, '%Y%m%d') ); cs_date = ''; tmp_cs_date = date.format(date.now, '%F'); date_started_null = 1; %]
94 [% ELSE; tmp_cs_date = cs_date; END %]
95 [% IF cs_date %]<input type="hidden" name="cs_date" value="[% cs_date | html %]"/>[% END %]
96 [% IF no_patron_input && date_started_null; %]
97 [% ELSE; %]<input type="date" name="cs_date" min="[% date.format(date.now, '%F') %]" value="[% tmp_cs_date | html %]" [% IF cs_date || no_patron_input %]disabled="disabled"[% END %]/>[% END %]
100 [% IF appointment || cs_date; # checking times %]
101 [% current_date = cs_date %]
102 [% IF date_started_null && no_patron_input %]
103 [% ELSIF appointment || ctx.cs_times.$lib.$current_date.size; # show a select %]
104 <select name="cs_time" [% IF disable_me || no_patron_input %]disabled="disabled"[% END %]>
106 [% FOR t IN ctx.cs_times.$lib.$current_date %]
107 <option value="[% t.0 | html %]"
108 [% IF cs_time == t.0; found_time=1 %] selected="selected"[% END %]
109 [% IF t.1 <= 0 && cs_time != t.0 %] disabled="disabled"[% END %]>
110 [% date.format(current_date _ ' ' _ t.0,'%l:%M %p') | html %]
113 [% IF cs_time && !found_time %]
114 <option value="[% cs_time | html %]" selected="selected">
115 [% date.format(current_date _ ' ' _ cs_time,'%l:%M %p') | html %]
120 [% l('No times available for selected date') %]
123 [% IF !no_patron_input; %][% l('Select a date') %][% END %]
127 [% IF cs_date; # show the notes box %]
128 <input type="text" name="cs_notes" value="[% cs_notes | html %]" [% IF no_patron_input || disable_me %]disabled="disabled"[% END %]/>
133 disable_arrival_button = 1; # assume arrival is not yet allowed
134 IF appointment && appointment.slot;
135 stime = date.format(ctx.parse_datetime(appointment.slot), '%s');
136 now_time = date.format(date.now, '%s');
137 IF now_time >= stime;
138 disable_arrival_button = 0; # if 'now' is after the slot time, allow arrival
141 [% IF no_patron_input %]
142 [% l('Please contact the library to schedule, change, or cancel your appointment.') %]
143 [% ELSIF appointment.staged && !appointment.arrival; # relevant submit action %]
144 <button type="submit" name="cs_action" value="arrive" class="btn btn-sm btn-action" style="margin: .25em;" [% IF disable_arrival_button %]disabled="disabled"[% END %]>
145 <i class="fas fa-bell" aria-hidden="true"></i> [% l('Alert staff of your arrival') %]
147 <button type="submit" name="cs_action" value="cancel" class="btn btn-sm btn-danger" style="margin: .25em;">
148 <i class="fas fa-ban" aria-hidden="true"></i> [% l('Cancel') %]
150 [% ELSIF appointment.arrival %]
151 [% l('Staff have been notified of your arrival.') %]<br/>
153 <button type="submit" name="cs_action" value="deliver" class="btn btn-" style="margin: .25em;">
154 [% l('Confirm delivery of items') %]
157 <button type="submit" name="cs_action" value="cancel" class="btn btn-sm btn-danger" style="margin: .25em;">
158 <i class="fas fa-ban" aria-hidden="true"></i> [% l('Cancel') %]
160 [% ELSIF appointment.slot %]
161 <button type="submit" name="cs_action" value="arrive" class="btn btn-sm btn-action" style="margin: .25em;" [% IF disable_arrival_button %]disabled="disabled"[% END %]>
162 <i class="fas fa-bell" aria-hidden="true"></i> [% l('Alert staff of your arrival') %]
164 <button type="submit" name="cs_action" value="save" class="btn btn-sm btn-action" style="margin: .25em;">
165 <i class="fas fa-edit" aria-hidden="true"></i> [% l('Update') %]
167 <button type="submit" name="cs_action" value="cancel" class="btn btn-sm btn-danger" style="margin: .25em;">
168 <i class="fas fa-ban" aria-hidden="true"></i> [% l('Cancel') %]
171 <button type="submit" name="cs_action" value="save" class="btn btn-sm btn-action" style="margin: .25em;">
172 <i class="fas fa-check" aria-hidden="true"></i> [% l('Request appointment') %]
174 <button type="submit" name="cs_action" value="reset" class="btn btn-sm btn-opac" style="margin: .25em;">
175 <i class="fas fa-calendar" aria-hidden="true"></i> [% l('Select another date') %]
178 <button type="submit" name="cs_action" value="next" class="btn btn-sm btn-opac" style="margin: .25em;">
179 <i class="fas fa-clock" aria-hidden="true"></i> [% l('Check times') %]
183 </tr></tbody></table>