This commit is contained in:
Daniel Seifert 2020-07-06 22:44:22 +02:00
parent 84d660066b
commit 2296007906
Signed by: DanielS
GPG Key ID: 6A513E13AEE66170
4 changed files with 134 additions and 0 deletions

16
IntelliSenseHelper.php Normal file
View File

@ -0,0 +1,16 @@
<?php
/**
* See LICENSE file for license details.
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\PdfDocumentsCompat\Modules\Application\Model
{
use OxidEsales\Eshop\Application\Model\Order;
class d3_Order_PDFDocsCompat_parent extends Order {}
}

View File

@ -0,0 +1,70 @@
<?php
/**
* See LICENSE file for license details.
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Max Buhe <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\PdfDocumentsCompat\Modules\Application\Model;
use D3\PdfDocuments\Application\Model\AbstractClasses\pdfdocumentsGeneric;
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 OxidEsales\Eshop\Core\Registry;
class d3_Order_PDFDocsCompat extends d3_Order_PDFDocsCompat_parent
{
public function setSelectedLang($iLang)
{
return null;
}
public function pdfFooter($oPdf)
{
return null;
}
public function pdfHeaderPlus($oPdf)
{
return null;
}
public function pdfHeader($oPdf)
{
return null;
}
public function genPdf($sFilename, $iSelLang = 0, $target = pdfdocumentsGeneric::PDF_DESTINATION_STDOUT)
{
switch (Registry::getRequest()->getRequestEscapedParameter('pdftype')) {
case ('dnote'):
$document = oxNew(deliverynotePdf::class);
break;
case ('dnote_without_logo'):
$document = oxNew(deliverynotewithoutlogoPdf::class);
break;
case ('standart'):
$document = oxNew(invoicePdf::class);
break;
default:
$document = oxNew(invoicewithoutlogoPdf::class);
}
return $document->genPdf($sFilename, $iSelLang, $target);
}
public function exportStandart($oPdf)
{
return null;
}
public function exportDeliveryNote($oPdf)
{
return null;
}
}

View File

@ -37,5 +37,10 @@
},
"replace": {
"oxid-projects/pdf-invoice-module": "*"
},
"autoload": {
"psr-4": {
"D3\\PdfDocumentsCompat\\": "../../../source/modules/d3/pdfdocuments_compat"
}
}
}

43
metadata.php Normal file
View File

@ -0,0 +1,43 @@
<?php
/**
* See LICENSE file for license details.
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Max Buhe <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
use D3\PdfDocumentsCompat\Modules\Application\Model\d3_Order_PDFDocsCompat;
use OxidEsales\Eshop\Application\Model\Order as Order;
/**
* Metadata version
*/
$sMetadataVersion = '2.0';
$logo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="height:1em;width:1em">';
$sModuleId = 'd3PdfDocumentsCompat';
/**
* Module information
*/
$aModule = [
'id' => $sModuleId,
'title' => [
'de' => $logo.' PDF-Dokumente Kompatibilitätsschicht',
'en' => $logo.' PDF documents compatibility layer',
],
'version' => '0.1',
'author' => 'D&sup3; Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'http://www.oxidmodule.com/',
'extend' => [
Order::class => d3_Order_PDFDocsCompat::class
],
'controllers' => [],
'templates' => [],
'events' => [],
'blocks' => [],
'settings' => []
];