Issue 19728: Format js files org.openbravo.client.application - utilities
authorIván Perdomo <ivan.perdomo@openbravo.com>
Sat, 11 Feb 2012 17:22:32 +0100
changeset 15469 90cd8fb48f1a
parent 15468 9c44288913ac
child 15470 ee3d80bd57c0
Issue 19728: Format js files org.openbravo.client.application - utilities
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-eventhandler.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-external-page.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-history-manager.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-keyboard-manager.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-popup.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-property-store.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-recent-utilities.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-remote-call-manager.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-section-stack.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-test-registry.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-eventhandler.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-eventhandler.js	Sat Feb 11 17:22:32 2012 +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) 2011 Openbravo SLU
+ * All portions are Copyright (C) 2011-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -21,7 +21,7 @@
 // Contains code which is called for page level events. The mouse down event
 // is handled to set the correct active view.
 //
-(function(OB, isc){
+(function (OB, isc) {
 
   if (!OB || !isc) {
     throw {
@@ -29,93 +29,91 @@
       message: 'openbravo and isc objects are required'
     };
   }
-  
-  function EventHandler(){
-  }
-  
+
+  function EventHandler() {}
+
   EventHandler.prototype = {
 
-      mouseDown: function (canvas) {
-        var lastEvent = isc.EventHandler.lastEvent, 
+    mouseDown: function (canvas) {
+      var lastEvent = isc.EventHandler.lastEvent,
           checkName = lastEvent.nativeTarget ? lastEvent.nativeTarget.name : null,
           index = checkName ? checkName.indexOf('_') : -1;
-        // this code assumes that there is a name attribute on the html element
-        // which points to the formitem
-        // happens with compount formitems, such as date
-        // in that case the formitem name consists of the fieldname followed
-        // by the 
-        if (index !== -1) {
-          checkName = checkName.substring(0, index);
-        }
-        
-        // handle a click on a formitem
-        if (isc.isA.DynamicForm(canvas) && checkName) {
-          return this.processEvent(canvas.getField(checkName));
-        } else {
-          return this.processEvent(canvas);
-        }
-      },
-      
-      // at this point target can be a canvas or a formitem
-      processEvent: function(target) {
-        var onClickTarget = null, lastEvent = isc.EventHandler.lastEvent;
-        
-        // handle a special case:
-        // https://issues.openbravo.com/view.php?id=17439
-        // when setting the active view we loose the click
-        if (lastEvent && lastEvent.eventType === 'mouseDown' &&
-            lastEvent.DOMevent && lastEvent.DOMevent.target && lastEvent.DOMevent.target.onclick) {
-          onClickTarget = lastEvent.DOMevent.target;
-        }
-        
-        if (!target) {
+      // this code assumes that there is a name attribute on the html element
+      // which points to the formitem
+      // happens with compount formitems, such as date
+      // in that case the formitem name consists of the fieldname followed
+      // by the 
+      if (index !== -1) {
+        checkName = checkName.substring(0, index);
+      }
+
+      // handle a click on a formitem
+      if (isc.isA.DynamicForm(canvas) && checkName) {
+        return this.processEvent(canvas.getField(checkName));
+      } else {
+        return this.processEvent(canvas);
+      }
+    },
+
+    // at this point target can be a canvas or a formitem
+    processEvent: function (target) {
+      var onClickTarget = null,
+          lastEvent = isc.EventHandler.lastEvent;
+
+      // handle a special case:
+      // https://issues.openbravo.com/view.php?id=17439
+      // when setting the active view we loose the click
+      if (lastEvent && lastEvent.eventType === 'mouseDown' && lastEvent.DOMevent && lastEvent.DOMevent.target && lastEvent.DOMevent.target.onclick) {
+        onClickTarget = lastEvent.DOMevent.target;
+      }
+
+      if (!target) {
+        return true;
+      }
+      if (target.pane && target.pane.setAsActiveView) {
+        target.pane.setAsActiveView();
+        return true;
+      }
+
+      // when clicking in the tabbar
+      if (target.tabSet && target.tabSet.getSelectedTab() && target.tabSet.getSelectedTab().pane && target.tabSet.getSelectedTab().pane.setAsActiveView) {
+        target.tabSet.getSelectedTab().pane.setAsActiveView();
+        return true;
+      }
+
+      do {
+        if (target.view && target.view.setAsActiveView && target.view.isVisible()) {
+          // don't do this if already activec
+          if (target.view.isActiveView()) {
+            onClickTarget = null;
+          }
+          target.view.setAsActiveView();
+          if (onClickTarget) {
+            onClickTarget.onclick();
+          }
           return true;
         }
-        if (target.pane && target.pane.setAsActiveView) {
-          target.pane.setAsActiveView();
-          return true;
-        }
-        
-        // when clicking in the tabbar
-        if (target.tabSet && target.tabSet.getSelectedTab() && target.tabSet.getSelectedTab().pane 
-            && target.tabSet.getSelectedTab().pane.setAsActiveView) {
-          target.tabSet.getSelectedTab().pane.setAsActiveView();
-          return true;
-        }
-        
-        do {
-          if (target.view && target.view.setAsActiveView && target.view.isVisible()) {
-            // don't do this if already activec
-            if (target.view.isActiveView()) {
-              onClickTarget = null;
-            }
-            target.view.setAsActiveView();
-            if (onClickTarget) {
-              onClickTarget.onclick();
-            }
+        // a direct click in a form item
+        if (isc.isA.FormItem(target)) {
+          var view = OB.Utilities.determineViewOfFormItem(target);
+          if (view && view.setAsActiveView) {
+            view.lastFocusedItem = target;
+            view.setAsActiveView();
             return true;
           }
-          // a direct click in a form item
-          if (isc.isA.FormItem(target)) {
-            var view = OB.Utilities.determineViewOfFormItem(target);
-            if (view && view.setAsActiveView) {
-              view.lastFocusedItem = target;
-              view.setAsActiveView();
-              return true;
-            }
-          }
-          if (target.mouseDownCancelParentPropagation) { // Added to be able to scroll the toolbar without focusing top level view
-            target = null;
-          } else if (!target.parentElement && target.grid) {
-            target = target.grid;
-          } else {
-            target = target.parentElement;
-          }
-        } while (target);
-        return true;
-      }
+        }
+        if (target.mouseDownCancelParentPropagation) { // Added to be able to scroll the toolbar without focusing top level view
+          target = null;
+        } else if (!target.parentElement && target.grid) {
+          target = target.grid;
+        } else {
+          target = target.parentElement;
+        }
+      } while (target);
+      return true;
+    }
   };
-  
+
   OB.EventHandler = new EventHandler();
   isc.Page.setEvent(isc.EH.MOUSE_DOWN, OB.EventHandler, null, 'mouseDown');
-}(OB, isc));
+}(OB, isc));
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-external-page.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-external-page.js	Sat Feb 11 17:22:32 2012 +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) 2010 Openbravo SLU
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -21,32 +21,30 @@
 //
 // A view which displays an external url inside a tab of the main layout.
 //
-isc.defineClass('OBExternalPage', isc.HTMLFlow).addProperties( {
-  showsItself : false,
-  contentsType : 'page',
-  showEdges : false,
-  styleName : 'obClassicWindow',
-  padding : 0,
-  margin : 0,
-  height : '100%',
-  width : '100%'
+isc.defineClass('OBExternalPage', isc.HTMLFlow).addProperties({
+  showsItself: false,
+  contentsType: 'page',
+  showEdges: false,
+  styleName: 'obClassicWindow',
+  padding: 0,
+  margin: 0,
+  height: '100%',
+  width: '100%'
 });
 
 // get the label and set it in the class
 OB.I18N.getLabel('OBUIAPP_Loading', null, isc.OBExternalPage, 'loadingMessage');
 
-isc.OBExternalPage
-    .addMethods( {
+isc.OBExternalPage.addMethods({
 
-      // the following methods are used to support history management
-      getBookMarkParams : function() {
-        var result = {};
-        result.contentsURL = this.contentsURL;
-        return result;
-      },
+  // the following methods are used to support history management
+  getBookMarkParams: function () {
+    var result = {};
+    result.contentsURL = this.contentsURL;
+    return result;
+  },
 
-      isSameTab : function(params) {
-        return (params && (params.contentsURL || this.contentsURL) && params.contentsURL === this.contentsURL);
-      }
-
-    });
+  isSameTab: function (params) {
+    return (params && (params.contentsURL || this.contentsURL) && params.contentsURL === this.contentsURL);
+  }
+});
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-history-manager.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-history-manager.js	Sat Feb 11 17:22:32 2012 +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) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -27,20 +27,22 @@
 // actually update the address in the address bar and to get called when
 // the user presses the back or forward button.
 //
-(function(OB, isc) {
+(function (OB, isc) {
 
   if (!OB || !isc) {
     throw {
-      name : 'ReferenceError',
-      message : 'openbravo and isc objects are required'
+      name: 'ReferenceError',
+      message: 'openbravo and isc objects are required'
     };
   }
 
   // cache object references locally
-  var L = OB.Layout, QUOTE_REPLACE = '__', ISC = isc, historyMgr;
+  var L = OB.Layout,
+      QUOTE_REPLACE = '__',
+      ISC = isc,
+      historyMgr;
 
-  function HistoryManager() {
-  }
+  function HistoryManager() {}
 
   HistoryManager.prototype = {
 
@@ -53,9 +55,10 @@
     // state of that tab. The combined state is passed to the smartclient
     // History object.
     //
-    updateHistory: function() {
+    updateHistory: function () {
 
-      var state = {}, stateStr, data, i, tabsLength, tab, tabObject;
+      var state = {},
+          stateStr, data, i, tabsLength, tab, tabObject;
 
       if (L.ViewManager.inStateHandling) {
         return;
@@ -79,7 +82,7 @@
         tabObject = OB.MainView.TabSet.getTabObject(tab);
 
         state.bm[i] = {
-          viewId : tabObject.viewName
+          viewId: tabObject.viewName
         };
 
         // store the bookmark parameters
@@ -99,8 +102,8 @@
       // now encode the state as a json string
       // which is used as a the id in the url
       stateStr = isc.JSON.encode(state, {
-        prettyPrint : false,
-        strictQuoting : false
+        prettyPrint: false,
+        strictQuoting: false
       });
 
       // smartclient fails if there is a " in the string, replace them all
@@ -133,7 +136,7 @@
     // string
     // * {{{data}}} type: String, extra parameter passed in by Smartclient, not
     // used
-    restoreHistory: function(id, data) {
+    restoreHistory: function (id, data) {
       var correctedId, state;
       isc.Log.logDebug('Restoring history ' + id, 'OB');
 
@@ -154,7 +157,6 @@
   historyMgr = L.HistoryManager = new HistoryManager();
 
   // and register the callback
-  isc.History
-      .registerCallback('OB.Layout.HistoryManager.restoreHistory(id, data)');
+  isc.History.registerCallback('OB.Layout.HistoryManager.restoreHistory(id, data)');
 
-}(OB, isc));
+}(OB, isc));
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-keyboard-manager.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-keyboard-manager.js	Sat Feb 11 17:22:32 2012 +0100
@@ -11,16 +11,17 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
+
 // = Keyboard Manager =
 //
 // Manages the keyboard shortcuts which are used to open flyouts, menus etc.
 //
-(function(OB, isc){
+(function (OB, isc) {
 
   if (!OB || !isc) {
     throw {
@@ -28,19 +29,23 @@
       message: 'openbravo and isc objects are required'
     };
   }
-  
+
   // cache object references locally
-  var O = OB, ISC = isc, keyboardMgr; // Local reference to UrlManager instance
-  function KeyboardManager(){
-  }
-  
+  var O = OB,
+      ISC = isc,
+      keyboardMgr; // Local reference to UrlManager instance
+
+
+  function KeyboardManager() {}
+
   KeyboardManager.prototype = {
 
     Shortcuts: {
-    
-      setPredefinedList: function(RefList){
-        var i, list = [], length;
-        
+
+      setPredefinedList: function (RefList) {
+        var i, list = [],
+            length;
+
         list = OB.PropertyStore.get(RefList);
         if (list) {
           length = list.length;
@@ -50,7 +55,7 @@
         }
       },
 
-      set: function(id, execLevel, action, funcParam, keyComb) {
+      set: function (id, execLevel, action, funcParam, keyComb) {
         if (typeof id === 'undefined' || id === null) {
           return false;
         }
@@ -121,45 +126,107 @@
                 this.list[position].keyComb.text += '+';
               }
               switch (keyComb.key) {
-                case 'f1': keyComb.key = 'F1'; break;
-                case 'f2': keyComb.key = 'F2'; break;
-                case 'f3': keyComb.key = 'F3'; break;
-                case 'f4': keyComb.key = 'F4'; break;
-                case 'f5': keyComb.key = 'F5'; break;
-                case 'f6': keyComb.key = 'F6'; break;
-                case 'f7': keyComb.key = 'F7'; break;
-                case 'f8': keyComb.key = 'F8'; break;
-                case 'f9': keyComb.key = 'F9'; break;
-                case 'f10': keyComb.key = 'F10'; break;
-                case 'f11': keyComb.key = 'F11'; break;
-                case 'f12': keyComb.key = 'F12'; break;
-                case 'I': keyComb.key = 'i'; break; //Special case to ensure 'I' is different than 'l'
-                case 'Space': keyComb.key =  OB.I18N.getLabel('OBUIAPP_SpaceKey'); break;
-                case 'Tab': keyComb.key = OB.I18N.getLabel('OBUIAPP_TabKey'); break;
-                case 'Enter': keyComb.key = OB.I18N.getLabel('OBUIAPP_EnterKey'); break;
-                case 'Escape': keyComb.key = OB.I18N.getLabel('OBUIAPP_EscKey'); break;
-                case 'Backspace': keyComb.key = OB.I18N.getLabel('OBUIAPP_BackspaceKey'); break;
-                case 'Insert': keyComb.key = OB.I18N.getLabel('OBUIAPP_InsKey'); break;
-                case 'Delete': keyComb.key = OB.I18N.getLabel('OBUIAPP_DelKey'); break;
-                case 'Arrow_Up': keyComb.key = OB.I18N.getLabel('OBUIAPP_ArrowUpKey'); break;
-                case 'Arrow_Down': keyComb.key = OB.I18N.getLabel('OBUIAPP_ArrowDownKey'); break;
-                case 'Arrow_Left': keyComb.key = OB.I18N.getLabel('OBUIAPP_ArrowLeftKey'); break;
-                case 'Arrow_Right': keyComb.key = OB.I18N.getLabel('OBUIAPP_ArrowRightKey'); break;
-                case 'Home': keyComb.key = OB.I18N.getLabel('OBUIAPP_HomeKey'); break;
-                case 'End': keyComb.key = OB.I18N.getLabel('OBUIAPP_EndKey'); break;
-                case 'Page_Up': keyComb.key = OB.I18N.getLabel('OBUIAPP_PgUpKey'); break;
-                case 'Page_Down': keyComb.key = OB.I18N.getLabel('OBUIAPP_PgDnKey'); break;
-                case 'Shift': keyComb.key = OB.I18N.getLabel('OBUIAPP_ShiftKey'); break;
-                case 'Ctrl': keyComb.key = OB.I18N.getLabel('OBUIAPP_CtrlKey'); break;
-                case 'Alt': keyComb.key = OB.I18N.getLabel('OBUIAPP_AltKey'); break;
+              case 'f1':
+                keyComb.key = 'F1';
+                break;
+              case 'f2':
+                keyComb.key = 'F2';
+                break;
+              case 'f3':
+                keyComb.key = 'F3';
+                break;
+              case 'f4':
+                keyComb.key = 'F4';
+                break;
+              case 'f5':
+                keyComb.key = 'F5';
+                break;
+              case 'f6':
+                keyComb.key = 'F6';
+                break;
+              case 'f7':
+                keyComb.key = 'F7';
+                break;
+              case 'f8':
+                keyComb.key = 'F8';
+                break;
+              case 'f9':
+                keyComb.key = 'F9';
+                break;
+              case 'f10':
+                keyComb.key = 'F10';
+                break;
+              case 'f11':
+                keyComb.key = 'F11';
+                break;
+              case 'f12':
+                keyComb.key = 'F12';
+                break;
+              case 'I':
+                keyComb.key = 'i';
+                break; //Special case to ensure 'I' is different than 'l'
+              case 'Space':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_SpaceKey');
+                break;
+              case 'Tab':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_TabKey');
+                break;
+              case 'Enter':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_EnterKey');
+                break;
+              case 'Escape':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_EscKey');
+                break;
+              case 'Backspace':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_BackspaceKey');
+                break;
+              case 'Insert':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_InsKey');
+                break;
+              case 'Delete':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_DelKey');
+                break;
+              case 'Arrow_Up':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_ArrowUpKey');
+                break;
+              case 'Arrow_Down':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_ArrowDownKey');
+                break;
+              case 'Arrow_Left':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_ArrowLeftKey');
+                break;
+              case 'Arrow_Right':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_ArrowRightKey');
+                break;
+              case 'Home':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_HomeKey');
+                break;
+              case 'End':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_EndKey');
+                break;
+              case 'Page_Up':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_PgUpKey');
+                break;
+              case 'Page_Down':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_PgDnKey');
+                break;
+              case 'Shift':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_ShiftKey');
+                break;
+              case 'Ctrl':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_CtrlKey');
+                break;
+              case 'Alt':
+                keyComb.key = OB.I18N.getLabel('OBUIAPP_AltKey');
+                break;
               }
               this.list[position].keyComb.text += keyComb.key;
             }
           }
         }
       },
-      
-      remove: function(id){
+
+      remove: function (id) {
         var position = this.getProperty('position', id, 'id');
         if (position === null) {
           return false;
@@ -167,25 +234,20 @@
         delete this.list[position];
       },
 
-      getProperty: function(property, element, searchPattern) {
-        var i, position = null, length = this.list.length;
+      getProperty: function (property, element, searchPattern) {
+        var i, position = null,
+            length = this.list.length;
         for (i = 0; i < length; i++) {
           if (typeof this.list[i] === 'undefined') {
             break;
           }
           if (searchPattern === 'id' && this.list[i].id === element) {
             position = i;
-          } else if (searchPattern === 'execLevel' &&
-          this.list[i].execLevel === element) {
+          } else if (searchPattern === 'execLevel' && this.list[i].execLevel === element) {
             position = i;
-          } else if (searchPattern === 'keyComb' &&
-          this.list[i].keyComb.ctrl === element.ctrl &&
-          this.list[i].keyComb.alt === element.alt &&
-          this.list[i].keyComb.shift === element.shift &&
-          this.list[i].keyComb.key === element.key) {
+          } else if (searchPattern === 'keyComb' && this.list[i].keyComb.ctrl === element.ctrl && this.list[i].keyComb.alt === element.alt && this.list[i].keyComb.shift === element.shift && this.list[i].keyComb.key === element.key) {
             position = i;
-          } else if (searchPattern === 'action' &&
-          this.list[i].action === element) {
+          } else if (searchPattern === 'action' && this.list[i].action === element) {
             position = i;
           }
         }
@@ -202,7 +264,7 @@
         }
       },
 
-      execute: function(position){
+      execute: function (position) {
         if (this.list[position].action !== null && typeof this.list[position].action === 'function') {
           return this.list[position].action(this.list[position].funcParam);
         } else {
@@ -210,11 +272,11 @@
         }
       },
 
-      getList: function() {
+      getList: function () {
         return this.list;
       },
 
-      monitor: function(execLevel){
+      monitor: function (execLevel) {
         var i, j, length = this.list.length,
             position = null,
             pushedKS = {};
@@ -238,12 +300,8 @@
             break;
           }
           if (this.list[i].execLevel) {
-            for (j = 0; j < this.list[i].execLevel.length ; j++) {
-              if (this.list[i].execLevel[j] === execLevel &&
-                  this.list[i].keyComb.ctrl === pushedKS.ctrl &&
-                  this.list[i].keyComb.alt === pushedKS.alt &&
-                  this.list[i].keyComb.shift === pushedKS.shift &&
-                  this.list[i].keyComb.key === pushedKS.key) {
+            for (j = 0; j < this.list[i].execLevel.length; j++) {
+              if (this.list[i].execLevel[j] === execLevel && this.list[i].keyComb.ctrl === pushedKS.ctrl && this.list[i].keyComb.alt === pushedKS.alt && this.list[i].keyComb.shift === pushedKS.shift && this.list[i].keyComb.key === pushedKS.key) {
                 position = i;
                 break;
               }
@@ -272,7 +330,7 @@
 
   /* isc.Page.setEvent('keyPress', 'OB.KeyboardManager.Shortcuts.monitor('Canvas')'); // Discart due to Chrome event propagation problems http://forums.smartclient.com/showthread.php?p=65578 */
   isc.Canvas.getPrototype()._originalKeyDown = isc.Canvas.getPrototype().keyDown;
-  isc.Canvas.getPrototype().keyDown = function() {
+  isc.Canvas.getPrototype().keyDown = function () {
     var response = OB.KeyboardManager.Shortcuts.monitor('Canvas');
     if (response) { // To ensure that if a previous keyDown was set in the Canvas it is executed if the action KeyboardManager.action should be propagated
       response = this._originalKeyDown();
@@ -280,4 +338,4 @@
     return response;
   };
 
-}(OB, isc));
+}(OB, isc));
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-popup.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-popup.js	Sat Feb 11 17:22:32 2012 +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) 2010 Openbravo SLU
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -24,70 +24,70 @@
 // The OBPopup is the Openbravo popup implementator.
 //
 isc.OBPopup.addProperties({
-  title : '',
-  autoSize : true,
-  autoCenter : true,
-  canDragReposition : true,
-  canDragResize : true,
-  keepInParentRect : true,
-  showFooter : false,
-  isModal : true,
-  showModalMask : true,
-  dismissOnEscape : true,
-  animateMinimize : false,
-  showHeader : true,
-  showHeaderIcon : true,
-  showMinimizeButton : true,
-  showMaximizeButton : true,
-  showCloseButton : true,
-  autoDraw : false,
-  dragAppearance : 'target',
-  closeClick : function() {
+  title: '',
+  autoSize: true,
+  autoCenter: true,
+  canDragReposition: true,
+  canDragResize: true,
+  keepInParentRect: true,
+  showFooter: false,
+  isModal: true,
+  showModalMask: true,
+  dismissOnEscape: true,
+  animateMinimize: false,
+  showHeader: true,
+  showHeaderIcon: true,
+  showMinimizeButton: true,
+  showMaximizeButton: true,
+  showCloseButton: true,
+  autoDraw: false,
+  dragAppearance: 'target',
+  closeClick: function () {
     this.Super('closeClick', arguments);
     this.Super('destroy', arguments);
   }
 });
 
 isc.OBPopup.changeDefaults('headerLabelDefaults', {
-  wrap : false,
-  width : '100%',
-  inherentWidth : true
+  wrap: false,
+  width: '100%',
+  inherentWidth: true
 });
 
 isc.OBPopup.changeDefaults('restoreButtonDefaults', {
-  showRollOver : true,
-  showDisabled : true,
-  showFocused : true,
-  showDown : true,
-  showFocusedAsOver : false
+  showRollOver: true,
+  showDisabled: true,
+  showFocused: true,
+  showDown: true,
+  showFocusedAsOver: false
 });
 
 isc.OBPopup.changeDefaults('closeButtonDefaults', {
-  showRollOver : true,
-  showDisabled : true,
-  showFocused : true,
-  showDown : true,
-  showFocusedAsOver : false
+  showRollOver: true,
+  showDisabled: true,
+  showFocused: true,
+  showDown: true,
+  showFocusedAsOver: false
 });
 
 isc.OBPopup.changeDefaults('maximizeButtonDefaults', {
-  showRollOver : true,
-  showDisabled : true,
-  showFocused : true,
-  showDown : true,
-  showFocusedAsOver : false
+  showRollOver: true,
+  showDisabled: true,
+  showFocused: true,
+  showDown: true,
+  showFocusedAsOver: false
 });
 
 isc.OBPopup.changeDefaults('minimizeButtonDefaults', {
-  showRollOver : true,
-  showDisabled : true,
-  showFocused : true,
-  showDown : true,
-  showFocusedAsOver : false
+  showRollOver: true,
+  showDisabled: true,
+  showFocused: true,
+  showDown: true,
+  showFocusedAsOver: false
 });
 
 isc.OBPopup.changeDefaults('toolbarDefaults', {
-  buttonConstructor : 'IButton'
+  buttonConstructor: 'IButton'
 });
 
 isc.ClassFactory.defineClass('OBPopupHTMLFlow', isc.HTMLFlow);
@@ -97,9 +97,9 @@
 // The OBPopupHTMLFlow is the iframe container to open classic OB popups with
 // the new implementation
 //
-isc.OBPopupHTMLFlow.addProperties( {
-  showEdges : false,
-  width : '100%',
-  height : '100%',
-  contentsType : 'page'
+isc.OBPopupHTMLFlow.addProperties({
+  showEdges: false,
+  width: '100%',
+  height: '100%',
+  contentsType: 'page'
 });
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-property-store.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-property-store.js	Sat Feb 11 17:22:32 2012 +0100
@@ -11,11 +11,12 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
+
 // = Property Store =
 //
 // The Property Store maintains properties. A property can be anything from the width of a column to 
@@ -25,7 +26,7 @@
 // If a component requests a certain property then the local cache (OB.Properties) is checked. 
 // If no value can be found there then an undefined value is returned. 
 //
-(function(OB, isc){
+(function (OB, isc) {
 
   if (!OB || !isc) {
     throw {
@@ -33,18 +34,19 @@
       message: 'openbravo and isc objects are required'
     };
   }
-  
+
   // cache object references locally
-  var ISC = isc, pstore; // Local reference to RemoveCallManager instance
-  function PropertyStore(){
-  }
-  
+  var ISC = isc,
+      pstore; // Local reference to RemoveCallManager instance
+
+  function PropertyStore() {}
+
   PropertyStore.prototype = {
-  
+
     // array of functions which are called when a property change
     // occurs
     listeners: [],
-    
+
     // ** {{{ PropertyStore.get(propertyName) }}} **
     //
     // Retrieves the property from the local cache. If not found then null
@@ -54,7 +56,7 @@
     // * {{{propertyName}}}: the name of the property
     // * {{{windowId}}}: the system will first search for property on windowId level
     //
-    get: function(/* String */propertyName, windowId){
+    get: function (propertyName, windowId) {
       if (windowId && OB.Properties[propertyName + '_' + windowId]) {
         return OB.Properties[propertyName + '_' + windowId];
       }
@@ -63,7 +65,7 @@
       }
       return OB.Properties[propertyName];
     },
-    
+
     // ** {{{ PropertyStore.set(propertyName, value) }}} **
     //
     // Sets the property in the local cache. Also performs a server call to
@@ -74,21 +76,27 @@
     // * {{{propertyName}}}: the name of the property
     // * {{{value}}}: the value of the property
     //
-    set: function(/* String */propertyName, /* Object */ value, windowId, noSetInServer, setAsSystem) {
-      var currentValue = OB.Properties[propertyName], data={property: propertyName, system: setAsSystem?true:false},
-          localPropertyName=propertyName, i, length;
-      if(windowId){
-        data.windowId=windowId;
-        localPropertyName=propertyName + '_' + windowId;
+    set: function (propertyName, value, windowId, noSetInServer, setAsSystem) {
+      var currentValue = OB.Properties[propertyName],
+          localPropertyName = propertyName,
+          i, length, data;
+
+      data = {
+        property: propertyName,
+        system: setAsSystem ? true : false
+      };
+
+      if (windowId) {
+        data.windowId = windowId;
+        localPropertyName = propertyName + '_' + windowId;
       }
-      
+
       // set it locally
       OB.Properties[localPropertyName] = value;
 
       if (!noSetInServer) {
         // and set it in the server also
-        OB.RemoteCallManager.call('org.openbravo.client.application.StorePropertyActionHandler', value, data, function(){
-        });
+        OB.RemoteCallManager.call('org.openbravo.client.application.StorePropertyActionHandler', value, data, function () {});
       }
 
       // call the listeners
@@ -107,11 +115,11 @@
     // Parameters:
     // * {{{listener}}}: a function which is called when a new alert result is
     // received. The function will get three parameters: property name, old value, new value
-    addListener: function(/* function */listener){
+    addListener: function (listener) {
       this.listeners[this.listeners.length] = listener;
     }
   };
 
   // Initialize PropertyStore object
   pstore = OB.PropertyStore = new PropertyStore();
-}(OB, isc));
+}(OB, isc));
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-recent-utilities.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-recent-utilities.js	Sat Feb 11 17:22:32 2012 +0100
@@ -11,11 +11,12 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010 Openbravo SLU
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
+
 // = Recent Utilities =
 //
 // The Recent Utilities provides a mechanism to store and maintain recent choices
@@ -23,7 +24,7 @@
 // of a user in the application menu. The number of entries stores is defined
 // by a property UINAVBA_RecentListSize.
 //
-(function(OB, isc){
+(function (OB, isc) {
 
   if (!OB || !isc) {
     throw {
@@ -31,14 +32,15 @@
       message: 'openbravo and isc objects are required'
     };
   }
-  
+
   // cache object references locally
-  var ISC = isc, rcutils; // Local reference to RemoveCallManager instance
-  function RecentUtilities(){
-  }
-  
+  var ISC = isc,
+      rcutils; // Local reference to RemoveCallManager instance
+
+  function RecentUtilities() {}
+
   RecentUtilities.prototype = {
-    getRecentNum: function() {
+    getRecentNum: function () {
       if (this.recentNum) {
         return this.recentNum;
       }
@@ -50,14 +52,14 @@
         // a direct number
         this.recentNum = storedRecentNum;
       }
-      
+
       // is the value valid
       if (!this.recentNum || (String(this.recentNum)) !== (String(parseInt(this.recentNum, 10)))) {
         this.recentNum = 3;
       }
       return this.recentNum;
     },
-  
+
     // ** {{{ RecentUtilities.getRecent(/*String*/ propertyName) }}} **
     //
     // Retrieves the most recent choices which are stored under the name
@@ -67,14 +69,14 @@
     // Parameters:
     // * {{{propertyName}}}: the name under which the recent value is stored.
     //
-    getRecentValue: function(/* String */propertyName){
+    getRecentValue: function (propertyName) {
       var value = OB.PropertyStore.get(propertyName);
       if (!value) {
         return [];
       }
       return value;
     },
-    
+
     // ** {{{ RecentUtilities.addRecent(/*String*/ propertyName, /*Object*/
     // choiceObject) }}} **
     //
@@ -87,28 +89,27 @@
     // * {{{choiceObject}}}: the object defining the last user choice, can be null
     //                        in this case the call returns without changing things.
     //
-    addRecent: function(/* String */propertyName, /* Object */ choiceObject){
+    addRecent: function (propertyName, choiceObject) {
       // in some cases the choiceobject is not set, just ignore those
       if (!choiceObject) {
         return;
       }
       var currentRecentValue = this.getRecentValue(propertyName);
       // check if there is already an entry for the new recent
-      var currentIndex = -1, i, length = currentRecentValue.length;
+      var currentIndex = -1,
+          i, length = currentRecentValue.length;
       for (i = 0; i < length; i++) {
         // if the title is the same then assume they are the same, only 
         // check this if there is no recentId being used
-        if (!currentRecentValue[i].recentId && currentRecentValue[i].tabTitle && 
-            choiceObject.tabTitle && choiceObject.tabTitle === currentRecentValue[i].tabTitle) {
+        if (!currentRecentValue[i].recentId && currentRecentValue[i].tabTitle && choiceObject.tabTitle && choiceObject.tabTitle === currentRecentValue[i].tabTitle) {
           currentIndex = i;
-        } else  if (currentRecentValue[i].recentId && 
-              choiceObject.recentId && choiceObject.recentId === currentRecentValue[i].recentId) {
-            currentIndex = i;
+        } else if (currentRecentValue[i].recentId && choiceObject.recentId && choiceObject.recentId === currentRecentValue[i].recentId) {
+          currentIndex = i;
         } else if (currentRecentValue[i].id && currentRecentValue[i].id === choiceObject.id) {
           currentIndex = i;
         }
       }
-      
+
       // if found then first remove it, re-add it later
       if (currentIndex > -1) {
         var currentLength = currentRecentValue.length;
@@ -117,7 +118,7 @@
         }
         currentRecentValue.length = currentRecentValue.length - 1;
       }
-      
+
       var newLength = 1;
       for (i = (currentRecentValue.length - 1); i >= 0; i--) {
         if (i < (this.getRecentNum() - 1)) {
@@ -132,8 +133,8 @@
       OB.PropertyStore.set(propertyName, currentRecentValue);
     }
   };
-  
+
   // Initialize RemoteCallManager object
   rcutils = OB.RecentUtilities = new RecentUtilities();
   OB.RecentUtilitiesClass = RecentUtilities;
-}(OB, isc));
+}(OB, isc));
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-remote-call-manager.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-remote-call-manager.js	Sat Feb 11 17:22:32 2012 +0100
@@ -11,29 +11,31 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
+
 // = Remote Call Manager =
 //
 // The Remote Call Manager provides support for calling java from the client
 // and retrieving the result.
 //
-(function(OB, isc) {
+(function (OB, isc) {
 
   if (!OB || !isc) {
     throw {
-      name : 'ReferenceError',
-      message : 'openbravo and isc objects are required'
+      name: 'ReferenceError',
+      message: 'openbravo and isc objects are required'
     };
   }
 
   // cache object references locally
-  var ISC = isc, rcmgr; // Local reference to RemoveCallManager instance
-  function RemoteCallManager() {
-  }
+  var ISC = isc,
+      rcmgr; // Local reference to RemoveCallManager instance
+
+  function RemoteCallManager() {}
 
   RemoteCallManager.prototype = {
 
@@ -56,8 +58,7 @@
     // * {{{callerContext}}}: a context object which is available
     // (as rpcRequest.clientContext) when the callback gets called
     //
-    call : function(/* String */actionName, /* Object */data, /* Object */
-    requestParams, /* Function */callback, /* Object */callerContext) {
+    call: function (actionName, data, requestParams, callback, callerContext) {
 
       var requestParameters = {};
       ISC.addProperties(requestParameters, requestParams);
@@ -88,4 +89,4 @@
 
   // Initialize RemoteCallManager object
   rcmgr = OB.RemoteCallManager = new RemoteCallManager();
-}(OB, isc));
+}(OB, isc));
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-section-stack.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-section-stack.js	Sat Feb 11 17:22:32 2012 +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) 2011 Openbravo SLU
+ * All portions are Copyright (C) 2011-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-test-registry.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-test-registry.js	Sat Feb 11 17:22:32 2012 +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) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -22,7 +22,7 @@
 // TestRegistry using a unique name, selenium tests can then easily retrieve components from the test registry
 // using the unique name.
 //
-(function(OB, isc){
+(function (OB, isc) {
 
   if (!OB || !isc) {
     throw {
@@ -40,14 +40,13 @@
     isc.Log.logDebug('No Test Environment, registering test components disabled', 'OB');
   }
 
-  function TestRegistry(){
-  }
+  function TestRegistry() {}
 
   TestRegistry.prototype = {
 
     registry: {},
-    
-    register: function(key, object){
+
+    register: function (key, object) {
       if (isTestEnvironment || OB.Application.testEnvironment) {
         isc.Log.logDebug('Registering ' + key + ' in test registry ', 'OB');
         this.registry[key] = object;
@@ -56,4 +55,4 @@
   };
 
   OB.TestRegistry = new TestRegistry();
-}(OB, isc));
+}(OB, isc));
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js	Sat Feb 11 17:22:32 2012 +0100
@@ -11,11 +11,12 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2009-2011 Openbravo SLU
+ * All portions are Copyright (C) 2009-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
+
 // = Openbravo Date Utilities =
 // Defines utility methods related to handling date, incl. formatting.
 OB.Utilities.Date = {};
@@ -27,15 +28,14 @@
 OB.Utilities.Date.centuryReference = 50; // Notice that change this value
 // implies that also the QUnit test
 // case should be changed
-
 // ** {{{ OB.Utilities.Date.normalizeDisplayFormat }}} **
 // Repairs the displayFormat definition (passed in as a parameter) to a value
 // expected by the rest of the system. For example mm is replaced by MM,
 // dd is replacecd by DD, YYYY to %Y.
 //
 // Parameters:
-// * {{{displayFormat}}}: the displayFormat definition to repair.
-OB.Utilities.Date.normalizeDisplayFormat = function(/* String */displayFormat){
+// * {{{displayFormat}}}: the string displayFormat definition to repair.
+OB.Utilities.Date.normalizeDisplayFormat = function (displayFormat) {
   var newFormat = '';
   displayFormat = displayFormat.replace('mm', 'MM').replace('dd', 'DD').replace('yyyy', 'YYYY').replace('yy', 'YY');
   displayFormat = displayFormat.replace('%D', '%d').replace('%M', '%m');
@@ -72,29 +72,29 @@
 // * {{{dateFormat}}}: the dateFormat pattern to use
 // Return:
 // * a Date object or null if conversion was not possible.
-OB.Utilities.Date.OBToJS = function(/* String */OBDate, /* String */ dateFormat){
+OB.Utilities.Date.OBToJS = function (OBDate, dateFormat) {
   if (!OBDate) {
     return null;
   }
-  
+
   // if already a date then return true
   var isADate = Object.prototype.toString.call(OBDate) === '[object Date]';
   if (isADate) {
     return OBDate;
   }
-  
+
   dateFormat = OB.Utilities.Date.normalizeDisplayFormat(dateFormat);
   var dateSeparator = dateFormat.substring(2, 3);
   var timeSeparator = dateFormat.substring(11, 12);
   var isFullYear = (dateFormat.indexOf('%Y') !== -1);
-  
+
   if ((isFullYear ? OBDate.length - 2 : OBDate.length) !== dateFormat.length) {
     return null;
   }
   if (isFullYear) {
     dateFormat = dateFormat.replace('%Y', '%YYY');
   }
-  
+
   if (dateFormat.indexOf('-') !== -1 && OBDate.indexOf('-') === -1) {
     return null;
   } else if (dateFormat.indexOf('/') !== -1 && OBDate.indexOf('/') === -1) {
@@ -104,7 +104,7 @@
   } else if (dateFormat.indexOf('.') !== -1 && OBDate.indexOf('.') === -1) {
     return null;
   }
-  
+
   var year = dateFormat.indexOf('%y') !== -1 ? OBDate.substring(dateFormat.indexOf('%y'), dateFormat.indexOf('%y') + 2) : 0;
   var fullYear = dateFormat.indexOf('%Y') !== -1 ? OBDate.substring(dateFormat.indexOf('%Y'), dateFormat.indexOf('%Y') + 4) : 0;
   var month = dateFormat.indexOf('%m') !== -1 ? OBDate.substring(dateFormat.indexOf('%m'), dateFormat.indexOf('%m') + 2) : 0;
@@ -119,19 +119,17 @@
   minutes = parseInt(minutes, 10);
   seconds = parseInt(seconds, 10);
 
-  if (day < 1 || day > 31 || month < 1 || month > 12 || year > 99 ||
-  fullYear > 9999) {
+  if (day < 1 || day > 31 || month < 1 || month > 12 || year > 99 || fullYear > 9999) {
     return null;
   }
-  
+
   if (hours > 23 || minutes > 59 || seconds > 59) {
     return null;
   }
-  
+
   // alert('year: ' + year + '\n' + 'fullYear: ' + fullYear + '\n' + 'month: ' +
   // month + '\n' + 'day: ' + day + '\n' + 'hours: ' + hours + '\n' + 'minutes:
   // ' + minutes + '\n' + 'seconds: ' + seconds);
-  
   // var JSDate = isc.Date.create(); /**It doesn't work in IE**/
   var JSDate = new Date();
   var centuryReference = OB.Utilities.Date.centuryReference;
@@ -144,7 +142,7 @@
   }
 
   fullYear = parseInt(fullYear, 10);
-  JSDate.setFullYear(fullYear, month-1, day);
+  JSDate.setFullYear(fullYear, month - 1, day);
   JSDate.setHours(hours);
   JSDate.setMinutes(minutes);
   JSDate.setSeconds(seconds);
@@ -165,14 +163,14 @@
 // * {{{dateFormat}}}: the dateFormat pattern to use
 // Return:
 // * a String or null if the JSDate is not a date.
-OB.Utilities.Date.JSToOB = function(/* Date */JSDate, /* String */ dateFormat){
+OB.Utilities.Date.JSToOB = function (JSDate, dateFormat) {
   dateFormat = OB.Utilities.Date.normalizeDisplayFormat(dateFormat);
-  
+
   var isADate = Object.prototype.toString.call(JSDate) === '[object Date]';
   if (!isADate) {
     return null;
   }
-  
+
   var year = JSDate.getYear().toString();
   var fullYear = JSDate.getFullYear().toString();
   var month = (JSDate.getMonth() + 1).toString();
@@ -180,11 +178,10 @@
   var hours = JSDate.getHours().toString();
   var minutes = JSDate.getMinutes().toString();
   var seconds = JSDate.getSeconds().toString();
-  
+
   var centuryReference = OB.Utilities.Date.centuryReference;
   if (dateFormat.indexOf('%y') !== -1) {
-    if (parseInt(fullYear, 10) >= 1900 + centuryReference &&
-    parseInt(fullYear, 10) < 2100 - centuryReference) {
+    if (parseInt(fullYear, 10) >= 1900 + centuryReference && parseInt(fullYear, 10) < 2100 - centuryReference) {
       if (parseInt(year, 10) >= 100) {
         year = parseInt(year, 10) - 100;
         year = year.toString();
@@ -193,7 +190,7 @@
       return null;
     }
   }
-  
+
   while (year.length < 2) {
     year = '0' + year;
   }
@@ -223,6 +220,6 @@
   OBDate = OBDate.replace('%H', hours);
   OBDate = OBDate.replace('%M', minutes);
   OBDate = OBDate.replace('%S', seconds);
-  
+
   return OBDate;
-};
+};
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js	Sat Feb 11 17:22:32 2012 +0100
@@ -11,11 +11,12 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011 Openbravo SLU
+ * All portions are Copyright (C) 2011-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
+
 // = Openbravo Number Utilities =
 // Defines utility methods related to handling numbers on the client, for 
 // example formatting. 
@@ -30,7 +31,7 @@
 // * {{{dec}}}: the JS number of decimals
 // Return:
 // * The rounded JS number
-OB.Utilities.Number.roundJSNumber = function(/* Number */num, /* Number */ dec){
+OB.Utilities.Number.roundJSNumber = function (num, dec) {
   var result = Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec);
   return result;
 };
@@ -45,16 +46,16 @@
 // * {{{groupSeparator}}}: the group separator of the OB number
 // Return:
 // * The plain OB number
-OB.Utilities.Number.OBMaskedToOBPlain = function(/* String */number, /* String */ decSeparator, /* String */ groupSeparator){
+OB.Utilities.Number.OBMaskedToOBPlain = function (number, decSeparator, groupSeparator) {
   number = number.toString();
   var plainNumber = number;
-  
+
   // Remove group separators
   if (groupSeparator) {
     var groupRegExp = new RegExp('\\' + groupSeparator, 'g');
     plainNumber = plainNumber.replace(groupRegExp, '');
   }
-  
+
   // Catch sign
   var numberSign = '';
   if (plainNumber.substring(0, 1) === '+') {
@@ -64,31 +65,29 @@
     numberSign = '-';
     plainNumber = plainNumber.substring(1, number.length);
   }
-  
+
   // Remove ending decimal '0'
   if (plainNumber.indexOf(decSeparator) !== -1) {
     while (plainNumber.substring(plainNumber.length - 1, plainNumber.length) === '0') {
       plainNumber = plainNumber.substring(0, plainNumber.length - 1);
     }
   }
-  
+
   // Remove starting integer '0'
-  while (plainNumber.substring(0, 1) === '0' &&
-  plainNumber.substring(1, 2) !== decSeparator &&
-  plainNumber.length > 1) {
+  while (plainNumber.substring(0, 1) === '0' && plainNumber.substring(1, 2) !== decSeparator && plainNumber.length > 1) {
     plainNumber = plainNumber.substring(1, plainNumber.length);
   }
-  
+
   // Remove decimal separator if is the last character
   if (plainNumber.substring(plainNumber.length - 1, plainNumber.length) === decSeparator) {
     plainNumber = plainNumber.substring(0, plainNumber.length - 1);
   }
-  
+
   // Re-set sign
   if (plainNumber !== '0') {
     plainNumber = numberSign + plainNumber;
   }
-  
+
   // Return plain number
   return plainNumber;
 };
@@ -106,19 +105,16 @@
 // * {{{groupInterval}}}: The group interval of the OB number
 // Return:
 // * The OB formatted number.
-OB.Utilities.Number.OBPlainToOBMasked = function(/* Number */number, /* String */ maskNumeric, /* String */ decSeparator, /* String */ groupSeparator, /* String */ groupInterval){
+OB.Utilities.Number.OBPlainToOBMasked = function (number, maskNumeric, decSeparator, groupSeparator, groupInterval) {
   if (number === '' || number === null || number === undefined) {
     return number;
   }
-  
+
   // Management of the mask
   if (maskNumeric.indexOf('+') === 0 || maskNumeric.indexOf('-') === 0) {
     maskNumeric = maskNumeric.substring(1, maskNumeric.length);
   }
-  if (groupSeparator && maskNumeric.indexOf(groupSeparator) !== -1 &&
-  maskNumeric.indexOf(decSeparator) !== -1 &&
-  maskNumeric.indexOf(groupSeparator) >
-  maskNumeric.indexOf(decSeparator)) {
+  if (groupSeparator && maskNumeric.indexOf(groupSeparator) !== -1 && maskNumeric.indexOf(decSeparator) !== -1 && maskNumeric.indexOf(groupSeparator) > maskNumeric.indexOf(decSeparator)) {
     var fixRegExp = new RegExp('\\' + groupSeparator, 'g');
     maskNumeric = maskNumeric.replace(fixRegExp, '');
   }
@@ -129,9 +125,8 @@
   }
   var intMask = maskNumeric.substring(0, decMaskPosition);
   var decMask = maskNumeric.substring(decMaskPosition + 1, maskLength);
-  
-  if ((groupSeparator && decMask.indexOf(groupSeparator) !== -1) ||
-      decMask.indexOf(decSeparator) !== -1) {
+
+  if ((groupSeparator && decMask.indexOf(groupSeparator) !== -1) || decMask.indexOf(decSeparator) !== -1) {
     if (groupSeparator) {
       var fixRegExp_1 = new RegExp('\\' + groupSeparator, 'g');
       decMask = decMask.replace(fixRegExp_1, '');
@@ -139,7 +134,7 @@
     var fixRegExp_2 = new RegExp('\\' + decSeparator, 'g');
     decMask = decMask.replace(fixRegExp_2, '');
   }
-  
+
   // Management of the number
   number = number.toString();
   number = OB.Utilities.Number.OBMaskedToOBPlain(number, decSeparator, groupSeparator);
@@ -151,7 +146,7 @@
     numberSign = '-';
     number = number.substring(1, number.length);
   }
-  
+
   // //Splitting the number
   var formattedNumber = '';
   var numberLength = number.length;
@@ -161,7 +156,7 @@
   }
   var intNumber = number.substring(0, decPosition);
   var decNumber = number.substring(decPosition + 1, numberLength);
-  
+
   // //Management of the decimal part
   if (decNumber.length > decMask.length) {
     decNumber = '0.' + decNumber;
@@ -174,10 +169,11 @@
     }
     decNumber = decNumber.substring(2, decNumber.length);
   }
-  
+
   if (decNumber.length < decMask.length) {
     var decNumber_temp = '',
-        decMaskLength = decMask.length, i;
+        decMaskLength = decMask.length,
+        i;
     for (i = 0; i < decMaskLength; i++) {
       if (decMask.substring(i, i + 1) === '#') {
         if (decNumber.substring(i, i + 1) !== '') {
@@ -193,10 +189,10 @@
     }
     decNumber = decNumber_temp;
   }
-  
+
   // Management of the integer part
   var isGroup = false;
-  
+
   if (groupSeparator) {
     if (intMask.indexOf(groupSeparator) !== -1) {
       isGroup = true;
@@ -209,17 +205,16 @@
   var intNumber_temp;
   if (intNumber.length < intMask.length) {
     intNumber_temp = '';
-    var diff = intMask.length - intNumber.length, j;
+    var diff = intMask.length - intNumber.length,
+        j;
     for (j = intMask.length; j > 0; j--) {
       if (intMask.substring(j - 1, j) === '#') {
         if (intNumber.substring(j - 1 - diff, j - diff) !== '') {
-          intNumber_temp = intNumber.substring(j - 1 - diff, j - diff) +
-          intNumber_temp;
+          intNumber_temp = intNumber.substring(j - 1 - diff, j - diff) + intNumber_temp;
         }
       } else if (intMask.substring(j - 1, j) === '0') {
         if (intNumber.substring(j - 1 - diff, j - diff) !== '') {
-          intNumber_temp = intNumber.substring(j - 1 - diff, j - diff) +
-          intNumber_temp;
+          intNumber_temp = intNumber.substring(j - 1 - diff, j - diff) + intNumber_temp;
         } else {
           intNumber_temp = '0' + intNumber_temp;
         }
@@ -230,24 +225,24 @@
 
   if (isGroup === true) {
     intNumber_temp = '';
-    var groupCounter = 0, k;
+    var groupCounter = 0,
+        k;
     for (k = intNumber.length; k > 0; k--) {
       intNumber_temp = intNumber.substring(k - 1, k) + intNumber_temp;
       groupCounter++;
-      if (groupCounter.toString() === groupInterval.toString() &&
-      k !== 1) {
+      if (groupCounter.toString() === groupInterval.toString() && k !== 1) {
         groupCounter = 0;
         intNumber_temp = groupSeparator + intNumber_temp;
       }
     }
     intNumber = intNumber_temp;
   }
-  
+
   // Building the final number
   if (intNumber === '' && decNumber !== '') {
     intNumber = '0';
   }
-  
+
   formattedNumber = numberSign + intNumber;
   if (decNumber !== '') {
     formattedNumber += decSeparator + decNumber;
@@ -266,7 +261,7 @@
 // * {{{groupSeparator}}}: The group separator of the OB number
 // Return:
 // * The JS number.
-OB.Utilities.Number.OBMaskedToJS = function(numberStr, decSeparator, groupSeparator){
+OB.Utilities.Number.OBMaskedToJS = function (numberStr, decSeparator, groupSeparator) {
   if (!numberStr || numberStr.trim() === '') {
     return null;
   }
@@ -292,7 +287,7 @@
 // * {{{groupInterval}}}: The group interval of the OB number
 // Return:
 // * The OB formatted number.
-OB.Utilities.Number.JSToOBMasked = function(number, maskNumeric, decSeparator, groupSeparator, groupInterval){
+OB.Utilities.Number.JSToOBMasked = function (number, maskNumeric, decSeparator, groupSeparator, groupInterval) {
   if (!isc.isA.Number(number)) {
     return number;
   }
@@ -303,19 +298,19 @@
   return formattedNumber;
 };
 
-OB.Utilities.Number.IsValidValueString = function(type, numberStr){
+OB.Utilities.Number.IsValidValueString = function (type, numberStr) {
   var maskNumeric = type.maskNumeric;
   // note 0 is also okay to return true
   if (!numberStr) {
     return true;
   }
-  
+
   var bolNegative = true;
   if (maskNumeric.indexOf('+') === 0) {
     bolNegative = false;
     maskNumeric = maskNumeric.substring(1, maskNumeric.length);
   }
-  
+
   var bolDecimal = true;
   if (maskNumeric.indexOf(type.decSeparator) === -1) {
     bolDecimal = false;
@@ -335,4 +330,4 @@
     return true;
   }
   return false;
-};
+};
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Sat Feb 11 17:22:32 2012 +0100
@@ -11,11 +11,12 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011 Openbravo SLU
+ * All portions are Copyright (C) 2011-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
+
 // = Openbravo Utilities =
 // Defines utility methods in the top-level OB.Utilities object. Utility methods
 // are related to opening views, opening popups, displaying yes/no, etc. 
@@ -26,8 +27,8 @@
 // (!= community). If the instance has a community instance then 
 // a popup message is shown and false is returned.
 // The parameter can be used to add a custom message to the popup.
-OB.Utilities.checkProfessionalLicense = function(msg, doNotShowMessage) {
-  if(OB.Application.licenseType === 'C') {
+OB.Utilities.checkProfessionalLicense = function (msg, doNotShowMessage) {
+  if (OB.Application.licenseType === 'C') {
     if (!doNotShowMessage) {
       if (!msg) {
         msg = '';
@@ -36,7 +37,7 @@
         isModal: true,
         showModalMask: true,
         toolbarButtons: [isc.Dialog.OK]
-      });      
+      });
     }
     return false;
   }
@@ -50,7 +51,7 @@
 // suffix is set then ... is appended
 // TODO: more advanced implementations can cut of at a space or dash for 
 // example
-OB.Utilities.truncTitle = function(title, cutLength, suffix){
+OB.Utilities.truncTitle = function (title, cutLength, suffix) {
   cutLength = cutLength || 30;
   if (!title || title.length < cutLength) {
     return title;
@@ -76,7 +77,7 @@
 // Creates a dialog with a title, an ok button and a layout in the middle.
 // The dialog is not shown but returned. The caller needs to call setContent to 
 // set the content in the dialog and show it.
-OB.Utilities.createDialog = function(title, focusOnOKButton, properties){
+OB.Utilities.createDialog = function (title, focusOnOKButton, properties) {
   var dialog = isc.Dialog.create({
     title: title,
     toolbarButtons: [isc.Dialog.OK],
@@ -85,14 +86,14 @@
     keepInParentRect: true,
     autoSize: true,
     autoCenter: true,
-    
+
     contentLayout: 'horizontal',
     autoChildParentMap: isc.addProperties({}, isc.Window.getInstanceProperty("autoChildParentMap"), {
       stack: 'body',
       layout: 'stack',
       toolbar: 'stack'
     }),
-    
+
     stackDefaults: {
       height: 1
     },
@@ -101,8 +102,8 @@
       layoutAlign: 'center',
       buttonConstructor: isc.OBFormButton
     }),
-    
-    createChildren: function(){
+
+    createChildren: function () {
       this.showToolbar = false;
       this.Super('createChildren');
       this.addAutoChild('stack', null, isc.VStack);
@@ -113,20 +114,20 @@
       }, isc.VLayout);
       this.showToolbar = true;
       this.makeToolbar();
-      
+
       // can't be done via defaults because policy and direction are dynamically determined
       this.body.hPolicy = 'fill';
     },
-    
+
     // will set the content and show it
-    setContent: function(content){
-      
+    setContent: function (content) {
+
       // Note: we lazily create children on draw, so verify that the items have been
       // initialized before manipulating the label
       if (!this._isInitialized) {
         this.createChildren();
       }
-      
+
       // Update the content in the body        
       this.layout.addMember(content);
       this.toolbar.layoutChildren();
@@ -135,23 +136,23 @@
         this.body.layoutChildren();
         this.layoutChildren();
       }
-      
+
       this.show();
-      
+
       // focus in the first button so you can hit Enter to do the default thing
       if (this.toolbar && focusOnOKButton) {
         var firstButton = this.toolbar.getMember(0);
         firstButton.focus();
       }
     }
-    
+
   }, properties);
   return dialog;
 };
 
 // ** {{{OB.Utilities.createLoadingLayout}}} **
 // Creates a layout with the loading image.
-OB.Utilities.createLoadingLayout = function(){
+OB.Utilities.createLoadingLayout = function () {
   var mainLayout = isc.HLayout.create({
     styleName: OB.Styles.LoadingPrompt.mainLayoutStyleName,
     width: '100%',
@@ -180,7 +181,7 @@
 // ** {{{OB.Utilities.addRequiredSuffixToBaseStyle}}} **
 // Adds the Required suffix to a base style for a required formitem, to show it yellow in 
 // the forms.
-OB.Utilities.addRequiredSuffixToBaseStyle = function(item){
+OB.Utilities.addRequiredSuffixToBaseStyle = function (item) {
   if (item.required) {
     // apparently this is called many times therefore do not append
     // if we already did append it
@@ -199,7 +200,7 @@
 
 // ** {{{OB.Utilities.determineViewOfFormItem}}} **
 // Handles the different ways to find the view of a form item.
-OB.Utilities.determineViewOfFormItem = function(item){
+OB.Utilities.determineViewOfFormItem = function (item) {
   var form = item.form;
   if (form.view) {
     // form item in standard form
@@ -223,31 +224,32 @@
 // object to call the function on) and parameters (an array passed to the function).
 // If action is null/undefined then nothing is done and undefined is returned.
 // When the action is called the result of the action is returned.
-OB.Utilities.callAction = function(action){
-  function IEApplyHack(method, object, parameters){
+OB.Utilities.callAction = function (action) {
+  function IEApplyHack(method, object, parameters) {
     if (!object) {
       object = window;
     }
     if (!parameters) {
       parameters = [];
     }
-    
+
     object.customApplyMethod = method;
-    
-    var argsString = [], i, length = parameters.length;
+
+    var argsString = [],
+        i, length = parameters.length;
     for (i = 0; i < length; i++) {
       argsString[i] = 'parameters[' + i + ']';
     }
-    
+
     var argsList = argsString.join(",");
-    
+
     var result = eval('object.customApplyMethod(' + argsList + ');');
-    
+
     delete object.customApplyMethod;
-    
+
     return result;
   }
-  
+
   if (!action) {
     return;
   }
@@ -264,7 +266,7 @@
 
 // ** {{{OB.Utilities.replaceNullStringValue}}} **
 // Replaces values which are 'null' with null
-OB.Utilities.replaceNullStringValue = function(form, values) {
+OB.Utilities.replaceNullStringValue = function (form, values) {
   var prop;
   for (prop in values) {
     if (values.hasOwnProperty(prop)) {
@@ -279,7 +281,7 @@
 // ** {{{OB.Utilities.useClassicMode}}} **
 // Returns true if the user wants to work in classic mode, checks the url parameter
 // as well as a property value.
-OB.Utilities.useClassicMode = function(windowId){
+OB.Utilities.useClassicMode = function (windowId) {
   if (OB.Utilities.hasUrlParameter('mode', 'classic')) {
     return true;
   }
@@ -297,16 +299,17 @@
 // Open a view using a tab id and record id. The tab can be a child tab. If the record id
 // is not set then the tab is opened in grid mode. If command is not set then default is
 // used.
-OB.Utilities.openDirectTab = function(tabId, recordId, command){
-  
+OB.Utilities.openDirectTab = function (tabId, recordId, command) {
+
   tabId = OB.Utilities.removeFragment(tabId);
   recordId = OB.Utilities.removeFragment(recordId);
   command = OB.Utilities.removeFragment(command);
-  
-  var urlParams = OB.Utilities.getUrlParameters();
-  
+
+  var urlParams = OB.Utilities.getUrlParameters(),
+      callback;
+
   //added to have the additional filter clause and tabid. Mallikarjun M
-  var callback = function(response, data, request){
+  callback = function (response, data, request) {
     command = command || 'DEFAULT';
     var view = {
       viewId: '_' + data.windowId,
@@ -319,11 +322,11 @@
     if (command !== 'NEW') {
       view.targetTabId = tabId;
     }
-    
+
     if (recordId) {
       view.targetRecordId = recordId;
     }
-    
+
     //// Begins-added to have the additional filter clause and tabid..Mallikarjun M
     //URL example:http://localhost:8080/openbravo/?tabId=186&filterClause=e.businessPartner.searchKey%3D%27mcgiver%27&replaceDefaultFilter=true&
     if (urlParams.filterClause) {
@@ -334,15 +337,14 @@
       view.additionalCriteriaTabId = data.tabId;
       view.additionalCriteria = urlParams.criteria;
     }
-     
+
     if (urlParams.replaceDefaultFilter) {
-       view.replaceDefaultFilter = urlParams.replaceDefaultFilter;
+      view.replaceDefaultFilter = urlParams.replaceDefaultFilter;
     }
     ////Ends..
-    
     OB.Layout.ViewManager.openView(view.viewId, view);
   };
-  
+
   OB.RemoteCallManager.call('org.openbravo.client.application.ComputeWindowActionHandler', {}, {
     'tabId': tabId,
     'recordId': recordId
@@ -351,7 +353,7 @@
 
 // ** {{{OB.Utilities.removeFragment}}} **
 // remove a # and the rest from a string
-OB.Utilities.removeFragment = function(str) {
+OB.Utilities.removeFragment = function (str) {
   if (!str) {
     return str;
   }
@@ -365,9 +367,9 @@
 // ** {{{OB.Utilities.openView}}} **
 // Open a view taking into account if a specific window should be opened in classic mode or not.
 // Returns the object used to open the window.
-OB.Utilities.openView = function(windowId, tabId, tabTitle, recordId, command, icon){
+OB.Utilities.openView = function (windowId, tabId, tabTitle, recordId, command, icon) {
   var isClassicEnvironment = OB.Utilities.useClassicMode(windowId);
-  
+
   var openObject;
   if (isClassicEnvironment) {
     if (recordId) {
@@ -411,15 +413,16 @@
 
 // ** {{{OB.Utilities.openDirectView}}} **
 // Open the correct view for a passed in target definition, coming from a certain source Window.
-OB.Utilities.openDirectView = function(sourceWindowId, keyColumn, targetEntity, recordId){
+OB.Utilities.openDirectView = function (sourceWindowId, keyColumn, targetEntity, recordId) {
 
-  var actionURL = OB.Application.contextUrl + 'utility/ReferencedLink.html';
-  
-  var callback = function(response, data, request){
+  var actionURL = OB.Application.contextUrl + 'utility/ReferencedLink.html',
+      callback, reqObj, request;
+
+  callback = function (response, data, request) {
     OB.Utilities.openView(data.windowId, data.tabId, data.tabTitle, data.recordId);
   };
-  
-  var reqObj = {
+
+  reqObj = {
     params: {
       Command: 'JSON',
       inpEntityName: targetEntity,
@@ -433,13 +436,14 @@
     useSimpleHttp: true,
     actionURL: actionURL
   };
-  var request = isc.RPCManager.sendRequest(reqObj);
+  request = isc.RPCManager.sendRequest(reqObj);
 };
 
 // ** {{{OB.Utilities.getPromptString}}} **
 // Translates a string or array of strings to a string with html returns.
-OB.Utilities.getPromptString = function(msg){
-  var msgString = '', i, length;
+OB.Utilities.getPromptString = function (msg) {
+  var msgString = '',
+      i, length;
   if (!isc.isAn.Array(msg)) {
     msg = [msg];
   }
@@ -452,13 +456,14 @@
 // ** {{{OB.Utilities.getUrlParameters}}} **
 // Returns the url parameters as a javascript object. Note works for simple cases
 // where no & is used for character encoding, this is fine for most cases.
-OB.Utilities.getUrlParameters = function(href){
+OB.Utilities.getUrlParameters = function (href) {
   href = href || window.location.href;
-  var vars = {}, hash, length,
-    hashes = href.slice(href.indexOf('?') + 1).split('&'), i;
-  
+  var vars = {},
+      hash, length, hashes = href.slice(href.indexOf('?') + 1).split('&'),
+      i;
+
   length = hashes.length;
-  
+
   for (i = 0; i < length; i++) {
     hash = hashes[i].split('=');
     if (hash[i] && hash[i].contains('#')) {
@@ -471,16 +476,17 @@
 
 // ** {{{OB.Utilities.hasUrlParameter}}} **
 // Returns true if the url has a certain parameter with a certain value.
-OB.Utilities.hasUrlParameter = function(name, value){
-  var url = window.document.location.href, checkPoint = url.indexOf(name + '=' +
-  value);
+OB.Utilities.hasUrlParameter = function (name, value) {
+  var url = window.document.location.href,
+      checkPoint = url.indexOf(name + '=' + value);
   return checkPoint !== -1;
 };
 
 // ** {{{OB.Utilities.getLocationUrlWithoutFragment()}}} **
 // Returns the url of the page without the fragment (the part starting with #)
-OB.Utilities.getLocationUrlWithoutFragment = function(){
-  var url = window.document.location.href, checkPoint = url.indexOf('#');
+OB.Utilities.getLocationUrlWithoutFragment = function () {
+  var url = window.document.location.href,
+      checkPoint = url.indexOf('#');
   if (checkPoint !== -1) {
     url = url.substring(0, checkPoint);
   }
@@ -496,14 +502,12 @@
 //                     properties of this object to url as POST, other case a GET to url is
 //                     performed
 // frameset
-OB.Utilities.openProcessPopup = function(/* String */url, noFrameSet, postParams, height, width){
+OB.Utilities.openProcessPopup = function (url, noFrameSet, postParams, height, width) {
   height = height || 450;
   width = width || 625;
   var top = (screen.height - height) / 2;
   var left = (screen.width - width) / 2;
-  var adds = 'height=' + height + ', width=' + width + ', left=' + left +
-  ', top=' +
-  top;
+  var adds = 'height=' + height + ', width=' + width + ', left=' + left + ', top=' + top;
   adds += ', location=0';
   adds += ', scrollbars=1';
   adds += ', status=1';
@@ -511,26 +515,19 @@
   adds += ', toolbar=0';
   adds += ', resizable=1';
   var winPopUp;
-  
+
   if (noFrameSet) {
     winPopUp = window.open(url, 'PROCESS', adds);
   } else {
     winPopUp = window.open('', 'PROCESS', adds);
-    var mainFrameSrc = !postParams ? ('src="' + url + '"') : '', html = '<html>' +
-    '<frameset cols="0%,100%" frameborder="no" border="0" framespacing="0" rows="*" id="framesetMenu">' +
-    '<frame name="frameMenu" scrolling="no" src="' +
-    OB.Application.contextUrl +
-    'utility/VerticalMenu.html?Command=LOADING" id="paramFrameMenuLoading"></frame>' +
-    '<frame name="mainframe" noresize="" ' +
-    mainFrameSrc +
-    ' id="fieldProcessId"></frame>' +
-    '<frame name="hiddenFrame" scrolling="no" noresize="" src=""></frame>' +
-    '</frameset>' +
-    '</html>';
+    var mainFrameSrc = !postParams ? ('src="' + url + '"') : '',
+        html = '<html>' + '<frameset cols="0%,100%" frameborder="no" border="0" framespacing="0" rows="*" id="framesetMenu">' + '<frame name="frameMenu" scrolling="no" src="' + OB.Application.contextUrl + 'utility/VerticalMenu.html?Command=LOADING" id="paramFrameMenuLoading"></frame>' + '<frame name="mainframe" noresize="" ' + mainFrameSrc + ' id="fieldProcessId"></frame>' + '<frame name="hiddenFrame" scrolling="no" noresize="" src=""></frame>' + '</frameset>' + '</html>';
 
     winPopUp.document.write(html);
     if (postParams) {
-      var doc = winPopUp.frames[1].document, frm = doc.createElement('form'), i;
+      var doc = winPopUp.frames[1].document,
+          frm = doc.createElement('form'),
+          i;
       frm.setAttribute('method', 'post');
       frm.setAttribute('action', url);
       for (i in postParams) {
@@ -554,7 +551,7 @@
 
 // ** {{{ OB.Utilities.registerClassicPopupInTestRegistry(/*String*/ url, /*Object*/ obj }}} **
 // Registers the obj as a classic popup
-OB.Utilities.registerClassicPopupInTestRegistry = function(url, obj){
+OB.Utilities.registerClassicPopupInTestRegistry = function (url, obj) {
   if (url.startsWith('/')) {
     var index = url.indexOf('/', 1);
     url = url.substring(index + 1);
@@ -566,7 +563,7 @@
 // Returns true if the parameter is a valid String which has length > 0
 // Parameters:
 // * {{{strValue}}}: the value to check
-OB.Utilities.isNonEmptyString = function(/* String */strValue){
+OB.Utilities.isNonEmptyString = function (strValue) {
   if (!strValue) {
     return false;
   }
@@ -579,7 +576,7 @@
 // Parameters:
 // * {{{str1}}}: the first String to check
 // * {{{str2}}}: the second String to compare
-OB.Utilities.areEqualWithTrim = function(/* String */str1, /* String */ str2){
+OB.Utilities.areEqualWithTrim = function (str1, str2) {
   if (!str1 || !str2) {
     return false;
   }
@@ -590,20 +587,21 @@
 
 //** {{{ OB.Utilities.trim(/*String*/ str)}}} **
 //Trims a string
-OB.Utilities.trim = function(/* String */str){
+OB.Utilities.trim = function (str) {
   if (!str) {
-   return str;
+    return str;
   }
   return str.replace(/^\s*/, '').replace(/\s*$/, '');
 };
 
-OB.Utilities.processLogoutQueue = function(){
-  var q = OB.Utilities.logoutWorkQueue, qElement, result, tab, tabID;
-  
+OB.Utilities.processLogoutQueue = function () {
+  var q = OB.Utilities.logoutWorkQueue,
+      qElement, result, tab, tabID;
+
   if (q && q.length === 0) {
     return;
   }
-  
+
   if (typeof arguments[1] === 'string') {
     // The 2nd parameter in a sendRequest callback is the 'data' parameter
     // http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#type..RPCCallback
@@ -630,9 +628,9 @@
 // ** {{{ OB.Utilities.logout }}} **
 // Logout from the application, removes server side session info and redirects
 // the client to the Login page.
-OB.Utilities.logout = function(confirmed){
+OB.Utilities.logout = function (confirmed) {
   if (!confirmed) {
-    isc.confirm(OB.I18N.getLabel('OBUIAPP_LogoutConfirmation'), function(ok){
+    isc.confirm(OB.I18N.getLabel('OBUIAPP_LogoutConfirmation'), function (ok) {
       if (ok) {
         OB.Utilities.logout(true);
       }
@@ -640,22 +638,24 @@
     return;
   }
   OB.Utilities.logoutWorkQueue = [];
-  var q = OB.Utilities.logoutWorkQueue, i, tabs = OB.MainView.TabSet.tabs, tabsLength = tabs.length, appFrame;
-  
+  var q = OB.Utilities.logoutWorkQueue,
+      i, tabs = OB.MainView.TabSet.tabs,
+      tabsLength = tabs.length,
+      appFrame;
+
   // Push the logout process to the 'end' of the queue
   q.push({
     func: OB.RemoteCallManager.call,
     self: this,
-    args: ['org.openbravo.client.application.LogOutActionHandler', {}, {}, function(){
+    args: ['org.openbravo.client.application.LogOutActionHandler',
+    {}, {}, function () {
       window.location.href = OB.Application.contextUrl;
-    }
-]
+    }]
   });
-  
+
   for (i = 0; i < tabsLength; i++) {
     if (tabs[i].pane.Class === 'OBClassicWindow') {
-      appFrame = tabs[i].pane.appFrameWindow ||
-      tabs[i].pane.getAppFrameWindow();
+      appFrame = tabs[i].pane.appFrameWindow || tabs[i].pane.getAppFrameWindow();
       if (appFrame && appFrame.isUserChanges) {
         if (appFrame.validate && !appFrame.validate()) {
           q = [];
@@ -674,7 +674,7 @@
 
 // ** {{{ OB.Utilities.getYesNoDisplayValue }}} **
 // Returns the Yes label if the passed value is true, the No label if false.
-OB.Utilities.getYesNoDisplayValue = function(/* Boolean */value){
+OB.Utilities.getYesNoDisplayValue = function (value) {
   if (value === true || value === 'true') {
     return OB.I18N.getLabel('OBUISC_Yes');
   } else if (value === false) {
@@ -686,7 +686,7 @@
 
 // ** {{{ OB.Utilities.getClassicValue }}} **
 // Returns the Y if the passed value is true, and N if false.
-OB.Utilities.getClassicValue = function(/* Boolean */value){
+OB.Utilities.getClassicValue = function (value) {
   if (value) {
     return 'Y';
   } else if (value === false) {
@@ -705,8 +705,9 @@
 // * {{{fields}}}: the current values
 // * {{{defaultValues}}}: the default values to set in the fields object (if the
 // property is not set in the fields object).
-OB.Utilities.applyDefaultValues = function(/* Object */fields, /* Object */ defaultValues){
-  var fieldsLength = fields.length, i, property;
+OB.Utilities.applyDefaultValues = function (fields, defaultValues) {
+  var fieldsLength = fields.length,
+      i, property;
   for (i = 0; i < fieldsLength; i++) {
     var field = fields[i];
     for (property in defaultValues) {
@@ -729,17 +730,19 @@
 // * {{{win}}}: (Optional) a reference to the global context (window) where to
 // get the document
 // and functions are located, if not passed, the current window is used
-OB.Utilities.addFormInputsToCriteria = function(/* Object */criteria, /* Window */ win){
-  var d = (win && win.document ? win.document : null) || window.document, elementsLength = (d.frmMain ? d.frmMain.elements.length : 0), inputValue = (win && win.inputValue ? win.inputValue : null) ||
-  window.inputValue, i, elem;
-  
+OB.Utilities.addFormInputsToCriteria = function (criteria, win) {
+  var d = (win && win.document ? win.document : null) || window.document,
+      elementsLength = (d.frmMain ? d.frmMain.elements.length : 0),
+      inputValue = (win && win.inputValue ? win.inputValue : null) || window.inputValue,
+      i, elem;
+
   for (i = 0; i < elementsLength; i++) {
     elem = d.frmMain.elements[i];
     if (elem.name) {
       criteria[elem.name] = inputValue(elem);
     }
   }
-  
+
   // the form can have an organization field,
   // in the server it is used to determine the accessible orgs
   // TODO: make this optional or make it possible to set the orgid html id
@@ -756,8 +759,7 @@
 // Parameters:
 // * {{{url}}}: the url to post the request.
 // * {{{data}}}: the data to include in the request.
-
-OB.Utilities.postThroughHiddenForm = function(url, data) {
+OB.Utilities.postThroughHiddenForm = function (url, data) {
   var key;
   OB.GlobalHiddenForm.setAttribute('action', url);
 
@@ -769,7 +771,7 @@
 
   var encodeProperties = {
     // prevents timezone issues
-    encodeDate: function(dt) {
+    encodeDate: function (dt) {
       var ret, oldXMLSchemaMode = isc.Comm.xmlSchemaMode;
       isc.Comm.xmlSchemaMode = true;
       ret = dt.toSerializeableDate();
@@ -783,9 +785,9 @@
       var field = document.createElement('input');
       field.setAttribute('type', 'hidden');
       field.setAttribute('name', key);
-      if(isc.isA.Object(data[key])){
+      if (isc.isA.Object(data[key])) {
         field.setAttribute('value', isc.JSON.encode(data[key], encodeProperties));
-      }else{
+      } else {
         field.setAttribute('value', data[key]);
       }
       OB.GlobalHiddenForm.appendChild(field);
@@ -802,7 +804,7 @@
 // Parameters:
 // * {{{input}}}: the input field (html dom input element)
 // * {{{component}}}: the Smartclient component (must have a setValue function)
-OB.Utilities.updateSmartClientComponentValue = function(/* Object */input, /* Object */ component){
+OB.Utilities.updateSmartClientComponentValue = function (input, component) {
   component.setValue(input.value);
 };
 
@@ -812,11 +814,10 @@
 //
 // Parameters:
 // * {{{currentValues}}}: array of values
-OB.Utilities.fixNull250 = function(currentValues){
+OB.Utilities.fixNull250 = function (currentValues) {
   var i;
   for (i in currentValues) {
-    if (currentValues.hasOwnProperty(i) &&
-         (currentValues[i] === null || currentValues[i] === undefined)) {
+    if (currentValues.hasOwnProperty(i) && (currentValues[i] === null || currentValues[i] === undefined)) {
       currentValues[i] = '';
     }
   }
@@ -827,7 +828,7 @@
 //
 // Parameters:
 // * {{{url}}}: String url
-OB.Utilities.isValidURL = function(url){
+OB.Utilities.isValidURL = function (url) {
   // Validation based on: http://view.jquery.com/trunk/plugins/validate/jquery.validate.js
   // Note: http://localhost is not a valid URL, http://localhost.localdomain is a valid one
   if (!url) {
@@ -843,68 +844,56 @@
 // Parameters:
 //  * {{{path}}} path portion of URL
 //
-OB.Utilities.applicationUrl = function(path) {
+OB.Utilities.applicationUrl = function (path) {
   var appUrl = OB.Application.contextUrl + path;
-  if(appUrl.indexOf('//') === 0 ) {
+  if (appUrl.indexOf('//') === 0) {
     // Double slash at start of relative URL only keeps scheme, not server
     appUrl = appUrl.substring(1);
   }
   return appUrl;
 };
 
-OB.Utilities.formatTimePassedMessage = function(
-/* number of time units */n, /*
-                 * message id
-                 */messageId) {
-  var message = OB.I18N.getLabel(messageId,[n]);
+OB.Utilities.formatTimePassedMessage = function (n, messageId) {
+  var message = OB.I18N.getLabel(messageId, [n]);
   return message;
 };
 
-OB.Utilities.getTimePassed = function(
-  /* date the note was created */created) {
-    // 0-59 minutes: minutes
+OB.Utilities.getTimePassed = function (created) {
+  // 0-59 minutes: minutes
   // 1-24 hours: hours
   // >24 hours: days
   // >7 days: weeks
   // >30 days: months
-
-  var now = new Date(), 
+  var now = new Date(),
       msCreated = created.getTime(),
       msNow = now.getTime();
-  
+
   // time difference in days
   return OB.Utilities.getTimePassedInterval(msNow - msCreated);
 };
 
-OB.Utilities.getTimePassedInterval = function(
-  /* amount of time in miliseconds */ timeInMiliseconds) {
+OB.Utilities.getTimePassedInterval = function (timeInMiliseconds) {
   var n;
   var diffDays = Math.floor((timeInMiliseconds) / (1000 * 60 * 60 * 24));
   if (diffDays >= 30) {
     n = Math.floor(diffDays / 30);
-    return OB.Utilities.formatTimePassedMessage(n,
-        'OBUIAPP_months_ago');
+    return OB.Utilities.formatTimePassedMessage(n, 'OBUIAPP_months_ago');
   } else if (diffDays >= 7) {
     n = Math.floor(diffDays / 7);
-    return OB.Utilities.formatTimePassedMessage(n,
-        'OBUIAPP_weeks_ago');
+    return OB.Utilities.formatTimePassedMessage(n, 'OBUIAPP_weeks_ago');
   } else if (diffDays >= 1) {
     n = diffDays;
-    return OB.Utilities.formatTimePassedMessage(n,
-        'OBUIAPP_days_ago');
+    return OB.Utilities.formatTimePassedMessage(n, 'OBUIAPP_days_ago');
   }
 
   // time difference in hours
   var diffHours = Math.floor((timeInMiliseconds) / (1000 * 60 * 60));
   if (diffHours >= 1) {
     n = diffHours;
-    return OB.Utilities.formatTimePassedMessage(n,
-        'OBUIAPP_hours_ago');
+    return OB.Utilities.formatTimePassedMessage(n, 'OBUIAPP_hours_ago');
   }
 
   // time difference in minutes
   n = Math.floor((timeInMiliseconds) / (1000 * 60));
-  return OB.Utilities.formatTimePassedMessage(n,
-      'OBUIAPP_minutes_ago');
-  };
-    
+  return OB.Utilities.formatTimePassedMessage(n, 'OBUIAPP_minutes_ago');
+};
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js	Sat Feb 11 17:01:05 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js	Sat Feb 11 17:22:32 2012 +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) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -23,7 +23,7 @@
 // manager. View types which are not yet defined on the client are loaded
 // from the server. 
 //
-(function(OB, isc){
+(function (OB, isc) {
 
   if (!OB || !isc) {
     throw {
@@ -31,11 +31,13 @@
       message: 'openbravo and isc objects are required'
     };
   }
-  
+
   // cache object references locally
-  var L = OB.Layout, ISC = isc, vmgr; // Local reference to ViewManager instance
+  var L = OB.Layout,
+      ISC = isc,
+      vmgr; // Local reference to ViewManager instance
 
-  function ViewManager(){
+  function ViewManager() {
     // keep the last 5 opened views
     this.recentManager.recentNum = 5;
   }
@@ -52,8 +54,9 @@
     views: {
       cache: [],
 
-      getViewTabID: function(vName, params){
-        var len = this.cache.length, i, item;
+      getViewTabID: function (vName, params) {
+        var len = this.cache.length,
+            i, item;
         for (i = len; i > 0; i--) {
           item = this.cache[i - 1];
           if (item.instance.isSameTab && item.instance.isSameTab(vName, params)) {
@@ -63,8 +66,11 @@
         return null;
       },
 
-      getTabNumberFromViewParam: function(param, value) {
-        var numberOfTabs = OB.MainView.TabSet.tabs.length, viewParam = '', result = null, i;
+      getTabNumberFromViewParam: function (param, value) {
+        var numberOfTabs = OB.MainView.TabSet.tabs.length,
+            viewParam = '',
+            result = null,
+            i;
         for (i = 0; i < numberOfTabs; i++) {
           viewParam = OB.MainView.TabSet.getTabPane(i)[param];
           if (viewParam === value) {
@@ -74,12 +80,13 @@
         return result;
       },
 
-      push: function(instanceDetails) {
+      push: function (instanceDetails) {
         this.cache.push(instanceDetails);
       },
 
-      removeTab: function(viewTabId) {
-        var len = this.cache.length, i, item, removed;
+      removeTab: function (viewTabId) {
+        var len = this.cache.length,
+            i, item, removed;
         for (i = len; i > 0; i--) {
           item = this.cache[i - 1];
           if (item.viewTabId === viewTabId) {
@@ -90,7 +97,7 @@
       }
     },
 
-    findLoadingTab: function(params) {
+    findLoadingTab: function (params) {
       var i, length;
       if (!params.loadingTabId) {
         return null;
@@ -105,7 +112,7 @@
       return null;
     },
 
-    createLoadingTab: function(viewId, params, viewTabId) {
+    createLoadingTab: function (viewId, params, viewTabId) {
       // open a loading tab
       params = params || {};
       var layout = OB.Utilities.createLoadingLayout();
@@ -116,14 +123,16 @@
       this.createTab(viewId, viewTabId, layout, params);
       return params;
     },
-    
-    fetchView: function(viewId, callback, clientContext, params, useLoadingTab) {
+
+    fetchView: function (viewId, callback, clientContext, params, useLoadingTab) {
+      var rpcMgr = ISC.RPCManagerm,
+          reqObj, request;
+
       if (useLoadingTab) {
         params = this.createLoadingTab(viewId, params);
       }
 
-      var rpcMgr = ISC.RPCManager;
-      var reqObj = {
+      reqObj = {
         params: {
           viewId: viewId
         },
@@ -134,25 +143,24 @@
         useSimpleHttp: true,
         actionURL: OB.Application.contextUrl + 'org.openbravo.client.kernel/OBUIAPP_MainLayout/View'
       };
-      var request = rpcMgr.sendRequest(reqObj);
+      request = rpcMgr.sendRequest(reqObj);
     },
 
-    addRecentDocument: function(params) {
-      vmgr.recentManager.addRecent('OBUIAPP_RecentDocumentsList', 
-          isc.addProperties({icon: OB.Styles.OBApplicationMenu.Icons.window}, 
-              params));
+    addRecentDocument: function (params) {
+      vmgr.recentManager.addRecent('OBUIAPP_RecentDocumentsList', isc.addProperties({
+        icon: OB.Styles.OBApplicationMenu.Icons.window
+      }, params));
     },
 
-    createTab: function(viewName, viewTabId, viewInstance, params) {
+    createTab: function (viewName, viewTabId, viewInstance, params) {
       var tabTitle;
-      
+
       if (params.i18nTabTitle) {
         // note call to I18N is done below after the tab
         // has been created
         tabTitle = '';
       } else {
-        tabTitle = params.tabTitle || viewInstance.tabTitle || params.tabId ||
-        viewName;
+        tabTitle = params.tabTitle || viewInstance.tabTitle || params.tabId || viewName;
       }
 
       var tabDef = {
@@ -163,7 +171,7 @@
         params: params,
         pane: viewInstance
       };
-      
+
       // let the params override tab properties like canClose
       tabDef = isc.addProperties(tabDef, params);
 
@@ -181,7 +189,7 @@
         // note the callback calls the tabSet
         // with the tabid to set the label
         OB.I18N.getLabel(params.i18nTabTitle, null, {
-          setTitle: function(label){
+          setTitle: function (label) {
             OB.MainView.TabSet.setTabTitle(viewTabId, label);
           }
         }, 'setTitle');
@@ -222,7 +230,7 @@
     // information
     // to initialize an instance.
     //
-    openView: function(viewName, params, state) {
+    openView: function (viewName, params, state) {
 
       params = params || {};
 
@@ -240,14 +248,15 @@
           params.viewId = viewName;
         }
         // add and set a default icon
-        vmgr.recentManager.addRecent('OBUIAPP_RecentViewList', 
-            isc.addProperties({icon: OB.Styles.OBApplicationMenu.Icons.window}, 
-                params));
+        vmgr.recentManager.addRecent('OBUIAPP_RecentViewList', isc.addProperties({
+          icon: OB.Styles.OBApplicationMenu.Icons.window
+        }, params));
       }
 
       //
       // Returns the function implementation of a View
       //
+
       function getView(viewName, params, state) {
 
         if (!viewName) {
@@ -260,6 +269,7 @@
         //
         // Shows a view in a tab in the {{{ TabSet }}} or external
         //
+
         function showTab(viewName, params, state) {
 
           // will as a default display a loading tab when loading the 
@@ -268,9 +278,8 @@
           // 1) view is not open and class not loaded (open view and show loading bar)
           // 2) view is not open but class was loaded (open view and show loading bar)
           // 3) view is open and class is loaded (show loading bar in open view)          
-          var viewTabId, tabTitle, loadingTab = vmgr.findLoadingTab(params), 
-              loadingPane, currentPane,
-              tabSet = OB.MainView.TabSet;
+          var viewTabId, tabTitle, loadingTab = vmgr.findLoadingTab(params),
+              loadingPane, currentPane, tabSet = OB.MainView.TabSet;
 
           params = params || {};
 
@@ -290,7 +299,7 @@
               loadingPane.isLoadingTab = true;
 
               tabSet.updateTab(viewTabId, loadingPane);
-              
+
               // and show it
               tabSet.selectTab(viewTabId);
             } else {
@@ -299,16 +308,16 @@
               // in another thread
               params = vmgr.createLoadingTab(viewName, params, viewTabId);
             }
-            
+
             // make a clone to prevent params being updated in multiple threads
             // happens for the myob tab in special cases
             // https://issues.openbravo.com/view.php?id=18548
             params = isc.shallowClone(params);
-            
+
             // use a canvas to make use of the fireOnPause possibilities
             // but don't forget to destroy it afterwards...
             var cnv = isc.Canvas.create({
-              openView: function() {
+              openView: function () {
                 vmgr.openView(viewName, params);
                 // delete so that at the next opening a new loading layout
                 // is created
@@ -375,21 +384,20 @@
             // '_tab'
             // but this is not a problem, it should be unique that's the most
             // important part
-            
             // the select tab event will update the history
             if (tabSet.getSelectedTab() && tabSet.getSelectedTab().pane.viewTabId === viewTabId) {
               OB.Layout.HistoryManager.updateHistory();
             } else if (viewInstance.getClassName() !== 'OBMyOpenbravoImplementation') {
-                // only select a non myob tab
+              // only select a non myob tab
               tabSet.selectTab(viewTabId);
             }
 
             return;
           }
-          
+
           // Creating an instance of the view implementation
           viewTabId = viewInstance.ID + '_tab';
-          
+
           if (viewInstance) {
             vmgr.createTab(viewName, viewTabId, viewInstance, params);
           }
@@ -399,6 +407,7 @@
         // Function used by the {{ ISC.RPCManager }} after receiving the view
         // implementation from the back-end
         //          
+
         function fetchViewCallback(response, data, request) {
           // if the window is in development it's name is always unique
           // and has changed
@@ -416,7 +425,7 @@
 
         if (isc[viewName]) {
           showTab(viewName, params);
-        } else {         
+        } else {
           vmgr.fetchView(viewName, fetchViewCallback, null, params, true);
         }
       }
@@ -430,11 +439,11 @@
     // The data object contains extra (more complex) state information which 
     // can not be bookmarked.
     //
+    restoreState: function (newState, data) {
 
-    restoreState: function(newState, data) {
-
-      var viewId, tabSet = OB.MainView.TabSet, tabsLength, i, tabObject, 
-        hasChanged = false, stateData, requestViewsRestoreState;
+      var viewId, tabSet = OB.MainView.TabSet,
+          tabsLength, i, tabObject, hasChanged = false,
+          stateData, requestViewsRestoreState;
 
       if (vmgr.inStateHandling) {
         return;
@@ -457,7 +466,7 @@
       if (!hasChanged) {
         for (i = 0; i < tabsLength; i++) {
           tabObject = OB.MainView.TabSet.getTabObject(i);
-          
+
           // changed if the view id is different
           if (newState.bm[i].viewId !== tabObject.viewName) {
             hasChanged = true;
@@ -487,7 +496,7 @@
         // arrives
         // see here:
         // https://issues.openbravo.com/view.php?id=15146
-        requestViewsRestoreState = function (rpcResponse){
+        requestViewsRestoreState = function (rpcResponse) {
           var clientContext = rpcResponse.clientContext;
           var currentIndex = clientContext.currentIndex;
           var data = clientContext.data;
@@ -542,7 +551,7 @@
 
           if (!isc[newState.bm[i].viewId]) {
             var clientContext = {};
-            
+
             viewId = newState.bm[i].viewId;
             clientContext.currentIndex = i + 1;
             clientContext.data = data;
@@ -555,14 +564,14 @@
           vmgr.openView(newState.bm[i].viewId, newState.bm[i].params, stateData);
         }
       }
-      
+
       OB.MainView.TabSet.selectTab(newState.st);
 
       vmgr.inStateHandling = false;
     },
 
-    createAddStartTab: function(){
-      var error, historyId =  isc.History.getCurrentHistoryId();
+    createAddStartTab: function () {
+      var error, historyId = isc.History.getCurrentHistoryId();
       if (historyId) {
         try {
           OB.Layout.HistoryManager.restoreHistory(historyId, isc.History.getHistoryData(historyId));
@@ -602,4 +611,4 @@
 
   // Initialize ViewManager object
   vmgr = L.ViewManager = OB.ViewManager = new ViewManager();
-}(OB, isc));
+}(OB, isc));
\ No newline at end of file