LP#1879983: tweak OPAC when no patron input desired
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 17 Jun 2020 18:09:09 +0000 (14:09 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 17 Jun 2020 18:09:09 +0000 (14:09 -0400)
* Don't display a disabled date selector with today's date
  if no date has been set yet or an appointment doesn't
  exist.
* Tweak the wording directing the patron to contact the
  library.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/opac/myopac/holds_curbside.tt2

index e18cc45..1698869 100644 (file)
@@ -83,6 +83,7 @@
             <input type="hidden" name="cs_slot_id" value="[% appointment.id %]"/>
             [% 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 %]
             <span class="egtd">
                 <input type="hidden" name="cs_org" value="[% lib %]"/>
             </span>
             <span class="egtd">
-                [% IF !cs_date; tmp_cs_date = date.format(date.now, '%F') %]
+                [% 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 %]<input type="hidden" name="cs_date" value="[% cs_date | html %]"/>[% END %]
-                <input type="date" name="cs_date" value="[% tmp_cs_date | html %]" [% IF cs_date || no_patron_input %]disabled="disabled"[% END %]/>
+                [% IF no_patron_input && date_started_null; %]
+                [% ELSE; %]<input type="date" name="cs_date" value="[% tmp_cs_date | html %]" [% IF cs_date || no_patron_input %]disabled="disabled"[% END %]/>[% END %]
             </span>
             <span class="egtd">
                 [% IF appointment || cs_date; # checking times %]
                   [% current_date = cs_date %]
-                  [% IF appointment || ctx.cs_times.$current_date.size; # show a select %]
+                  [% IF date_started_null && no_patron_input %]
+                  [% ELSIF appointment || ctx.cs_times.$current_date.size; # show a select %]
                     <select name="cs_time" [% IF disable_me || no_patron_input %]disabled="disabled"[% END %]>
                       [% found_time = 0 %]
                       [% FOR t IN ctx.cs_times.$current_date %]
                         </option>
                       [% END %]
                     </select>
-                  [% ELSIF no_patron_input %]
-                    [% l('Please contact the library to select a date.') %]
                   [% ELSE %] 
                     [% l('No times available') %]
                     <button type="submit" name="cs_action" value="reset" class="opac-button">
                     </button><br/>
                   [% END %]
                 [% ELSE %] 
-                  [% l('Select a date') %]
+                  [% IF !no_patron_input; %][% l('Select a date') %][% END %]
                 [% END %]
             </span>
             <span class="egtd">
                     END;
                 END %]
                 [% IF no_patron_input %]
-                    [% l('Please contact the library to update or cancel your appointment.') %]
+                    [% l('Please contact the library to schedule, change, or cancel your appointment.') %]
                 [% ELSIF appointment.staged && !appointment.arrival; # relevant submit action %]
                     <button type="submit" name="cs_action" value="arrive" class="opac-button" [% IF disable_arrival_button %]disabled="disabled"[% END %]>
                         [% l('Alert staff of your arrival') %]