From bbfeb604571b19dc184f65a843621d2556f40261 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 22 Sep 2011 14:31:32 -0400 Subject: [PATCH] TPac: Setting to remove org unit from hold pickup lib options 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 --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 11 ++++++++--- .../XXXX.data.org-setting-ou-not-pickup-lib.sql | 20 ++++++++++++++++++++ Open-ILS/src/templates/opac/myopac/holds/edit.tt2 | 2 +- Open-ILS/src/templates/opac/parts/org_selector.tt2 | 3 ++- Open-ILS/src/templates/opac/parts/place_hold.tt2 | 3 ++- 5 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.org-setting-ou-not-pickup-lib.sql diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index e317202c66..e45efc324d 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -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 index 0000000000..d5506cf369 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.org-setting-ou-not-pickup-lib.sql @@ -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; diff --git a/Open-ILS/src/templates/opac/myopac/holds/edit.tt2 b/Open-ILS/src/templates/opac/myopac/holds/edit.tt2 index fc2d3d9d03..d77fb58b8e 100644 --- a/Open-ILS/src/templates/opac/myopac/holds/edit.tt2 +++ b/Open-ILS/src/templates/opac/myopac/holds/edit.tt2 @@ -43,7 +43,7 @@ [% 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 %] [% IF hold.hold.status < 3 %] diff --git a/Open-ILS/src/templates/opac/parts/org_selector.tt2 b/Open-ILS/src/templates/opac/parts/org_selector.tt2 index 96bdcbf9ca..3a7e3183a4 100644 --- a/Open-ILS/src/templates/opac/parts/org_selector.tt2 +++ b/Open-ILS/src/templates/opac/parts/org_selector.tt2 @@ -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')); %]