styling for invalid addresses
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Aug 2006 14:40:57 +0000 (14:40 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Aug 2006 14:40:57 +0000 (14:40 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5516 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 34cdff3..8b203d1 100644 (file)
@@ -20,6 +20,7 @@
                        <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 invalid_address_indicator" value="(Invalid Address)"/>
                        <label class="hideme alert_indicator" value="(Alert)"/>
                        <label class="hideme note_indicator" value="(See Notes)"/>
                </hbox>
index 489bda9..0fe8300 100644 (file)
@@ -377,6 +377,7 @@ patron.summary.prototype = {
                                                                e.setAttribute('value',
                                                                        obj.patron.mailing_address().street1()
                                                                );
+                                                               if (!get_bool(obj.patron.mailing_address().valid())){e.setAttribute('style','color: red');}
                                                        };
                                                }
                                        ],
@@ -387,6 +388,7 @@ patron.summary.prototype = {
                                                                e.setAttribute('value',
                                                                        obj.patron.mailing_address().street2()
                                                                );
+                                                               if (!get_bool(obj.patron.mailing_address().valid())){e.setAttribute('style','color: red');}
                                                        };
                                                }
                                        ],
@@ -397,6 +399,7 @@ patron.summary.prototype = {
                                                                e.setAttribute('value',
                                                                        obj.patron.mailing_address().city()
                                                                );
+                                                               if (!get_bool(obj.patron.mailing_address().valid())){e.setAttribute('style','color: red');}
                                                        };
                                                }
                                        ],
@@ -407,6 +410,7 @@ patron.summary.prototype = {
                                                                e.setAttribute('value',
                                                                        obj.patron.mailing_address().state()
                                                                );
+                                                               if (!get_bool(obj.patron.mailing_address().valid())){e.setAttribute('style','color: red');}
                                                        };
                                                }
                                        ],
@@ -417,6 +421,7 @@ patron.summary.prototype = {
                                                                e.setAttribute('value',
                                                                        obj.patron.mailing_address().post_code()
                                                                );
+                                                               if (!get_bool(obj.patron.mailing_address().valid())){e.setAttribute('style','color: red');}
                                                        };
                                                }
                                        ],
@@ -427,6 +432,7 @@ patron.summary.prototype = {
                                                                e.setAttribute('value',
                                                                        obj.patron.billing_address().street1()
                                                                );
+                                                               if (!get_bool(obj.patron.billing_address().valid())){e.setAttribute('style','color: red');}
                                                        };
                                                }
                                        ],
@@ -437,6 +443,7 @@ patron.summary.prototype = {
                                                                e.setAttribute('value',
                                                                        obj.patron.billing_address().street2()
                                                                );
+                                                               if (!get_bool(obj.patron.billing_address().valid())){e.setAttribute('style','color: red');}
                                                        };
                                                }
                                        ],
@@ -447,6 +454,7 @@ patron.summary.prototype = {
                                                                e.setAttribute('value',
                                                                        obj.patron.billing_address().city()
                                                                );
+                                                               if (!get_bool(obj.patron.billing_address().valid())){e.setAttribute('style','color: red');}
                                                        };
                                                }
                                        ],
@@ -457,6 +465,7 @@ patron.summary.prototype = {
                                                                e.setAttribute('value',
                                                                        obj.patron.billing_address().state()
                                                                );
+                                                               if (!get_bool(obj.patron.billing_address().valid())){e.setAttribute('style','color: red');}
                                                        };
                                                }
                                        ],
@@ -467,6 +476,7 @@ patron.summary.prototype = {
                                                                e.setAttribute('value',
                                                                        obj.patron.billing_address().post_code()
                                                                );
+                                                               if (!get_bool(obj.patron.billing_address().valid())){e.setAttribute('style','color: red');}
                                                        };
                                                }
                                        ]
index 1cbadbb..14b6529 100644 (file)
@@ -506,6 +506,17 @@ patron.util.set_penalty_css = function(patron) {
                        addCSSClass(document.documentElement,'PATRON_HAS_INVALID_DOB');
                }
 
+               if (patron.mailing_address()) {
+                       if (!get_bool(patron.mailing_address().valid())) {
+                               addCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS');
+                       }
+               }
+               if (patron.billing_address()) {
+                       if (!get_bool(patron.billing_address().valid())) {
+                               addCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS');
+                       }
+               }
+
        } catch(E) {
                dump('patron.util.set_penalty_css: ' + E + '\n');
                alert('patron.util.set_penalty_css: ' + E + '\n');
index 71402a0..b5e9551 100755 (executable)
@@ -44,6 +44,8 @@ deck#patron_deck { border-left: solid thin black; }
 .PATRON_HAS_INVALID_DOB .dob { color: purple; }
 .PATRON_HAS_INVALID_DOB label.invalid_dob_indicator { display: inline; color: purple }
 
+.PATRON_HAS_INVALID_ADDRESS label.invalid_address_indicator { display: inline; color: red }
+
 .PATRON_HAS_ALERT .patronNameLarge, 
 .PATRON_HAS_ALERT groupbox.alert { background-color: yellow; color: black; }
 .PATRON_HAS_ALERT label.alert_indicator { display: inline; color: olive }