From: miker Date: Sat, 27 Mar 2010 17:40:51 +0000 (+0000) Subject: Patch from Dan Wells which allows restriction of renewal when the item in question... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f0af902a66c98c7dc030dc538bc81c734702cbc7;p=working%2FEvergreen.git 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/branches/rel_1_6@16021 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index 78b74b54fa..881497095a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -2948,6 +2948,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 21b1f0bd5c..f4473a5edc 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1392,6 +1392,7 @@ INSERT INTO permission.perm_list (code) VALUES ('UPDATE_ORG_UNIT_SETTING.global. INSERT INTO permission.perm_list (code) VALUES ('UPDATE_ORG_UNIT_SETTING.cat.bib.keep_on_empty'); INSERT INTO permission.perm_list (code) VALUES ('UPDATE_ORG_UNIT_SETTING.cat.bib.alert_on_empty'); INSERT INTO permission.perm_list (code) VALUES ('UPDATE_ORG_UNIT_SETTING.patron.password.use_phone'); +INSERT INTO permission.perm_list (code) VALUES ('UPDATE_ORG_UNIT_SETTING.circ.block_renews_for_holds'); SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000); diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 75c6f19b2d..768be312f5 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1637,6 +1637,8 @@ + + diff --git a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml index eadba00c59..9a4df7b04b 100644 --- a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml @@ -103,6 +103,11 @@ desc : '&staff.server.admin.org_settings.circ.hold_estimate_wait_interval.desc;', type : 'number' }, + 'circ.block_renews_for_holds' : { + label : '&staff.server.admin.org_settings.circ.block_renews_for_holds;', + desc : '&staff.server.admin.org_settings.circ.block_renews_for_holds.desc;', + type : 'bool' + }, 'circ.selfcheck.patron_login_timeout' : { label : '&staff.server.admin.org_settings.circ.selfcheck.patron_login_timeout;', desc : '&staff.server.admin.org_settings.circ.selfcheck.patron_login_timeout.desc;',