Implement direct opening of record in tab
authorMartin Taal <martin.taal@openbravo.com>
Tue, 08 Mar 2011 15:29:03 +0100
changeset 11102 9ff12adabca8
parent 11101 1724a83b0f0c
child 11103 367dbc74a9bc
Implement direct opening of record in tab
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-manager.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-manager.js	Tue Mar 08 15:28:21 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-manager.js	Tue Mar 08 15:29:03 2011 +0100
@@ -216,7 +216,10 @@
       // only add closable views to the recent items, this prevents the workspace
       // view from being displayed, explicitly doing !== false to catch 
       // views which don't have this set at all
-      if (params.canClose !== false && !vmgr.inStateHandling) {
+      // don't store OBPopupClassicWindow in the viewmanager 
+      // don't store direct links to a target tab, this should be set in a different
+      // property
+      if (!params.targetTabId && params.canClose !== false && !vmgr.inStateHandling && params.viewId !== 'OBPopupClassicWindow') {
         // add and set a default icon
         vmgr.recentManager.addRecent('OBUIAPP_RecentViewList', 
             isc.addProperties({icon: '[SKINIMG]../../org.openbravo.client.application/images/application-menu/iconWindow.png'}, 
@@ -509,6 +512,15 @@
       if (!viewTabId) {
         this.openView(viewId, viewParams, null);
       }
+      
+      // check if a tabId was passed as a url param
+      // only do this if there is no other history
+      if (!historyId) {
+        var urlParams = OB.Utilities.getUrlParameters();
+        if (urlParams.tabId) {
+          OB.Utilities.openDirectTab(urlParams.tabId, urlParams.recordId, urlParams.command);
+        }
+      }
     }
   };