9 Révisions

17 fichiers modifiés avec 152 ajouts et 39 suppressions

Voir le fichier

@ -27,6 +27,10 @@ class orderOverviewPdfGenerator
{
$Pdf= $this->getPdfClass();
$Pdf->setDevelopmentMode(
Registry::getConfig()->getConfigParam('d3PdfDocumentsbDev') &&
Registry::getRequest()->getRequestEscapedParameter('devmode')
);
$Pdf->setOrder($order);
$Pdf->downloadPdf($iSelLang);
}

Voir le fichier

@ -42,6 +42,8 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
/** @var string */
public $filename;
protected $devMode = false;
/**
* pdfDocumentsGeneric constructor.
*/
@ -53,6 +55,11 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
$this->oSmarty = Registry::getUtilsView()->getSmarty(true);
}
public function setDevelopmentMode(bool $devMode)
{
$this->devMode = $devMode;
}
public function runPreAction()
{
}
@ -316,7 +323,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
*/
public function output(Html2Pdf $oPdf, $sFilename, $target, $html)
{
if ((bool) Registry::getConfig()->getConfigParam('d3PdfDocumentsbDev') === true) {
if ($this->devMode) {
return $this->outputDev($oPdf, $sFilename, $target, $html);
} else {
return $oPdf->output($sFilename, $target);
@ -332,7 +339,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
*/
public function outputDev(Html2Pdf $oPdf, $sFilename, $target, $html)
{
$sFilename = str_replace('.pdf', '.html', $sFilename);
$sFilename = str_replace('.pdf', '.sgml', $sFilename);
switch($target) {
case 'I': {
@ -357,7 +364,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
break;
}
case 'D': {
// Download PDF as file
// Download PDF as a file
if (ob_get_contents()) {
$oPdf->pdf->Error('Some data has already been output, can\'t send PDF file');
}
@ -373,7 +380,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
header('Content-Type: application/force-download');
header('Content-Type: application/octet-stream', false);
header('Content-Type: application/download', false);
header('Content-Type: text/html', false);
header('Content-Type: text/sgml', false);
// use the Content-Disposition header to supply a recommended filename
header('Content-Disposition: attachment; filename="'.basename($sFilename).'";');
header('Content-Transfer-Encoding: binary');

Voir le fichier

@ -12,6 +12,8 @@ namespace D3\PdfDocuments\Application\Model\Interfaces;
interface pdfdocumentsGenericInterface
{
public function setDevelopmentMode(bool $devMode);
/**
* @return string
*/

Voir le fichier

@ -15,15 +15,21 @@ 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;
use OxidEsales\Eshop\Core\Registry;
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);
$config = Registry::getConfig();
if ($config->getConfigParam('d3PdfDocumentsDocInvoice'))
$this->addGenerator(invoicePdf::class);
if ($config->getConfigParam('d3PdfDocumentsDocDeliveryNote'))
$this->addGenerator(deliverynotePdf::class);
if ($config->getConfigParam('d3PdfDocumentsDocInvoiceNoLogo'))
$this->addGenerator(invoicewithoutlogoPdf::class);
if ($config->getConfigParam('d3PdfDocumentsDocDeliveryNoteNoLogo'))
$this->addGenerator(deliverynotewithoutlogoPdf::class);
}
/**

Voir le fichier

@ -15,15 +15,21 @@ 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;
use OxidEsales\Eshop\Core\Registry;
class registryOrderoverview extends registryAbstract implements registryOrderoverviewInterface
{
public function __construct()
{
$this->addGenerator(invoicePdf::class);
$this->addGenerator(deliverynotePdf::class);
$this->addGenerator(invoicewithoutlogoPdf::class);
$this->addGenerator(deliverynotewithoutlogoPdf::class);
$config = Registry::getConfig();
if ($config->getConfigParam('d3PdfDocumentsDocInvoice'))
$this->addGenerator(invoicePdf::class);
if ($config->getConfigParam('d3PdfDocumentsDocDeliveryNote'))
$this->addGenerator(deliverynotePdf::class);
if ($config->getConfigParam('d3PdfDocumentsDocInvoiceNoLogo'))
$this->addGenerator(invoicewithoutlogoPdf::class);
if ($config->getConfigParam('d3PdfDocumentsDocDeliveryNoteNoLogo'))
$this->addGenerator(deliverynotewithoutlogoPdf::class);
}
/**

Voir le fichier

@ -13,7 +13,7 @@ $aLang = array(
'charset' => 'utf-8',
'D3_PDFDOCUMENTS_THANKYOU_1' => 'Vielen Dank für Ihren Einkauf!',
'D3_PDFDOCUMENTS_THANKYOU_2' => 'Ihr Team von %1$s',
'D3_PDFDOCUMENTS_THANKYOU_2' => 'Ihr Team von %1$s.',
'D3_PDFDOCUMENTS_GET_IN_CONTACT' => 'So erreichen Sie uns:',
'D3_PDFDOCUMENTS_TELEFON' => 'Telefon',
@ -65,7 +65,7 @@ $aLang = array(
'D3_PDFDOCUMENTS_TOTALSUMBRUT' => 'Gesamtsumme (brutto)',
'D3_PDFDOCUMENTS_USED_PAYMENTMETHOD' => 'Ihre gewählte Zahlungsweise',
'D3_PDFDOCUMENTS_PAYABLEUNTIL' => 'Zahlbar bis zum',
'D3_PDFDOCUMENTS_PAYABLEUNTIL' => 'Zahlbar bis zum %s.',
'D3_PDFDOCUMENTS_RECEIVED_PAYMENT' => 'Den Rechnungsbetrag haben wir dankend erhalten.',
'D3_PDFDOCUMENTS_MANAGINGDIRECTOR' => 'Geschäftsführer',

Voir le fichier

@ -12,7 +12,7 @@ $aLang = array(
'charset' => 'utf-8',
'D3_PDFDOCUMENTS_THANKYOU_1' => 'Many thanks for your purchase!',
'D3_PDFDOCUMENTS_THANKYOU_2' => 'Your team from %1$s',
'D3_PDFDOCUMENTS_THANKYOU_2' => 'Your team from %1$s.',
'D3_PDFDOCUMENTS_GET_IN_CONTACT' => 'You can contact us as follows',
'D3_PDFDOCUMENTS_TELEFON' => 'Telephone',
@ -33,8 +33,8 @@ $aLang = array(
'D3_PDFDOCUMENTS_INVOICE' => 'Invoice',
'D3_PDFDOCUMENTS_INVOICE_WITHOUT_LOGO' => 'Invoice without logo',
'D3_PDFDOCUMENTS_DELIVERYNOTE' => 'Deliverynote',
'D3_PDFDOCUMENTS_DELIVERYNOTE_WITHOUT_LOGO' => 'Deliverynote without logo',
'D3_PDFDOCUMENTS_DELIVERYNOTE' => 'Delivery note',
'D3_PDFDOCUMENTS_DELIVERYNOTE_WITHOUT_LOGO' => 'Delivery note without logo',
'D3_PDFDOCUMENTS_ORDERNR' => 'Order No.',
'D3_PDFDOCUMENTS_ORDER_FROM_AT' => 'Your order from %1$s at "%2$s"',
@ -64,7 +64,7 @@ $aLang = array(
'D3_PDFDOCUMENTS_TOTALSUMBRUT' => 'Total sum (gross)',
'D3_PDFDOCUMENTS_USED_PAYMENTMETHOD' => 'Your chosen payment method',
'D3_PDFDOCUMENTS_PAYABLEUNTIL' => 'Billing till',
'D3_PDFDOCUMENTS_PAYABLEUNTIL' => 'Billing till %s.',
'D3_PDFDOCUMENTS_RECEIVED_PAYMENT' => 'We have received the invoice amount with thanks.',
'D3_PDFDOCUMENTS_MANAGINGDIRECTOR' => 'Managing director',

Voir le fichier

@ -19,13 +19,23 @@ $aLang = array(
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Grundeinstellungen',
'SHOP_MODULE_d3PdfDocumentsbDev' => 'Entwicklermodus',
'HELP_SHOP_MODULE_d3PdfDocumentsbDev' => 'Mit aktiviertem Entwicklermodus wird das Dokument im '.
'HTML-Format ausgegeben. Inhaltliche Fehler können so besser nachvollzogen werden.',
'HELP_SHOP_MODULE_d3PdfDocumentsbDev' => 'Mit aktiviertem Entwicklermodus kann das Dokument im '.
'SGML-Format ausgegeben werden. Inhaltliche Fehler können so besser nachvollzogen werden.',
'SHOP_MODULE_d3PdfDocumentsbasicAuthUserName' => 'BasicAuth des Shops - Benutzername (optional)',
'HELP_SHOP_MODULE_d3PdfDocumentsbasicAuthUserName' => $basicAuthHelp,
'SHOP_MODULE_d3PdfDocumentsbasicAuthPassword' => 'BasicAuth des Shops - Passwort (optional)',
'HELP_SHOP_MODULE_d3PdfDocumentsbasicAuthPassword' => $basicAuthHelp,
'SHOP_MODULE_GROUP_d3PdfDocumentscontents' => 'Inhalte',
'SHOP_MODULE_d3PdfDocumentsLogoUrl' => 'Logo-Grafik URL',
'SHOP_MODULE_d3PdfDocumentsBackgroundUrl' => 'Hintergrund-Grafik URL',
'SHOP_MODULE_GROUP_d3PdfDocumentsdocuments' => 'Dokumente',
'SHOP_MODULE_d3PdfDocumentsDocInvoice' => 'Rechnung',
'SHOP_MODULE_d3PdfDocumentsDocInvoiceNoLogo' => 'Rechnung ohne Logo',
'SHOP_MODULE_d3PdfDocumentsDocDeliveryNote' => 'Lieferschein',
'SHOP_MODULE_d3PdfDocumentsDocDeliveryNoteNoLogo' => 'Lieferschein ohne Logo',
'D3_PDFDOCUMENTS' => 'PDF-Dokumente',
'D3_PDFDOCUMENTS_INVOICE' => 'Rechnung',
'D3_PDFDOCUMENTS_INVOICE_WITHOUT_LOGO' => 'Rechnung ohne Logo',
@ -34,5 +44,6 @@ $aLang = array(
'D3_PDFDOCUMENTS_PDF_TYPE' => 'Dokument',
'D3_PDFDOCUMENTS_LANGUAGE' => 'Sprache',
'D3_PDFDOCUMENTS_SGML_GENERATE' => 'SGML erstellen',
'D3_PDFDOCUMENTS_PDF_GENERATE' => 'Dokument erstellen',
);

Voir le fichier

@ -19,20 +19,31 @@ $aLang = array(
'SHOP_MODULE_GROUP_d3PdfDocumentsmain' => 'Basic settings',
'SHOP_MODULE_d3PdfDocumentsbDev' => 'Developer mode',
'HELP_SHOP_MODULE_d3PdfDocumentsbDev' => 'If developer mode is activated, the document is output in '.
'HTML format. This makes it much easier to trace content errors.',
'HELP_SHOP_MODULE_d3PdfDocumentsbDev' => 'If developer mode is activated, the document can exported '.
'in SGML format. This makes it much easier to trace content errors.',
'SHOP_MODULE_d3PdfDocumentsbasicAuthUserName' => 'BasicAuth of the shop - user name (optional)',
'HELP_SHOP_MODULE_d3PdfDocumentsbasicAuthUserName' => $basicAuthHelp,
'SHOP_MODULE_d3PdfDocumentsbasicAuthPassword' => 'BasicAuth of the shop - password (optional)',
'HELP_SHOP_MODULE_d3PdfDocumentsbasicAuthPassword' => $basicAuthHelp,
'SHOP_MODULE_GROUP_d3PdfDocumentscontents' => 'Contents',
'SHOP_MODULE_d3PdfDocumentsLogoUrl' => 'Logo image URL',
'SHOP_MODULE_d3PdfDocumentsBackgroundUrl' => 'Background image URL',
'SHOP_MODULE_GROUP_d3PdfDocumentsdocuments' => 'Documents',
'SHOP_MODULE_d3PdfDocumentsDocInvoice' => 'Invoice',
'SHOP_MODULE_d3PdfDocumentsDocInvoiceNoLogo' => 'Invoice without logo',
'SHOP_MODULE_d3PdfDocumentsDocDeliveryNote' => 'Delivery note',
'SHOP_MODULE_d3PdfDocumentsDocDeliveryNoteNoLogo' => 'Delivery note without logo',
'D3_PDFDOCUMENTS' => 'PDF Documents',
'D3_PDFDOCUMENTS_INVOICE' => 'Invoice',
'D3_PDFDOCUMENTS_INVOICE_WITHOUT_LOGO' => 'Invoice without logo',
'D3_PDFDOCUMENTS_DELIVERYNOTE' => 'Deliverynote',
'D3_PDFDOCUMENTS_DELIVERYNOTE_WITHOUT_LOGO' => 'Deliverynote without logo',
'D3_PDFDOCUMENTS_DELIVERYNOTE' => 'Delivery note',
'D3_PDFDOCUMENTS_DELIVERYNOTE_WITHOUT_LOGO' => 'Delivery note without logo',
'D3_PDFDOCUMENTS_PDF_TYPE' => 'Document',
'D3_PDFDOCUMENTS_LANGUAGE' => 'Language',
'D3_PDFDOCUMENTS_SGML_GENERATE' => 'Create SGML',
'D3_PDFDOCUMENTS_PDF_GENERATE' => 'Create Document',
);

Voir le fichier

@ -1,10 +1,14 @@
[{if $edit && $oView->d3CanExport()}]
<br>
[{assign var="config" value=$oViewConf->getConfig()}]
[{assign var="devmode" value=$config->getConfigParam('d3PdfDocumentsbDev')}]
<form name="d3CreatePdf" id="d3CreatePdf" action="[{$oViewConf->getSelfLink()}]" method="post" target="d3ExpPDF">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="order_overview">
<input type="hidden" name="fnc" value="d3CreatePDF">
<input type="hidden" name="oxid" value="[{$oxid}]">
[{if $devmode}]<input type="hidden" id="devmode" name="devmode" value="0">[{/if}]
<fieldset style="padding: 5px">
<legend>[{oxmultilang ident="D3_PDFDOCUMENTS"}]</legend>
<table style="width: 100%">
@ -14,7 +18,7 @@
</td>
<td style="vertical-align: top; text-align: right" class="edittext">
<label for="pdftype">[{oxmultilang ident="D3_PDFDOCUMENTS_PDF_TYPE" suffix="COLON"}]</label>:&nbsp;
<select id="pdftype" name="pdftype" class="editinput" style="width:80px;">
<select id="pdftype" name="pdftype" class="editinput" style="min-width:80px;">
[{block name="d3_pdfdocuments_order_overview_pdfTypeOptions"}]
[{assign var="generatorList" value=$oView->d3getGeneratorList()}]
[{foreach from=$generatorList->getList() item="generator"}]
@ -27,7 +31,7 @@
<tr>
<td style="text-align: right" class="edittext">
<label for="pdflanguage">[{oxmultilang ident="D3_PDFDOCUMENTS_LANGUAGE" suffix="COLON"}]</label>
<select id="pdflanguage" name="pdflanguage" class="saveinnewlanginput" style="width:80px;">
<select id="pdflanguage" name="pdflanguage" class="saveinnewlanginput" style="width:150px;">
[{foreach from=$alangs key=lang item=slang}]
<option value="[{$lang}]" [{if $lang == "0"}]SELECTED[{/if}]>[{$slang}]</option>
[{/foreach}]
@ -35,8 +39,11 @@
</td>
</tr>
<tr>
<td style="text-align: right" class="edittext"><br/>
<input type="submit" class="edittext" name="save" value="[{oxmultilang ident="D3_PDFDOCUMENTS_PDF_GENERATE"}]">
<td style="text-align: right" class="edittext" colspan="2"><br/>
[{if $devmode}]
<input type="submit" class="edittext" name="save" value="[{oxmultilang ident="D3_PDFDOCUMENTS_SGML_GENERATE"}]" onclick="document.getElementById('devmode').value = 1;">
[{/if}]
<input type="submit" class="edittext" name="save" value="[{oxmultilang ident="D3_PDFDOCUMENTS_PDF_GENERATE"}]" [{if $devmode}] onclick="document.getElementById('devmode').value = 0;"[{/if}]>
<iframe name="d3ExpPDF" style="width: 0; height: 0; border: none; display:none;"></iframe>
</td>
</tr>

Voir le fichier

@ -10,7 +10,24 @@
[{/foreach}]
</style>
<page backtop="[{$pagePadding.0}]mm" backright="[{$pagePadding.1}]mm" backbottom="[{$pagePadding.2}]mm" backleft="[{$pagePadding.3}]mm" pageset="[{$pageset}]" orientation="[{$orientation}]" format="[{$format}]">
<page
[{block name="pageSettings"}]
backtop="[{$pagePadding.0}]mm"
backright="[{$pagePadding.1}]mm"
backbottom="[{$pagePadding.2}]mm"
backleft="[{$pagePadding.3}]mm"
pageset="[{$pageset}]"
orientation="[{$orientation}]"
format="[{$format}]"
[{if $showLogo && $config->getConfigParam('d3PdfDocumentsBackgroundUrl')}]
backimg="[{$config->getConfigParam('d3PdfDocumentsBackgroundUrl')}]"
[{/if}]
[{* backcolor="#FFF" *}]
[{* backimgx="center" *}]
[{* backimgy="middle" *}]
[{* backimgw="100%" *}]
[{/block}]
>
<page_header>
[{foreach from=$pdfBlock_header item="_block"}]
[{$_block}]

Voir le fichier

@ -19,9 +19,15 @@
[{block name="pdfFooterCenter"}]
<td class="footerCenter">
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_MANAGINGDIRECTOR" suffix="COLON"}] [{$shop->getFieldData('oxfname')}] [{$shop->getFieldData('oxlname')}]</div>
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_COURT" suffix="COLON"}] [{$shop->getFieldData('oxcourt')}]</div>
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_HRBNR" suffix="COLON"}] [{$shop->getFieldData('oxhrbnr')}]</div>
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_USTID" suffix="COLON"}] [{$shop->getFieldData('oxvatnumber')}]</div>
[{if $shop->getFieldData('oxcourt')}]
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_COURT" suffix="COLON"}] [{$shop->getFieldData('oxcourt')}]</div>
[{/if}]
[{if $shop->getFieldData('oxhrbnr')}]
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_HRBNR" suffix="COLON"}] [{$shop->getFieldData('oxhrbnr')}]</div>
[{/if}]
[{if $shop->getFieldData('oxvatnumber')}]
<div>[{oxmultilang ident="D3_PDFDOCUMENTS_USTID" suffix="COLON"}] [{$shop->getFieldData('oxvatnumber')}]</div>
[{/if}]
</td>
[{/block}]
[{block name="pdfFooterRight"}]

Voir le fichier

@ -6,7 +6,8 @@
[{* pdf logo is available only in non admin theme *}]
[{assign var="isAdmin" value=$viewConfig->isAdmin()}]
[{$viewConfig->setAdminMode(false)}]
<img class="logo" alt="Logo" src="[{$viewConfig->getImageUrl('pdf_logo.jpg')}]">
[{assign var="logoUrl" value=$config->getConfigParam('d3PdfDocumentsLogoUrl')|default:$viewConfig->getImageUrl('pdf_logo.jpg')}]
<img class="logo" alt="Logo" src="[{$logoUrl}]">
[{$viewConfig->setAdminMode($isAdmin)}]
[{/if}]
</div>

Voir le fichier

@ -11,9 +11,11 @@
[{assign var="dateFormat" value='D3_PDFDOCUMENTS_DATE_FORMAT'|oxmultilangassign}]
[{oxmultilang ident="D3_PDFDOCUMENTS_DATE" suffix="COLON"}] [{$order->getFieldData('oxbilldate')|date_format:$dateFormat}]
</div>
<div>
[{oxmultilang ident="D3_PDFDOCUMENTS_USTIDNR" suffix="COLON"}] [{$shop->getFieldData('oxvatnumber')}]
</div>
[{if $shop->getFieldData('oxvatnumber')}]
<div>
[{oxmultilang ident="D3_PDFDOCUMENTS_USTIDNR" suffix="COLON"}] [{$shop->getFieldData('oxvatnumber')}]
</div>
[{/if}]
[{/block}]
</div>
[{/block}]

Voir le fichier

@ -2,8 +2,7 @@
[{if $payment->getId() == 'oxidinvoice'}]
[{block name="payinfo_billable_till"}]
[{assign var="dateFormat" value='D3_PDFDOCUMENTS_DATE_FORMAT'|oxmultilangassign}]
[{oxmultilang ident="D3_PDFDOCUMENTS_PAYABLEUNTIL"}]
[{$document->getPayableUntilDate()|date_format:$dateFormat}]
[{oxmultilang ident="D3_PDFDOCUMENTS_PAYABLEUNTIL" args=$document->getPayableUntilDate()|date_format:$dateFormat}]
[{/block}]
[{elseif $payment->getId() == 'oxidpayadvance' || $payment->getId() == 'oxidcreditcard'}]
[{block name="payinfo_payed"}]

Voir le fichier

@ -8,7 +8,7 @@ Erstellen Sie unterschiedliche statische oder dynamische PDF-Dokumente auf Kopfd
An den Bestellungen Ihres OXID-Shops steht Ihnen die Erstellung von Rechnung und Lieferschein zur Verfügung.
Das Modul kann einfach erweitert werden, um bestehende Dokumente anzupassen oder Neue hinzuzufügen. Auch komplett andere Dokumentarten (z.B. Artikeldatenblätter) sind einfach möglich.
Das Modul kann einfach erweitert werden, um bestehende Dokumente anzupassen oder neue hinzuzufügen. Auch komplett andere Dokumentarten (z.B. Artikeldatenblätter) sind einfach möglich.
## Systemanforderungen:

Voir le fichier

@ -95,6 +95,40 @@ $aModule = [
'group' => $sModuleId.'main',
'name' => $sModuleId.'basicAuthPassword',
'type' => 'password'
],
[
'group' => $sModuleId.'contents',
'name' => $sModuleId.'LogoUrl',
'type' => 'str'
],
[
'group' => $sModuleId.'contents',
'name' => $sModuleId.'BackgroundUrl',
'type' => 'str'
],
[
'group' => $sModuleId.'documents',
'name' => $sModuleId.'DocInvoice',
'type' => 'bool',
'value' => true
],
[
'group' => $sModuleId.'documents',
'name' => $sModuleId.'DocInvoiceNoLogo',
'type' => 'bool',
'value' => true
],
[
'group' => $sModuleId.'documents',
'name' => $sModuleId.'DocDeliveryNote',
'type' => 'bool',
'value' => true
],
[
'group' => $sModuleId.'documents',
'name' => $sModuleId.'DocDeliveryNoteNoLogo',
'type' => 'bool',
'value' => true
]
]
];