LP#856688 OUS to disable org unit as hold pickup lib user/berick/lp856688-org-not-pickup-lib
authorBill Erickson <berick@esilibrary.com>
Fri, 30 Aug 2013 20:49:58 +0000 (16:49 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 9 Sep 2013 12:32:32 +0000 (08:32 -0400)
YAOUS that removes an org unit from consideration as a hold pickup
library.  This setting only affects the OPAC display and does not
otherwise affect the display of the org unit in the OPAC.  (In other
words, it's not the same thing as actor.org_unit.opac_visible).  It also
has no affect on hold targeting / capturing.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.org-not-pickup.sql [new file with mode: 0644]
Open-ILS/src/templates/opac/myopac/holds/edit.tt2
Open-ILS/src/templates/opac/parts/org_selector.tt2
Open-ILS/src/templates/opac/parts/place_hold.tt2

index 8242492..25c06bf 100644 (file)
@@ -13325,3 +13325,22 @@ VALUES (
 );
 
 
+
+
+INSERT into config.org_unit_setting_type 
+    (name, grp, label, description, datatype)
+VALUES ( 
+    'opac.holds.org_unit_not_pickup_lib', 
+    'opac',
+    oils_i18n_gettext('opac.holds.org_unit_not_pickup_lib',
+        'OPAC: Org Unit is not a hold pickup library',
+        'coust', 'label'),
+    oils_i18n_gettext('opac.holds.org_unit_not_pickup_lib',
+        'If set, this org unit will not be offered to the patron as an '||
+        'option for a hold pickup location.  This setting has no affect '||
+        'on searching or hold targeting',
+        'coust', 'description'),
+    'bool'
+);
+
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.org-not-pickup.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.org-not-pickup.sql
new file mode 100644 (file)
index 0000000..061846b
--- /dev/null
@@ -0,0 +1,22 @@
+BEGIN;
+
+--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT into config.org_unit_setting_type 
+    (name, grp, label, description, datatype)
+VALUES ( 
+    'opac.holds.org_unit_not_pickup_lib', 
+    'opac',
+    oils_i18n_gettext('opac.holds.org_unit_not_pickup_lib',
+        'OPAC: Org Unit is not a hold pickup library',
+        'coust', 'label'),
+    oils_i18n_gettext('opac.holds.org_unit_not_pickup_lib',
+        'If set, this org unit will not be offered to the patron as an '||
+        'option for a hold pickup location.  This setting has no affect '||
+        'on searching or hold targeting',
+        'coust', 'description'),
+    'bool'
+);
+
+COMMIT;
+
index 3415546..271cdad 100644 (file)
@@ -48,7 +48,8 @@
                         </th>
                         <td>
                             [% INCLUDE build_org_selector
-                                name='pickup_lib' value=ahr.pickup_lib can_have_vols_only=1 %]
+                                name='pickup_lib' value=ahr.pickup_lib 
+                                can_have_vols_only=1 hold_pickup_lib=1 %]
                         </td>
                     </tr>
                     [% IF hold.hold.status < 3 OR hold.hold.status == 7 %]
index 4625023..0246628 100644 (file)
@@ -97,6 +97,11 @@ BLOCK build_org_selector;
                 selected = 'selected="selected"';
             END; 
 
+            IF hold_pickup_lib AND ctx.get_org_setting(
+                    org_unit.id, 'opac.holds.org_unit_not_pickup_lib');
+                disabled = 'disabled="disabled"';
+            END;
+
             # caller provided a list of valid org units.
             # all orgs not in the list are marked invalid.
             IF valid_org_list AND 
index 07bdcc7..9b410fb 100644 (file)
@@ -72,7 +72,9 @@
             [%- org_select_id = 'pickup_lib'; -%]
             <label for="[% org_select_id %]">[%l('Pickup location:') %]</label>
             [% PROCESS "opac/parts/org_selector.tt2";
-                INCLUDE build_org_selector name='pickup_lib' value=ctx.default_pickup_lib id=org_select_id can_have_vols_only=1 %]
+                INCLUDE build_org_selector name='pickup_lib' 
+                    value=ctx.default_pickup_lib id=org_select_id 
+                    can_have_vols_only=1 hold_pickup_lib=1 %]
         </p>
         <p>
             [% l('Notify when hold is ready for pickup?') %]