From: Mike Rylander Date: Tue, 28 Jan 2014 16:35:50 +0000 (-0500) Subject: Allow YAOUS to control ILL mediation X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a611e49f52f09c42c29d47b0841fbe0d44e82ff4;p=evergreen%2Fequinox.git Allow YAOUS to control ILL mediation Signed-off-by: Mike Rylander Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/sql/Pg/fulfillment-mods.sql b/Open-ILS/src/sql/Pg/fulfillment-mods.sql index 7d70751351..ec9e5bf61d 100644 --- a/Open-ILS/src/sql/Pg/fulfillment-mods.sql +++ b/Open-ILS/src/sql/Pg/fulfillment-mods.sql @@ -98,6 +98,15 @@ $func$ LANGUAGE PLPGSQL; -- Triggers ------------------------------------------------------------------ +CREATE FUNCTION action.hold_request_mediated () RETURNS TRIGGER AS $f$ +BEGIN + SELECT COALESCE(oils_json_to_text(value)::BOOL,FALSE) INTO NEW.frozen FROM actor.org_unit_ancestor_setting('ff.request.force_mediation', NEW.request_lib)); + RETURN NEW; +END; +$f$ LANGUAGE PLPGSQL; + +CREATE TRIGGER ahr_mediation_tgr BEFORE INSERT ON action.hold_request + FOR EACH ROW EXECUTE PROCEDURE action.hold_request_mediated (); CREATE OR REPLACE FUNCTION biblio.item_load_trigger () RETURNS TRIGGER AS $$ BEGIN @@ -382,6 +391,15 @@ VALUES ( 'string' ); +-- force staff mediated ILL requests +INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) + VALUES ( + 'ff.request.force_mediation', + oils_i18n_gettext('ff.request.force_mediation', 'ILL: Force initial staff-mediation for all requests', 'coust', 'label'), + oils_i18n_gettext('ff.request.force_mediation', 'When patrons belonging to this org unit place an ILL request, it starts frozen to force staff mediation', 'coust', 'description'), + 'bool' + ); + INSERT INTO config.org_unit_setting_type (name, label, description, datatype) VALUES ( 'ff.remote.connector.extra.sip2.host',