allow forced filename

This commit is contained in:
Daniel Seifert 2020-06-05 09:37:11 +02:00
parent 015e85c942
commit d13dda978d
Signed by: DanielS
GPG Key ID: 8A7C4C6ED1915C6F
3 changed files with 21 additions and 0 deletions

View File

@ -39,6 +39,9 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
/** @var Smarty */
public $oSmarty;
/** @var string */
public $filename;
/**
* pdfDocumentsGeneric constructor.
*/
@ -126,6 +129,14 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
return [self::PDF_ORIENTATION_PORTRAIT, 'A4', 'de'];
}
/**
* @param $filename
*/
public function setFilename($filename)
{
$this->filename = $filename;
}
/**
* Gets proper file name
*

View File

@ -66,6 +66,11 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
*/
public function getFilename()
{
// forced filename from setFilename()
if ($this->filename) {
return $this->filename;
}
$sTrimmedBillName = trim($this->getOrder()->getFieldData('oxbilllname'));
return implode(

View File

@ -56,6 +56,11 @@ interface pdfdocumentsGenericInterface
*/
public function genPdf($sFilename, $iSelLang = 0, $target = 'I');
/**
* @param string $filename
*/
public function setFilename($filename);
/**
* @return string
*/