wiki:sysadminCircRules

Version 1 (modified by Peter Zimmerman, 11 years ago) (diff)

--

Conifer Documentation
Windsor Leddy and Law Circ Rules
Peter Zimmerman

Before activating the circ rules javascript files, a number of rule definitions must be created.

Circulation Rules
non_circ
OWA_Faculty
OWA_Staff
OWA_Graduate
OWA_Undergraduate
OWA_Readers
OWA_short
OWA_sevenday
OWA_serials
OWA_audiovisual
OWA_rsv_oneday
OWA_rsv_threeday
OWA_rsv_sevenday
OWA_rsv_twohour
OWAL_Faculty
OWAL_Faculty_serials
OWAL_Staff
OWAL_Readers
OWAL_Graduate
OWAL_Undergraduate
OWAL_rsv_oneday
OWAL_rsv_threeday
OWAL_rsv_threehour
OWAL_rsv_fivehour

Recurring Fines Rules
free
OWAL_daily
OWAL_hourly
OWA_daily
OWA_daily_short
OWA_daily_rsv
OWA_hourly_rsv
OWA_daily_serials

Max Fines Rules
OWAL_normal
OWAL_readers
OWA_normal
OWA_short
OWA_rsv

Files updated to support Windsor's rules

  • circ_lib.js
  • circ_permit_copy.js
  • circ_duration.js
  • circ_duration_OWA.js
  • circ_duration_OWAL.js

circ_lib.js

A single function, isValidPatron(), has been added to circ_lib.js. The function includes a list of patron profiles in use at both Leddy and Law and returns true if the current patron's patronProfile is on the list (currently 'Faculty', 'Graduate', 'Undergraduate', 'Staff members', and 'Readers'). This function is called from circ_permit_copy.js, circ_duration_OWA.js and circ_duration_OWAL.js.

circ_permit_copy.js

If the patron's library is OWA, isValidPatron() checks to see if patronProfile is on the expected list. If not, COPY_CIRC_NOT_ALLOWED is triggered. (It would be better to have a specific event for this, but that's a task for another day.)

If patron is valid, an array variable circ_allow_list is built. Values are added to the array based on patronProfile.

The function testCircAllow() is then called to determine if the circ_modifier is on the allow list. If not, COPY_CIRC_NOT_ALLOWED is triggered. If the circ_modifier is on the allow list, script proceeds. testCircAllow() resides in this file (circ_permit_copy.js).

This process is identical for OWAL patrons, but the logic to assign permitted circ_modifiers according to patronProfile is a little different.

circ_duration.js

This file loads institution-specific files based on the staff client's current location. The logic for this was worked out by Dan Scott, and has been in place since fairly early in the Conifer installation.

circ_duration_OWA.js

First sets default values for the five "results" that are determined by this script. SIPMediaType and magneticMedia are set here and remain unchanged throughout. durationRule is set to non_circ, but this should only be unchanged if the isValidPatron() test fails. Finally, recurringFinesRule and maxFine are set to the most commonly used values to avoid the need to duplicate later.

The isValidPatron() test is necessary here in case the staff member signing out the item overrides the COPY_CIRC_NOT_ALLOWED message triggered in circ_permit_copy.js. If the patron fails the test, the default values are used.

The remainder of this file assigns circDuration values in cases where the patronProfile is expected, including those times when COPY_CIRC_NOT_ALLOWED has been triggered by the profile-specific rules in circ_permit_copy.js but has been overridden by staff.

If the patron has one of the five expected profiles, the first word of the patronProfile is assigned to the variable profileFirst. This makes it possible to reference values in the circ rules tables in a more abstract way. Spaces are not permissible in the rules tables, thus the need to use only the first word of the profile value (see "possible issues", below).

Leddy takes two different policy approaches to how item rules are set. Some items circulate for the same period regardless of who the patron is. These include 'CD MUSIC', 'CIRC SHORT', 'CRC MEDIA', 'DVD VIDEO', 'REF', 'RSV1', 'RSV2', 'RSV3', 'RSV7', 'SER'. Rules are assigned by referring to the corresponding rule in the tables.

The second policy approach applies to the other circ modifiers ('CIRC', 'CRC SPEC', 'CRC TEXT', 'DOC', 'MEDIA', 'MFORM', 'THESIS'): the duration rule varies based on patronProfile, but for any given patronProfile the rule is the same for all of these modifiers. The duration rule can then be assigned the value 'OWA_' + profileFirst, and the rule appropriate to that patronProfile will be looked up. For example, if the patronProfile value is 'Staff members', the duration rule 'OWA_' + profileFirst will equal 'OWA_Staff'.

circ_duration_OWAL.js

Law rules follow the same pattern as Leddy. However, exceptions are included for Readers and Faculty. Readers are handled first: Readers whose home_ou is not OWAL can't borrow anything, Readers whose home_ou is Law can only borrow monographs. Again, if staff override the default value of 'non_circ' is used.

Faculty exceptions occur at the end: all Faculty can borrow serials. Law faculty never pay fines, and they get a three day loan period for all reserve items.

possible issues for the future

The profileFirst variable only works because each patronProfile begins with a different first word. If a new profile is created in future, the first word will also need to be unique or the duration rules will become ambiguous. For example, "Faculty retirees" would be confused with "Faculty".