bug #322. in copy editor, make alert message truly empty if it doesn't have alphanum...
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 13 Feb 2007 05:30:44 +0000 (05:30 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 13 Feb 2007 05:30:44 +0000 (05:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6939 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_editor.js

index 7a83add..f9fe04a 100644 (file)
@@ -435,6 +435,7 @@ g.reset = function() {
 g.apply = function(field,value) {
        g.error.sdump('D_TRACE','applying field = <' + field + '>  value = <' + value + '>\n');
        if (value == '<HACK:KLUDGE:NULL>') value = null;
+       if (field == 'alert_message') { value = value.replace(/^\W+$/g,''); }
        for (var i = 0; i < g.copies.length; i++) {
                var copy = g.copies[i];
                try {
@@ -827,7 +828,7 @@ g.panes_and_field_names = {
                "Alert Message",
                {
                        render: 'fm.alert_message() == null ? "<Unset>" : fm.alert_message()',
-                       input: 'c = function(v){ g.apply("alert_message",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("multiline",true); g.populate_alert_message_input(x); x.addEventListener("apply",function(f){ return function(ev) { f( String(ev.target.value).replace(/^\s+$/,"") ); } }(c), false);',
+                       input: 'c = function(v){ g.apply("alert_message",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("multiline",true); g.populate_alert_message_input(x); x.addEventListener("apply",function(f){ return function(ev) { f( ev.target.value ); } }(c), false);',
                }
        ],