Compare commits

..

6 Commits

10 changed files with 33 additions and 22 deletions

View File

@ -10,6 +10,7 @@
namespace D3\PdfDocuments\Application\Model\AbstractClasses; namespace D3\PdfDocuments\Application\Model\AbstractClasses;
use D3\ModCfg\Application\Model\d3filesystem;
use D3\PdfDocuments\Application\Model\Exceptions\pdfGeneratorExceptionAbstract; use D3\PdfDocuments\Application\Model\Exceptions\pdfGeneratorExceptionAbstract;
use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsGenericInterface as genericInterface; use D3\PdfDocuments\Application\Model\Interfaces\pdfdocumentsGenericInterface as genericInterface;
use OxidEsales\Eshop\Core\Base; use OxidEsales\Eshop\Core\Base;
@ -218,15 +219,15 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
{ {
// forced filename from setFilename() // forced filename from setFilename()
if ($this->filename) { if ($this->filename) {
return $this->addFilenameExtension( return $this->makeValidFileName(
$this->makeValidFileName( $this->addFilenameExtension(
$this->filename $this->filename
) )
); );
} }
return $this->addFilenameExtension( return $this->makeValidFileName(
$this->makeValidFileName( $this->addFilenameExtension(
$this->getTypeForFilename() $this->getTypeForFilename()
) )
); );
@ -257,10 +258,8 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
*/ */
public function makeValidFileName($sFilename) public function makeValidFileName($sFilename)
{ {
$sFilename = preg_replace('/[\s]+/', '_', $sFilename); $fs = oxNew(d3filesystem::class);
$sFilename = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $sFilename); return $fs->filterFilename($sFilename);
return str_replace(' ', '_', $sFilename);
} }
/** /**

View File

@ -63,8 +63,8 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
{ {
// forced filename from setFilename() // forced filename from setFilename()
if ($this->filename) { if ($this->filename) {
return $this->addFilenameExtension( return $this->makeValidFileName(
$this->makeValidFileName( $this->addFilenameExtension(
$this->filename $this->filename
) )
); );
@ -72,8 +72,8 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
$sTrimmedBillName = trim($this->getOrder()->getFieldData('oxbilllname')); $sTrimmedBillName = trim($this->getOrder()->getFieldData('oxbilllname'));
return $this->addFilenameExtension( return $this->makeValidFileName(
$this->makeValidFileName( $this->addFilenameExtension(
implode( implode(
'_', '_',
[ [

View File

@ -54,8 +54,6 @@ class invoicePdf extends pdfdocumentsOrder implements pdfdocumentsOrderinvoiceIn
public function setInvoiceNumber() public function setInvoiceNumber()
{ {
$this->blIsNewOrder = false;
if (!$this->getOrder()->getFieldData('oxbillnr')) { if (!$this->getOrder()->getFieldData('oxbillnr')) {
$this->getOrder()->assign(['oxbillnr' => $this->getOrder()->getNextBillNum()]); $this->getOrder()->assign(['oxbillnr' => $this->getOrder()->getNextBillNum()]);

View File

@ -13,7 +13,7 @@ The module can be easily extended to adapt existing documents or add new ones. E
## System requirements: ## System requirements:
- installed OXID eShop version from 6.1 - installed OXID eShop version from 6.1
- PHP version for which installation packages are available (PHP 7) - PHP version for which installation packages are available (PHP 7 + 8)
- Installation via Composer - Installation via Composer
## Compatibility: ## Compatibility:

View File

@ -13,7 +13,7 @@ Das Modul kann einfach erweitert werden, um bestehende Dokumente anzupassen oder
## Systemanforderungen: ## Systemanforderungen:
- installierter OXID eShop in Version ab 6.1 - installierter OXID eShop in Version ab 6.1
- PHP-Version, für die Installationspakete verfügbar sind (PHP 7) - PHP-Version, für die Installationspakete verfügbar sind (PHP 7 + 8)
- Installation via Composer - Installation via Composer
## Kompatibilität: ## Kompatibilität:

View File

@ -31,9 +31,10 @@
} }
}, },
"require": { "require": {
"php": "^7.0", "php": "^7.0 || ^8.0",
"oxid-esales/oxideshop-ce": "6.3 - 6.5", "oxid-esales/oxideshop-ce": "6.3 - 6.8",
"spipu/html2pdf": "^5.2" "spipu/html2pdf": "^5.2",
"d3/modcfg": "^5.3.6.000 || ^6"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {

View File

@ -2,6 +2,17 @@
title: Changelog title: Changelog
--- ---
## 1.0.2.0 - (2021-04-30)
### Added
- installierbar in OXID 6.2.4 und 6.3.0
- Dateinamen werden auf Gültigkeit hin korrigiert
### Fixed
- Setzen der Rechnungsnummer setzt den "neue Bestellung"-Status nicht zurück
---
## 1.0.1.0 - (2020-08-20) ## 1.0.1.0 - (2020-08-20)
### Changed ### Changed

View File

@ -1,6 +1,6 @@
{ {
"title": "<i class='fab fa-d3 d3fa-color-blue'></i> PDF Dokumente", "title": "<i class='fab fa-d3 d3fa-color-blue'></i> PDF Dokumente",
"moduleversion": "1.0.1.0", "moduleversion": "1.0.2.0",
"titledesc": "für den Oxid eShop", "titledesc": "für den Oxid eShop",
"author": "D³ Data Development", "author": "D³ Data Development",
"moduledate": "20.08.2020", "moduledate": "20.08.2020",

View File

@ -3,13 +3,15 @@ title: Systemanforderungen
--- ---
* PHP Version * PHP Version
* 7.0.x bis 7.4.x * 7.0.x bis 8.0.x
* Shopversionen / -editionen * Shopversionen / -editionen
* OXID eShop Community Edition (CE), Professional Edition (PE) oder Enterprise Edition (EE) in Compilation Version * OXID eShop Community Edition (CE), Professional Edition (PE) oder Enterprise Edition (EE) in Compilation Version
* 6.1.x * 6.1.x
* 6.2.x * 6.2.x
* 6.3.x
* Themes * Themes
* Diese Modul bindet sich nicht in Frontendthemes ein und ist daher davon unabhängig * Diese Modul bindet sich nicht in Frontendthemes ein und ist daher davon unabhängig
* (D3) Modul-Connector ([kostenfrei bei D3 erhältlich](https://www.oxidmodule.com/connector/)) ab Version 5.3.6.0
* Template-Engine * Template-Engine
* Smarty * Smarty
* Installation via [Composer](https://getcomposer.org) * Installation via [Composer](https://getcomposer.org)

View File

@ -28,7 +28,7 @@ $aModule = [
'de' => $logo.' PDF-Dokumente', 'de' => $logo.' PDF-Dokumente',
'en' => $logo.' PDF documents', 'en' => $logo.' PDF documents',
], ],
'version' => '1.0.1.0', 'version' => '1.0.2.0',
'author' => 'D&sup3; Data Development (Inh.: Thomas Dartsch)', 'author' => 'D&sup3; Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com', 'email' => 'support@shopmodule.com',
'url' => 'http://www.oxidmodule.com/', 'url' => 'http://www.oxidmodule.com/',