Pārlūkot izejas kodu

Forced the PDF produced by the impact analysis to be downloaded as an attachment, otherwise on some browsers the result cannot be saved.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3725 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 9 gadi atpakaļ
vecāks
revīzija
206ddcee52
2 mainītis faili ar 2 papildinājumiem un 5 dzēšanām
  1. 1 5
      application/pdfpage.class.inc.php
  2. 1 0
      pages/ajax.render.php

+ 1 - 5
application/pdfpage.class.inc.php

@@ -89,7 +89,6 @@ class PDFPage extends WebPage
 		// Add a page, we're ready to start
 		$this->oPdf->AddPage();
 		
-		$this->SetContentType('application/pdf');
 		$this->SetContentDisposition('inline', $s_title.'.pdf');
 		$this->SetDefaultStyle();
 		
@@ -174,10 +173,7 @@ EOF
 	 */
 	public function output()
 	{
-	    if (!empty($this->sContentType))
-    	{
-			$this->add_header('Content-type: '.$this->sContentType);
-    	}
+		$this->add_header('Content-type: application/x-pdf');
     	if (!empty($this->sContentDisposition))
     	{
 			$this->add_header('Content-Disposition: '.$this->sContentDisposition.'; filename="'.$this->sContentFileName.'"');

+ 1 - 0
pages/ajax.render.php

@@ -1816,6 +1816,7 @@ EOF
 		}
 		
 		$oPage = new PDFPage($sTitle, $sPageFormat, $sPageOrientation);
+		$oPage->SetContentDisposition('attachment', $sTitle.'.pdf');
 		
 		$oGraph = DisplayableGraph::FromRelationGraph($oRelGraph, $iGroupingThreshold, ($sDirection == 'down'));
 		$oGraph->InitFromGraphviz();