From 0476ce7c9c954225904c9161050193a6d20dbd7c Mon Sep 17 00:00:00 2001 From: miker Date: Sat, 27 Mar 2010 17:30:40 +0000 Subject: [PATCH] Patch from Dan Wells which allows restriction of renewal when the item in question is needed to fulfill a hold. There was concern initially about whether a patrons own holds should be ignored, but that is not the case in scripted circ rules, so the behavior, as implemented by Dan, is correct. git-svn-id: svn://svn.open-ils.org/ILS/trunk@16019 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm | 8 ++++++++ Open-ILS/src/sql/Pg/950.data.seed-values.sql | 10 ++++++++-- Open-ILS/web/opac/locale/en-US/lang.dtd | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index cf1aa196a..ce0efe526 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -3019,6 +3019,14 @@ sub run_renew_permit { my $events = []; + if ($U->ou_ancestor_setting_value($self->circ_lib, 'circ.block_renews_for_holds')) { + my ($hold, undef, $retarget) = $holdcode->find_nearest_permitted_hold( + $self->editor, $self->copy, $self->editor->requestor, 1 ); + if ($hold) { + push(@$events, 'COPY_NEEDED_FOR_HOLD'); + } + } + if(!$self->legacy_script_support) { my $results = $self->run_indb_circ_test; unless($self->circ_test_success) { 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 3ce194942..ef48b0c2f 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1331,7 +1331,8 @@ INSERT INTO permission.perm_list VALUES (384, 'ADMIN_TRIGGER_VALIDATOR', oils_i18n_gettext(384, 'Allow a user to create, update, and delete trigger validators', 'ppl', 'description')), (385, 'CREATE_TRIGGER_VALIDATOR', oils_i18n_gettext(385, 'Allow a user to create trigger validators', 'ppl', 'description')), (386, 'DELETE_TRIGGER_VALIDATOR', oils_i18n_gettext(386, 'Allow a user to delete trigger validators', 'ppl', 'description')), - (387, 'UPDATE_TRIGGER_VALIDATOR', oils_i18n_gettext(387, 'Allow a user to update trigger validators', 'ppl', 'description')) + (387, 'UPDATE_TRIGGER_VALIDATOR', oils_i18n_gettext(387, 'Allow a user to update trigger validators', 'ppl', 'description')), + (388, 'UPDATE_ORG_UNIT_SETTING.circ.block_renews_for_holds', oils_i18n_gettext(388, 'Allow a user to enable blocking of renews on items that could fulfill holds', 'ppl', 'description')) ; SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000); @@ -1930,7 +1931,12 @@ INSERT into config.org_unit_setting_type ( 'lib.courier_code', oils_i18n_gettext('lib.courier_code', 'Courier Code', 'coust', 'label'), oils_i18n_gettext('lib.courier_code', 'Courier Code for the library. Available in transit slip templates as the %courier_code% macro.', 'coust', 'description'), - 'string') + 'string'), + +( 'circ.block_renews_for_holds', + oils_i18n_gettext('circ.block_renews_for_holds', 'Holds: Block Renewal of Items Needed for Holds', 'coust', 'label'), + oils_i18n_gettext('circ.block_renews_for_holds', 'When an item could fulfill a hold, do not allow the current patron to renew', 'coust', 'description'), + 'bool' ) ; -- Org_unit_setting_type(s) that need an fm_class: diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 53bbb1d2b..ef57da929 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1799,6 +1799,8 @@ + + -- 2.11.0