details:   https://code.openbravo.com/erp/devel/pi/rev/8608083895a6
changeset: 13638:8608083895a6
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Wed Aug 31 20:54:22 2011 +0200
summary:   Fixes issue 18381: Forms personalization does not persist 
personalized layout
Store personalization on window class level and update when the user changes 
the layout

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
             |   3 +
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form.js
 |  19 ++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diffs (70 lines):

diff -r 144538d99c98 -r 8608083895a6 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
       Wed Aug 31 20:06:35 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
       Wed Aug 31 20:54:22 2011 +0200
@@ -89,6 +89,8 @@
     // method is also called explicitly from the personalization window
     if (!this.getClass().windowSettingsRead) {
       this.readWindowSettings();
+    } else if (this.getClass().personalization) {
+      OB.Personalization.personalizeWindow(this.getClass().personalization, 
this);
     }
   },
   
@@ -114,6 +116,7 @@
     if (this.getClass().windowSettingsRead) {
       return;
     }
+    this.getClass().personalization = data.personalization;
     this.getClass().windowSettingsRead = true;
     this.getClass().uiPattern = data.uiPattern;
     this.getClass().autoSave = data.autoSave;
diff -r 144538d99c98 -r 8608083895a6 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form.js
   Wed Aug 31 20:06:35 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form.js
   Wed Aug 31 20:54:22 2011 +0200
@@ -590,6 +590,8 @@
         
'org.openbravo.client.application.personalization.PersonalizationActionHandler',
 
         this.getPersonalizationFields(), params,
         function(resp, data, req){
+          var personalization;
+          
           // if there is no personalization data then create it
           if (!me.personalizationData) {
             me.personalizationData = {};
@@ -621,6 +623,12 @@
           if (callback) {
             callback();
           }
+          
+          // update the information in the global class
+          // so that the settings are maintained when the window
+          // is re-opened
+          personalization = me.getStandardWindow().getClass().personalization;
+          personalization[me.tabId] = me.personalizationData;          
         });
   },
 
@@ -656,6 +664,9 @@
           me.hasBeenDeleted = true;
           // close when returned
           me.doClose(true);
+          
+          personalization = me.getStandardWindow().getClass().personalization;
+          personalization[me.tabId] = null;          
         }
      );
   },
@@ -925,6 +936,14 @@
     }
   },
   
+  getStandardWindow: function() {
+    if (this.openedFromMaintenanceWindow) {
+      return this.maintenanceView.standardWindow;
+    } else {
+      return this.form.view.standardWindow;
+    }
+  },
+  
   // close the form personalizer, refresh the existing form so that 
   // the changes are shown immediately, or if called from the 
   // maintenance window refresh the record there

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to