From 314501bd2993207edc17433121c329f356740bd8 Mon Sep 17 00:00:00 2001 From: miker Date: Sat, 27 Mar 2010 17:35:48 +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/branches/rel_1_6_0@16020 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 | 1 + Open-ILS/web/opac/locale/en-US/lang.dtd | 2 ++ Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml | 5 +++++ 4 files changed, 16 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index e9cb811385..be3fad64f9 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -2451,6 +2451,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 90e60fea86..0dfe4f6f61 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1380,6 +1380,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'); INSERT INTO permission.grp_tree (id, name, parent, description, perm_interval, usergroup, application_perm) VALUES (1, oils_i18n_gettext(1, 'Users', 'pgt', 'name'), NULL, NULL, '3 years', FALSE, 'group_application.user'); diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 1944bf3d70..b34dd83eb7 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1600,6 +1600,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 3399388fd0..b8148fb93e 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;', -- 2.11.0