fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [16841]


From: nelson . guerra
Subject: [Fmsystem-commits] [16841]
Date: Tue, 6 Jun 2017 11:42:00 -0400 (EDT)

Revision: 16841
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16841
Author:   nelson224
Date:     2017-06-06 11:42:00 -0400 (Tue, 06 Jun 2017)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind-2/property/js/portico/report.edit.js

Modified: branches/dev-syncromind-2/property/js/portico/report.edit.js
===================================================================
--- branches/dev-syncromind-2/property/js/portico/report.edit.js        
2017-06-06 15:41:46 UTC (rev 16840)
+++ branches/dev-syncromind-2/property/js/portico/report.edit.js        
2017-06-06 15:42:00 UTC (rev 16841)
@@ -245,13 +245,24 @@
        var order = "";
        var field = "";
        var operator = "";
-
+       var text = "";
+       var conector = "";
+       
+       var values = {};
+       values['cbo_restricted_value'] = {};
+       values['cbo_operator'] = {};
+       values['txt_value1'] = {};
+       values['cbo_conector'] = {};
+               
+       var length = 0;
        $('.criteria').each(function() 
        {
                order = $(this).val();
                field = $("#cbo_restricted_value_" + order).val();
                operator = $("#cbo_operator_" + order).val();
-
+               text = $("#txt_value1_" + order).val();
+               conector = $("#cbo_conector_" + order).val();
+               
                if (field == "")
                {
                        return true;
@@ -261,8 +272,6 @@
                {
                        result = false;
                        alert(lang['select_operator'] + ' ' + field);
-                       $("#cbo_operator_" + order).focus();
-
                        return false;
                }
 
@@ -271,15 +280,43 @@
                        case (in_array_object(operator, operators_null)):
                                break;
                        default: 
-                               if ($("#txt_value1_" + order).val() == "")
+                               if (text == "")
                                {
                                        result = false;
                                        alert(lang['enter_value'] + ' ' + 
field);
-                                       $("#txt_value1_" + order).focus();
-                               }
-               }       
+                               } 
+               }
+               
+               if (result)
+               {
+                       values['cbo_restricted_value'][order] = field;
+                       values['cbo_operator'][order] = operator;
+                       values['txt_value1'][order] = text;
+                       values['cbo_conector'][order] = conector;               
+                       length++;
+               }
        });
 
+       if (result == false)
+       {
+               return false;                           
+       }
+               
+       var n = 0;
+       $.each(values.cbo_restricted_value, function(key, value) 
+       {
+               if (n < (length - 1))
+               {
+                       if ($("#cbo_conector_" + key).val() == '')
+                       {
+                               result = false;
+                               alert(lang['select_conector'] + ' ' + 
values.cbo_restricted_value[key]);
+                               return false;                           
+                       }
+               }
+               n++;
+       });
+       
        return result;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]