diff --git a/workflow/engine/classes/model/OutputDocument.php b/workflow/engine/classes/model/OutputDocument.php index 47d48d602..0e53cf3dc 100755 --- a/workflow/engine/classes/model/OutputDocument.php +++ b/workflow/engine/classes/model/OutputDocument.php @@ -178,12 +178,12 @@ class OutputDocument extends BaseOutputDocument if(!empty($aData['OUT_DOC_DESCRIPTION'])){ $description .= ", Description: ".$aData['OUT_DOC_DESCRIPTION']; } - if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){ - $description .= ", Report Generator: ". $aData['OUT_DOC_REPORT_GENERATOR']; - } - if(!empty($aData['OUT_DOC_GENERATE'])){ - $description .= ", Output Document to Generate: ".$aData['OUT_DOC_GENERATE']; - } + if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){ + $description .= ", Report Generator: ". $aData['OUT_DOC_REPORT_GENERATOR']; + } + if(!empty($aData['OUT_DOC_GENERATE'])){ + $description .= ", Output Document to Generate: ".$aData['OUT_DOC_GENERATE']; + } if($aData['OUT_DOC_PDF_SECURITY_ENABLED']==0){ $pdfSecurity = 'Disabled'; }else{ @@ -199,14 +199,14 @@ class OutputDocument extends BaseOutputDocument if(!empty($aData['OUT_DOC_TAGS'])){ $description .= ", Tags: ".$aData['OUT_DOC_TAGS']; } - if(!empty($aData['OUT_DOC_OPEN_TYPE'])){ - if($aData['OUT_DOC_OPEN_TYPE']==0){ - $genLink = 'Open the file'; - }else{ - $genLink = 'Download the file'; - } - $description .= ", By clicking on the generated file link: ".$genLink; - } + if(!empty($aData['OUT_DOC_OPEN_TYPE'])){ + if($aData['OUT_DOC_OPEN_TYPE']==0){ + $genLink = 'Open the file'; + }else{ + $genLink = 'Download the file'; + } + $description .= ", By clicking on the generated file link: ".$genLink; + } G::auditLog("CreateOutputDocument", $description); return $aData['OUT_DOC_UID']; @@ -268,12 +268,12 @@ class OutputDocument extends BaseOutputDocument if(!empty($aData['OUT_DOC_DESCRIPTION'])){ $description .= ", Description: ".$aData['OUT_DOC_DESCRIPTION']; } - if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){ - $description .= ", Report Generator: ". $aData['OUT_DOC_REPORT_GENERATOR']; - } - if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){ - $description .= ", Output Document to Generate: ".$aData['OUT_DOC_GENERATE']; - } + if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){ + $description .= ", Report Generator: ". $aData['OUT_DOC_REPORT_GENERATOR']; + } + if(!empty($aData['OUT_DOC_REPORT_GENERATOR'])){ + $description .= ", Output Document to Generate: ".$aData['OUT_DOC_GENERATE']; + } if($aData['OUT_DOC_PDF_SECURITY_ENABLED']==0){ $pdfSecurity = 'Disabled'; }else{ @@ -289,14 +289,14 @@ class OutputDocument extends BaseOutputDocument if(!empty($aData['OUT_DOC_TAGS'])){ $description .= ", Tags: ".$aData['OUT_DOC_TAGS']; } - if(!empty($aData['OUT_DOC_OPEN_TYPE'])){ - if($aData['OUT_DOC_OPEN_TYPE']==0){ - $genLink = 'Open the file'; - }else{ - $genLink = 'Download the file'; - } - $description .= ", By clicking on the generated file link: ".$genLink; - } + if(!empty($aData['OUT_DOC_OPEN_TYPE'])){ + if($aData['OUT_DOC_OPEN_TYPE']==0){ + $genLink = 'Open the file'; + }else{ + $genLink = 'Download the file'; + } + $description .= ", By clicking on the generated file link: ".$genLink; + } if (isset($aData['OUT_DOC_TEMPLATE'])) { $description .= ", [EDIT TEMPLATE]"; } @@ -556,6 +556,24 @@ class OutputDocument extends BaseOutputDocument if (($sUID != '') && is_array($aFields) && ($sPath != '')) { $sContent = G::replaceDataGridField($sContent, $aFields); + if (strpos($sContent, ''; + $oFile = fopen($sPath . $sFilename . '_smarty.html', 'wb'); + fwrite($oFile, $sContent); + fclose($oFile); + $template->templateFile = $sPath . $sFilename . '_smarty.html'; + //assign the variables and use the template $template + $template->assign($aFields); + $sContent = $template->fetch($template->templateFile); + unlink($template->templateFile); + } + G::verifyPath($sPath, true); //Start - Create .doc