better support for ils events where .ils_event == null. Can now include the textcode...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Sep 2009 22:57:49 +0000 (22:57 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Sep 2009 22:57:49 +0000 (22:57 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14065 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/network.js

index 7b48545..9a4dbc9 100644 (file)
@@ -452,12 +452,24 @@ util.network.prototype = {
                        var result = obj.get_result(req);
                        if (!result) return req;
 
-                       if ( (typeof result.ilsevent != 'undefined') && (override_params.overridable_events.indexOf( result.ilsevent == null ? null : Number(result.ilsevent) ) != -1) ) {
+                       if ( 
+                (typeof result.ilsevent != 'undefined') && 
+                (
+                    (override_params.overridable_events.indexOf( result.ilsevent == null ? null : Number(result.ilsevent) ) != -1) ||
+                    (override_params.overridable_events.indexOf( result.textcode ) != -1)
+                )
+            ) {
                                req = override([result]);
                        } else {
                                var found_good = false; var found_bad = false;
                                for (var i = 0; i < result.length; i++) {
-                                       if ( (result[i].ilsevent != 'undefined') && (override_params.overridable_events.indexOf( result[i].ilsevent == null ? null : Number(result[i].ilsevent) ) != -1) ) {
+                                       if ( 
+                        (result[i].ilsevent != 'undefined') && 
+                        (
+                            (override_params.overridable_events.indexOf( result[i].ilsevent == null ? null : Number(result[i].ilsevent) ) != -1) ||
+                            (override_params.overridable_events.indexOf( result[i].textcode ) != -1) 
+                        )
+                    ) {
                                                found_good = true;
                                        } else {
                                                found_bad = true;