Added optional popup for pdf reports display.
[fa-stable.git] / reporting / includes / pdf_report.inc
index b9ae9410a22d56d2d8e52f243a3553ae1d55e9a4..e3d84a1914e94c8dfda83a6cb954534bab8cfc0f 100644 (file)
@@ -361,9 +361,7 @@ class FrontReport extends Cpdf
 
                if ($pdf_debug == 1)
                {
-                       $buf = $this->Output();
-                       $len = strlen($buf);
-                       $pdfcode = $buf;
+                       $pdfcode = $this->Output();
                        $pdfcode = str_replace("\n", "\n<br>", htmlspecialchars($pdfcode));
                        echo '<html><body>';
                        echo trim($pdfcode);
@@ -474,7 +472,10 @@ class FrontReport extends Cpdf
                                                $fname = substr(realpath($fname), strlen($_SERVER['DOCUMENT_ROOT']));
                                                if (substr($fname,0,1) != '/') $fname = '/'.$fname;
 
-                                               $Ajax->redirect($fname);
+                                               if (user_rep_popup()) 
+                                                       $Ajax->popup($fname);
+                                               else
+                                                       $Ajax->redirect($fname);
                                        } else {
                                        //echo '<html>
                                        //              <head>