From 74cc7855682d93caf53c840c526abcf6c3d94b18 Mon Sep 17 00:00:00 2001 From: Kyle Tomita Date: Fri, 31 May 2013 11:33:59 -0700 Subject: [PATCH] LP1185524 - Duplicate patron checking in the user editor is limited to workstation OU Added a new library setting opac.duplicate_patron_check_use_consortium. When true, the duplicate check will use the consortium (1) as the OU. When false or not set, the duplicate check will use the workstation OU. The setting is checked in subroutine that creates the search request and sets the OU accordingly. [LFW: Signing off but following with material changes next commit.] Signed-off-by: Kyle Tomita Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Chris Sharp Conflicts: Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm --- .../src/perlmods/lib/OpenILS/Application/Actor.pm | 7 +++++-- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 12 +++++++++++ ...ium_as_search_ou_for_duplicate_patron_check.sql | 24 ++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.add_setting_for_selecting_consortium_as_search_ou_for_duplicate_patron_check.sql diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm index d818454d14..bfd2e75378 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm @@ -1329,8 +1329,11 @@ sub patron_adv_search { my $opt_boundary = 0; $opt_boundary = $U->ou_ancestor_setting_value($e->requestor->ws_ou,'org.patron_opt_boundary') if user_opt_in_enabled($self); - return $U->storagereq( - "open-ils.storage.actor.user.crazy_search", $search_hash, + #Only set search_ou if it is undef. Set search_ou to Consortium (1) or the workstation org unit depending on Library Setting + $search_ou = ($U->ou_ancestor_setting_value($e->requestor->ws_ou, 'opac.duplicate_patron_check_use_consortium') == 1) ? 1 : $e->requestor->ws_ou if $search_ou == undef; + + return $U->storagereq( + "open-ils.storage.actor.user.crazy_search", $search_hash, $search_limit, $search_sort, $include_inactive, $e->requestor->ws_ou, $search_ou, $opt_boundary); } 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 4dee9d95ed..b03711f992 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -4759,6 +4759,18 @@ INSERT into config.org_unit_setting_type ), 'string', null) +,( 'opac.duplicate_patron_check_use_consortium', 'opac', + oils_i18n_gettext( + 'opac.duplicate_patron_check_use_consortium', + 'Use consortium as the search ou for the duplicate patron check.', + 'coust', + 'label'), + oils_i18n_gettext( + 'opac.duplicate_patron_check_use_consortium', + 'When using the patron registration page, the duplicate patron check will use the consortium as the search_ou.', + 'coust', + 'description'), + 'bool', null) ; UPDATE config.org_unit_setting_type diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.add_setting_for_selecting_consortium_as_search_ou_for_duplicate_patron_check.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.add_setting_for_selecting_consortium_as_search_ou_for_duplicate_patron_check.sql new file mode 100644 index 0000000000..957d27881f --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.add_setting_for_selecting_consortium_as_search_ou_for_duplicate_patron_check.sql @@ -0,0 +1,24 @@ +BEGIN; + + SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + + INSERT INTO config.org_unit_setting_type ( name, grp, label, description, datatype ) VALUES ( + 'opac.duplicate_patron_check_use_consortium', 'opac', + oils_i18n_gettext( + 'opac.duplicate_patron_check_use_consortium', + 'Use consortium as the search ou for the duplicate patron check.', + 'coust', + 'label'), + oils_i18n_gettext( + 'opac.duplicate_patron_check_use_consortium', + 'When using the patron registration page, the duplicate patron check will use the consortium as the search_ou.', + 'coust', + 'description'), + 'bool' + ); + + INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES ( + 1, 'opac.duplicate_patron_check_use_consortium', 'true' + ); + +COMMIT; -- 2.11.0