LP#1879983: Make staff-only workflow possilbe
authorMike Rylander <mrylander@gmail.com>
Fri, 12 Jun 2020 21:26:36 +0000 (17:26 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 15 Jun 2020 15:53:15 +0000 (11:53 -0400)
Based on a YAOUS, disable all patron input in the My Account -> Holds
interface for curbside.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.curbside.sql
Open-ILS/src/templates/opac/myopac/holds_curbside.tt2

index affeb15..602b6a8 100644 (file)
@@ -40,6 +40,15 @@ VALUES (
     'integer'
 );
 
+INSERT INTO config.org_unit_setting_type (name, label, grp, description, datatype)
+VALUES (
+    'circ.curbside.disable_patron_input',
+    'When enabled, patrons cannot use the My Account interface to select curbside pickup times',
+    'circ',
+    'When enabled, patrons cannot use the My Account interface to select curbside pickup times',
+    'bool'
+);
+
 INSERT INTO actor.org_unit_setting (org_unit, name, value)
     SELECT id, 'circ.curbside', 'false' FROM actor.org_unit WHERE parent_ou IS NULL
         UNION
index 4156b31..38c9005 100644 (file)
             <input type="hidden" name="action" value="curbside"/>
             <input type="hidden" name="cs_slot_id" value="[% appointment.id %]"/>
             [% disable_me = 0 %]
+            [% no_patron_input = 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">
-                [% ctx.get_aou(lib).name | html %]
+                [% ctx.get_aou(lib).name | html %]<br/>
+                [% l('Phone:')%] [% ctx.get_aou(lib).phone | html %]
                 <input type="hidden" name="cs_org" value="[% lib %]"/>
             </span>
             <span class="egtd">
                 [% IF !cs_date; tmp_cs_date = date.format(date.now, '%F') %]
                 [% 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 %]disabled="disabled"[% END %]/>
+                <input type="date" name="cs_date" value="[% tmp_cs_date | html %]" [% IF cs_date || no_patron_input %]disabled="disabled"[% 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 %]
-                    <select name="cs_time" [% IF disable_me %]disabled="disabled"[% END %]>
+                    <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 value="[% t.0 | html %]"
                         </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">
             </span>
             <span class="egtd">
                 [% IF cs_date; # show the notes box %]
-                <input type="text" name="cs_notes" value="[% cs_notes | html %]" [% IF disable_me %]disabled="disabled"[% END %]/>
+                <input type="text" name="cs_notes" value="[% cs_notes | html %]" [% IF no_patron_input || disable_me %]disabled="disabled"[% END %]/>
                 [% ELSE %] &nbsp;
                 [% END %]
             </span>
             <span class="egtd">
-                [% IF appointment.staged && !appointment.arrival; # relevant submit action %]
+                [% 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">
                         [% l('Alert staff of your arrival') %]
                     </button><br/>