details:   /erp/devel/pi/rev/ebcc3d5bc6f5
changeset: 11398:ebcc3d5bc6f5
user:      Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
date:      Wed Mar 30 12:29:32 2011 +0200
summary:   [OBUIAPP] Ensure that all needed data is initialized before creating 
the sections.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js
 |  45 ++++++++-
 1 files changed, 37 insertions(+), 8 deletions(-)

diffs (63 lines):

diff -r c5770165866b -r ebcc3d5bc6f5 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js
     Wed Mar 30 10:14:11 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js
     Wed Mar 30 12:29:32 2011 +0200
@@ -44,10 +44,30 @@
   
   initWidget: function(){
     OB.AlertManagement = this;
-    OB.I18N.getLabel('AlertStatus_New', null, this.translatedStatus, 'New');
-    OB.I18N.getLabel('AlertStatus_Acknowledged', null, this.translatedStatus, 
'Acknowledged');
-    OB.I18N.getLabel('AlertStatus_Suppressed', null, this.translatedStatus, 
'Suppressed');
-    OB.I18N.getLabel('AlertStatus_Solved', null, this.translatedStatus, 
'Solved');
+    OB.I18N.getLabel('AlertStatus_New', null, {
+      setTranslatedStatus: function(label) {
+        OB.AlertManagement.translatedStatus.New = label;
+        OB.AlertManagement.checkInitializeStatus();
+      }
+    }, 'setTranslatedStatus');
+    OB.I18N.getLabel('AlertStatus_Acknowledged', null, {
+      setTranslatedStatus: function(label) {
+        OB.AlertManagement.translatedStatus.Acknowledged = label;
+        OB.AlertManagement.checkInitializeStatus();
+      }
+    }, 'setTranslatedStatus');
+    OB.I18N.getLabel('AlertStatus_Suppressed', null, {
+      setTranslatedStatus: function(label) {
+        OB.AlertManagement.translatedStatus.Suppressed = label;
+        OB.AlertManagement.checkInitializeStatus();
+      }
+    }, 'setTranslatedStatus');
+    OB.I18N.getLabel('AlertStatus_Solved', null, {
+      setTranslatedStatus: function(label) {
+        OB.AlertManagement.translatedStatus.Solved = label;
+        OB.AlertManagement.checkInitializeStatus();
+      }
+    }, 'setTranslatedStatus');
     
     this.addMember(isc.OBToolbar.create({
         view: this,
@@ -68,11 +88,20 @@
     
OB.RemoteCallManager.call('org.openbravo.client.application.AlertManagementActionHandler',
         post, {}, function(rpcResponse, data, rpcRequest){
       OB.AlertManagement.alertRules = data.alertRules;
-      // Sections are created after alertRules are created. This is needed to 
be able to filter
-      // properly the grids of the sections.
+      OB.AlertManagement.checkInitializeStatus();
+    });
+  },
+  
+  checkInitializeStatus: function() {
+    if (OB.AlertManagement.translatedStatus.New !== '' &&
+      OB.AlertManagement.translatedStatus.Acknowledged !== '' &&
+      OB.AlertManagement.translatedStatus.Suppressed !== '' &&
+      OB.AlertManagement.translatedStatus.Solved !== '' &&
+      OB.AlertManagement.alertRules !== null) {
+      // Sections are created after alertRules are created and status 
translations are set.
+      // This is needed to be able to filter properly the grids of the 
sections.
       OB.AlertManagement.createSections();
-    });
-
+    }
   },
   
   createSections: function() {

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to