fixed bug 15724: Show filter funnel in filter icon in grid mode just after using it
authorAsier Lostalé <asier.lostale@openbravo.com>
Thu, 03 Mar 2011 12:59:35 +0100
changeset 10988 29010d7cd197
parent 10987 5aa83dba6969
child 10989 84fe58138b00
fixed bug 15724: Show filter funnel in filter icon in grid mode just after using it
src-wad/src/org/openbravo/wad/controls/WADGrid.java
src/org/openbravo/erpCommon/security/Login_F1.html
web/js/utils.js
--- a/src-wad/src/org/openbravo/wad/controls/WADGrid.java	Thu Mar 03 12:43:33 2011 +0100
+++ b/src-wad/src/org/openbravo/wad/controls/WADGrid.java	Thu Mar 03 12:59:35 2011 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2008 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2011 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -98,11 +98,15 @@
     addJSCode("onGridLoadDo", text.toString());
 
     text = new StringBuffer();
-    text.append("function setGridFilters(newparams) {\n" + "  var params = [];\n"
-        + "  params[\"newFilter\"] = \"1\";\n" + "  if (newparams!=null && newparams.length>0) {\n"
+    text.append("function setGridFilters(newparams) {\n"
+        + "  var params = [], hasFilter = false;\n" + "  params[\"newFilter\"] = \"1\";\n"
+        + "  if (newparams!=null && newparams.length>0) {\n"
         + "    var total = newparams.length;\n" + "    for (var i=0;i<total;i++) {\n"
-        + "      params[newparams[i][0]] = newparams[i][1];\n" + "    }\n" + "  }\n");
+        + "      params[newparams[i][0]] = newparams[i][1];\n"
+        + "      hasFilter = hasFilter || (newparams[i][1] !== '' && newparams[i][1] !== '%');\n"
+        + "    }\n" + "  }\n");
     text.append("  dijit.byId('").append(getData("id")).append("').setRequestParams(params);\n");
+    text.append("  changeSearchIcon(hasFilter);\n");
     text.append("  return true;\n");
     text.append('}');
     addJSCode("setGridFilters", text.toString());
--- a/src/org/openbravo/erpCommon/security/Login_F1.html	Thu Mar 03 12:43:33 2011 +0100
+++ b/src/org/openbravo/erpCommon/security/Login_F1.html	Thu Mar 03 12:59:35 2011 +0100
@@ -126,7 +126,7 @@
       clearForm();
     } catch (e) {}
     setWindowElementFocus('firstElement');
-    if ((!revisionControl('10926')) || (isOpsInstance() != isOpsInstanceCached())) {
+    if ((!revisionControl('10984')) || (isOpsInstance() != isOpsInstanceCached())) {
       alert(cacheMsg);
     }
 
--- a/web/js/utils.js	Thu Mar 03 12:43:33 2011 +0100
+++ b/web/js/utils.js	Thu Mar 03 12:59:35 2011 +0100
@@ -95,7 +95,7 @@
 * Return a number that would be checked at the Login screen to know if the file is cached with the correct version
 */
 function getCurrentRevision() {
-  var number = '10926';
+  var number = '10984';
   return number;
 }
 
@@ -4590,6 +4590,14 @@
     setTimeout("getDataBaseStandardMessage('showAudit', changeAuditIconTitle)",100);
 }
 
+function changeSearchIcon(filtered){
+  var obj = document.getElementById("buttonSearch") || document.getElementById("buttonSearchFiltered") ;
+  if (!obj) {
+    return false;
+  }
+  obj.className = "Main_ToolBar_Button_Icon Main_ToolBar_Button_Icon_Search"+(filtered?"Filtered":"");
+}
+
  function changeAuditIconTitle(paramXMLParticular, XMLHttpRequestObj) {
    var obj;
    object = document.getElementById("buttonAudit");