var co = req.getResultObject();
if (co.overdue > 0 || co.long_overdue > 0) addCSSClass(document.documentElement,'PATRON_HAS_OVERDUES');
});
+ net.simple_request('FM_AUN_RETRIEVE_ALL',[ ses(), { 'patronid' : patron.id() } ], function(req) {
+ var notes = req.getResultObject();
+ if (notes.length > 0) addCSSClass(document.documentElement,'PATRON_HAS_NOTES');
+ });
JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
data.last_patron = patron.id(); data.stash('last_patron');
if (expire < now) addCSSClass(document.documentElement,'PATRON_EXPIRED');
- var age_parts = patron.dob().substr(0,10).split('-');
- age_parts[1] = age_parts[1] - 1;
+ if (patron.dob()) {
+ var age_parts = patron.dob().substr(0,10).split('-');
+ age_parts[1] = age_parts[1] - 1;
- var born = new Date();
- born.setFullYear(age_parts[0], age_parts[1], age_parts[2]);
- born = born.getTime()/1000
+ var born = new Date();
+ born.setFullYear(age_parts[0], age_parts[1], age_parts[2]);
+ born = born.getTime()/1000
- var patron_age = now - born;
- var years_old = parseInt(patron_age / TIME.year);
+ var patron_age = now - born;
+ var years_old = parseInt(patron_age / TIME.year);
- addCSSClass(document.documentElement,'PATRON_AGE_IS_' + years_old);
+ addCSSClass(document.documentElement,'PATRON_AGE_IS_' + years_old);
- if ( years_old >= 65 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_65');
- if ( years_old < 65 ) addCSSClass(document.documentElement,'PATRON_AGE_LT_65');
-
- if ( years_old >= 24 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_24');
- if ( years_old < 24 ) addCSSClass(document.documentElement,'PATRON_AGE_LT_24');
+ if ( years_old >= 65 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_65');
+ if ( years_old < 65 ) addCSSClass(document.documentElement,'PATRON_AGE_LT_65');
- if ( years_old >= 21 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_21');
- if ( years_old < 21 ) addCSSClass(document.documentElement,'PATRON_AGE_LT_21');
+ if ( years_old >= 24 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_24');
+ if ( years_old < 24 ) addCSSClass(document.documentElement,'PATRON_AGE_LT_24');
+
+ if ( years_old >= 21 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_21');
+ if ( years_old < 21 ) addCSSClass(document.documentElement,'PATRON_AGE_LT_21');
- if ( years_old >= 18 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_18');
- if ( years_old < 18 ) addCSSClass(document.documentElement,'PATRON_AGE_LT_18');
-
- if ( years_old >= 13 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_13');
- if ( years_old < 13 ) addCSSClass(document.documentElement,'PATRON_AGE_LT_13');
+ if ( years_old >= 18 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_18');
+ if ( years_old < 18 ) addCSSClass(document.documentElement,'PATRON_AGE_LT_18');
+ if ( years_old >= 13 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_13');
+ if ( years_old < 13 ) addCSSClass(document.documentElement,'PATRON_AGE_LT_13');
+ } else {
+ addCSSClass(document.documentElement,'PATRON_HAS_INVALID_DOB');
+ }
} catch(E) {
dump('patron.util.set_penalty_css: ' + E + '\n');
.PATRON_HAS_BILLS .patronNameLarge { background-color: #FF9900; }
.PATRON_HAS_BILLS label.bill { color: #FF9900; }
-.PATRON_HAS_BILLS label.bill.label { text-decoration: underline; }
+/* .PATRON_HAS_BILLS label.bill.label { text-decoration: underline; } */
.PATRON_HAS_BILLS label.bill.value { }
.PATRON_HAS_OVERDUES .patronNameLarge { background-color: #FF9900; }
.PATRON_HAS_OVERDUES label.items_overdue { color: #FF9900; }
-.PATRON_HAS_OVERDUES label.items_overdue.label { text-decoration: underline; }
+/* .PATRON_HAS_OVERDUES label.items_overdue.label { text-decoration: underline; } */
.PATRON_HAS_OVERDUES label.items_overdue.value { }
-.PATRON_EXCEEDS_CHECKOUT_COUNT .patronNameLarge { background-color: purple; }
+.PATRON_EXCEEDS_CHECKOUT_COUNT .patronNameLarge { background-color: purple; color: white; }
.PATRON_EXCEEDS_CHECKOUT_COUNT label.items_out { color: purple; }
-.PATRON_EXCEEDS_CHECKOUT_COUNT label.items_out.label { text-decoration: underline; }
+/* .PATRON_EXCEEDS_CHECKOUT_COUNT label.items_out.label { text-decoration: underline; } */
.PATRON_EXCEEDS_CHECKOUT_COUNT label.items_out.value { }
-.PATRON_EXCEEDS_OVERDUE_COUNT .patronNameLarge { background-color: purple; }
+.PATRON_EXCEEDS_OVERDUE_COUNT .patronNameLarge { background-color: purple; color: white; }
.PATRON_EXCEEDS_OVERDUE_COUNT label.items_overdue { color: purple; }
-.PATRON_EXCEEDS_OVERDUE_COUNT label.items_overdue.label { text-decoration: underline; }
+/* .PATRON_EXCEEDS_OVERDUE_COUNT label.items_overdue.label { text-decoration: underline; } */
.PATRON_EXCEEDS_OVERDUE_COUNT label.items_overdue.value { }
-.PATRON_EXCEEDS_FINES .patronNameLarge { background-color: purple; }
+.PATRON_EXCEEDS_FINES .patronNameLarge { background-color: purple; color: white; }
.PATRON_EXCEEDS_FINES label.bill { color: purple; }
-.PATRON_EXCEEDS_FINES label.bill.label { text-decoration: underline; }
+/* .PATRON_EXCEEDS_FINES label.bill.label { text-decoration: underline; } */
.PATRON_EXCEEDS_FINES label.bill.value { }
-.PATRON_AGE_LT_18 .dob { text-decoration: underline; color: purple; }
-.PATRON_AGE_LT_18 label.juvenile_indicator { display: inline; text-decoration: underline; color: purple; }
+.PATRON_AGE_LT_18 .dob { color: purple; }
+.PATRON_AGE_LT_18 label.juvenile_indicator { display: inline; color: purple; }
+
+.PATRON_HAS_INVALID_DOB .dob { color: purple; }
+.PATRON_HAS_INVALID_DOB label.invalid_dob_indicator { display: inline; color: purple }
.PATRON_HAS_ALERT .patronNameLarge,
.PATRON_HAS_ALERT groupbox.alert { background-color: yellow; }
-.PATRON_HAS_ALERT label.alert_indicator { display: inline; text-decoration: underline; color: olive }
+.PATRON_HAS_ALERT label.alert_indicator { display: inline; color: olive }
+
+.PATRON_HAS_NOTES label.note_indicator { display: inline; color: olive }
.PATRON_INACTIVE .patronNameLarge { background-color: #333333; }
-.PATRON_INACTIVE label.inactive_indicator { display: inline; text-decoration: underline; color: gray; }
+.PATRON_INACTIVE label.inactive_indicator { display: inline; color: gray; }
.PATRON_EXPIRED .patronNameLarge { background-color: #666666; }
-.PATRON_EXPIRED label.expired_indicator { display: inline; text-decoration: underline; color: fuchsia; }
+.PATRON_EXPIRED label.expired_indicator { display: inline; color: fuchsia; }
.PATRON_BARRED .patronNameLarge { background-color: red; }
-.PATRON_BARRED label.barred_indicator { display: inline; text-decoration: underline; color: red; }
+.PATRON_BARRED label.barred_indicator { display: inline; color: red; }