add ordermanager combination
This commit is contained in:
parent
3c871862d6
commit
c1ce7ac95c
@ -66,7 +66,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
$sFilename = $this->getFilename();
|
$sFilename = $this->getFilename();
|
||||||
$oPdf = oxNew(Html2Pdf::class, ...$this->getPdfProperties());
|
$oPdf = oxNew(Html2Pdf::class, ...$this->getPdfProperties());
|
||||||
$oPdf->writeHTML($this->getHTMLContent($iSelLang));
|
$oPdf->writeHTML($this->getHTMLContent($iSelLang));
|
||||||
$oPdf->output($sFilename, $target);
|
return $oPdf->output($sFilename, $target);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -84,6 +84,30 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $iLanguage
|
||||||
|
*
|
||||||
|
* @return null|string
|
||||||
|
* @throws Html2PdfException
|
||||||
|
*/
|
||||||
|
public function getPdfContent($iLanguage = 0)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$sFilename = $this->getFilename();
|
||||||
|
ob_start();
|
||||||
|
//$this->genPdf( $sFilename, $iLanguage, self::PDF_DESTINATION_STDOUT );
|
||||||
|
$this->genPdf( $sFilename, $iLanguage, self::PDF_DESTINATION_STRING );
|
||||||
|
return ob_get_contents();
|
||||||
|
} catch (pdfGeneratorExceptionAbstract $e) {
|
||||||
|
Registry::get(UtilsView::class)->addErrorToDisplay($e);
|
||||||
|
Registry::getLogger()->error($e);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
dumpvar($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public function setSmartyVars()
|
public function setSmartyVars()
|
||||||
{
|
{
|
||||||
$this->oSmarty->assign('oConfig', Registry::getSession()->getConfig());
|
$this->oSmarty->assign('oConfig', Registry::getSession()->getConfig());
|
||||||
|
@ -46,6 +46,13 @@ interface pdfdocumentsGenericInterface
|
|||||||
*/
|
*/
|
||||||
public function downloadPdf($iLanguage = 0);
|
public function downloadPdf($iLanguage = 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $iLanguage
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getPdfContent($iLanguage = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $sFilename
|
* @param $sFilename
|
||||||
* @param int $iSelLang
|
* @param int $iSelLang
|
||||||
|
50
Application/Model/Registries/registryOrdermanagerActions.php
Normal file
50
Application/Model/Registries/registryOrdermanagerActions.php
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This Software is the property of Data Development and is protected
|
||||||
|
* by copyright law - it is NOT Freeware.
|
||||||
|
* Any unauthorized use of this software without a valid license
|
||||||
|
* is a violation of the license agreement and will be prosecuted by
|
||||||
|
* civil and criminal law.
|
||||||
|
* http://www.shopmodule.com
|
||||||
|
*
|
||||||
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
|
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
||||||
|
* @link http://www.oxidmodule.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace D3\PdfDocuments\Application\Model\Registries;
|
||||||
|
|
||||||
|
use D3\PdfDocuments\Application\Model\Documents\deliverynotePdf;
|
||||||
|
use D3\PdfDocuments\Application\Model\Documents\deliverynotewithoutlogoPdf;
|
||||||
|
use D3\PdfDocuments\Application\Model\Documents\invoicePdf;
|
||||||
|
use D3\PdfDocuments\Application\Model\Documents\invoicewithoutlogoPdf;
|
||||||
|
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsOrderInterface;
|
||||||
|
|
||||||
|
class registryOrdermanagerActions extends registryAbstract implements registryOrdermanagerActionsInterface
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->addGenerator(invoicePdf::class);
|
||||||
|
$this->addGenerator(deliverynotePdf::class);
|
||||||
|
$this->addGenerator(invoicewithoutlogoPdf::class);
|
||||||
|
$this->addGenerator(deliverynotewithoutlogoPdf::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getRequiredGeneratorInterfaceClassName()
|
||||||
|
{
|
||||||
|
return pdfdocumentsOrderInterface::class;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $className * generator fully qualified class name
|
||||||
|
* @return pdfdocumentsOrderInterface
|
||||||
|
*/
|
||||||
|
public function getGenerator($className)
|
||||||
|
{
|
||||||
|
return $this->_aRegistry[$className];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This Software is the property of Data Development and is protected
|
||||||
|
* by copyright law - it is NOT Freeware.
|
||||||
|
*
|
||||||
|
* Any unauthorized use of this software without a valid license
|
||||||
|
* is a violation of the license agreement and will be prosecuted by
|
||||||
|
* civil and criminal law.
|
||||||
|
*
|
||||||
|
* http://www.shopmodule.com
|
||||||
|
*
|
||||||
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
|
* @author D3 Data Development - Max Buhe <support@shopmodule.com>
|
||||||
|
* @link http://www.oxidmodule.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace D3\PdfDocuments\Application\Model\Registries;
|
||||||
|
|
||||||
|
interface registryOrdermanagerActionsInterface extends registryGenericInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param $className * generator fully qualified class name
|
||||||
|
*/
|
||||||
|
public function addGenerator($className);
|
||||||
|
}
|
@ -28,7 +28,7 @@ $sMetadataVersion = '2.0';
|
|||||||
|
|
||||||
$logo = (class_exists(d3utils::class) ? d3utils::getInstance()->getD3Logo() : 'D³');
|
$logo = (class_exists(d3utils::class) ? d3utils::getInstance()->getD3Logo() : 'D³');
|
||||||
|
|
||||||
$sModuleId = 'pdfDocuments';
|
$sModuleId = 'd3PdfDocuments';
|
||||||
/**
|
/**
|
||||||
* Module information
|
* Module information
|
||||||
*/
|
*/
|
||||||
@ -38,7 +38,6 @@ $aModule = [
|
|||||||
'de' => $logo.' PDF-Dokumente aus HTML-Templates',
|
'de' => $logo.' PDF-Dokumente aus HTML-Templates',
|
||||||
'en' => $logo.' PDF documents from HTML templates',
|
'en' => $logo.' PDF documents from HTML templates',
|
||||||
],
|
],
|
||||||
'thumbnail' => 'picture.png',
|
|
||||||
'version' => '1.0',
|
'version' => '1.0',
|
||||||
'author' => 'D³ Data Development (Inh.: Thomas Dartsch)',
|
'author' => 'D³ Data Development (Inh.: Thomas Dartsch)',
|
||||||
'email' => 'support@shopmodule.com',
|
'email' => 'support@shopmodule.com',
|
||||||
|
Loading…
Reference in New Issue
Block a user