[open-ils-commits] r465 - conifer/trunk/circ (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu May 7 11:37:33 EDT 2009
Author: dbs
Date: 2009-05-07 11:37:31 -0400 (Thu, 07 May 2009)
New Revision: 465
Added:
conifer/trunk/circ/circ_duration_OSUL.js
conifer/trunk/circ/circ_duration_OWAL.js
Modified:
conifer/trunk/circ/circ_duration.js
conifer/trunk/circ/circ_permit_copy.js
Log:
Update circ rules to broaden circ range (NOSM/LU and OWA/OWAL)
Add OWAL and OSUL circ duration rules
Modified: conifer/trunk/circ/circ_duration.js
===================================================================
--- conifer/trunk/circ/circ_duration.js 2009-05-07 08:45:52 UTC (rev 464)
+++ conifer/trunk/circ/circ_duration.js 2009-05-07 15:37:31 UTC (rev 465)
@@ -49,15 +49,18 @@
if (patronProfile == 'Faculty') {
result.durationRule = '120_days_2_renew';
}
-if (patronProfile == 'Graduate students') {
+if (patronProfile == 'Graduate') {
result.durationRule = '120_days_2_renew';
}
-if (patronProfile == 'Undergraduate students') {
+if (patronProfile == 'Undergraduate') {
result.durationRule = '3_weeks_2_renew';
}
-if (patronProfile == 'Guest borrowers') {
+if (patronProfile == 'Staff members') {
result.durationRule = '3_weeks_2_renew';
}
+if (patronProfile == 'Readers') {
+ result.durationRule = '3_weeks_2_renew';
+}
log_info('final duration results: ' +
Added: conifer/trunk/circ/circ_duration_OSUL.js
===================================================================
--- conifer/trunk/circ/circ_duration_OSUL.js (rev 0)
+++ conifer/trunk/circ/circ_duration_OSUL.js 2009-05-07 15:37:31 UTC (rev 465)
@@ -0,0 +1,33 @@
+/* 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' ||
+ patronProfile == 'Graduate') {
+ result.durationRule = '120_days_2_renew';
+}
+if (patronProfile == 'Undergraduate' ||
+ patronProfile == 'Staff members' ||
+ patronProfile == 'Readers') {
+ result.durationRule = '3_weeks_2_renew';
+}
+
+
Added: conifer/trunk/circ/circ_duration_OWAL.js
===================================================================
--- conifer/trunk/circ/circ_duration_OWAL.js (rev 0)
+++ conifer/trunk/circ/circ_duration_OWAL.js 2009-05-07 15:37:31 UTC (rev 465)
@@ -0,0 +1,606 @@
+/* SIP media types
+000 Other
+001 Book
+002 Magazine
+003 Bound journal
+004 Audio tape
+005 Video tape
+006 CD/CDROM
+007 Diskette
+008 Book with diskette
+009 Book with CD
+010 Book with audio tape
+*/
+
+/* set item type defaults - if the either the patron group or the circ modifier
+ is missing or invalid, these settings will be used */
+
+// do these first two have any significance for us?
+result.SIPMediaType = '001';
+result.magneticMedia = 'f';
+
+// if result.durationRule is not modified for a patron group, item does not circulate
+//
+// of course, what this rule actually does is circulate the item for 0 days, meaning
+// that it is immediately due... need to move this logic over to circ_permit_patron.js
+// or circ_permit_copy.js
+result.durationRule = 'non_circ';
+
+// for fines, set the most common value here
+result.recurringFinesRule = '50_cent_per_day';
+result.maxFine = '10_dollars';
+
+/* adjust rules by patron group and circ modifier */
+
+switch(patronProfile) {
+
+ case 'Patrons':
+ switch(copy.circ_modifier) {
+ case 'CD MUSIC':
+ // use defaults
+ break;
+ case 'CIRC':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'CIRC SHORT':
+ // use defaults
+ break;
+ case 'CRC MEDIA':
+ result.durationRule = '7_days_3_renew';
+ break;
+ case 'CRC SPEC':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'CRC TEXT':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'DNON':
+ // use defaults
+ break;
+ case 'DOC':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'DVD VIDEO':
+ result.durationRule = '3_days_1_renew';
+ break;
+ case 'LAW MONO':
+ // use defaults
+ break;
+ case 'LAW NOCIRC':
+ // use defaults
+ break;
+ case 'LAW RES1D':
+ // use defaults
+ break;
+ case 'LAW RES3D':
+ // use defaults
+ break;
+ case 'LAW RES3H':
+ // use defaults
+ break;
+ case 'LAW RES5H':
+ // use defaults
+ break;
+ case 'LAW SERIAL':
+ // use defaults
+ break;
+ case 'MAP':
+ // use defaults
+ break;
+ case 'MAP (CIRCULATING)':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'MAP (REFERENCE)':
+ // use defaults
+ break;
+ case 'MEDIA':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'MFORM':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'MFORM REF':
+ // use defaults
+ break;
+ case 'MFORM SER':
+ // use defaults
+ break;
+ case 'REF':
+ result.durationRule = '7_days_3_renew';
+ break;
+ case 'RSV1':
+ // use defaults
+ break;
+ case 'RSV2':
+ // use defaults
+ break;
+ case 'RSV3':
+ // use defaults
+ break;
+ case 'RSV7':
+ // use defaults
+ break;
+ case 'SER':
+ // use defaults
+ break;
+ case 'THESIS':
+ result.durationRule = '14_days_3_renew';
+ break;
+ }
+ break;
+
+ case 'Faculty':
+ switch(copy.circ_modifier) {
+ case 'CD MUSIC':
+ result.durationRule = '3_days_1_renew';
+ break;
+ case 'CIRC':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'CIRC SHORT':
+ result.durationRule = '3_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'CRC MEDIA':
+ result.durationRule = '7_days_3_renew';
+ break;
+ case 'CRC SPEC':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'CRC TEXT':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'DNON':
+ // use defaults
+ break;
+ case 'DOC':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'DVD VIDEO':
+ result.durationRule = '3_days_1_renew';
+ break;
+
+ /* settings for law item types are those applicable to LAW FACLTY
+ and will need to be changed as soon as a conifer Law Faculty patron
+ group can be created */
+
+ case 'LAW MONO':
+ result.durationRule = '28_days_5_renew';
+ result.recurringFinesRule = 'free';
+ result.maxFine = 0;
+ break;
+ case 'LAW NOCIRC':
+ result.durationRule = '14_days_5_renew';
+ result.recurringFinesRule = 'free';
+ result.maxFine = 0;
+ break;
+ case 'LAW RES1D':
+ result.durationRule = '2_days_20_renew';
+ result.recurringFinesRule = 'free';
+ result.maxFine = 0;
+ break;
+ case 'LAW RES3D':
+ result.durationRule = '3_days_20_renew';
+ result.recurringFinesRule = 'free';
+ result.maxFine = 0;
+ break;
+ case 'LAW RES3H':
+ result.durationRule = '2_days_20_renew';
+ result.recurringFinesRule = 'free';
+ result.maxFine = 0;
+ break;
+ case 'LAW RES5H':
+ result.durationRule = '2_days_20_renew';
+ result.recurringFinesRule = 'free';
+ result.maxFine = 0;
+ break;
+ case 'LAW SERIAL':
+ result.durationRule = '14_days_5_renew';
+ result.recurringFinesRule = 'free';
+ result.maxFine = 0;
+ break;
+ case 'MAP':
+ // use defaults
+ break;
+ case 'MAP (CIRCULATING)':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'MAP (REFERENCE)':
+ // use defaults
+ break;
+ case 'MEDIA':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'MFORM':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'MFORM REF':
+ // use defaults
+ break;
+ case 'MFORM SER':
+ // use defaults
+ break;
+ case 'REF':
+ result.durationRule = '7_days_3_renew';
+ break;
+ case 'RSV1':
+ result.durationRule = '1_day_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV2':
+ result.durationRule = '120_minutes_0_renew';
+ result.recurringFinesRule = '5_cents_per_minute';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV3':
+ result.durationRule = '3_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV7':
+ result.durationRule = '7_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'SER':
+ result.durationRule = '1_day_1_renew';
+ result.recurringFinesRule = '2_dollars_per_day';
+ break;
+ case 'THESIS':
+ result.durationRule = '28_days_3_renew';
+ break;
+ }
+ break;
+
+ case 'Graduate':
+ switch(copy.circ_modifier) {
+ case 'CD MUSIC':
+ // use defaults
+ break;
+ case 'CIRC':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'CIRC SHORT':
+ result.durationRule = '3_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'CRC MEDIA':
+ result.durationRule = '7_days_3_renew';
+ break;
+ case 'CRC SPEC':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'CRC TEXT':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'DNON':
+ // use defaults
+ break;
+ case 'DOC':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'DVD VIDEO':
+ result.durationRule = '3_days_1_renew';
+ break;
+ case 'LAW MONO':
+ result.durationRule = '28_days_5_renew';
+ result.recurringFinesRule = '50_cent_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW NOCIRC':
+ // use defaults
+ break;
+ case 'LAW RES1D':
+ result.durationRule = '16_hours_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW RES3D':
+ result.durationRule = '2_days_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW RES3H':
+ result.durationRule = '3_hours_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW RES5H':
+ result.durationRule = '5_hours_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW SERIAL':
+ // use defaults
+ break;
+ case 'MAP':
+ // use defaults
+ break;
+ case 'MAP (CIRCULATING)':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'MAP (REFERENCE)':
+ // use defaults
+ break;
+ case 'MEDIA':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'MFORM':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'MFORM REF':
+ // use defaults
+ break;
+ case 'MFORM SER':
+ // use defaults
+ break;
+ case 'REF':
+ result.durationRule = '7_days_3_renew';
+ break;
+ case 'RSV1':
+ result.durationRule = '1_day_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV2':
+ result.durationRule = '120_minutes_0_renew';
+ result.recurringFinesRule = '5_cents_per_minute';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV3':
+ result.durationRule = '3_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV7':
+ result.durationRule = '7_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'SER':
+ result.durationRule = '1_day_1_renew';
+ result.recurringFinesRule = '2_dollars_per_day';
+ break;
+ case 'THESIS':
+ result.durationRule = '28_days_3_renew';
+ break;
+ }
+ break;
+
+ case 'Readers':
+
+ /* currently STAFF, LAW1, LAW2, and LAW3. applying STAFF rules to Leddy items
+ and LAWx rules to Law items - fix as soon as Windsor groups exists! */
+
+ switch(copy.circ_modifier) {
+ case 'cd music':
+ result.durationRule = '3_days_1_renew';
+ break;
+ case 'CIRC':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'CIRC SHORT':
+ result.durationRule = '1_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'CRC MEDIA':
+ result.durationRule = '7_days_3_renew';
+ break;
+ case 'CRC SPEC':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'CRC TEXT':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'DNON':
+ // use defaults
+ break;
+ case 'DOC':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'DVD VIDEO':
+ result.durationRule = '3_days_1_renew';
+ break;
+ case 'LAW MONO':
+ result.durationRule = '28_days_5_renew';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW NOCIRC':
+ // use defaults
+ break;
+ case 'LAW RES1D':
+ result.durationRule = '16_hours_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW RES3D':
+ result.durationRule = '2_days_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW RES3H':
+ result.durationRule = '3_hours_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW RES5H':
+ result.durationRule = '5_hours_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW SERIAL':
+ // use defaults
+ break;
+ case 'MAP':
+ // use defaults
+ break;
+ case 'MAP (CIRCULATING)':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'MAP (REFERENCE)':
+ // use defaults
+ break;
+ case 'MEDIA':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'MFORM':
+ result.durationRule = '28_days_3_renew';
+ break;
+ case 'MFORM REF':
+ // use defaults
+ break;
+ case 'MFORM SER':
+ // use defaults
+ break;
+ case 'REF':
+ result.durationRule = '7_days_3_renew';
+ break;
+ case 'RSV1':
+ result.durationRule = '1_day_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV2':
+ result.durationRule = '120_minutes_0_renew';
+ result.recurringFinesRule = '5_cents_per_minute';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV3':
+ result.durationRule = '3_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV7':
+ result.durationRule = '7_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'SER':
+ result.durationRule = '1_day_1_renew';
+ result.recurringFinesRule = '2_dollars_per_day';
+ break;
+ case 'THESIS':
+ result.durationRule = '28_days_3_renew';
+ break;
+ }
+ break;
+
+ case 'Undergraduate':
+ switch(copy.circ_modifier) {
+ case 'CD MUSIC':
+ // use defaults
+ break;
+ case 'CIRC':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'CIRC SHORT':
+ result.durationRule = '3_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'CRC MEDIA':
+ result.durationRule = '7_days_3_renew';
+ break;
+ case 'CRC SPEC':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'CRC TEXT':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'DNON':
+ // use defaults
+ break;
+ case 'DOC':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'DVD VIDEO':
+ result.durationRule = '3_days_1_renew';
+ break;
+ case 'LAW MONO':
+ result.durationRule = '28_days_5_renew';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW NOCIRC':
+ // use defaults
+ break;
+ case 'LAW RES1D':
+ result.durationRule = '16_hours_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW RES3D':
+ result.durationRule = '2_days_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW RES3H':
+ result.durationRule = '3_hours_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW RES5H':
+ result.durationRule = '5_hours_20_renew';
+ result.recurringFinesRule = '60_cents_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'LAW SERIAL':
+ // use defaults
+ break;
+ case 'MAP':
+ // use defaults
+ break;
+ case 'MAP (CIRCULATING)':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'MAP (REFERENCE)':
+ // use defaults
+ break;
+ case 'MEDIA':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'MFORM':
+ result.durationRule = '14_days_3_renew';
+ break;
+ case 'MFORM REF':
+ // use defaults
+ break;
+ case 'MFORM SER':
+ // use defaults
+ break;
+ case 'REF':
+ result.durationRule = '7_days_3_renew';
+ break;
+ case 'RSV1':
+ result.durationRule = '1_day_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV2':
+ result.durationRule = '120_minutes_0_renew';
+ result.recurringFinesRule = '5_cents_per_minute';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV3':
+ result.durationRule = '3_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'RSV7':
+ result.durationRule = '7_days_1_renew';
+ result.recurringFinesRule = '10_dollars_per_day';
+ result.maxFine = '50_dollars';
+ break;
+ case 'SER':
+ // use defaults
+ break;
+ case 'THESIS':
+ result.durationRule = '14_days_3_renew';
+ break;
+ }
+ break;
+
+}
Modified: conifer/trunk/circ/circ_permit_copy.js
===================================================================
--- conifer/trunk/circ/circ_permit_copy.js 2009-05-07 08:45:52 UTC (rev 464)
+++ conifer/trunk/circ/circ_permit_copy.js 2009-05-07 15:37:31 UTC (rev 465)
@@ -8,21 +8,30 @@
var lusys = ['LUSYS', 'CRC', 'HUNTINGTON', 'LDCR', 'MRC', 'OSUL', 'MEDIACEN', 'SUDBURY'];
var hearstsys = ['HEARSTSYS', 'HEARST', 'KAP', 'TIMMINS'];
var nosmsys = ['OSM', 'NOSME', 'NOSMW'];
+var winsys = ['OWA', 'OWAL'];
/* In theory, isOrgDescendent would work - but it isn't, for some reason */
if (patron.home_ou.id != copy.circ_lib.id) {
/* Laurentian campus patrons can borrow from one another */
if (isOrgDescendent('LUSYS', patron.home_ou.id) && isOrgDescendent('LUSYS', copy.circ_lib.id)) {
// go in peace
- } else if (isAMember(patron.home_ou.shortname, lusys) && isAMember(copy.circ_lib.shortname, lusys)) {
+ } else if (isAMember(patron.home_ou.shortname, lusys) && (
+ isAMember(copy.circ_lib.shortname, lusys) || isAMember(copy.circ_lib.shortname, nosmsys)
+ ))
+ {
// No problemo
} else if (isOrgDescendent('HEARSTSYS', patron.home_ou.id) && isOrgDescendent('LUSYS', copy.circ_lib.id)) {
// go in peace
} else if (isAMember(patron.home_ou.shortname, hearstsys) && isAMember(copy.circ_lib.shortname, hearstsys)) {
// No problemo
+ } else if (isAMember(patron.home_ou.shortname, winsys) && isAMember(copy.circ_lib.shortname, winsys)) {
+ // No problemo
} else if (isOrgDescendent('OSM', patron.home_ou.id) && isOrgDescendent('OSM', copy.circ_lib.id)) {
// go in peace
- } else if (isAMember(patron.home_ou.shortname, nosmsys) && isAMember(copy.circ_lib.shortname, nosmsys)) {
+ } else if (isAMember(patron.home_ou.shortname, nosmsys) && (
+ isAMember(copy.circ_lib.shortname, lusys) || isAMember(copy.circ_lib.shortname, nosmsys)
+ ))
+ {
// No problemo
} else {
result.events.push('CIRC_EXCEEDS_COPY_RANGE');
More information about the open-ils-commits
mailing list