From daf515b50662160b64b9f2978564be686b1fef8e Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 4 Sep 2006 04:00:48 +0000 Subject: [PATCH] added check for staff to apply the staff max/recurring fines levels git-svn-id: svn://svn.open-ils.org/ILS/trunk@5912 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/javascript/backend/circ/circ_duration.js | 16 ++++++++++++++-- Open-ILS/src/javascript/backend/circ/circ_lib.js | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/javascript/backend/circ/circ_duration.js b/Open-ILS/src/javascript/backend/circ/circ_duration.js index a5d46abe3c..f4e0c67da3 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_duration.js +++ b/Open-ILS/src/javascript/backend/circ/circ_duration.js @@ -10,6 +10,7 @@ if( isTrue(isPrecat) ) { result.durationRule = '14_days_2_renew'; result.recurringFinesRule = '10_cent_per_day'; result.maxFine = 'overdue_mid'; + checkStaff(); return; } @@ -30,8 +31,6 @@ if( config ) { result.recurringFinesRule = config.recurringFinesRule; result.maxFine = config.maxFine; - log_debug(config.durationRule + ' : ' + config.recurringFinesRule + ' : ' + config.maxFine ); - } else { result.durationRule = '14_days_2_renew'; @@ -63,6 +62,19 @@ if( isOrgDescendent('STATELIB', copy.circ_lib.id) ) { } +checkStaff(); + +log_debug(result.durationRule + ' : ' + result.recurringFinesRule + ' : ' + result.maxFine ); } go(); + + +function checkStaff() { + log_debug("Checking to see if patron is staff: profile = "+patronProfile); + if( isGroupDescendant('Staff', patronProfile) ) { + result.recurringFinesRule = "staff"; + result.maxFine = "staff"; + } +} + diff --git a/Open-ILS/src/javascript/backend/circ/circ_lib.js b/Open-ILS/src/javascript/backend/circ/circ_lib.js index 32f13a1b0f..ab0bdc7877 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_lib.js +++ b/Open-ILS/src/javascript/backend/circ/circ_lib.js @@ -137,6 +137,7 @@ function flattenGroupTree(node) { * @param child The name of the child group */ function isGroupDescendant( parent, child ) { + log_debug("checking descendant p="+parent + " c=" + child); return __isGroupDescendant( groupList[parent], groupList[child]); -- 2.43.2