$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;
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';
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,
'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
--- /dev/null
+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;