From f2eda6e6e39d00fe46af823314565fa7701ce685 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Mon, 24 Sep 2012 14:03:18 -0400 Subject: [PATCH] MEDIACEN doesn't charge anything on AV-EQUIP items Signed-off-by: Dan Scott --- .../backend/circ/circ_duration_MEDIACEN.js | 71 +++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) mode change 120000 => 100644 Open-ILS/src/javascript/backend/circ/circ_duration_MEDIACEN.js diff --git a/Open-ILS/src/javascript/backend/circ/circ_duration_MEDIACEN.js b/Open-ILS/src/javascript/backend/circ/circ_duration_MEDIACEN.js deleted file mode 120000 index e54bfe16fa..0000000000 --- a/Open-ILS/src/javascript/backend/circ/circ_duration_MEDIACEN.js +++ /dev/null @@ -1 +0,0 @@ -circ_duration_OSUL.js \ No newline at end of file diff --git a/Open-ILS/src/javascript/backend/circ/circ_duration_MEDIACEN.js b/Open-ILS/src/javascript/backend/circ/circ_duration_MEDIACEN.js new file mode 100644 index 0000000000..2b2d4422cf --- /dev/null +++ b/Open-ILS/src/javascript/backend/circ/circ_duration_MEDIACEN.js @@ -0,0 +1,70 @@ +/* grab the config from the config script */ +var config = getItemConfig(); +var itemForm = (marcXMLDoc) ? extractFixedField(marcXMLDoc,'Form') : ""; + +/* Set the defaults for books for most patron types */ +result.durationRule = '3_weeks_3_renew'; +result.recurringFinesRule = 'OSUL_daily'; +result.maxFine = 'OSUL_daily'; + +if (patronProfile == 'Faculty' || + patronProfile == 'Graduate') { + result.durationRule = '120_days_1_renew'; +} + +/* Distance education laptops */ +if (copy.circ_modifier == 'COMPUTER LONG') { + result.durationRule = 'OSUL_computer_long'; + result.recurringFinesRule = 'OSUL_computer'; + result.maxFine = 'overdue_equip_max'; +} + +/* Short term laptops */ +if (copy.circ_modifier == 'COMPUTER SHORT') { + result.durationRule = '4_hours_0_renew'; + result.recurringFinesRule = 'OSUL_computer'; + result.maxFine = 'overdue_equip_max'; +} + +/* Study room keys */ +if (copy.circ_modifier == 'KEYS') { + result.durationRule = '3_hours_1_renew'; + result.recurringFinesRule = 'OSUL_hourly'; + result.maxFine = 'OSUL_hourly'; +} + +/* Reserve items - let's use regular expressions to save some pain */ +res_day_re = /^RESERVE (\d+) DAY$/; +res_hour_re = /^RESERVE (\d+) HOUR$/; +res_day_match = res_day_re.exec(copy.circ_modifier); +res_hour_match = res_hour_re.exec(copy.circ_modifier); +if (res_day_match) { + result.durationRule = res_day_match[1] + '_days_0_renew'; + result.recurringFinesRule = 'OSUL_reserves_daily'; + result.maxFine = 'OSUL_reserves'; +} else if (res_hour_match) { + result.durationRule = res_hour_match[1] + '_hours_0_renew'; + result.recurringFinesRule = 'OSUL_hourly'; + result.maxFine = 'OSUL_reserves'; +} + +/* RACER books */ +if (copy.circ_modifier == 'PEB-LIVRE') { + result.durationRule = '14_days_0_renew'; + result.recurringFinesRule = '1_dollar_per_day'; + result.maxFine = 'INFINITY_AND_BEYOND'; +} + +/* VIDEO recordings */ +if (copy.circ_modifier == 'VIDEO') { + result.durationRule = '3_days_0_renew'; + result.recurringFinesRule = '1_dollar_per_day'; + result.maxFine = 'OSUL_reserves'; +} + +/* AV-EQUIP equipment */ +if (copy.circ_modifier == 'AV-EQUIP') { + result.durationRule = '3_days_0_renew'; + result.recurringFinesRule = 'free'; + result.maxFine = 'OSUL_reserves'; +} -- 2.11.0