-function go(){
-
-load_lib('circ/circ_item_config.js');
-load_lib('JSON_v1.js');
-log_vars('circ_duration');
-
-try {
- /* load circ rules for specific institutions */
- var circ_duration_institution_file = 'circ/circ_duration_' + currentLocation.shortname + '.js';
- load_lib(circ_duration_institution_file);
-
- log_error(circ_duration_institution_file);
-
- /* if an institution specific script was loaded, then stop */
- if (result.durationRule) return;
-} catch (e) {
- // fall through to system-wide defaults
-}
-
-/* treat pre-cat copies like vanilla books */
-if( isTrue(isPrecat) ) {
- log_info("pre-cat copy getting duration defaults...");
- result.durationRule = 'default';
- result.recurringFinesRule = 'default';
- result.maxFine = 'default'
- return;
-}
-
-
-/* grab the config from the config script */
-var config = getItemConfig();
-var itemForm = (marcXMLDoc) ? extractFixedField(marcXMLDoc,'Form') : "";
-
-
-/* -----------------------------------------------------------------------------
- Now set the rule values based on the config. If there is no configured info
- on this copy, fall back on defaults.
- ----------------------------------------------------------------------------- */
-if( config ) {
-
- log_debug("circ_duration found a config for the copy");
- result.durationRule = config.durationRule;
- result.recurringFinesRule = config.recurringFinesRule;
- result.maxFine = config.maxFine;
-
-} else {
-
- result.durationRule = 'default';
- result.recurringFinesRule = 'default';
- result.maxFine = 'default';
-}
-
-if (patronProfile == 'Faculty') {
- result.durationRule = '120_days_2_renew';
-}
-if (patronProfile == 'Graduate') {
- result.durationRule = '120_days_2_renew';
-}
-if (patronProfile == 'Undergraduate') {
- result.durationRule = '3_weeks_2_renew';
-}
-if (patronProfile == 'Staff members') {
- result.durationRule = '3_weeks_2_renew';
-}
-if (patronProfile == 'Readers') {
- result.durationRule = '3_weeks_2_renew';
-}
-
-
-log_info('final duration results: ' +
- result.durationRule + ' : ' + result.recurringFinesRule + ' : ' + result.maxFine );
-
-} go();
-
-
-
-
+function go(){\r
+\r
+load_lib('circ/circ_item_config.js');\r
+load_lib('JSON_v1.js');\r
+log_vars('circ_duration');\r
+\r
+var currentTime = new Date();\r
+var debugStamp = "circ" + (currentTime.getMonth() + 1) + "" +\r
+ "" + currentTime.getDate() + "" + currentTime.getFullYear() +\r
+ ": ";\r
+\r
+\r
+log_info(debugStamp + "location identified as " + currentLocation.shortname);\r
+\r
+try { \r
+ /* load circ rules for specific institutions */\r
+ var circ_duration_institution_file = 'circ/circ_duration_' + currentLocation.shortname + '.js';\r
+ load_lib(circ_duration_institution_file);\r
+\r
+ log_error(circ_duration_institution_file);\r
+\r
+ /* if an institution specific script was loaded, then stop */\r
+ if (result.durationRule) return;\r
+} catch (e) {\r
+ // fall through to system-wide defaults\r
+ log_info("circ0814: error loading " + e);\r
+}\r
+\r
+/* treat pre-cat copies like vanilla books */\r
+if( isTrue(isPrecat) ) {\r
+ log_info("pre-cat copy getting duration defaults...");\r
+ result.durationRule = 'default';\r
+ result.recurringFinesRule = 'default';\r
+ result.maxFine = 'default'\r
+ return;\r
+}\r
+\r
+\r
+/* grab the config from the config script */\r
+var config = getItemConfig();\r
+var itemForm = (marcXMLDoc) ? extractFixedField(marcXMLDoc,'Form') : "";\r
+\r
+\r
+/* ----------------------------------------------------------------------------- \r
+ Now set the rule values based on the config. If there is no configured info\r
+ on this copy, fall back on defaults.\r
+ ----------------------------------------------------------------------------- */\r
+if( config ) {\r
+\r
+ log_info("config exists");\r
+ log_debug("circ_duration found a config for the copy");\r
+ result.durationRule = config.durationRule;\r
+ result.recurringFinesRule = config.recurringFinesRule;\r
+ result.maxFine = config.maxFine;\r
+\r
+} else {\r
+ log_info("falling back to default");\r
+\r
+ result.durationRule = 'default';\r
+ result.recurringFinesRule = 'default';\r
+ result.maxFine = 'default';\r
+}\r
+\r
+if (patronProfile == 'Faculty') {\r
+ result.durationRule = '120_days_2_renew';\r
+}\r
+if (patronProfile == 'Graduate') {\r
+ result.durationRule = '120_days_2_renew';\r
+}\r
+if (patronProfile == 'Undergraduate') {\r
+ result.durationRule = '3_weeks_2_renew';\r
+}\r
+if (patronProfile == 'Staff members') {\r
+ result.durationRule = '3_weeks_2_renew';\r
+}\r
+if (patronProfile == 'Readers') {\r
+ result.durationRule = '3_weeks_2_renew';\r
+}\r
+\r
+\r
+log_info('final duration results: ' + \r
+ result.durationRule + ' : ' + result.recurringFinesRule + ' : ' + result.maxFine );\r
+\r
+} go();\r