[% ELSE %]
[% END %]
</span>
- <span class="egtd">
+ <span class="egtd">[%
+ disable_arrival_button = 1; # assume arrival is not yet allowed
+ IF appointment && appointment.slot;
+ stime = date.format(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 update or cancel your appointment.') %]
[% ELSIF appointment.staged && !appointment.arrival; # relevant submit action %]
- <button type="submit" name="cs_action" value="arrive" class="opac-button">
+ <button type="submit" name="cs_action" value="arrive" class="opac-button" [% IF disable_arrival_button %]disabled="disabled"[% END %]>
[% l('Alert staff of your arrival') %]
</button><br/>
<button type="submit" name="cs_action" value="cancel" class="opac-button">
[% l('Cancel appointment') %]
</button>
[% ELSIF appointment.slot %]
- <button type="submit" name="cs_action" value="arrive" class="opac-button">
+ <button type="submit" name="cs_action" value="arrive" class="opac-button" [% IF disable_arrival_button %]disabled="disabled"[% END %]>
[% l('Alert staff of your arrival') %]
</button><br/>
<button type="submit" name="cs_action" value="save" class="opac-button">