From d3361569844d4233f7db0770a460ceb015065243 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 7 Jul 2005 21:34:19 +0000 Subject: [PATCH] added script for permitting holds git-svn-id: svn://svn.open-ils.org/ILS/trunk@1095 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Evergreen/circ_rules/circ_main.rules | 2 +- Evergreen/circ_rules/permit_hold.rules | 44 ++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 Evergreen/circ_rules/permit_hold.rules diff --git a/Evergreen/circ_rules/circ_main.rules b/Evergreen/circ_rules/circ_main.rules index 64690dc6fe..9899256401 100644 --- a/Evergreen/circ_rules/circ_main.rules +++ b/Evergreen/circ_rules/circ_main.rules @@ -11,7 +11,7 @@ BLOCK ret_block; result.0 = s; result.1 = t; - "Circ Template Result: "; result.0; " "; result.1; + "Template Result: "; result.0; " "; result.1; STOP; END; diff --git a/Evergreen/circ_rules/permit_hold.rules b/Evergreen/circ_rules/permit_hold.rules new file mode 100644 index 0000000000..ccb5e46f41 --- /dev/null +++ b/Evergreen/circ_rules/permit_hold.rules @@ -0,0 +1,44 @@ +[% + +# ------------------------------------------------------------------ +# Permissibility script. +# ------------------------------------------------------------------ + + + +# ------------------------------------------------------------------ +# Patron checks +# ------------------------------------------------------------------ + +IF patron.standing != "Good"; + ret(PATRON_STANDING, "Patron not in good standing: ${patron.standing}"); END; + +IF patron.profile == "STAFF" && patron_copies > 50; + ret(PATRON_CHECKOUT_COUNT, "Patron checkout count exceeds limit"); END; + +IF patron.profile == "ADULT" && patron_copies > 10; + ret(PATRON_CHECKOUT_COUNT, "Patron checkout count exceeds limit"); END; + +IF patron.profile == "JUVENILE" && patron_copies > 5; + ret(PATRON_CHECKOUT_COUNT, "Patron checkout count exceeds limit"); END; + + +# ------------------------------------------------------------------ +# Copy checks +# ------------------------------------------------------------------ + +IF ! copy.circulate; + ret(COPY_NOCIRC, "Copy is not allowed to circulate"); END; + +IF !copy.location.circulate; + ret(COPY_LOCATION, "Copy location not allowed to curculate"); END; + +IF copy.ref; + ret(COPY_ISREF, "Copy is reference material"); END; + + + + +ret(OK,"Allowed"); + +%] -- 2.43.2