adding and updating circ scripts as the code evolves
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 30 Jan 2006 21:09:19 +0000 (21:09 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 30 Jan 2006 21:09:19 +0000 (21:09 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2894 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/javascript/backend/circ/circ_duration.js [new file with mode: 0644]
Open-ILS/src/javascript/backend/circ/circ_max_fines.js [new file with mode: 0644]
Open-ILS/src/javascript/backend/circ/circ_permit_copy.js
Open-ILS/src/javascript/backend/circ/circ_permit_patron.js
Open-ILS/src/javascript/backend/circ/circ_recurring_fines.js [new file with mode: 0644]

diff --git a/Open-ILS/src/javascript/backend/circ/circ_duration.js b/Open-ILS/src/javascript/backend/circ/circ_duration.js
new file mode 100644 (file)
index 0000000..f2fd522
--- /dev/null
@@ -0,0 +1,29 @@
+
+function go() {
+
+/* load the lib script */
+load_lib('circ_lib.js');
+
+/* collect some useful variables */
+var copy                                       = environment.copy;
+var patron                             = environment.patron;
+var patronStanding     = patron.standing.value.toLowerCase();
+var patronProfile              = patron.profile.name.toLowerCase();
+var copyStatus                 = copy.status.name.toLowerCase();
+var patronItemsOut     = environment.patronItemsOut;
+var patronFines                = environment.patronFines;
+var isRenewal                  = environment.isRenewal;
+
+
+/* set sane defaults */
+result.durationLevel   = copy.loan_duration;
+result.durationRule    = "2wk_default";
+
+
+
+
+
+return;
+
+
+} go();
diff --git a/Open-ILS/src/javascript/backend/circ/circ_max_fines.js b/Open-ILS/src/javascript/backend/circ/circ_max_fines.js
new file mode 100644 (file)
index 0000000..f593e3a
--- /dev/null
@@ -0,0 +1,22 @@
+
+function go() {
+
+/* load the lib script */
+load_lib('circ_lib.js');
+
+/* collect some useful variables */
+var copy                                       = environment.copy;
+var patron                             = environment.patron;
+var patronStanding     = patron.standing.value.toLowerCase();
+var patronProfile              = patron.profile.name.toLowerCase();
+var copyStatus                 = copy.status.name.toLowerCase();
+var patronItemsOut     = environment.patronItemsOut;
+var patronFines                = environment.patronFines;
+var isRenewal                  = environment.isRenewal;
+
+
+return result.maxFine = "books";
+
+
+
+} go();
index 1249ee9..66887d9 100644 (file)
@@ -3,28 +3,27 @@ function go() {
 /* load the lib script */
 load_lib('circ_lib.js');
 
-
 /* collect some useful variables */
-var copy                       = environment.copy;
-var patron             = environment.patron;
-var standing   = patron.standing.value.toLowerCase();
-var profile            = patron.profile.name.toLowerCase();
-var status             = copy.status.name.toLowerCase();
-var itemsOut   = environment.patronItemsOut;
-var fines              = environment.patronFines;
-var isRenewal  = environment.isRenewal;
+var copy                                       = environment.copy;
+var patron                             = environment.patron;
+var patronStanding     = patron.standing.value.toLowerCase();
+var patronProfile              = patron.profile.name.toLowerCase();
+var copyStatus                 = copy.status.name.toLowerCase();
+var patronItemsOut     = environment.patronItemsOut;
+var patronFines                = environment.patronFines;
+var isRenewal                  = environment.isRenewal;
 
 
 log_debug('circ_permit_copy: permit circ on ' +
        ' Copy: '                                       + copy.id + 
        ', Patron:'                                     + patron.id +
        ', Patron Username:'            + patron.usrname +
-       ', Patron Profile: '            + patron.profile.name +
-       ', Patron Standing: '   + patron.standing.value +
-       ', Patron copies: '             + itemsOut +
+       ', Patron Profile: '            + patronProfile +
+       ', Patron Standing: '   + patronStanding +
+       ', Patron copies: '             + patronItemsOut +
        ', Patron Library: '            + patron.home_ou.name +
-       ', Patron fines: '              + fines +
-       ', Copy status: '                       + copy.status.name +
+       ', Patron fines: '              + patronFines +
+       ', Copy status: '                       + copyStatus +
        ', Copy location: '             + copy.location.name +
        ', Is Renewal: '                        + ( (isRenewal) ? "yes" : "no" ) +
        '');
@@ -37,7 +36,7 @@ if( copy.circulate == '0' )
 if( copy.ref != '0' ) 
        return result.event = 'COPY_IS_REFERENCE';
 
-if( status != 'available' && status != 'on holds shelf' )
+if( copyStatus != 'available' && copyStatus != 'on holds shelf' )
        return result.event = 'COPY_NOT_AVAILABLE';
 
 var holds = copy.fetchHold();
index a0b6270..50b015b 100644 (file)
@@ -5,34 +5,34 @@ load_lib('circ_lib.js');
 
 
 /* collect some useful variables */
-var patron             = environment.patron;
-var standing   = patron.standing.value.toLowerCase();
-var profile            = patron.profile.name.toLowerCase();
-var itemsOut   = environment.patronItemsOut;
-var fines              = environment.patronFines;
-var isRenewal  = environment.isRenewal;
+var patron                             = environment.patron;
+var patronStanding     = patron.standing.value.toLowerCase();
+var patronProfile              = patron.profile.name.toLowerCase();
+var patronItemsOut     = environment.patronItemsOut;
+var patronFines                = environment.patronFines;
+var isRenewal                  = environment.isRenewal;
 
 
 log_debug('circ_permit_patron: permit circ on ' +
        ', Patron:'                                     + patron.id +
        ', Patron Username:'            + patron.usrname +
-       ', Patron Profile: '            + patron.profile.name +
-       ', Patron Standing: '   + patron.standing.value +
-       ', Patron copies: '             + itemsOut +
+       ', Patron Profile: '            + patronProfile +
+       ', Patron Standing: '   + patronStanding +
+       ', Patron copies: '             + patronItemsOut +
        ', Patron Library: '            + patron.home_ou.name +
-       ', Patron fines: '              + fines +
+       ', Patron fines: '              + patronFines +
        ', Is Renewal: '                        + ( (isRenewal) ? "yes" : "no" ) +
        '');
 
 
 
-if( standing != 'good' ) 
+if( patronStanding != 'good' ) 
        return result.event = 'PATRON_BAD_STANDING';
 
-if( profile == 'patrons' && itemsOut > 10 )
+if( patronProfile == 'patrons' && patronItemsOut > 10 )
        return result.event = 'PATRON_EXCEEDS_CHECKOUT_COUNT';
 
-if( profile == 'staff' && itemsOut > 30 )
+if( patronProfile == 'staff' && patronItemsOut > 30 )
        return result.event = 'PATRON_EXCEEDS_CHECKOUT_COUNT';
 
 
diff --git a/Open-ILS/src/javascript/backend/circ/circ_recurring_fines.js b/Open-ILS/src/javascript/backend/circ/circ_recurring_fines.js
new file mode 100644 (file)
index 0000000..6c3ec96
--- /dev/null
@@ -0,0 +1,27 @@
+
+function go() {
+
+/* load the lib script */
+load_lib('circ_lib.js');
+
+/* collect some useful variables */
+var copy                                       = environment.copy;
+var patron                             = environment.patron;
+var patronStanding     = patron.standing.value.toLowerCase();
+var patronProfile              = patron.profile.name.toLowerCase();
+var copyStatus                 = copy.status.name.toLowerCase();
+var patronItemsOut     = environment.patronItemsOut;
+var patronFines                = environment.patronFines;
+var isRenewal                  = environment.isRenewal;
+
+/** 
+Set some sane defaults.  Valid values for result.recurringFinesLevel
+are low, nornal, and high
+*/
+result.recurringFinesRule = "books";
+result.recurringFinesLevel = 'normal';
+
+
+return;
+
+} go();