TPac: Setting to remove org unit from hold pickup lib options user/berick/org-not-pickup-lib
authorBill Erickson <berick@esilibrary.com>
Thu, 22 Sep 2011 18:31:32 +0000 (14:31 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 16 Nov 2011 14:42:25 +0000 (09:42 -0500)
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-setting-ou-not-pickup-lib.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 e317202..e45efc3 100644 (file)
@@ -4472,8 +4472,6 @@ INSERT into config.org_unit_setting_type
         'If this setting is true at a given org unit or one of its ancestors, the hold targeter will target copies from this org unit even if the org unit is closed (according to the actor.org_unit.closed_date table) IF AND ONLY IF the copy''s circ lib is the same as the hold''s pickup lib.',
         'coust', 'description'),
     'bool', null)
-
-
 ,( 'opac.staff.jump_to_details_on_single_hit', 'opac',
     oils_i18n_gettext('opac.staff.jump_to_details_on_single_hit',
         'Jump to details on 1 hit (staff client)',
@@ -4490,7 +4488,14 @@ INSERT into config.org_unit_setting_type
         'When a search yields only 1 result, jump directly to the record details page.  This setting only affects the public OPAC',
         'coust', 'description'),
     'bool', null)
-
+,( '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 org unit-based OPAC searches or hold targeting.',
+        'coust', 'description'),
+    'bool', null)
 ;
 
 UPDATE config.org_unit_setting_type
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.org-setting-ou-not-pickup-lib.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.org-setting-ou-not-pickup-lib.sql
new file mode 100644 (file)
index 0000000..d5506cf
--- /dev/null
@@ -0,0 +1,20 @@
+-- Evergreen DB patch XXXX.data.org-setting-ou-not-pickup-lib.sql
+BEGIN;
+
+-- check whether patch can be applied
+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 org unit-based OPAC searches or hold targeting.',
+            'coust', 'description'),
+        'bool'
+    );
+
+COMMIT;
index fc2d3d9..d77fb58 100644 (file)
@@ -43,7 +43,7 @@
                         </th>
                         <td>
                             [% PROCESS build_org_selector
-                                name='pickup_lib' value=ahr.pickup_lib %]
+                                name='pickup_lib' value=ahr.pickup_lib can_have_vols_only=1 hold_pickup_lib=1 %]
                         </td>
                     </tr>
                     [% IF hold.hold.status < 3 %]
index 96bdcbf..3a7e318 100644 (file)
@@ -7,7 +7,8 @@
         ELSIF walker.id == value;
             selected = 'selected="selected"';
         END;
-        IF ctx.is_staff || walker.opac_visible == 't';
+        IF (ctx.is_staff || walker.opac_visible == 't') AND
+            !(hold_pickup_lib AND ctx.get_org_setting(walker.id, 'opac.holds.org_unit_not_pickup_lib'));
 %]
             <option value='[% walker.id | uri %]' [% selected %] [% disabled %]>
                 [%
index 4580b9c..b9a8d3c 100644 (file)
@@ -51,7 +51,8 @@
         <p>
             [% l('Pickup location:') %]
             [% PROCESS "opac/parts/org_selector.tt2";
-                PROCESS build_org_selector name='pickup_lib' value=ctx.default_pickup_lib id='pickup_lib' can_have_vols_only=1 %]
+                PROCESS build_org_selector name='pickup_lib' 
+                    value=ctx.default_pickup_lib id='pickup_lib' can_have_vols_only=1 hold_pickup_lib=1 %]
         </p>
         <p>
             [% |l %]If you use the Traveling Library Center (TLC) and ABC Express