Fixes issue 30531: Openbravo ERP 3 doesn't work on Microsoft Edge
authorCarlos Aristu <carlos.aristu@openbravo.com>
Mon, 10 Aug 2015 14:26:44 +0200
changeset 27571 b28798b52483
parent 27570 1861f239c670
child 27572 c13047cce241
Fixes issue 30531: Openbravo ERP 3 doesn't work on Microsoft Edge

The application was crashing silently during the login process, because Smartclient sources were not identyfing properly the browser. This caused an error in the SC getStackTrace() method. In addition, the OB function getBrowserInfo() has been updated to identify the Microsft Edge browser in order to declare it as not supported for the time being
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/isomorphic/ISC_Combined.js
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/isomorphic/ISC_History.js
web/js/utils.js
--- a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/isomorphic/ISC_Combined.js	Mon Aug 10 10:23:33 2015 +0530
+++ b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/isomorphic/ISC_Combined.js	Mon Aug 10 14:26:44 2015 +0200
@@ -15,7 +15,7 @@
 return v.present=="true"||v.present.charAt(0)=="$"};isc.getOptionalModule=function(_1){return isc.$41r[_1]};isc.$a=window.isc_useSimpleNames;if(isc.$a==null)isc.$a=true;if(window.OpenAjax){isc.$b=isc.versionNumber.replace(/[a-zA-Z_]+/,".0");OpenAjax.registerLibrary("SmartClient","http://smartclient.com/SmartClient",isc.$b,{namespacedMode:!isc.$a,iscVersion:isc.version,buildDate:isc.buildDate,licenseType:isc.licenseType,licenseCompany:isc.licenseCompany,licenseSerialNumber:isc.licenseSerialNumber});OpenAjax.registerGlobals("SmartClient",["isc"])}
 isc.$e=window.isc_useLongDOMIDs;isc.$f="isc.";isc.addGlobal=function(_1,_2){if(_1.indexOf(isc.$f)==0)_1=_1.substring(4);isc[_1]=_2;if(isc.$a)window[_1]=_2}
 isc.onLine=true;isc.isOffline=function(){return!isc.onLine};isc.goOffline=function(){isc.onLine=false};isc.goOnline=function(){isc.onLine=true};if(window.addEventListener){window.addEventListener("online",isc.goOnline,false);window.addEventListener("offline",isc.goOffline,false)}
-isc.addGlobal("Browser",{isSupported:false});isc.Browser.isOpera=(navigator.appName=="Opera"||navigator.userAgent.indexOf("Opera")!=-1);isc.Browser.isNS=(navigator.appName=="Netscape"&&!isc.Browser.isOpera);isc.Browser.isIE=(navigator.appName=="Microsoft Internet Explorer"&&!isc.Browser.isOpera)||navigator.userAgent.indexOf("Trident/")!=-1;isc.Browser.isMSN=(isc.Browser.isIE&&navigator.userAgent.indexOf("MSN")!=-1);isc.Browser.isMoz=(navigator.userAgent.indexOf("Gecko")!=-1)&&(navigator.userAgent.indexOf("Safari")==-1)&&(navigator.userAgent.indexOf("AppleWebKit")==-1)&&!isc.Browser.isIE;isc.Browser.isCamino=(isc.Browser.isMoz&&navigator.userAgent.indexOf("Camino/")!=-1);isc.Browser.isFirefox=(isc.Browser.isMoz&&navigator.userAgent.indexOf("Firefox/")!=-1);isc.Browser.isAIR=(navigator.userAgent.indexOf("AdobeAIR")!=-1);isc.Browser.isWebKit=navigator.userAgent.indexOf("WebKit")!=-1;isc.Browser.isSafari=isc.Browser.isAIR||navigator.userAgent.indexOf("Safari")!=-1||navigator.userAgent.indexOf("AppleWebKit")!=-1;isc.Browser.isChrome=isc.Browser.isSafari&&(navigator.userAgent.indexOf("Chrome/")!=-1);if(!isc.Browser.isIE&&!isc.Browser.isOpera&&!isc.Browser.isMoz&&!isc.Browser.isAIR&&!isc.Browser.isWebkit&&!isc.Browser.isSafari)
+isc.addGlobal("Browser",{isSupported:false});isc.Browser.isOpera=(navigator.appName=="Opera"||navigator.userAgent.indexOf("Opera")!=-1);isc.Browser.isNS=(navigator.appName=="Netscape"&&!isc.Browser.isOpera);isc.Browser.isIE=(navigator.appName=="Microsoft Internet Explorer"&&!isc.Browser.isOpera)||navigator.userAgent.indexOf("Trident/")!=-1;isc.Browser.isMSN=(isc.Browser.isIE&&navigator.userAgent.indexOf("MSN")!=-1);isc.Browser.isMoz=(navigator.userAgent.indexOf("Gecko")!=-1)&&(navigator.userAgent.indexOf("Safari")==-1)&&(navigator.userAgent.indexOf("AppleWebKit")==-1)&&!isc.Browser.isIE;isc.Browser.isCamino=(isc.Browser.isMoz&&navigator.userAgent.indexOf("Camino/")!=-1);isc.Browser.isFirefox=(isc.Browser.isMoz&&navigator.userAgent.indexOf("Firefox/")!=-1);isc.Browser.isAIR=(navigator.userAgent.indexOf("AdobeAIR")!=-1);isc.Browser.isWebKit=navigator.userAgent.indexOf("WebKit")!=-1;isc.Browser.isSafari=isc.Browser.isAIR||navigator.userAgent.indexOf("Safari")!=-1||navigator.userAgent.indexOf("AppleWebKit")!=-1;isc.Browser.isEdge=isc.Browser.isSafari&&(navigator.userAgent.indexOf("Edge/")!=-1);isc.Browser.isChrome=isc.Browser.isSafari&&!isc.Browser.isEdge&&(navigator.userAgent.indexOf("Chrome/")!=-1);if(!isc.Browser.isIE&&!isc.Browser.isOpera&&!isc.Browser.isMoz&&!isc.Browser.isAIR&&!isc.Browser.isWebkit&&!isc.Browser.isSafari)
 {if(navigator.appVersion.indexOf("MSIE")!=-1){isc.Browser.isIE=true}}
 if(navigator.userAgent.indexOf("Trident/")>=0&&navigator.userAgent.lastIndexOf("rv:")>=0)
 {isc.Browser.minorVersion=parseFloat(navigator.userAgent.substring(navigator.userAgent.lastIndexOf("rv:")+"rv:".length))}else{isc.Browser.minorVersion=parseFloat(isc.Browser.isIE?navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE")+5):navigator.appVersion)}
@@ -7112,7 +7112,7 @@
 _11[16]=_1;if(_8)_8[_9]=_10;return _11},isc.A.$127g=function isc_TreeGrid__fixTitleWidth(){return this.fixedFieldWidths&&!this.autoFitFieldWidths},isc.A.getCellAlign=function isc_TreeGrid_getCellAlign(_1,_2,_3){var _4=this.getField(_3);if(_4&&_4.treeField){return this.isRTL()?"right":"left"}
 return this.Super("getCellAlign",arguments)},isc.A.getCellValue=function isc_TreeGrid_getCellValue(_1,_2,_3,_4,_5,_6,_7){var _8=this.invokeSuper(isc.TreeGrid,"getCellValue",_1,_2,_3,_4,_5,_6,_7);if(_3==this.getTreeFieldNum()){_8=this.getTreeCellValue(_8,_1,_2,_3)}
 return _8},isc.A.bodyDrawing=function isc_TreeGrid_bodyDrawing(_1,_2,_3,_4,_5){this.$35a={};return this.invokeSuper(isc.TreeGrid,"bodyDrawing",_1,_2,_3,_4,_5)},isc.A.getNodeTitle=function isc_TreeGrid_getNodeTitle(_1,_2,_3){var _4;if(_3.name&&_3.name!=this.$34o){if(_2==-1)return _1[_3.name];_4=this.getEditedRecord(_2)[_3.name]}else{_4=this.data.getTitle(_1)}
-return this.applyCellTypeFormatters(_4,_1,_3,_2,this.getFieldNum(_3))},isc.A.getTitleField=function isc_TreeGrid_getTitleField(){if(this.titleField!=null)return this.titleField;return this.getFieldName(this.getTreeFieldNum())},isc.A.getTreeFieldNum=function isc_TreeGrid_getTreeFieldNum(){return this.$34t},isc.A.getOpenAreaWidth=function isc_TreeGrid_getOpenAreaWidth(_1){var _2=this.getOpenerIconWidth(_1),_3=(this.showConnectors?_2:this.indentSize);return((this.data.getLevel(_1)-(this.showRoot?0:1))*_3)+_2},isc.A.getOpenerIconSize=function isc_TreeGrid_getOpenerIconSize(_1){return(this.openerIconSize||(this.showConnectors?this.cellHeight:this.iconSize))},isc.A.getOpenerIconWidth=function isc_TreeGrid_getOpenerIconWidth(_1){return this.openerIconWidth||this.getOpenerIconSize(_1)},isc.A.getOpenerIconHeight=function isc_TreeGrid_getOpenerIconHeight(_1){return this.openerIconHeight||this.getOpenerIconSize(_1)},isc.A.clickInOpenArea=function isc_TreeGrid_clickInOpenArea(_1){if(!this.data.isFolder(_1))return false;var _2=this.getTreeFieldNum(),_3=this.getFieldBody(_2),_4=this.getLocalFieldNum(_2),_5=_3.getColumnLeft(_4),_6=_3.getColumnWidth(_4),_7=this.getOpenAreaWidth(_1),x=_3.getOffsetX();if(this.isRTL()){var _9=_5+_6;return x>=(_9-_7)&&x<=_9}else{return x>=_5&&x<_5+_7}},isc.A.isOverOpenArea=function isc_TreeGrid_isOverOpenArea(){var _1=this.getRecord(this.getEventRow());if(_1==null)return false;return this.clickInOpenArea(_1)},isc.A.clickInCheckboxArea=function isc_TreeGrid_clickInCheckboxArea(_1){if(this.selectionAppearance!=this.$12c)return false;return this.isOverExtraIcon(_1)},isc.A.isOverExtraIcon=function isc_TreeGrid_isOverExtraIcon(_1){if(_1==null)_1=this.getRecord(this.getEventRow());if(_1==null)return false;var _2=this.$739(_1),_3=_2||this.getExtraIcon(_1);if(_3==null)return false;var _4=(_2!=null?this.$65a():this.iconSize);var _5=this.getTreeFieldNum(),_6=this.getFieldBody(_5),_7=this.getLocalFieldNum(_5),_8=_6.getColumnLeft(_7),_9=_6.getColumnWidth(_7),_10=this.getOpenAreaWidth(_1),x=_6.getOffsetX();if(this.isRTL()){var _12=_8+_9;return(x>=(_12-_10-_4)&&x<=(_12-_10))}else{return(x>=(_8+_10)&&x<(_8+_10+_4))}},isc.A.getIndentHTML=function isc_TreeGrid_getIndentHTML(_1,_2,_3,_4){var _5=_1;if(!this.showRoot)_5--;var _6=(this.showConnectors?this.getOpenerIconWidth(_2):this.indentSize),_7=this.isPrinting||isc.Browser.isIE||isc.Browser.isOpera,_8=(_7?1:0);if(this.showConnectors&&this.showFullConnectors){var _9=this.data.$59a(_2);_9.remove(_1);if(!this.showRoot)_9.remove(0);if(_9.length!=0){if(!this.$59c){var _10="ancestor";if(this.isRTL())_10+="_rtl";var _11=isc.Img.urlForState(this.connectorImage,null,null,_10),_12=this.getIconHTML(_11,null,this.cellHeight);this.$59c=_12}
+return this.applyCellTypeFormatters(_4,_1,_3,_2,this.getFieldNum(_3))},isc.A.getTitleField=function isc_TreeGrid_getTitleField(){if(this.titleField!=null)return this.titleField;return this.getFieldName(this.getTreeFieldNum())},isc.A.getTreeFieldNum=function isc_TreeGrid_getTreeFieldNum(){return this.$34t},isc.A.getOpenAreaWidth=function isc_TreeGrid_getOpenAreaWidth(_1){var _2=this.getOpenerIconWidth(_1),_3=(this.showConnectors?_2:this.indentSize);return((this.data.getLevel(_1)-(this.showRoot?0:1))*_3)+_2},isc.A.getOpenerIconSize=function isc_TreeGrid_getOpenerIconSize(_1){return(this.openerIconSize||(this.showConnectors?this.cellHeight:this.iconSize))},isc.A.getOpenerIconWidth=function isc_TreeGrid_getOpenerIconWidth(_1){return this.openerIconWidth||this.getOpenerIconSize(_1)},isc.A.getOpenerIconHeight=function isc_TreeGrid_getOpenerIconHeight(_1){return this.openerIconHeight||this.getOpenerIconSize(_1)},isc.A.clickInOpenArea=function isc_TreeGrid_clickInOpenArea(_1){if(!this.data.isFolder(_1))return false;var _2=this.getTreeFieldNum(),_3=this.getFieldBody(_2),_4=this.getLocalFieldNum(_2),_5=_3.getColumnLeft(_4),_6=_3.getColumnWidth(_4),_7=this.getOpenAreaWidth(_1),x=_3.getOffsetX();if(this.isRTL()){var _9=_5+_6;return x>=(_9-_7)&&x<=_9}else{return x>=_5&&x<_5+_7}},isc.A.isOverOpenArea=function isc_TreeGrid_isOverOpenArea(){var _1=this.getRecord(this.getEventRow());if(_1==null)return false;return this.clickInOpenArea(_1)},isc.A.clickInCheckboxArea=function isc_TreeGrid_clickInCheckboxArea(_1){if(this.selectionAppearance!=this.$12c)return false;return this.isOverExtraIcon(_1)},isc.A.isOverExtraIcon=function isc_TreeGrid_isOverExtraIcon(_1){if(_1==null)_1=this.getRecord(this.getEventRow());if(_1==null)return false;var _2=this.$739(_1),_3=_2||this.getExtraIcon(_1);if(_3==null)return false;var _4=(_2!=null?this.$65a():this.iconSize);var _5=this.getTreeFieldNum(),_6=this.getFieldBody(_5),_7=this.getLocalFieldNum(_5),_8=_6.getColumnLeft(_7),_9=_6.getColumnWidth(_7),_10=this.getOpenAreaWidth(_1),x=_6.getOffsetX();if(this.isRTL()){var _12=_8+_9;return(x>=(_12-_10-_4)&&x<=(_12-_10))}else{return(x>=(_8+_10)&&x<(_8+_10+_4))}},isc.A.getIndentHTML=function isc_TreeGrid_getIndentHTML(_1,_2,_3,_4){var _5=_1;if(!this.showRoot)_5--;var _6=(this.showConnectors?this.getOpenerIconWidth(_2):this.indentSize),_7=this.isPrinting||isc.Browser.isIE||isc.Browser.isOpera||isc.Browser.isEdge,_8=(_7?1:0);if(this.showConnectors&&this.showFullConnectors){var _9=this.data.$59a(_2);_9.remove(_1);if(!this.showRoot)_9.remove(0);if(_9.length!=0){if(!this.$59c){var _10="ancestor";if(this.isRTL())_10+="_rtl";var _11=isc.Img.urlForState(this.connectorImage,null,null,_10),_12=this.getIconHTML(_11,null,this.cellHeight);this.$59c=_12}
 var _13=this.$348(_6),_14=isc.StringBuffer.create(isc.emptyString);_14.append("<NOBR>");if(_7)_14.append(this.$348(1));for(var i=(this.showRoot?0:1);i<_1;i++){if(_9.contains(i)){_14.append(this.$59c);_8+=this.cellHeight}else{_14.append(_13);_8+=_6}}
 _14.append("</NOBR>");_14=_14.release();if(_3)_3[_4]=_8;return _14}}
 _8=_5*_6;if(_7)_8=Math.max(1,_8);var _16=this.$348(_8);if(isc.Browser.isIE9||(isc.Browser.isStrict&&(isc.Browser.isIE7||isc.Browser.isIE8))){_16="<NOBR>"+_16+"</NOBR>"}
--- a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/isomorphic/ISC_History.js	Mon Aug 10 10:23:33 2015 +0530
+++ b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/isomorphic/ISC_History.js	Mon Aug 10 14:26:44 2015 +0200
@@ -15,7 +15,7 @@
 return v.present=="true"||v.present.charAt(0)=="$"};isc.getOptionalModule=function(_1){return isc.$41r[_1]};isc.$a=window.isc_useSimpleNames;if(isc.$a==null)isc.$a=true;if(window.OpenAjax){isc.$b=isc.versionNumber.replace(/[a-zA-Z_]+/,".0");OpenAjax.registerLibrary("SmartClient","http://smartclient.com/SmartClient",isc.$b,{namespacedMode:!isc.$a,iscVersion:isc.version,buildDate:isc.buildDate,licenseType:isc.licenseType,licenseCompany:isc.licenseCompany,licenseSerialNumber:isc.licenseSerialNumber});OpenAjax.registerGlobals("SmartClient",["isc"])}
 isc.$e=window.isc_useLongDOMIDs;isc.$f="isc.";isc.addGlobal=function(_1,_2){if(_1.indexOf(isc.$f)==0)_1=_1.substring(4);isc[_1]=_2;if(isc.$a)window[_1]=_2}
 isc.onLine=true;isc.isOffline=function(){return!isc.onLine};isc.goOffline=function(){isc.onLine=false};isc.goOnline=function(){isc.onLine=true};if(window.addEventListener){window.addEventListener("online",isc.goOnline,false);window.addEventListener("offline",isc.goOffline,false)}
-isc.addGlobal("Browser",{isSupported:false});isc.Browser.isOpera=(navigator.appName=="Opera"||navigator.userAgent.indexOf("Opera")!=-1);isc.Browser.isNS=(navigator.appName=="Netscape"&&!isc.Browser.isOpera);isc.Browser.isIE=(navigator.appName=="Microsoft Internet Explorer"&&!isc.Browser.isOpera)||navigator.userAgent.indexOf("Trident/")!=-1;isc.Browser.isMSN=(isc.Browser.isIE&&navigator.userAgent.indexOf("MSN")!=-1);isc.Browser.isMoz=(navigator.userAgent.indexOf("Gecko")!=-1)&&(navigator.userAgent.indexOf("Safari")==-1)&&(navigator.userAgent.indexOf("AppleWebKit")==-1)&&!isc.Browser.isIE;isc.Browser.isCamino=(isc.Browser.isMoz&&navigator.userAgent.indexOf("Camino/")!=-1);isc.Browser.isFirefox=(isc.Browser.isMoz&&navigator.userAgent.indexOf("Firefox/")!=-1);isc.Browser.isAIR=(navigator.userAgent.indexOf("AdobeAIR")!=-1);isc.Browser.isWebKit=navigator.userAgent.indexOf("WebKit")!=-1;isc.Browser.isSafari=isc.Browser.isAIR||navigator.userAgent.indexOf("Safari")!=-1||navigator.userAgent.indexOf("AppleWebKit")!=-1;isc.Browser.isChrome=isc.Browser.isSafari&&(navigator.userAgent.indexOf("Chrome/")!=-1);if(!isc.Browser.isIE&&!isc.Browser.isOpera&&!isc.Browser.isMoz&&!isc.Browser.isAIR&&!isc.Browser.isWebkit&&!isc.Browser.isSafari)
+isc.addGlobal("Browser",{isSupported:false});isc.Browser.isOpera=(navigator.appName=="Opera"||navigator.userAgent.indexOf("Opera")!=-1);isc.Browser.isNS=(navigator.appName=="Netscape"&&!isc.Browser.isOpera);isc.Browser.isIE=(navigator.appName=="Microsoft Internet Explorer"&&!isc.Browser.isOpera)||navigator.userAgent.indexOf("Trident/")!=-1;isc.Browser.isMSN=(isc.Browser.isIE&&navigator.userAgent.indexOf("MSN")!=-1);isc.Browser.isMoz=(navigator.userAgent.indexOf("Gecko")!=-1)&&(navigator.userAgent.indexOf("Safari")==-1)&&(navigator.userAgent.indexOf("AppleWebKit")==-1)&&!isc.Browser.isIE;isc.Browser.isCamino=(isc.Browser.isMoz&&navigator.userAgent.indexOf("Camino/")!=-1);isc.Browser.isFirefox=(isc.Browser.isMoz&&navigator.userAgent.indexOf("Firefox/")!=-1);isc.Browser.isAIR=(navigator.userAgent.indexOf("AdobeAIR")!=-1);isc.Browser.isWebKit=navigator.userAgent.indexOf("WebKit")!=-1;isc.Browser.isSafari=isc.Browser.isAIR||navigator.userAgent.indexOf("Safari")!=-1||navigator.userAgent.indexOf("AppleWebKit")!=-1;isc.Browser.isEdge=isc.Browser.isSafari&&(navigator.userAgent.indexOf("Edge/")!=-1);isc.Browser.isChrome=isc.Browser.isSafari&&!isc.Browser.isEdge&&(navigator.userAgent.indexOf("Chrome/")!=-1);if(!isc.Browser.isIE&&!isc.Browser.isOpera&&!isc.Browser.isMoz&&!isc.Browser.isAIR&&!isc.Browser.isWebkit&&!isc.Browser.isSafari)
 {if(navigator.appVersion.indexOf("MSIE")!=-1){isc.Browser.isIE=true}}
 if(navigator.userAgent.indexOf("Trident/")>=0&&navigator.userAgent.lastIndexOf("rv:")>=0)
 {isc.Browser.minorVersion=parseFloat(navigator.userAgent.substring(navigator.userAgent.lastIndexOf("rv:")+"rv:".length))}else{isc.Browser.minorVersion=parseFloat(isc.Browser.isIE?navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE")+5):navigator.appVersion)}
--- a/web/js/utils.js	Mon Aug 10 10:23:33 2015 +0530
+++ b/web/js/utils.js	Mon Aug 10 14:26:44 2015 +0200
@@ -128,7 +128,11 @@
   var browserVersion = "";
   var browserMajorVersion = "";
   var i=0
-  if (navUserAgent.indexOf("MSIE") >= 0) {
+  if (navUserAgent.indexOf("EDGE") >= 0) {
+    browserName = "Microsoft Edge";
+    i=navUserAgent.indexOf("EDGE")+5;
+  }
+  else if (navUserAgent.indexOf("MSIE") >= 0) {
     browserName = "Microsoft Internet Explorer";
     i=navUserAgent.indexOf("MSIE")+5;
   } else if (navUserAgent.indexOf("TRIDENT") >= 0 && navUserAgent.indexOf("RV:") >= 0) {