alet_message is now required when barred is set to true
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Aug 2006 12:17:19 +0000 (12:17 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Aug 2006 12:17:19 +0000 (12:17 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5399 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/ue.xhtml
Open-ILS/xul/staff_client/server/patron/ue_config.js

index 92388ee..404c1d5 100644 (file)
                <span class='hide_me' id='ue_bad_date'>
                        The date provided is either in the future or invalid.  We're expecting YYYY-MM-DD
                </span>
+               <span class='hide_me' id='ue_made_barred'>
+                       Please add a note to the patron's alert message explaining why the patron is barred.
+               </span>
+
        </div>
 
        </body>
index 8113aff..e4628a9 100644 (file)
@@ -47,6 +47,8 @@ const nonumRegex      = /^[a-zA-Z]\D*$/; /* no numbers, no beginning whitespace */
 const dateRegex        = /^\d{4}-\d{2}-\d{2}/;
 const zipRegex         = /^\d{5}(-\d{4}|$)/; /* 12345 or 12345-6789 */
 
+var barredAlerted = false;
+
 
 function uEditUsrnameBlur(field) {
        var usrname = uEditNodeVal(field);
@@ -366,6 +368,18 @@ function uEditDefineData(patron) {
                        widget  : {
                                id                      : 'ue_barred',
                                type            : 'checkbox',
+                               onpostchange : function(field, val) {
+                                       var afield = uEditFindFieldByKey('alert_message');
+                                       if( val ) {
+                                               if( !barredAlerted ) {
+                                                       barredAlerted = true;
+                                                       alertId('ue_made_barred');
+                                               }
+                                               afield.required = true; 
+                                       } else {
+                                               afield.required = false;
+                                       }
+                               }
                        }
                },
                {