BUG-13914 Browser not recognizing PDF Output Document
New feature added in Output Document Properties and new column added in OUTPUT DOCUMENT table.
This commit is contained in:
@@ -34,18 +34,25 @@ if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/*
|
||||
* Created on 13-02-2008
|
||||
*
|
||||
* @author David Callizaya <davidsantos@colosa.com>
|
||||
/*
|
||||
* Created on 13-02-2008
|
||||
*
|
||||
* @author David Callizaya <davidsantos@colosa.com>
|
||||
*/
|
||||
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
require_once ("classes/model/OutputDocumentPeer.php");
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : null );
|
||||
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$sDocUid = $oAppDocument->Fields['DOC_UID'];
|
||||
|
||||
$oOutputDocument = new OutputDocument();
|
||||
$oOutputDocument->Fields = $oOutputDocument->getByUid( $sDocUid );
|
||||
$download = $oOutputDocument->Fields['OUT_DOC_OPEN_TYPE'];
|
||||
|
||||
$info = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
if (! isset( $_GET['ext'] )) {
|
||||
$ext = $info['extension'];
|
||||
@@ -58,7 +65,7 @@ if (! isset( $_GET['ext'] )) {
|
||||
}
|
||||
$ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
|
||||
|
||||
if (! $ver) //This code is in the case the outputdocument won't be versioned
|
||||
if (! $ver) //This code is in the case the outputdocument won't be versioned
|
||||
$ver = '_1';
|
||||
|
||||
$realPath = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext;
|
||||
@@ -102,7 +109,7 @@ if (! $sw_file_exists) {
|
||||
$res['message'] = $info['basename'] . $ver . '.' . $ext;
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::streamFile( $realPath, true, $info['basename'] . $ver . '.' . $ext );
|
||||
G::streamFile( $realPath, $download, $info['basename'] . $ver . '.' . $ext );
|
||||
}
|
||||
}
|
||||
//G::streamFile ( $realPath, true);
|
||||
|
||||
Reference in New Issue
Block a user