development mode ask for document type
This commit is contained in:
@ -27,6 +27,10 @@ class orderOverviewPdfGenerator
|
|||||||
{
|
{
|
||||||
$Pdf= $this->getPdfClass();
|
$Pdf= $this->getPdfClass();
|
||||||
|
|
||||||
|
$Pdf->setDevelopmentMode(
|
||||||
|
Registry::getConfig()->getConfigParam('d3PdfDocumentsbDev') &&
|
||||||
|
Registry::getRequest()->getRequestEscapedParameter('devmode')
|
||||||
|
);
|
||||||
$Pdf->setOrder($order);
|
$Pdf->setOrder($order);
|
||||||
$Pdf->downloadPdf($iSelLang);
|
$Pdf->downloadPdf($iSelLang);
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,8 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
/** @var string */
|
/** @var string */
|
||||||
public $filename;
|
public $filename;
|
||||||
|
|
||||||
|
protected $devMode = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pdfDocumentsGeneric constructor.
|
* pdfDocumentsGeneric constructor.
|
||||||
*/
|
*/
|
||||||
@ -53,6 +55,11 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
$this->oSmarty = Registry::getUtilsView()->getSmarty(true);
|
$this->oSmarty = Registry::getUtilsView()->getSmarty(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setDevelopmentMode(bool $devMode)
|
||||||
|
{
|
||||||
|
$this->devMode = $devMode;
|
||||||
|
}
|
||||||
|
|
||||||
public function runPreAction()
|
public function runPreAction()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -316,7 +323,7 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
*/
|
*/
|
||||||
public function output(Html2Pdf $oPdf, $sFilename, $target, $html)
|
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);
|
return $this->outputDev($oPdf, $sFilename, $target, $html);
|
||||||
} else {
|
} else {
|
||||||
return $oPdf->output($sFilename, $target);
|
return $oPdf->output($sFilename, $target);
|
||||||
|
@ -12,6 +12,8 @@ namespace D3\PdfDocuments\Application\Model\Interfaces;
|
|||||||
|
|
||||||
interface pdfdocumentsGenericInterface
|
interface pdfdocumentsGenericInterface
|
||||||
{
|
{
|
||||||
|
public function setDevelopmentMode(bool $devMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@ -44,5 +44,6 @@ $aLang = array(
|
|||||||
|
|
||||||
'D3_PDFDOCUMENTS_PDF_TYPE' => 'Dokument',
|
'D3_PDFDOCUMENTS_PDF_TYPE' => 'Dokument',
|
||||||
'D3_PDFDOCUMENTS_LANGUAGE' => 'Sprache',
|
'D3_PDFDOCUMENTS_LANGUAGE' => 'Sprache',
|
||||||
|
'D3_PDFDOCUMENTS_SGML_GENERATE' => 'SGML erstellen',
|
||||||
'D3_PDFDOCUMENTS_PDF_GENERATE' => 'Dokument erstellen',
|
'D3_PDFDOCUMENTS_PDF_GENERATE' => 'Dokument erstellen',
|
||||||
);
|
);
|
||||||
|
@ -44,5 +44,6 @@ $aLang = array(
|
|||||||
|
|
||||||
'D3_PDFDOCUMENTS_PDF_TYPE' => 'Document',
|
'D3_PDFDOCUMENTS_PDF_TYPE' => 'Document',
|
||||||
'D3_PDFDOCUMENTS_LANGUAGE' => 'Language',
|
'D3_PDFDOCUMENTS_LANGUAGE' => 'Language',
|
||||||
|
'D3_PDFDOCUMENTS_SGML_GENERATE' => 'Create SGML',
|
||||||
'D3_PDFDOCUMENTS_PDF_GENERATE' => 'Create Document',
|
'D3_PDFDOCUMENTS_PDF_GENERATE' => 'Create Document',
|
||||||
);
|
);
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
[{if $edit && $oView->d3CanExport()}]
|
[{if $edit && $oView->d3CanExport()}]
|
||||||
<br>
|
<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">
|
<form name="d3CreatePdf" id="d3CreatePdf" action="[{$oViewConf->getSelfLink()}]" method="post" target="d3ExpPDF">
|
||||||
[{$oViewConf->getHiddenSid()}]
|
[{$oViewConf->getHiddenSid()}]
|
||||||
<input type="hidden" name="cl" value="order_overview">
|
<input type="hidden" name="cl" value="order_overview">
|
||||||
<input type="hidden" name="fnc" value="d3CreatePDF">
|
<input type="hidden" name="fnc" value="d3CreatePDF">
|
||||||
<input type="hidden" name="oxid" value="[{$oxid}]">
|
<input type="hidden" name="oxid" value="[{$oxid}]">
|
||||||
|
[{if $devmode}]<input type="hidden" id="devmode" name="devmode" value="0">[{/if}]
|
||||||
<fieldset style="padding: 5px">
|
<fieldset style="padding: 5px">
|
||||||
<legend>[{oxmultilang ident="D3_PDFDOCUMENTS"}]</legend>
|
<legend>[{oxmultilang ident="D3_PDFDOCUMENTS"}]</legend>
|
||||||
<table style="width: 100%">
|
<table style="width: 100%">
|
||||||
@ -36,7 +40,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: right" class="edittext"><br/>
|
<td style="text-align: right" class="edittext"><br/>
|
||||||
<input type="submit" class="edittext" name="save" value="[{oxmultilang ident="D3_PDFDOCUMENTS_PDF_GENERATE"}]">
|
[{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>
|
<iframe name="d3ExpPDF" style="width: 0; height: 0; border: none; display:none;"></iframe>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Verwijs in nieuw issue
Block a user