dob display bug whacked, invalid dob indicator, See Notes indicator
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Aug 2006 15:29:28 +0000 (15:29 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Aug 2006 15:29:28 +0000 (15:29 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5245 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/display_overlay.xul
Open-ILS/xul/staff_client/server/patron/summary.js
Open-ILS/xul/staff_client/server/patron/util.js
Open-ILS/xul/staff_client/server/skin/patron_display.css

index c78a609..34cdff3 100644 (file)
@@ -19,7 +19,9 @@
                        <label class="hideme expired_indicator" value="(Expired)"/>
                        <label class="hideme inactive_indicator" value="(In-Active)"/>
                        <label class="hideme juvenile_indicator" value="(Juvenile)"/>
+                       <label class="hideme invalid_dob_indicator" value="(Invalid DOB)"/>
                        <label class="hideme alert_indicator" value="(Alert)"/>
+                       <label class="hideme note_indicator" value="(See Notes)"/>
                </hbox>
                <deck id="PatronNavBar" flex="1" class="my_overflow"/>
        </hbox>
index 1dfa509..47988d5 100644 (file)
@@ -270,7 +270,9 @@ patron.summary.prototype = {
                                                function(e) {
                                                        return function() { 
                                                                e.setAttribute('value',
-                                                                       obj.patron.dob().substr(0,10)
+                                                                       obj.patron.dob() ?
+                                                                       obj.patron.dob().substr(0,10) :
+                                                                       '<Unset>'
                                                                );
                                                        };
                                                }
index a5cf399..8c86fc2 100644 (file)
@@ -424,6 +424,10 @@ patron.util.set_penalty_css = function(patron) {
                        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');
@@ -464,33 +468,36 @@ patron.util.set_penalty_css = function(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');
index 385b2a5..cc3a453 100755 (executable)
@@ -15,43 +15,48 @@ deck#patron_deck { border-left: solid thin black; }
 
 .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; }