Fixed issue 18112: Now print button works in IE
authorDavid Baz Fayos <david.baz@openbravo.com>
Thu, 28 Jul 2011 20:43:04 +0200
changeset 13339 a7a2befbb130
parent 13338 583e489e4fcc
child 13340 736087383d76
Fixed issue 18112: Now print button works in IE
src/org/openbravo/erpCommon/businessUtility/PrinterReports.html
--- a/src/org/openbravo/erpCommon/businessUtility/PrinterReports.html	Thu Jul 28 19:30:46 2011 +0200
+++ b/src/org/openbravo/erpCommon/businessUtility/PrinterReports.html	Thu Jul 28 20:43:04 2011 +0200
@@ -27,8 +27,12 @@
 <script language="JavaScript" type="text/javascript" id="paramLanguage">    defaultLang = "en_US";</script>
 <script language="JavaScript" type="text/javascript" id="isPrintPreview">
 function printReport(pagina) {
-    if (top.OB && top.OB.Layout) {
-      top.OB.Layout.ClassicOBCompatibility.Popup.open('printpdf', 600, 300, pagina + "?Commnad=PDF", '', window, false, false, true);
+    if (isWindowInMDIContext) {
+      var LayoutMDI = getFrame('LayoutMDI');
+      if (pagina.indexOf('../') === 0) {
+        pagina = pagina.substring(3, pagina.length);
+      }
+      LayoutMDI.OB.Layout.ClassicOBCompatibility.Popup.open('printpdf', 600, 300, LayoutMDI.OB.Application.contextUrl + pagina + "?Commnad=PDF", '', window, false, false, true);
     } else {
       openPDF(pagina, 'PDF');
     }