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

View File

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

View File

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