Reformatted, changed save+close logic
authorMartin Taal <martin.taal@openbravo.com>
Tue, 08 Mar 2011 15:25:13 +0100
changeset 11097 5e3b48c5dec6
parent 11096 9af9632e9a14
child 11098 44a28572b42c
Reformatted, changed save+close logic
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js	Tue Mar 08 15:24:37 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js	Tue Mar 08 15:25:13 2011 +0100
@@ -26,7 +26,7 @@
   TYPE_UNDO: 'undo',
   TYPE_REFRESH: 'refresh',
   TYPE_EXPORT: 'export',
-
+  
   SAVE_BUTTON_PROPERTIES: {
     action: function(){
       this.view.saveRow();
@@ -34,17 +34,21 @@
     disabled: true,
     buttonType: 'save',
     prompt: OB.I18N.getLabel('OBUIAPP_SaveRow'),
-    updateState: function() {
-      var view = this.view, form = view.viewForm, hasErrors = false, editRow;      
+    updateState: function(){
+      var view = this.view, form = view.viewForm, hasErrors = false, editRow;
       if (view.isShowingForm) {
-        this.setDisabled(!form.isNew && (form.isSaving || form.readOnly || 
-              !view.hasValidState() || !form.hasChanged));
+        this.setDisabled(!form.isNew &&
+        (form.isSaving || form.readOnly ||
+        !view.hasValidState() ||
+        !form.hasChanged));
       } else if (view.isEditingGrid) {
-          form = view.viewGrid.getEditForm();
-          editRow = view.viewGrid.getEditRow();
-          hasErrors = view.viewGrid.rowHasErrors(editRow);
-          this.setDisabled(!form.isNew && !hasErrors && (form.isSaving || form.readOnly || 
-                !view.hasValidState() || !form.hasChanged));
+        form = view.viewGrid.getEditForm();
+        editRow = view.viewGrid.getEditRow();
+        hasErrors = view.viewGrid.rowHasErrors(editRow);
+        this.setDisabled(!form.isNew && !hasErrors &&
+        (form.isSaving || form.readOnly ||
+        !view.hasValidState() ||
+        !form.hasChanged));
       } else {
         this.setDisabled(true);
       }
@@ -53,23 +57,34 @@
   },
   SAVECLOSE_BUTTON_PROPERTIES: {
     action: function(){
-      // force autosave
-      this.view.standardWindow.setDirtyEditForm(this.view.viewForm);
-      this.view.statusBar.closeButton.action();
+      var actionObject = {
+        target: this,
+        method: this.saveAndClose,
+        parameters: []
+      };
+      this.view.standardWindow.doActionAfterAutoSave(actionObject, true);      
     },
+    
+    saveAndClose: function(){
+      this.view.switchFormGridVisibility();
+      this.view.messageBar.hide();
+    },
+    
     buttonType: 'savecloseX',
     prompt: OB.I18N.getLabel('OBUIAPP_CLOSEBUTTON'),
-    updateState: function() {
-      var view = this.view, form = view.viewForm;      
+    updateState: function(){
+      var view = this.view, form = view.viewForm;
       if (view.isShowingForm) {
         this.setDisabled(false);
-        var saveDisabled = (!form.isNew && (form.isSaving || form.readOnly || 
-              !view.hasValidState() || !form.hasChanged));
+        var saveDisabled = (!form.isNew &&
+        (form.isSaving || form.readOnly ||
+        !view.hasValidState() ||
+        !form.hasChanged));
         if (saveDisabled) {
           this.buttonType = 'savecloseX';
           this.prompt = OB.I18N.getLabel('OBUIAPP_CLOSEBUTTON');
         } else {
-          this.buttonType = 'saveclose';          
+          this.buttonType = 'saveclose';
           this.prompt = OB.I18N.getLabel('OBUIAPP_SaveClose');
         }
       } else {
@@ -85,7 +100,7 @@
     },
     buttonType: 'newRow',
     prompt: OB.I18N.getLabel('OBUIAPP_NewRow'),
-    updateState: function() {
+    updateState: function(){
       var view = this.view;
       this.setDisabled(view.isShowingForm || view.readOnly || view.singleRecord || !view.hasValidState());
     },
@@ -97,7 +112,7 @@
     },
     buttonType: 'newDoc',
     prompt: OB.I18N.getLabel('OBUIAPP_NewDoc'),
-    updateState: function() {
+    updateState: function(){
       var view = this.view, form = view.viewForm;
       if (view.isShowingForm) {
         this.setDisabled(form.isSaving || view.readOnly || view.singleRecord || !view.hasValidState());
@@ -114,24 +129,26 @@
     disabled: true,
     buttonType: 'eliminate',
     prompt: OB.I18N.getLabel('OBUIAPP_DeleteRow'),
-    updateState: function() {
-      var view = this.view, form = view.viewForm, grid = view.viewGrid, selectedRecords=grid.getSelectedRecords();
-      for (var i = 0; i < selectedRecords.length; i++){
-        if(!grid.isWritable(selectedRecords[i])) {
+    updateState: function(){
+      var view = this.view, form = view.viewForm, grid = view.viewGrid, selectedRecords = grid.getSelectedRecords();
+      for (var i = 0; i < selectedRecords.length; i++) {
+        if (!grid.isWritable(selectedRecords[i])) {
           this.setDisabled(true);
           return;
         }
-        if(selectedRecords[i]._new) {
+        if (selectedRecords[i]._new) {
           this.setDisabled(true);
           return;
         }
       }
       if (view.isShowingForm) {
-        this.setDisabled(form.isSaving || form.readOnly || view.singleRecord || 
-            !view.hasValidState() || form.isNew);
+        this.setDisabled(form.isSaving || form.readOnly || view.singleRecord ||
+        !view.hasValidState() ||
+        form.isNew);
       } else {
-        this.setDisabled(view.readOnly || view.singleRecord || !view.hasValidState() || 
-            !grid.getSelectedRecords() || grid.getSelectedRecords().length === 0);
+        this.setDisabled(view.readOnly || view.singleRecord || !view.hasValidState() ||
+        !grid.getSelectedRecords() ||
+        grid.getSelectedRecords().length === 0);
       }
     },
     keyboardShortcutId: 'ToolBar_Eliminate'
@@ -143,7 +160,7 @@
     disabled: false,
     buttonType: 'refresh',
     prompt: OB.I18N.getLabel('OBUIAPP_RefreshData'),
-    updateState: function() {
+    updateState: function(){
       var view = this.view, form = view.viewForm;
       if (view.isShowingForm) {
         this.setDisabled(form.isSaving || form.isNew || !view.hasValidState());
@@ -160,24 +177,26 @@
     disabled: true,
     buttonType: 'undo',
     prompt: OB.I18N.getLabel('OBUIAPP_Undo'),
-    updateState: function() {
+    updateState: function(){
       var view = this.view, form = view.viewForm, grid = view.viewGrid, hasErrors = false, editRow;
       if (view.isShowingForm) {
-        this.setDisabled(form.isSaving || form.readOnly || !view.hasValidState() || 
-            !form.hasChanged);
+        this.setDisabled(form.isSaving || form.readOnly || !view.hasValidState() ||
+        !form.hasChanged);
       } else if (view.isEditingGrid) {
         editRow = view.viewGrid.getEditRow();
         hasErrors = view.viewGrid.rowHasErrors(editRow);
         form = grid.getEditForm();
-        this.setDisabled(!form.isNew && !hasErrors && (form.isSaving || form.readOnly || 
-              !view.hasValidState() || !form.hasChanged));
+        this.setDisabled(!form.isNew && !hasErrors &&
+        (form.isSaving || form.readOnly ||
+        !view.hasValidState() ||
+        !form.hasChanged));
       } else {
         var selectedRecords = grid.getSelectedRecords(), allRowsHaveErrors = true;
-        for (var i = 0; i < selectedRecords.length; i++){
+        for (var i = 0; i < selectedRecords.length; i++) {
           var rowNum = grid.getRecordIndex(selectedRecords[i]);
           allRowsHaveErrors = allRowsHaveErrors && grid.rowHasErrors(rowNum);
         }
-        this.setDisabled(selectedRecords.length === 0 || !allRowsHaveErrors); 
+        this.setDisabled(selectedRecords.length === 0 || !allRowsHaveErrors);
       }
     },
     keyboardShortcutId: 'ToolBar_Undo'
@@ -185,39 +204,39 @@
   EXPORT_BUTTON_PROPERTIES: {
     action: function(){
       var requestProperties = {
-              exportAs: 'csv',
-              exportDisplay: 'download',
-              params: {
-                exportToFile: true
-              }
-            };
+        exportAs: 'csv',
+        exportDisplay: 'download',
+        params: {
+          exportToFile: true
+        }
+      };
       requestProperties.viewState = this.view.viewGrid.getViewState();
       this.view.viewGrid.exportData(requestProperties);
     },
     disabled: false,
     buttonType: 'export',
     prompt: OB.I18N.getLabel('OBUIAPP_ExportGrid'),
-    updateState: function() {
+    updateState: function(){
       this.setDisabled(this.view.isShowingForm);
     },
-  keyboardShortcutId: 'ToolBar_Export'
+    keyboardShortcutId: 'ToolBar_Export'
   },
   // This offers a mechanism to add properties at runtime to buttons created through
   // templates and java
   BUTTON_PROPERTIES: {
-    'audit' : {
+    'audit': {
       updateState: function(){
         var view = this.view, form = view.viewForm, grid = view.viewGrid;
         var selectedRecords = grid.getSelectedRecords();
         var disabled = false;
         if (selectedRecords && selectedRecords.length > 1) {
-            disabled = true;
+          disabled = true;
         } else if (view.isShowingForm && form.isNew) {
           disabled = true;
         } else if (view.isEditingGrid && grid.getEditForm().isNew) {
           disabled = true;
-        } else if (selectedRecords && selectedRecords.length > 0 && selectedRecords[0].updated && selectedRecords[0].creationDate && selectedRecords[0].updated.getTime() === selectedRecords[0].creationDate.getTime()){
-          disabled = true;          
+        } else if (selectedRecords && selectedRecords.length > 0 && selectedRecords[0].updated && selectedRecords[0].creationDate && selectedRecords[0].updated.getTime() === selectedRecords[0].creationDate.getTime()) {
+          disabled = true;
         }
         this.setDisabled(disabled);
       }
@@ -233,14 +252,11 @@
   randomId: null,
   initWidget: function(){
     this.Super('initWidget', arguments);
-    function getRandomId() {
-      var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz',
-          stringLength = 8,
-          randomString = '',
-          i, rnum;
+    function getRandomId(){
+      var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz', stringLength = 8, randomString = '', i, rnum;
       for (i = 0; i < stringLength; i++) {
         rnum = Math.floor(Math.random() * chars.length);
-        randomString += chars.substring(rnum,rnum+1);
+        randomString += chars.substring(rnum, rnum + 1);
       }
       return randomString;
     }
@@ -318,7 +334,7 @@
   // 
   // NOTE: new buttons should implement the updateState method.
   //
-  updateButtonState: function(noSetSession) {
+  updateButtonState: function(noSetSession){
     for (i = 0; i < this.leftMembers.length; i++) {
       if (this.leftMembers[i].updateState) {
         this.leftMembers[i].updateState();
@@ -328,7 +344,7 @@
     // and refresh the process toolbar buttons
     this.refreshCustomButtons(noSetSession);
   },
-
+  
   // ** {{{ getLeftMember(member) }}} **
   //
   // It works just for left side members.
@@ -767,12 +783,8 @@
       }
     }
     
-    var buttons = this.getRightMembers(),
-        numOfSelRecords = 0,
-        isNew = this.view.viewForm.isNew,
-        hideAllButtons = typeof(isNew)!=='undefined' && !isNew && 
-                         (!this.view.isShowingForm && (!this.view.viewGrid.getSelectedRecords() || this.view.viewGrid.getSelectedRecords().length !== 1)),
-        currentValues = this.view.getCurrentValues();
+    var buttons = this.getRightMembers(), numOfSelRecords = 0, isNew = this.view.viewForm.isNew, hideAllButtons = typeof(isNew) !== 'undefined' && !isNew &&
+    (!this.view.isShowingForm && (!this.view.viewGrid.getSelectedRecords() || this.view.viewGrid.getSelectedRecords().length !== 1)), currentValues = this.view.getCurrentValues();
     
     if (this.view.viewGrid.getSelectedRecords()) {
       numOfSelRecords = this.view.viewGrid.getSelectedRecords().length;
@@ -782,55 +794,55 @@
       var formView = this.view.viewForm, me = this;
       // Call FIC to obtain possible session attributes and set them in form
       requestParams = {
-          MODE: 'SETSESSION',
-          PARENT_ID: this.view.getParentId(),
-          TAB_ID: this.view.tabId,
-          ROW_ID: currentValues.id
-        };
+        MODE: 'SETSESSION',
+        PARENT_ID: this.view.getParentId(),
+        TAB_ID: this.view.tabId,
+        ROW_ID: currentValues.id
+      };
+      
+      OB.RemoteCallManager.call('org.openbravo.client.application.window.FormInitializationComponent', {}, requestParams, function(response, data, request){
+        var sessionAttributes = data.sessionAttributes, auxInputs = data.auxiliaryInputValues;
+        if (sessionAttributes) {
+          formView.sessionAttributes = sessionAttributes;
+        }
         
-        OB.RemoteCallManager.call('org.openbravo.client.application.window.FormInitializationComponent', {}, requestParams, function(response, data, request){
-         var sessionAttributes = data.sessionAttributes, auxInputs = data.auxiliaryInputValues;
-         if (sessionAttributes) {
-           formView.sessionAttributes = sessionAttributes;
-         }
-         
-         if (auxInputs) {
-           this.auxInputs = {};
-           for (var prop in auxInputs) {
-             if (auxInputs.hasOwnProperty(prop)) {
-               formView.setValue(prop, auxInputs[prop].value);
-               formView.auxInputs[prop] = auxInputs[prop].value;
-             }
-           }
-         }
-         
-         doRefresh(buttons, currentValues, false, me);
-        });
+        if (auxInputs) {
+          this.auxInputs = {};
+          for (var prop in auxInputs) {
+            if (auxInputs.hasOwnProperty(prop)) {
+              formView.setValue(prop, auxInputs[prop].value);
+              formView.auxInputs[prop] = auxInputs[prop].value;
+            }
+          }
+        }
+        
+        doRefresh(buttons, currentValues, false, me);
+      });
     } else {
       currentValues = this.view.getCurrentValues();
       doRefresh(buttons, currentValues, hideAllButtons, this);
-    } 
+    }
   },
-
-  visibilityChanged: function(state) {
+  
+  visibilityChanged: function(state){
     if (state) {
       this.enableShortcuts();
     } else {
       this.disableShortcuts();
     }
   },
-
-  draw: function() {
+  
+  draw: function(){
     this.Super('draw', arguments);
     this.defineRightMembersShortcuts();
     this.enableShortcuts();
   },
-
+  
   rightMembersShortcuts: [],
-
-  defineRightMembersShortcuts: function() {
+  
+  defineRightMembersShortcuts: function(){
     var i, j, k, l, id, character, position;
-    function isAssignedCharacter(character, me) {
+    function isAssignedCharacter(character, me){
       character = character.toString();
       character = character.toUpperCase();
       for (k = 0; k < me.rightMembersShortcuts.length; k++) {
@@ -841,14 +853,13 @@
       return false;
     }
     for (i = 0; i < this.rightMembers.length; i++) {
-      var title = this.rightMembers[i].realTitle,
-          haveToContinue = true;
+      var title = this.rightMembers[i].realTitle, haveToContinue = true;
       this.rightMembersShortcuts[i] = [];
       if (haveToContinue) { // Check if free character and assign
-       haveToContinue = true;
-       for (j = 0; j < title.length; j++) {
-          if (!isAssignedCharacter(title.substring(j,j+1), this)) {
-            this.rightMembersShortcuts[i][0] = title.substring(j,j+1).toUpperCase();
+        haveToContinue = true;
+        for (j = 0; j < title.length; j++) {
+          if (!isAssignedCharacter(title.substring(j, j + 1), this)) {
+            this.rightMembersShortcuts[i][0] = title.substring(j, j + 1).toUpperCase();
             this.rightMembersShortcuts[i][1] = j + 1;
             haveToContinue = false;
             break;
@@ -857,12 +868,12 @@
       }
       if (haveToContinue) { // Check if free number and assign
         haveToContinue = true;
-        for (l = 1; l < 10 ; l++) {
+        for (l = 1; l < 10; l++) {
           if (!isAssignedCharacter(l, this)) {
-             this.rightMembersShortcuts[i][0] = l;
-             this.rightMembersShortcuts[i][1] = 'end';
-             haveToContinue = false;
-             break;
+            this.rightMembersShortcuts[i][0] = l;
+            this.rightMembersShortcuts[i][1] = 'end';
+            haveToContinue = false;
+            break;
           }
         }
       }
@@ -875,8 +886,8 @@
       this.rightMembers[i].keyboardShortcutPosition = this.rightMembersShortcuts[i][1];
     }
   },
-
-  enableShortcuts: function() {
+  
+  enableShortcuts: function(){
     if (this.leftMembers) {
       for (i = 0; i < this.leftMembers.length; i++) {
         if (this.leftMembers[i].enableShortcut) {
@@ -893,8 +904,8 @@
       }
     }
   },
-
-  disableShortcuts: function() {
+  
+  disableShortcuts: function(){
     if (this.leftMembers) {
       for (i = 0; i < this.leftMembers.length; i++) {
         if (this.leftMembers[i].disableShortcut) {
@@ -910,7 +921,7 @@
       }
     }
   },
-
+  
   addMembers: 'null',
   
   leftMembers: [],
@@ -960,9 +971,9 @@
     
     this.setBaseStyle('OBToolbarIconButton_icon_' + this.buttonType + this.customState + extraClass + 'OBToolbarIconButton');
   },
-
+  
   keyboardShortcutId: null,
-  enableShortcut: function() {
+  enableShortcut: function(){
     if (this.keyboardShortcutId) {
       var me = this;
       var ksAction = function(){
@@ -973,9 +984,11 @@
       OB.KeyboardManager.KS.set(this.keyboardShortcutId, ksAction);
     }
   },
-  disableShortcut: function() {
+  disableShortcut: function(){
     if (this.keyboardShortcutId) {
-      OB.KeyboardManager.KS.set(this.keyboardShortcutId, function() { return true; });
+      OB.KeyboardManager.KS.set(this.keyboardShortcutId, function(){
+        return true;
+      });
     }
   }
 });
@@ -994,15 +1007,15 @@
   action: function(){
     alert(this.title);
   },
-  initWidget: function() {
+  initWidget: function(){
     this.Super('initWidget', arguments);
     this.realTitle = this.title;
   },
-
+  
   keyboardShortcutId: null,
   keyboardShortcutCharacter: null,
   keyboardShortcutPosition: null,
-  enableShortcut: function() {
+  enableShortcut: function(){
     if (this.keyboardShortcutId) {
       var me = this;
       var newTitle = this.realTitle;
@@ -1014,19 +1027,31 @@
       if (this.keyboardShortcutPosition === 'end') {
         newTitle = newTitle + ' (<u>' + this.keyboardShortcutCharacter + '</u>)';
       } else {
-        newTitle = newTitle.substring(0, this.keyboardShortcutPosition-1) + '<u>' + newTitle.substring(this.keyboardShortcutPosition-1, this.keyboardShortcutPosition) + '</u>' + newTitle.substring(this.keyboardShortcutPosition, newTitle.length);
+        newTitle = newTitle.substring(0, this.keyboardShortcutPosition - 1) + '<u>' + newTitle.substring(this.keyboardShortcutPosition - 1, this.keyboardShortcutPosition) + '</u>' + newTitle.substring(this.keyboardShortcutPosition, newTitle.length);
       }
       this.setTitle(newTitle);
       if (this.keyboardShortcutPosition) { // If 'this.keyboardShortcutPosition' equals 0 means that there is no shortcut assigned
-        OB.KeyboardManager.KS.set(this.keyboardShortcutId, ksAction, null, {'ctrl': true, 'alt': true, 'shift': true, 'key': this.keyboardShortcutCharacter});
+        OB.KeyboardManager.KS.set(this.keyboardShortcutId, ksAction, null, {
+          'ctrl': true,
+          'alt': true,
+          'shift': true,
+          'key': this.keyboardShortcutCharacter
+        });
       }
     }
   },
-  disableShortcut: function() {
+  disableShortcut: function(){
     if (this.keyboardShortcutId) {
       var newTitle = this.realTitle;
       this.setTitle(newTitle);
-      OB.KeyboardManager.KS.set(this.keyboardShortcutId, function() { return true; }, '', {'ctrl': true, 'alt': true, 'shift': true, 'key': 'xyz'});
+      OB.KeyboardManager.KS.set(this.keyboardShortcutId, function(){
+        return true;
+      }, '', {
+        'ctrl': true,
+        'alt': true,
+        'shift': true,
+        'key': 'xyz'
+      });
     }
   }
 });
@@ -1041,45 +1066,43 @@
     return;
   }
   
-  var popupParams = 'Command=DEFAULT', 
-      allProperties = view.getContextInfo(false, true),
-      sessionProperties = view.getContextInfo(true, true);
-
+  var popupParams = 'Command=DEFAULT', allProperties = view.getContextInfo(false, true), sessionProperties = view.getContextInfo(true, true);
+  
   for (var param in allProperties) {
     if (allProperties.hasOwnProperty(param)) {
       var value = allProperties[param];
       
       if (typeof value === 'boolean') {
-        value = value?'Y':'N';
+        value = value ? 'Y' : 'N';
       }
       
       popupParams += '&' + param + '=' + value;
     }
   }
   
-  popupParams += '&inppdfpath='+url;
-  popupParams += '&inphiddenkey='+view.standardProperties.inpKeyName;
-  popupParams += '&inpdirectprint='+(directPrint?'Y':'N');
+  popupParams += '&inppdfpath=' + url;
+  popupParams += '&inphiddenkey=' + view.standardProperties.inpKeyName;
+  popupParams += '&inpdirectprint=' + (directPrint ? 'Y' : 'N');
   
   var selectedIds = '';
-  for (var i = 0; i < selectedRecords.length; i++){
-    selectedIds += (i > 0?',':'') + selectedRecords[i].id;
+  for (var i = 0; i < selectedRecords.length; i++) {
+    selectedIds += (i > 0 ? ',' : '') + selectedRecords[i].id;
   }
   
-  popupParams += '&inphiddenvalue='+selectedIds;
+  popupParams += '&inphiddenvalue=' + selectedIds;
   
-  view.setContextInfo(sessionProperties, function() {
-    OB.Layout.ClassicOBCompatibility.Popup.open('print', 0, 0, OB.Application.contextUrl + '/businessUtility/PrinterReports.html?'+popupParams, '', window, false, false, true);
+  view.setContextInfo(sessionProperties, function(){
+    OB.Layout.ClassicOBCompatibility.Popup.open('print', 0, 0, OB.Application.contextUrl + '/businessUtility/PrinterReports.html?' + popupParams, '', window, false, false, true);
   });
 };
 
 OB.ToolbarUtils.showAuditTrail = function(view){
   var selectedRecords = view.viewGrid.getSelectedRecords();
-
+  
   if (selectedRecords.length > 1) {
     var setWarning = {
       set: function(label){
-      view.messageBar.setMessage(OBMessageBar.TYPE_WARNING, '', label);
+        view.messageBar.setMessage(OBMessageBar.TYPE_WARNING, '', label);
       }
     };
     OB.I18N.getLabel('JS28', null, setWarning, 'set');
@@ -1094,7 +1117,7 @@
     popupParams += '&inpRecordId=' + view.viewGrid.getSelectedRecord().id;
   }
   
-  OB.Layout.ClassicOBCompatibility.Popup.open('audit', 900, 600, OB.Application.contextUrl + '/businessUtility/AuditTrail.html?'+popupParams, '', window, false, false, true);
+  OB.Layout.ClassicOBCompatibility.Popup.open('audit', 900, 600, OB.Application.contextUrl + '/businessUtility/AuditTrail.html?' + popupParams, '', window, false, false, true);
 };
 
 OB.ToolbarUtils.showTree = function(view){
@@ -1103,5 +1126,5 @@
   popupParams += '&Command=DEFAULT';
   popupParams += '&inpTabId=' + view.tabId;
   popupParams += '&hideMenu=true&noprefs=true';
-  OB.Layout.ClassicOBCompatibility.Popup.open('tree', 750, 625, OB.Application.contextUrl + '/security/Menu.html?'+popupParams, '', window, false, false, true);
+  OB.Layout.ClassicOBCompatibility.Popup.open('tree', 750, 625, OB.Application.contextUrl + '/security/Menu.html?' + popupParams, '', window, false, false, true);
 };