fixes issue 31411: Not possible to install modules in Module Mgmt using Edge
authorCarlos Aristu <carlos.aristu@openbravo.com>
Tue, 10 Nov 2015 17:21:18 +0100
changeset 27851 a8ad0086de56
parent 27850 c365fc9d4bd0
child 27853 cb4dec610d4b
fixes issue 31411: Not possible to install modules in Module Mgmt using Edge

The problem is that on MS Edge browser, the window.opener was lost. Now it is recovered in the same way as it was done for IE9. This avoids the javascript error that was being fired when trying to hide the loading screen in that browser.

Together with this the cache revision number has been updated in the required files.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
src/org/openbravo/erpCommon/security/Login.html
src/org/openbravo/erpCommon/security/Login_F1.html
src/org/openbravo/erpCommon/utility/PopupLoading.html
web/js/utils.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js	Tue Nov 10 16:26:06 2015 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js	Tue Nov 10 17:21:18 2015 +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-2013 Openbravo SLU
+ * All portions are Copyright (C) 2010-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -446,8 +446,8 @@
         if (!cPopup.areParamsSet) {
           if (!postParams) {
             cPopup.getIframeHtmlObj().contentWindow.frames[0].location.href = cPopup.popupURL;
-            if (OB.Utilities.isIE9Strict) {
-              // In IE9 Strict, when the location.href or .src is defined, the previous defined opener is lost, and it should be defined again
+            if (OB.Utilities.isIE9Strict || OB.Utilities.isEdge) {
+              // In IE9 Strict and Edge, when the location.href or .src is defined, the previous defined opener is lost, and it should be defined again
               cPopup.getIframeHtmlObj().contentWindow.frames[0].opener = cPopup.theOpener;
               var setOpenerInterval;
               setOpenerInterval = setInterval(
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Tue Nov 10 16:26:06 2015 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Tue Nov 10 17:21:18 2015 +0100
@@ -27,6 +27,11 @@
   OB.Utilities.isIE9Strict = true;
 }
 
+OB.Utilities.isEdge = false;
+if (navigator.userAgent.toUpperCase().indexOf("EDGE") !== -1) {
+  OB.Utilities.isEdge = true;
+}
+
 //** {{{OB.Utilities.checkProfessionalLicense}}} **
 // Checks if the current instance is using a professional license 
 // (!= community). If the instance has a community instance then 
--- a/src/org/openbravo/erpCommon/security/Login.html	Tue Nov 10 16:26:06 2015 +0100
+++ b/src/org/openbravo/erpCommon/security/Login.html	Tue Nov 10 17:21:18 2015 +0100
@@ -406,7 +406,7 @@
     }
     catch (e) { }
 
-    if ((!revisionControl('27290')) || (isOpsInstance() != isOpsInstanceCached())) {
+    if ((!revisionControl('27851')) || (isOpsInstance() != isOpsInstanceCached())) {
       maskLoginWindow(cacheMsg);
       setLoginMessage('Warning', '', cacheMsg);
     }
--- a/src/org/openbravo/erpCommon/security/Login_F1.html	Tue Nov 10 16:26:06 2015 +0100
+++ b/src/org/openbravo/erpCommon/security/Login_F1.html	Tue Nov 10 17:21:18 2015 +0100
@@ -126,7 +126,7 @@
       clearForm();
     } catch (e) {}
     setWindowElementFocus('firstElement');
-    if ((!revisionControl('27290')) || (isOpsInstance() != isOpsInstanceCached())) {
+    if ((!revisionControl('27851')) || (isOpsInstance() != isOpsInstanceCached())) {
       alert(cacheMsg);
     }
 
--- a/src/org/openbravo/erpCommon/utility/PopupLoading.html	Tue Nov 10 16:26:06 2015 +0100
+++ b/src/org/openbravo/erpCommon/utility/PopupLoading.html	Tue Nov 10 17:21:18 2015 +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) 2008-2012 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2015 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -38,7 +38,7 @@
   <script language="javascript">
     function onLoadDo() {
       moreOnLoadDoFunctions();
-      if (isIE9Strict) {
+      if (isIE9Strict || isEdge) {
         var i=0;
         var setOpenerInterval = setInterval(
           function() {
--- a/web/js/utils.js	Tue Nov 10 16:26:06 2015 +0100
+++ b/web/js/utils.js	Tue Nov 10 17:21:18 2015 +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-2014 Openbravo SLU
+ * All portions are Copyright (C) 2001-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -29,6 +29,9 @@
   if (navigator.userAgent.toUpperCase().indexOf("MSIE") !== -1 && getBrowserInfo('documentMode') >= 9 && parseInt(getBrowserInfo('majorVersion'), 10) >= 9) {
     isIE9Strict = true;
   }
+  if (navigator.userAgent.toUpperCase().indexOf("EDGE") !== -1) {
+    isEdge = true;
+  }
   isWindowInMDIPopup = checkWindowInMDIPopup();
   isWindowInMDITab = checkWindowInMDITab();
   isWindowInMDIPage = checkWindowInMDIPage();
@@ -40,6 +43,7 @@
 }
 
 var isIE9Strict = false;
+var isEdge = false;
 var isRTL = false;
 var isWindowInMDIPopup = false;
 var isWindowInMDITab = false;
@@ -101,7 +105,7 @@
 * Return a number that would be checked at the Login screen to know if the file is cached with the correct version
 */
 function getCurrentRevision() {
-  var number = '27290';
+  var number = '27851';
   return number;
 }