From: dbs Date: Tue, 8 Mar 2011 17:40:23 +0000 (+0000) Subject: Put Huntington's $15/hour computer fines into effect X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5049524ebd37a372499495491a152730bc077bed;p=contrib%2FConifer.git Put Huntington's $15/hour computer fines into effect Because I have broken the link with the circ_duration_OSUL.js script, we will have to manually keep these rules in sync (at least until we move to in-database circ rules) git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/branches/rel_1_6_1@1258 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/circ/circ_duration_HUNTINGTON.js b/circ/circ_duration_HUNTINGTON.js deleted file mode 120000 index e54bfe16fa..0000000000 --- a/circ/circ_duration_HUNTINGTON.js +++ /dev/null @@ -1 +0,0 @@ -circ_duration_OSUL.js \ No newline at end of file diff --git a/circ/circ_duration_HUNTINGTON.js b/circ/circ_duration_HUNTINGTON.js new file mode 100644 index 0000000000..8b06795c66 --- /dev/null +++ b/circ/circ_duration_HUNTINGTON.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 = 'HUNT_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'; +} + +/* SOUND and DVD VIDEO recordings */ +if (copy.circ_modifier == 'SOUND' || copy.circ_modifier == 'DVD VIDEO') { + result.durationRule = '7_days_0_renew'; + result.recurringFinesRule = '1_dollar_per_day'; + result.maxFine = 'OSUL_reserves'; +}