[open-ils-commits] r16679 - in trunk/Open-ILS/src: perlmods/OpenILS perlmods/OpenILS/Application/Circ sql/Pg sql/Pg/upgrade (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jun 11 11:16:37 EDT 2010
Author: phasefx
Date: 2010-06-11 11:16:34 -0400 (Fri, 11 Jun 2010)
New Revision: 16679
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0305.data.org-setting-circ.holds.expired_patron_block.sql
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
trunk/Open-ILS/src/perlmods/OpenILS/Const.pm
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
Log:
Org unit setting and behavior for blocking hold requests if hold recipient has expired privileges
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2010-06-11 14:07:15 UTC (rev 16678)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2010-06-11 15:16:34 UTC (rev 16679)
@@ -100,6 +100,18 @@
$e->allowed('REQUEST_HOLDS', $recipient->home_ou) or return $e->event;
}
+ # If the related org setting tells us to, block if patron privs have expired
+ my $expire_setting = $U->ou_ancestor_setting_value($recipient->home_ou, OILS_SETTING_BLOCK_HOLD_FOR_EXPIRED_PATRON);
+ if ($expire_setting) {
+ my $expire = DateTime::Format::ISO8601->new->parse_datetime(
+ cleanse_ISO8601($recipient->expire_date));
+
+ push( @events, OpenILS::Event->new(
+ 'PATRON_ACCOUNT_EXPIRED',
+ "payload" => {"fail_part" => "actor.usr.privs_expired"}
+ )) if( CORE::time > $expire->epoch ) ;
+ }
+
# Now make sure the recipient is allowed to receive the specified hold
my $porg = $recipient->home_ou;
my $rid = $e->requestor->id;
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Const.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Const.pm 2010-06-11 14:07:15 UTC (rev 16678)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Const.pm 2010-06-11 15:16:34 UTC (rev 16679)
@@ -90,6 +90,7 @@
econst OILS_SETTING_VOID_LOST_PROCESS_FEE_ON_CHECKIN => 'circ.void_lost_proc_fee_on_checkin';
econst OILS_SETTING_RESTORE_OVERDUE_ON_LOST_RETURN => 'circ.restore_overdue_on_lost_return';
econst OILS_SETTING_LOST_IMMEDIATELY_AVAILABLE => 'circ.lost_immediately_available';
+econst OILS_SETTING_BLOCK_HOLD_FOR_EXPIRED_PATRON => 'circ.holds.expired_patron_block';
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-06-11 14:07:15 UTC (rev 16678)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-06-11 15:16:34 UTC (rev 16679)
@@ -68,7 +68,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0304'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0305'); -- phasefx
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-06-11 14:07:15 UTC (rev 16678)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-06-11 15:16:34 UTC (rev 16679)
@@ -2102,6 +2102,22 @@
'bool'
);
+-- 0305.data.org-setting-circ.holds.expired_patron_block.sql
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'circ.holds.expired_patron_block',
+ oils_i18n_gettext(
+ 'circ.holds.expired_patron_block',
+ 'Circulation: Block hold request if hold recipient privileges have expired',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'circ.holds.expired_patron_block',
+ 'Circulation: Block hold request if hold recipient privileges have expired',
+ 'coust',
+ 'description'),
+ 'bool'
+);
+
-- Org_unit_setting_type(s) that need an fm_class:
INSERT into config.org_unit_setting_type
( name, label, description, datatype, fm_class ) VALUES
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0305.data.org-setting-circ.holds.expired_patron_block.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0305.data.org-setting-circ.holds.expired_patron_block.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0305.data.org-setting-circ.holds.expired_patron_block.sql 2010-06-11 15:16:34 UTC (rev 16679)
@@ -0,0 +1,20 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0305'); -- phasefx
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'circ.holds.expired_patron_block',
+ oils_i18n_gettext(
+ 'circ.holds.expired_patron_block',
+ 'Circulation: Block hold request if hold recipient privileges have expired',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'circ.holds.expired_patron_block',
+ 'Circulation: Block hold request if hold recipient privileges have expired',
+ 'coust',
+ 'description'),
+ 'bool'
+);
+
+COMMIT;
More information about the open-ils-commits
mailing list