Related to Issue 23925 : Jslint changes
authorShankar Balachandran <shankar.balachandran@openbravo.com>
Thu, 30 May 2013 18:06:34 +0530
changeset 20501 e6e46782e850
parent 20500 7331622675df
child 20502 1693de72b307
Related to Issue 23925 : Jslint changes

added condition to ignore regex criteria while setting symbol and made modifications in code for jslint compliance
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js	Thu May 30 13:35:27 2013 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js	Thu May 30 18:06:34 2013 +0530
@@ -274,15 +274,18 @@
     if (criteria && criteria.length && criterion.operator === 'or') {
       for (i = 0; i < criteria.length; i++) {
         operators = isc.DataSource.getSearchOperators();
-        if (criteria[i].operator !== "iContains" && criteria[i].operator !== "contains") {
+        //handles case where column filter symbols are removed. Refer Issue https://issues.openbravo.com/view.php?id=23925
+        if (criteria[i].operator !== "iContains" && criteria[i].operator !== "contains" && criteria[i].operator !== "regexp") {
           for (operator in operators) {
-            if (operators[operator].ID === criteria[i].operator && operators[operator].symbol && criteria[i].value && criteria[i].value.indexOf(operators[operator].symbol) === -1) {
-              values.push(operators[operator].symbol + criteria[i].value);
-              valueSet = true;
+            if (operators.hasOwnProperty(operator)) {
+              if (operators[operator].ID === criteria[i].operator && operators[operator].symbol && criteria[i].value && criteria[i].value.indexOf(operators[operator].symbol) === -1) {
+                values.push(operators[operator].symbol + criteria[i].value);
+                valueSet = true;
+              }
             }
           }
         }
-        if (valueSet == false) {
+        if (valueSet === false) {
           values.push(criteria[i].value);
         }
         valueSet = false;