details:   /erp/devel/pi/rev/ff10593fc411
changeset: 11385:ff10593fc411
user:      Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
date:      Mon Mar 28 18:38:46 2011 +0200
summary:   [OBUIAPP] Several fixes on Alert Management window.

Fixed alert counter on section header.
Fixed alert status translations.
Fixed refresh button of toolbar.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js
            |  12 ++--
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js
 |  23 ++++++---
 2 files changed, 20 insertions(+), 15 deletions(-)

diffs (139 lines):

diff -r d175cba664f5 -r ff10593fc411 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js
        Mon Mar 28 18:13:13 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js
        Mon Mar 28 18:38:46 2011 +0200
@@ -132,17 +132,17 @@
   getGridTotalRows: function(){
     var criteria = this.getCriteria() || {}, requestProperties = {};
 
-    if (this.isGridFiltered(criteria) || 
!OB.AlertManagement.sections[this.alertStatus].expanded) {
+    if (!OB.AlertManagement.sections[this.alertStatus].expanded) {
       // fetch to the datasource with an empty criteria to get all the rows
       requestProperties.params = requestProperties.params || {};
       requestProperties.params[OB.Constants.WHERE_PARAMETER] = 
this.getFilterClause();
       requestProperties.clientContext = {alertStatus: this.alertStatus};
-      this.dataSource.fetchData({}, function(dsResponse, data, dsRequest){
+      this.dataSource.fetchData(criteria, function(dsResponse, data, 
dsRequest){
           OB.AlertManagement.setTotalRows(dsResponse.totalRows, 
dsResponse.clientContext.alertStatus);
         }, requestProperties );
 
     } else {
-      OB.AlertManagement.setTotalRows(this.data.totalRows, this.alertStatus);
+      OB.AlertManagement.setTotalRows(this.getTotalRows(), this.alertStatus);
     }
   },
   
@@ -240,7 +240,7 @@
     var grid = this;
     if (grid.alertStatus === 'Acknowledged' || grid.alertStatus === 
'Suppressed') {
       menuItems.add({
-        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', ['New']),
+        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', 
[OB.AlertManagement.translatedStatus.New]),
         click: function(){
           OB.AlertManagement.moveToStatus(record.id, grid.alertStatus, 'New');
         }
@@ -248,7 +248,7 @@
     }
     if (grid.alertStatus === 'New' || grid.alertStatus === 'Suppressed') {
       menuItems.add({
-        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', ['Acknowledged']),
+        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', 
[OB.AlertManagement.translatedStatus.Acknowledged]),
         click: function(){
           OB.AlertManagement.moveToStatus(record.id, grid.alertStatus, 
'Acknowledged');
         }
@@ -256,7 +256,7 @@
     }
     if (grid.alertStatus === 'New' || grid.alertStatus === 'Acknowledged') {
       menuItems.add({
-        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', ['Suppressed']),
+        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', 
[OB.AlertManagement.translatedStatus.Suppressed]),
         click: function(){
           OB.AlertManagement.moveToStatus(record.id, grid.alertStatus, 
'Suppressed');
         }
diff -r d175cba664f5 -r ff10593fc411 
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
     Mon Mar 28 18:13:13 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js
     Mon Mar 28 18:38:46 2011 +0200
@@ -29,6 +29,7 @@
     return result;
   },
   
+  translatedStatus: { New: '', Acknowledged: '', Suppressed: '', Solved: ''},
   sectionStack: null,
   grids: {},
   sections: {},
@@ -43,6 +44,10 @@
   
   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');
     
     this.addMember(isc.OBToolbar.create({
         view: this,
@@ -75,7 +80,7 @@
     this.NewAcknowledged = 
isc.OBAlertSectionStackControl.create({currentStatus: 'New', newStatus: 
'Acknowledged', ID:'NewAcknowledged'});
     this.NewSuppressed = isc.OBAlertSectionStackControl.create({currentStatus: 
'New', newStatus: 'Suppressed', ID:'NewSuppressed'});
     this.sections.New = {
-        title: OB.I18N.getLabel('AlertStatus_New'),
+        title: this.translatedStatus.New,
         alertStatus: 'New',
         expanded: true,
         items: [this.grids.New],
@@ -86,7 +91,7 @@
     this.AcknowledgedNew = 
isc.OBAlertSectionStackControl.create({currentStatus: 'Acknowledged', 
newStatus: 'New', ID:'AcknowledgedNew'});
     this.AcknowledgedSuppressed = 
isc.OBAlertSectionStackControl.create({currentStatus: 'Acknowledged', 
newStatus: 'Suppressed', ID:'AcknowledgedSuppressed'});
     this.sections.Acknowledged = {
-        title: OB.I18N.getLabel('AlertStatus_Acknowledged'),
+        title: this.translatedStatus.Acknowledged,
         alertStatus: 'Acknowledged',
         expanded: false,
         items: [this.grids.Acknowledged],
@@ -97,7 +102,7 @@
     this.SuppressedNew = isc.OBAlertSectionStackControl.create({currentStatus: 
'Suppressed', newStatus: 'New', ID:'SuppressedNew'});
     this.SuppressedAcknowledged = 
isc.OBAlertSectionStackControl.create({currentStatus: 'Suppressed', newStatus: 
'Acknowledged', ID:'SuppressedAcknowledged'});
     this.sections.Suppressed = {
-        title: OB.I18N.getLabel('AlertStatus_Suppressed'),
+        title: this.translatedStatus.Suppressed,
         alertStatus: 'Suppressed',
         expanded: false,
         items: [this.grids.Suppressed],
@@ -106,7 +111,7 @@
 
     this.grids.Solved = isc.OBAlertGrid.create({alertStatus: 'Solved'});
     this.sections.Solved = {
-        title: OB.I18N.getLabel('AlertStatus_Solved'), alertStatus: 'Solved', 
expanded: false, items: [this.grids.Solved] };
+        title: this.translatedStatus.Solved, alertStatus: 'Solved', expanded: 
false, items: [this.grids.Solved] };
     this.sectionStack.addSection(this.sections.Solved);
   },
   
@@ -131,16 +136,16 @@
   setTotalRows: function(totalRows, status) {
     if (OB.AlertManagement.sections[status]) {
       OB.AlertManagement.sections[status].getSectionHeader()
-          .setTitle(OB.I18N.getLabel('OBUIAPP_AlertSectionHeader', [status, 
totalRows]));
+          .setTitle(OB.I18N.getLabel('OBUIAPP_AlertSectionHeader', 
[OB.AlertManagement.translatedStatus[status], totalRows]));
     }
   },
   
   refresh: function() {
     var i, alertStatus = ['New', 'Acknowledged', 'Suppressed', 'Solved'];
     for (i = 0; i < 4; i++) {
-      OB.AlertManagement.grids.alertStatus[i].invalidateCache();
-      if (!OB.AlertManagement.sections.alertStatus[i].expanded) {
-        OB.AlertManagement.grids.alertStatus[i].getGridTotalRows();
+      OB.AlertManagement.grids[alertStatus[i]].invalidateCache();
+      if (!OB.AlertManagement.sections[alertStatus[i]].expanded) {
+        OB.AlertManagement.grids[alertStatus[i]].getGridTotalRows();
       }
     }
   }
@@ -152,7 +157,7 @@
   currentStatus: null,
   
   initWidget: function () {
-    this.setContents(OB.I18N.getLabel('OBUIAPP_MoveSelectedToStatus', 
[this.newStatus]));
+    this.setContents(OB.I18N.getLabel('OBUIAPP_MoveSelectedToStatus', 
[OB.AlertManagement.translatedStatus[this.newStatus]]));
     this.Super('initWidget', arguments);
   },
   

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and publish 
your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to