[open-ils-commits] r16019 - in trunk/Open-ILS: src/perlmods/OpenILS/Application/Circ src/sql/Pg web/opac/locale/en-US (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Sat Mar 27 13:30:44 EDT 2010


Author: miker
Date: 2010-03-27 13:30:40 -0400 (Sat, 27 Mar 2010)
New Revision: 16019

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
   trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
   trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
Log:
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.



Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm	2010-03-26 21:09:09 UTC (rev 16018)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm	2010-03-27 17:30:40 UTC (rev 16019)
@@ -3019,6 +3019,14 @@
 
     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) {

Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-03-26 21:09:09 UTC (rev 16018)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-03-27 17:30:40 UTC (rev 16019)
@@ -1331,7 +1331,8 @@
     (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 @@
 ( '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:

Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-03-26 21:09:09 UTC (rev 16018)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-03-27 17:30:40 UTC (rev 16019)
@@ -1799,6 +1799,8 @@
 <!ENTITY staff.server.admin.org_settings.circ.reshelving_complete.interval.desc 'Amount of time to wait before changing an item from "reshelving" status to "available".  Examples "1 day", "6 hours"'>
 <!ENTITY staff.server.admin.org_settings.circ.hold_estimate_wait_interval "Holds: Estimated Wait (Days)">
 <!ENTITY staff.server.admin.org_settings.circ.hold_estimate_wait_interval.desc "When predicting the amount of time a patron will be waiting for a hold to be fulfilled,this is the default/average number of days to assume an item will be checked out.">
+<!ENTITY staff.server.admin.org_settings.circ.block_renews_for_holds "Holds: Block Renewal of Items Needed for Holds">
+<!ENTITY staff.server.admin.org_settings.circ.block_renews_for_holds.desc "When an item could fulfill a hold, do not allow the current patron to renew">
 <!ENTITY staff.server.admin.org_settings.circ.selfcheck.patron_login_timeout "Selfcheck: Patron Login Timeout (in seconds)">
 <!ENTITY staff.server.admin.org_settings.circ.selfcheck.patron_login_timeout.desc "Number of seconds of inactivity before the patron is logged out of the selfcheck interface">
 <!ENTITY staff.server.admin.org_settings.circ.selfcheck.alert_on_checkout_event "Selfcheck: Pop-up alert for errors">



More information about the open-ils-commits mailing list