details:   /erp/devel/pi/rev/ebe5baf95742
changeset: 10531:ebe5baf95742
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Thu Feb 10 16:12:02 2011 +0100
summary:   fixed issue 15723: Direct navigation is customizable by preferences

diffstat:

 src/org/openbravo/erpCommon/utility/ReferencedLink.java |  18 ++++++++++++++--
 1 files changed, 15 insertions(+), 3 deletions(-)

diffs (49 lines):

diff -r 242dc84362f8 -r ebe5baf95742 
src/org/openbravo/erpCommon/utility/ReferencedLink.java
--- a/src/org/openbravo/erpCommon/utility/ReferencedLink.java   Thu Feb 10 
14:35:10 2011 +0100
+++ b/src/org/openbravo/erpCommon/utility/ReferencedLink.java   Thu Feb 10 
16:12:02 2011 +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) 2001-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2011 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -38,6 +38,7 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
 import org.openbravo.data.Sqlc;
+import org.openbravo.erpCommon.businessUtility.Preferences;
 import org.openbravo.model.ad.system.Language;
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.WindowTrl;
@@ -172,7 +173,19 @@
         isSOTrx = ref.isSOTrx();
       ref = null;
     }
-    {
+
+    // Fixes issue #15723 while the complete implementation defined in #15379 
is not ready
+    boolean forcedLink;
+    try {
+      strWindowId = Preferences.getPreferenceValue("ForcedLinkWindow" + 
strTableName, false, vars
+          .getClient(), vars.getOrg(), vars.getUser(), vars.getRole(), 
strWindowId);
+      forcedLink = true;
+    } catch (PropertyException e) {
+      // Property is not set, follow standard flow
+      forcedLink = false;
+    }
+
+    if (!forcedLink) {
       String strTableRealReference = strTableReferenceId;
       if (strTableReferenceId.equals("800018")) { // DP
         if (ReferencedTablesData.selectKeyId(this, "C_INVOICE_ID", 
strTableName,
@@ -213,7 +226,6 @@
         if (!isSOTrx && !data[0].poWindowId.equals(""))
           strWindowId = data[0].poWindowId;
       }
-
     }
     ReferencedLinkData[] data = ReferencedLinkData.select(this, strWindowId, 
strTableReferenceId);
     if (data == null || data.length == 0)

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to