Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
b374688479
|
|||
7785181e4c
|
|||
67a046476f
|
|||
ea982a89d0
|
|||
3d52203d94
|
|||
564ddd891d
|
|||
09fa1bce31
|
|||
622b2c7e57
|
|||
1379b76f2d
|
|||
da08b322f4
|
|||
d2599a57b6
|
|||
767750a09a
|
|||
eac41bc94d
|
|||
d1c1ba90b8
|
|||
11d4227874
|
|||
3635f3c7e9
|
|||
b0b0c93691
|
|||
a4fa041154
|
|||
ccb48a73c1
|
|||
f59d6b4cc7 | |||
81e730ca8f | |||
c899d09f77 | |||
0f4561d6f6 | |||
62a534d42f | |||
ef589ee8a3 | |||
bf9bd60921 | |||
73f38afc7f |
BIN
.gitattributes
vendored
Normal file
BIN
.gitattributes
vendored
Normal file
Binary file not shown.
45
CHANGELOG.md
45
CHANGELOG.md
@ -1,22 +1,57 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## Unreleased
|
---
|
||||||
|
|
||||||
## 1.2.0.0
|
## 3.0.0.1 (2021-04-28)
|
||||||
|
### Changed
|
||||||
|
- Modul verwendbar in OXID 6.3
|
||||||
|
### Fixed
|
||||||
|
- falsche prepared statement Kombination korrigiert
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3.0.0.0 (2020-11-11)
|
||||||
|
### Changed
|
||||||
|
- Modul verwendbar in OXID 6.2, deprecated Code bestm<74>glich entfernt
|
||||||
|
- Anzeige von Anfragemails entfernt, da dazugeh<65>riges Modul nicht weiter entwickelt wird
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2.0.1.0 (2019-10-21)
|
||||||
|
### Changed
|
||||||
|
- Mails k<>nnen auch Dreingabeartikel regenerieren und darstellen
|
||||||
|
- weitere Mailinformationen werden f<>r Mailumleitung ge<67>ndert
|
||||||
|
### Fixed
|
||||||
|
- verhindert Thankyou Redirect, wenn keine Order geladen wurde
|
||||||
|
- Debugging von Mails mit Dreingabebestellungen l<>scht diese Discounts in der gesamten Bestellung
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2.0.0.0 (2018-02-23)
|
||||||
|
### Added
|
||||||
|
- verf<72>gbar f<>r OXID 6
|
||||||
|
- Installation via Composer
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1.2.0.0 (2017-11-21)
|
||||||
### Added
|
### Added
|
||||||
- Mail-Anzeige fordert zus<75>tzlich Authentfikation mit einem Shopadmin-Konto
|
- Mail-Anzeige fordert zus<75>tzlich Authentfikation mit einem Shopadmin-Konto
|
||||||
- Seitenencoding definiert
|
- Seitenencoding definiert
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Dokumentation erg<72>nzt
|
- Dokumentation erg<72>nzt
|
||||||
|
|
||||||
## 1.1.0.0
|
---
|
||||||
|
|
||||||
|
## 1.1.0.0 (2017-05-31)
|
||||||
### Added
|
### Added
|
||||||
- Mailversand <20>bers Shopframework wird blockiert oder
|
- Mailversand <20>bers Shopframework wird blockiert oder
|
||||||
- Mails werden an alternative Mailadresse umgeleitet
|
- Mails werden an alternative Mailadresse umgeleitet
|
||||||
|
|
||||||
## 1.0.0.0
|
---
|
||||||
|
|
||||||
|
## 1.0.0.0 (2015-12-16)
|
||||||
### Added
|
### Added
|
||||||
- unterbindet das L<>schen des Warenkorbs nach Bestellabschluss
|
- unterbindet das L<>schen des Warenkorbs nach Bestellabschluss
|
||||||
- Thankyou ist ohne Bestellabschluss aufrufbar (unter Angabe der Bestellnummer auch f<>r eine bestimmte Bestellung)
|
- Thankyou ist ohne Bestellabschluss aufrufbar (unter Angabe der Bestellnummer auch f<>r eine bestimmte Bestellung)
|
||||||
|
40
README.md
40
README.md
@ -1,29 +1,35 @@
|
|||||||
# TPL Development Helper
|
# TPL Development Helper
|
||||||
|
|
||||||
|
## VersionsĂĽbersicht:
|
||||||
|
|
||||||
|
* 3.x - OXID 6.2 bis 6.3
|
||||||
|
* 2.x - OXID 6.0 bis 6.1
|
||||||
|
* 1.x - bis OXID 4.10 / 5.3
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
composer require d3/devhelper
|
composer require d3/devhelper:"^3.0"
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
### Entwicklungswerkzeug zur Kontrolle schwer zug<EFBFBD>nglicher Shopinhalte
|
### Entwicklungswerkzeug zur Kontrolle schwer zugänglicher Shopinhalte
|
||||||
|
|
||||||
Diese Tool soll bei t<EFBFBD>glichen Entwicklungsaufgaben im OXID eShop helfen, die (systembedingt) vom Shopsystem erschwert werden.
|
Diese Tool soll bei täglichen Entwicklungsaufgaben im OXID eShop helfen, die (systembedingt) vom Shopsystem erschwert werden.
|
||||||
|
|
||||||
* Mailversand (<EFBFBD>bers Shopframework) <EFBFBD>bers Shopframework wird blockiert __oder__
|
* Mailversand (ĂĽbers Shopframework) ĂĽbers Shopframework wird blockiert __oder__
|
||||||
* Mails (<EFBFBD>bers Shopframework) werden an alternative Mailadresse umgeleitet
|
* Mails (ĂĽbers Shopframework) werden an alternative Mailadresse umgeleitet
|
||||||
(Das Tool setzt direkt an der oxemail::_sendMail()-Methode an und kann damit __jeden__ Mailversand kontrollieren, der <EFBFBD>bers Framework l<EFBFBD>uft. Man muss nicht X verschiedene Module <EFBFBD>berwachen und hat auch Kontrolle <EFBFBD>ber Mailerweiterungen, die keinen Stage-Einsatz vorsehen.)
|
(Das Tool setzt direkt an der oxemail::_sendMail()-Methode an und kann damit __jeden__ Mailversand kontrollieren, der übers Framework läuft. Man muss nicht X verschiedene Module überwachen und hat auch Kontrolle über Mailerweiterungen, die keinen Stage-Einsatz vorsehen.)
|
||||||
* unterbindet das L<EFBFBD>schen des Warenkorbs nach Bestellabschluss
|
* unterbindet das Löschen des Warenkorbs nach Bestellabschluss
|
||||||
* Thankyou-Seite ist auch ohne Bestellabschluss aufrufbar (unter Angabe der Bestellnummer auch f<EFBFBD>r eine bestimmte Bestellung)
|
* Thankyou-Seite ist auch ohne Bestellabschluss aufrufbar (unter Angabe der Bestellnummer auch fĂĽr eine bestimmte Bestellung)
|
||||||
* Bestellbest<EFBFBD>tigungsmails und sind im Browser darstellbar (unter Angabe der Bestellnummer auch f<EFBFBD>r eine bestimmte Bestellung)
|
* Bestellbestätigungsmails und sind im Browser darstellbar (unter Angabe der Bestellnummer auch für eine bestimmte Bestellung)
|
||||||
|
|
||||||
## Sicherheitshinweis
|
## Sicherheitshinweis
|
||||||
|
|
||||||
Da hiermit gezielt Mails der Shopbestellungen angezeigt werden k<EFBFBD>nnen, ist das Modul mit entsprechender Vorsicht zu verwenden. Die H<EFBFBD>rden f<EFBFBD>r die Anzeige der Mails sind daher absichtlich sehr hoch gesetzt. Vor der Verwendung sind Einstellungen zu <EFBFBD>ndern. Denken Sie unbedingt daran, diese Einstellungen im Anschluss wieder zur<EFBFBD>ckzusetzen. Sonst sind Kunden- und Bestelldaten frei abrufbar. Wir <EFBFBD>bernehmen f<EFBFBD>r daraus resultierenden Sch<EFBFBD>den keine Haftung.
|
Da hiermit gezielt Mails der Shopbestellungen angezeigt werden können, ist das Modul mit entsprechender Vorsicht zu verwenden. Die Hürden für die Anzeige der Mails sind daher absichtlich sehr hoch gesetzt. Vor der Verwendung sind Einstellungen zu ändern. Denken Sie unbedingt daran, diese Einstellungen im Anschluss wieder zurückzusetzen. Sonst sind Kunden- und Bestelldaten frei abrufbar. Wir übernehmen für daraus resultierenden Schäden keine Haftung.
|
||||||
|
|
||||||
## Verwendung
|
## Verwendung
|
||||||
|
|
||||||
Um unser Tool verwenden zu k<EFBFBD>nnen, folgen Sie bitte diesen Schritten:
|
Um unser Tool verwenden zu können, folgen Sie bitte diesen Schritten:
|
||||||
|
|
||||||
1. Produktivmodus entfernen
|
1. Produktivmodus entfernen
|
||||||
|
|
||||||
@ -33,14 +39,14 @@ Um unser Tool verwenden zu k
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
3. In den Einstellungen die gew<EFBFBD>nschten Funktionen freischalten
|
3. In den Einstellungen die gewĂĽnschten Funktionen freischalten
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
4. <EFBFBD>ber die Links im Tab <EFBFBD>Stamm<EFBFBD> k<EFBFBD>nnen Sie die betreffenden Seiten aufrufen. Vor der Darstellung wird ein Benutzername und Passwort abgefragt. Hierf<EFBFBD>r verwenden Sie die Anmeldedaten des Adminbereichs Ihres Shops.
|
4. Über die Links im Tab "Stamm" können Sie die betreffenden Seiten aufrufen. Vor der Darstellung wird ein Benutzername und Passwort abgefragt. Hierfür verwenden Sie die Anmeldedaten des Adminbereichs Ihres Shops.
|
||||||
|
|
||||||
5. An den E-Mail- und Thankyou-Links gibt es einen leeren Parameter, den Sie bei Bedarf mit einer Bestellnummer f<EFBFBD>llen k<EFBFBD>nnen. Dann wird statt der letzten Bestellung ganz gezielt eine andere Bestellung zur Darstellung verwendet.
|
5. An den E-Mail- und Thankyou-Links gibt es einen leeren Parameter, den Sie bei Bedarf mit einer Bestellnummer füllen können. Dann wird statt der letzten Bestellung ganz gezielt eine andere Bestellung zur Darstellung verwendet.
|
||||||
|
|
||||||
6. Beachten Sie unbedingt, dass Sie nach der Verwendung unbedingt das Modul wieder deaktivieren und den Produktivmodus wieder anschalten.
|
6. Beachten Sie unbedingt, dass Sie nach der Verwendung unbedingt das Modul wieder deaktivieren und den Produktivmodus wieder anschalten.
|
||||||
|
|
||||||
Ber<EFBFBD>cksichtigen Sie bei der Darstellung der E-Mails bitte, dass die Mailprogramme diese m<EFBFBD>glicherweise anders darstellen, als der Browser dies tut. Daher kann die Darstellung im Browser nur ein Anhaltspunkt sein.
|
Berücksichtigen Sie bei der Darstellung der E-Mails bitte, dass die Mailprogramme diese möglicherweise anders darstellen, als der Browser dies tut. Daher kann die Darstellung im Browser nur ein Anhaltspunkt sein.
|
||||||
|
@ -1,41 +1,43 @@
|
|||||||
{
|
{
|
||||||
"name": "d3/devhelper",
|
"name": "d3/devhelper",
|
||||||
"description": "Manipulate shop standard processes for easier development",
|
"description": "Manipulate shop standard processes for easier development",
|
||||||
"type": "oxideshop-module",
|
"type": "oxideshop-module",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"oxid",
|
"oxid",
|
||||||
"modules",
|
"modules",
|
||||||
"eShop",
|
"eShop",
|
||||||
"d3",
|
"d3",
|
||||||
"devhelper",
|
"devhelper",
|
||||||
"developer",
|
"developer",
|
||||||
"development",
|
"development",
|
||||||
"tools"
|
"tools",
|
||||||
],
|
"template",
|
||||||
"authors": [
|
"e-mail",
|
||||||
{
|
"thankyou"
|
||||||
"name": "D3 Data Development (Inh. Thomas Dartsch)",
|
],
|
||||||
"email": "info@shopmodule.com",
|
"authors": [
|
||||||
"homepage": "http://www.d3data.de"
|
{
|
||||||
}
|
"name": "D3 Data Development (Inh. Thomas Dartsch)",
|
||||||
],
|
"email": "info@shopmodule.com",
|
||||||
"homepage": "https://www.oxidmodule.com/",
|
"homepage": "https://www.d3data.de"
|
||||||
"license": [
|
}
|
||||||
"proprietary"
|
],
|
||||||
],
|
"homepage": "https://www.oxidmodule.com/",
|
||||||
"extra": {
|
"license": [
|
||||||
"oxideshop": {
|
"GPL-3.0-or-later"
|
||||||
"source-directory": "/src",
|
],
|
||||||
"target-directory": "d3/devhelper"
|
"extra": {
|
||||||
}
|
"oxideshop": {
|
||||||
},
|
"source-directory": "/src",
|
||||||
"require": {
|
"target-directory": "d3/devhelper"
|
||||||
"php": ">=5.6",
|
}
|
||||||
"oxid-esales/oxideshop-metapackage-ce": "~6.0.0 || ~6.1.0"
|
},
|
||||||
},
|
"require": {
|
||||||
"autoload": {
|
"oxid-esales/oxideshop-ce": "6.5 - 6.14"
|
||||||
"psr-4": {
|
},
|
||||||
"D3\\Devhelper\\": "../../../source/modules/d3/devhelper"
|
"autoload": {
|
||||||
}
|
"psr-4": {
|
||||||
}
|
"D3\\Devhelper\\": "../../../source/modules/d3/devhelper"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -4,6 +4,7 @@ namespace D3\Devhelper\Application\Controller;
|
|||||||
|
|
||||||
use D3\Devhelper\Modules\Application\Controller as ModuleController;
|
use D3\Devhelper\Modules\Application\Controller as ModuleController;
|
||||||
use D3\Devhelper\Modules\Core as ModuleCore;
|
use D3\Devhelper\Modules\Core as ModuleCore;
|
||||||
|
use Exception;
|
||||||
use OxidEsales\Eshop\Application\Controller\FrontendController;
|
use OxidEsales\Eshop\Application\Controller\FrontendController;
|
||||||
use OxidEsales\Eshop\Application\Controller\ThankYouController;
|
use OxidEsales\Eshop\Application\Controller\ThankYouController;
|
||||||
use OxidEsales\Eshop\Application\Model\User;
|
use OxidEsales\Eshop\Application\Model\User;
|
||||||
@ -12,7 +13,6 @@ use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
|||||||
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
||||||
use OxidEsales\Eshop\Core\Exception\UserException;
|
use OxidEsales\Eshop\Core\Exception\UserException;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
use OxidEsales\Eshop\Core\Request;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This Software is the property of Data Development and is protected
|
* This Software is the property of Data Development and is protected
|
||||||
@ -41,8 +41,8 @@ class d3dev extends FrontendController
|
|||||||
protected function _authenticate ()
|
protected function _authenticate ()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$sUser = Registry::get(Request::class)->getRequestEscapedParameter('usr');
|
$sUser = Registry::getRequest()->getRequestEscapedParameter('usr');
|
||||||
$sPassword = Registry::get(Request::class)->getRequestEscapedParameter('pwd');
|
$sPassword = Registry::getRequest()->getRequestEscapedParameter('pwd');
|
||||||
|
|
||||||
if ( !$sUser || !$sPassword ) {
|
if ( !$sUser || !$sPassword ) {
|
||||||
$sUser = $_SERVER[ 'PHP_AUTH_USER' ];
|
$sUser = $_SERVER[ 'PHP_AUTH_USER' ];
|
||||||
@ -67,13 +67,10 @@ class d3dev extends FrontendController
|
|||||||
}
|
}
|
||||||
$oUser = oxNew( User::class );
|
$oUser = oxNew( User::class );
|
||||||
if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) {
|
if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) {
|
||||||
/** @var UserException $oEx */
|
throw oxNew( UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN' );
|
||||||
$oEx = oxNew( UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN' );
|
|
||||||
|
|
||||||
throw $oEx;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch ( \Exception $oEx ) {
|
catch ( Exception $oEx ) {
|
||||||
$oShop = Registry::getConfig()->getActiveShop();
|
$oShop = Registry::getConfig()->getActiveShop();
|
||||||
header( 'WWW-Authenticate: Basic realm="' . $oShop->getFieldData('oxname') . '"' );
|
header( 'WWW-Authenticate: Basic realm="' . $oShop->getFieldData('oxname') . '"' );
|
||||||
header( 'HTTP/1.0 401 Unauthorized' );
|
header( 'HTTP/1.0 401 Unauthorized' );
|
||||||
@ -90,12 +87,12 @@ class d3dev extends FrontendController
|
|||||||
header('Content-type: text/html; charset='.Registry::getLang()->translateString('charset'));
|
header('Content-type: text/html; charset='.Registry::getLang()->translateString('charset'));
|
||||||
|
|
||||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()
|
if (Registry::getConfig()->getActiveShop()->isProductiveMode()
|
||||||
|| false == Registry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser')
|
|| false == Registry::getConfig()->getConfigParam(ModuleCore\d3_dev_conf::OPTION_SHOWMAILSINBROWSER)
|
||||||
) {
|
) {
|
||||||
Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start');
|
Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start');
|
||||||
}
|
}
|
||||||
|
|
||||||
$sTpl = Registry::get(Request::class)->getRequestEscapedParameter('type');
|
$sTpl = Registry::getRequest()->getRequestEscapedParameter('type');
|
||||||
|
|
||||||
/** @var ModuleController\d3_dev_thankyou $oThankyou */
|
/** @var ModuleController\d3_dev_thankyou $oThankyou */
|
||||||
$oThankyou = oxNew(ThankYouController::class);
|
$oThankyou = oxNew(ThankYouController::class);
|
||||||
@ -106,27 +103,4 @@ class d3dev extends FrontendController
|
|||||||
echo $oEmail->d3GetOrderMailContent($oOrder, $sTpl);
|
echo $oEmail->d3GetOrderMailContent($oOrder, $sTpl);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws DatabaseConnectionException
|
|
||||||
*/
|
|
||||||
public function showInquiryMailContent()
|
|
||||||
{
|
|
||||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()
|
|
||||||
|| false == Registry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser')
|
|
||||||
) {
|
|
||||||
Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start');
|
|
||||||
}
|
|
||||||
|
|
||||||
$sTpl = Registry::get(Request::class)->getRequestEscapedParameter('type');
|
|
||||||
|
|
||||||
/** @var ModuleController\d3_dev_thankyou $oThankyou */
|
|
||||||
$oThankyou = oxNew(ThankYouController::class);
|
|
||||||
$oOrder = $oThankyou->d3GetLastInquiry();
|
|
||||||
|
|
||||||
/** @var ModuleCore\d3_dev_oxemail $oEmail */
|
|
||||||
$oEmail = oxNew(Email::class);
|
|
||||||
echo $oEmail->d3GetInquiryMailContent($oOrder, $sTpl);
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -16,27 +16,33 @@
|
|||||||
|
|
||||||
namespace D3\Devhelper\Modules\Application\Controller
|
namespace D3\Devhelper\Modules\Application\Controller
|
||||||
{
|
{
|
||||||
class d3_dev_thankyou_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {}
|
use OxidEsales\Eshop\Application\Controller\ThankYouController;
|
||||||
|
|
||||||
|
class d3_dev_thankyou_parent extends ThankYouController {}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace D3\Devhelper\Modules\Application\Model
|
namespace D3\Devhelper\Modules\Application\Model
|
||||||
{
|
{
|
||||||
class d3_dev_oxorder_parent extends \OxidEsales\Eshop\Application\Model\Order {}
|
use OxidEsales\Eshop\Application\Controller\OrderController;
|
||||||
|
use OxidEsales\Eshop\Application\Model\Basket;
|
||||||
|
use OxidEsales\Eshop\Application\Model\BasketItem;
|
||||||
|
use OxidEsales\Eshop\Application\Model\Order;
|
||||||
|
use OxidEsales\Eshop\Application\Model\OrderArticle;
|
||||||
|
|
||||||
class d3_dev_d3inquiry_parent extends d3inquiry {}
|
class d3_dev_oxorder_parent extends Order {}
|
||||||
|
|
||||||
class d3_dev_d3inquiryarticle_parent extends d3inquiryarticle {}
|
class d3_dev_oxorderarticle_parent extends OrderArticle {}
|
||||||
|
|
||||||
class d3_dev_oxorderarticle_parent extends \OxidEsales\Eshop\Application\Model\OrderArticle {}
|
class d3_dev_oxbasket_parent extends Basket {}
|
||||||
|
|
||||||
class d3_dev_oxbasket_parent extends \OxidEsales\Eshop\Application\Model\Basket {}
|
class d3_dev_oxbasketitem_parent extends BasketItem {}
|
||||||
|
|
||||||
class d3_dev_oxbasketitem_parent extends \OxidEsales\Eshop\Application\Model\BasketItem {}
|
class d3_dev_order_parent extends OrderController {}
|
||||||
|
|
||||||
class d3_dev_order_parent extends \OxidEsales\Eshop\Application\Controller\OrderController {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace D3\Devhelper\Modules\Core
|
namespace D3\Devhelper\Modules\Core
|
||||||
{
|
{
|
||||||
class d3_dev_oxemail_parent extends \OxidEsales\Eshop\Core\Email {}
|
use OxidEsales\Eshop\Core\Email;
|
||||||
|
|
||||||
|
class d3_dev_oxemail_parent extends Email {}
|
||||||
}
|
}
|
@ -3,15 +3,16 @@
|
|||||||
namespace D3\Devhelper\Modules\Application\Controller;
|
namespace D3\Devhelper\Modules\Application\Controller;
|
||||||
|
|
||||||
// .../?cl=thankyou[&d3orderid=23]
|
// .../?cl=thankyou[&d3orderid=23]
|
||||||
use D3\Devhelper\Modules\Application\Model\d3_dev_d3inquiry;
|
|
||||||
use D3\Devhelper\Modules\Application\Model\d3_dev_oxorder;
|
use D3\Devhelper\Modules\Application\Model\d3_dev_oxorder;
|
||||||
|
use D3\Devhelper\Modules\Core\d3_dev_conf;
|
||||||
|
use Exception;
|
||||||
use OxidEsales\Eshop\Application\Model\Order;
|
use OxidEsales\Eshop\Application\Model\Order;
|
||||||
use OxidEsales\Eshop\Application\Model\User;
|
use OxidEsales\Eshop\Application\Model\User;
|
||||||
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
||||||
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
||||||
use OxidEsales\Eshop\Core\Exception\UserException;
|
use OxidEsales\Eshop\Core\Exception\UserException;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
use OxidEsales\Eshop\Core\Request;
|
use oxOrder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This Software is the property of Data Development and is protected
|
* This Software is the property of Data Development and is protected
|
||||||
@ -40,24 +41,54 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent
|
|||||||
|
|
||||||
parent::init();
|
parent::init();
|
||||||
|
|
||||||
Registry::getSession()->setVariable('sess_challenge', $sSessChallenge);
|
if (Registry::getRequest()->getRequestEscapedParameter("d3dev")
|
||||||
|
|
||||||
if (Registry::get(Request::class)->getRequestEscapedParameter("d3dev")
|
|
||||||
&& false == (bool) Registry::getConfig()->getActiveShop()->isProductiveMode()
|
&& false == (bool) Registry::getConfig()->getActiveShop()->isProductiveMode()
|
||||||
&& Registry::getConfig()->getConfigParam('blD3DevShowThankyou')
|
&& Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_PREVENTDELBASKET)
|
||||||
) {
|
) {
|
||||||
|
Registry::getSession()->setVariable( 'sess_challenge', $sSessChallenge );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->d3DevCanShowThankyou()) {
|
||||||
$this->_d3authenticate();
|
$this->_d3authenticate();
|
||||||
$oOrder = $this->d3GetLastOrder();
|
$oOrder = $this->d3GetLastOrder();
|
||||||
$oBasket = $oOrder->d3DevGetOrderBasket();
|
$this->_oBasket = $oOrder->d3DevGetOrderBasket();
|
||||||
$this->_oBasket = $oBasket;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function d3DevCanShowThankyou()
|
||||||
|
{
|
||||||
|
return Registry::getRequest()->getRequestEscapedParameter("d3dev")
|
||||||
|
&& false == (bool) Registry::getConfig()->getActiveShop()->isProductiveMode()
|
||||||
|
&& Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_SHOWTHANKYOU);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$currentClass = '';
|
||||||
|
if ($this->d3DevCanShowThankyou()) {
|
||||||
|
$currentClass = $this->getViewConfig()->getViewConfigParam('cl');
|
||||||
|
}
|
||||||
|
|
||||||
|
$ret = parent::render();
|
||||||
|
|
||||||
|
if ($this->d3DevCanShowThankyou()) {
|
||||||
|
$this->getViewConfig()->setViewConfigParam('cl', $currentClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
protected function _d3authenticate ()
|
protected function _d3authenticate ()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$sUser = Registry::get(Request::class)->getRequestEscapedParameter( 'usr');
|
$sUser = Registry::getRequest()->getRequestEscapedParameter( 'usr');
|
||||||
$sPassword = Registry::get(Request::class)->getRequestEscapedParameter('pwd');
|
$sPassword = Registry::getRequest()->getRequestEscapedParameter('pwd');
|
||||||
|
|
||||||
if ( !$sUser || !$sPassword ) {
|
if ( !$sUser || !$sPassword ) {
|
||||||
$sUser = $_SERVER[ 'PHP_AUTH_USER' ];
|
$sUser = $_SERVER[ 'PHP_AUTH_USER' ];
|
||||||
@ -88,7 +119,7 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent
|
|||||||
throw $oEx;
|
throw $oEx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch ( \Exception $oEx ) {
|
catch ( Exception $oEx ) {
|
||||||
$oShop = Registry::getConfig()->getActiveShop();
|
$oShop = Registry::getConfig()->getActiveShop();
|
||||||
header( 'WWW-Authenticate: Basic realm="{' . $oShop->getFieldData('oxname') . '"' );
|
header( 'WWW-Authenticate: Basic realm="{' . $oShop->getFieldData('oxname') . '"' );
|
||||||
header( 'HTTP/1.0 401 Unauthorized' );
|
header( 'HTTP/1.0 401 Unauthorized' );
|
||||||
@ -96,6 +127,33 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool|d3_dev_oxorder|oxOrder
|
||||||
|
* @throws DatabaseConnectionException
|
||||||
|
* @throws DatabaseErrorException
|
||||||
|
*/
|
||||||
|
public function getOrder()
|
||||||
|
{
|
||||||
|
$oOrder = parent::getOrder();
|
||||||
|
|
||||||
|
if ((false == $oOrder || !$oOrder->getFieldData('oxordernr'))
|
||||||
|
&& $this->d3DevCanShowThankyou()
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
$this->_oOrder = $this->d3GetLastOrder();
|
||||||
|
$oOrder = $this->_oOrder;
|
||||||
|
|
||||||
|
if (!$oOrder || !$oOrder->getFieldData('oxordernr')) {
|
||||||
|
throw oxNew(\RuntimeException::class, 'unknown order');
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
die($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $oOrder;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool|d3_dev_oxorder
|
* @return bool|d3_dev_oxorder
|
||||||
* @throws DatabaseConnectionException
|
* @throws DatabaseConnectionException
|
||||||
@ -113,21 +171,4 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent
|
|||||||
|
|
||||||
return $oOrder;
|
return $oOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return bool|d3_dev_d3inquiry
|
|
||||||
* @throws DatabaseConnectionException
|
|
||||||
*/
|
|
||||||
public function d3GetLastInquiry()
|
|
||||||
{
|
|
||||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @var d3_dev_d3inquiry $oInquiry */
|
|
||||||
$oInquiry = oxNew('d3inquiry');
|
|
||||||
$oInquiry->d3getLastInquiry();
|
|
||||||
|
|
||||||
return $oInquiry;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,179 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace D3\Devhelper\Modules\Application\Model;
|
|
||||||
|
|
||||||
use OxidEsales\Eshop\Application\Model\Basket;
|
|
||||||
use OxidEsales\Eshop\Core\DatabaseProvider;
|
|
||||||
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
|
||||||
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
|
||||||
use OxidEsales\Eshop\Core\Request;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 © D³ Data Development, Thomas Dartsch
|
|
||||||
* @author DÂł Data Development - Daniel Seifert <info@shopmodule.com>
|
|
||||||
* @link http://www.oxidmodule.com
|
|
||||||
*/
|
|
||||||
|
|
||||||
class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
|
|
||||||
{
|
|
||||||
protected $_oOrderBasket = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return d3_dev_oxbasket
|
|
||||||
* @throws DatabaseConnectionException
|
|
||||||
* @throws DatabaseErrorException
|
|
||||||
*/
|
|
||||||
public function d3DevGetOrderBasket()
|
|
||||||
{
|
|
||||||
/** @var Basket $oBasket */
|
|
||||||
$this->_getInquiryBasket();
|
|
||||||
|
|
||||||
// unsetting bundles
|
|
||||||
$oOrderArticles = $this->getInquiryArticles();
|
|
||||||
foreach ($oOrderArticles as $sItemId => $oItem) {
|
|
||||||
if ($oItem->isBundle()) {
|
|
||||||
$oOrderArticles->offsetUnset($sItemId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// add this order articles to basket and recalculate basket
|
|
||||||
$oBasket = $this->_addInquiryArticlesToBasket($this->getInquiryUser(), $oOrderArticles);
|
|
||||||
// recalculating basket
|
|
||||||
$oBasket->calculateBasket(true);
|
|
||||||
$oBasket->d3ClearBasketItemArticles();
|
|
||||||
|
|
||||||
return $oBasket;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
* @throws DatabaseConnectionException
|
|
||||||
*/
|
|
||||||
public function d3getLastInquiryId()
|
|
||||||
{
|
|
||||||
$inquiryNr = (int) Registry::get(Request::class)->getRequestEscapedParameter('d3inquirynr');
|
|
||||||
$sWhere = 1;
|
|
||||||
if ($inquiryNr) {
|
|
||||||
$sWhere = ' oxinquirynr = ' . $inquiryNr;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sSelect = "SELECT oxid FROM ".getViewName('d3inquiry')." WHERE ".$sWhere." ORDER BY oxinquirydate DESC LIMIT 1";
|
|
||||||
|
|
||||||
return DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getOne($sSelect);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws DatabaseConnectionException
|
|
||||||
*/
|
|
||||||
public function d3getLastInquiry()
|
|
||||||
{
|
|
||||||
$this->load($this->d3getLastInquiryId());
|
|
||||||
//$this->_d3AddVouchers();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Basket
|
|
||||||
* @throws DatabaseConnectionException
|
|
||||||
* @throws DatabaseErrorException
|
|
||||||
*/
|
|
||||||
public function getBasket()
|
|
||||||
{
|
|
||||||
$oBasket = parent::getBasket();
|
|
||||||
|
|
||||||
if (false == $oBasket && Registry::getConfig()->getActiveView()->getClassKey() == 'd3dev') {
|
|
||||||
$oBasket = $this->d3DevGetOrderBasket();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $oBasket;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws DatabaseConnectionException
|
|
||||||
* @throws DatabaseErrorException
|
|
||||||
*/
|
|
||||||
protected function _d3AddVouchers()
|
|
||||||
{
|
|
||||||
$sSelect = "SELECT oxid FROM oxvouchers WHERE oxorderid = ". DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->quote($this->getId()).";";
|
|
||||||
|
|
||||||
$aResult = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getAll($sSelect);
|
|
||||||
|
|
||||||
foreach ($aResult as $aFields) {
|
|
||||||
$oVoucher = oxNew('oxvoucher');
|
|
||||||
$oVoucher->load($aFields['oxid']);
|
|
||||||
$this->_aVoucherList[$oVoucher->getId()] = $oVoucher;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns basket object filled up with discount, delivery, wrapping and all other info
|
|
||||||
*
|
|
||||||
* @param bool $blStockCheck perform stock check or not (default true)
|
|
||||||
*
|
|
||||||
* @return Basket
|
|
||||||
* @throws DatabaseConnectionException
|
|
||||||
* @throws DatabaseErrorException
|
|
||||||
*/
|
|
||||||
protected function _getInquiryBasket($blStockCheck = true)
|
|
||||||
{
|
|
||||||
/** @var Basket _oOrderBasket */
|
|
||||||
$this->_oOrderBasket = oxNew(Basket::class);
|
|
||||||
$this->_oOrderBasket->enableSaveToDataBase(false);
|
|
||||||
|
|
||||||
//setting recalculation mode
|
|
||||||
$this->_oOrderBasket->setCalculationModeNetto($this->isNettoMode());
|
|
||||||
|
|
||||||
// setting stock check mode
|
|
||||||
$this->_oOrderBasket->setStockCheckMode($blStockCheck);
|
|
||||||
|
|
||||||
// setting virtual basket user
|
|
||||||
$this->_oOrderBasket->setBasketUser($this->getInquiryUser());
|
|
||||||
|
|
||||||
// transferring order id
|
|
||||||
$this->_oOrderBasket->setInquiryId($this->getId());
|
|
||||||
|
|
||||||
// setting basket currency order uses
|
|
||||||
$aCurrencies = Registry::getConfig()->getCurrencyArray();
|
|
||||||
foreach ($aCurrencies as $oCur) {
|
|
||||||
if ($oCur->name == $this->getFieldData('oxcurrency')) {
|
|
||||||
$oBasketCur = $oCur;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// setting currency
|
|
||||||
$this->_oOrderBasket->setBasketCurrency($oBasketCur);
|
|
||||||
|
|
||||||
// set basket card id and message
|
|
||||||
$this->_oOrderBasket->setCardId($this->getFieldData('oxcardid'));
|
|
||||||
$this->_oOrderBasket->setCardMessage($this->getFieldData('oxcardtext'));
|
|
||||||
|
|
||||||
if ($this->_blReloadDiscount) {
|
|
||||||
$oDb = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC);
|
|
||||||
// disabling availability check
|
|
||||||
$this->_oOrderBasket->setSkipVouchersChecking(true);
|
|
||||||
|
|
||||||
// add previously used vouchers
|
|
||||||
$sQ = 'select oxid from oxvouchers where oxorderid = ' . $oDb->quote($this->getId());
|
|
||||||
$aVouchers = $oDb->getAll($sQ);
|
|
||||||
foreach ($aVouchers as $aVoucher) {
|
|
||||||
$this->_oOrderBasket->addVoucher($aVoucher['oxid']);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$this->_oOrderBasket->setDiscountCalcMode(false);
|
|
||||||
$this->_oOrderBasket->setVoucherDiscount($this->getFieldData('oxvoucherdiscount'));
|
|
||||||
$this->_oOrderBasket->setTotalDiscount($this->getFieldData('oxdiscount'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->_oOrderBasket;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
<?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 © D³ Data Development, Thomas Dartsch
|
|
||||||
* @author DÂł Data Development - Daniel Seifert <info@shopmodule.com>
|
|
||||||
* @link http://www.oxidmodule.com
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace D3\Devhelper\Modules\Application\Model;
|
|
||||||
|
|
||||||
use OxidEsales\Eshop\Application\Model\ArticleList;
|
|
||||||
|
|
||||||
class d3_dev_d3inquiryarticle extends d3_dev_d3inquiryarticle_parent
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @return null|ArticleList
|
|
||||||
*/
|
|
||||||
public function getCustomerAlsoBoughtThisProducts()
|
|
||||||
{
|
|
||||||
$oArticle = $this->getArticle();
|
|
||||||
|
|
||||||
return $oArticle->getCustomerAlsoBoughtThisProducts();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if ordered product is bundle
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function isBundle()
|
|
||||||
{
|
|
||||||
return ( bool ) $this->getFieldData('oxisbundle');
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace D3\Devhelper\Modules\Application\Model;
|
|
||||||
|
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This Software is the property of Data Development and is protected
|
* This Software is the property of Data Development and is protected
|
||||||
* by copyright law - it is NOT Freeware.
|
* by copyright law - it is NOT Freeware.
|
||||||
@ -19,12 +15,21 @@ use OxidEsales\Eshop\Core\Registry;
|
|||||||
* @link http://www.oxidmodule.com
|
* @link http://www.oxidmodule.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
namespace D3\Devhelper\Modules\Application\Model;
|
||||||
|
|
||||||
|
use D3\Devhelper\Modules\Core\d3_dev_conf;
|
||||||
|
use oxArticleInputException;
|
||||||
|
use OxidEsales\Eshop\Application\Model\BasketItem;
|
||||||
|
use OxidEsales\Eshop\Application\Model\OrderArticle;
|
||||||
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
use oxNoArticleException;
|
||||||
|
|
||||||
class d3_dev_oxbasket extends d3_dev_oxbasket_parent
|
class d3_dev_oxbasket extends d3_dev_oxbasket_parent
|
||||||
{
|
{
|
||||||
public function deleteBasket()
|
public function deleteBasket()
|
||||||
{
|
{
|
||||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()
|
if (Registry::getConfig()->getActiveShop()->isProductiveMode()
|
||||||
|| false == Registry::getConfig()->getConfigParam('blD3DevAvoidDelBasket')
|
|| false == Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_PREVENTDELBASKET)
|
||||||
) {
|
) {
|
||||||
parent::deleteBasket();
|
parent::deleteBasket();
|
||||||
}
|
}
|
||||||
@ -61,4 +66,37 @@ class d3_dev_oxbasket extends d3_dev_oxbasket_parent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param OrderArticle $oOrderArticle
|
||||||
|
*
|
||||||
|
* @return d3_dev_oxbasketitem|null
|
||||||
|
* @throws oxArticleInputException
|
||||||
|
* @throws oxNoArticleException
|
||||||
|
*/
|
||||||
|
public function d3addOrderArticleToBasket($oOrderArticle)
|
||||||
|
{
|
||||||
|
// adding only if amount > 0
|
||||||
|
if ($oOrderArticle->getFieldData('oxamount') > 0) {
|
||||||
|
$this->_isForOrderRecalculation = true;
|
||||||
|
$sItemId = $oOrderArticle->getId();
|
||||||
|
|
||||||
|
//inserting new
|
||||||
|
/** @var d3_dev_oxbasketitem $oBasketItem */
|
||||||
|
$oBasketItem = oxNew( BasketItem::class);
|
||||||
|
$oBasketItem->initFromOrderArticle($oOrderArticle);
|
||||||
|
$oBasketItem->d3ConvertToArticleObject();
|
||||||
|
$oBasketItem->setWrapping($oOrderArticle->getFieldData('oxwrapid'));
|
||||||
|
$oBasketItem->setBundle($oOrderArticle->isBundle());
|
||||||
|
|
||||||
|
$this->_aBasketContents[$sItemId] = $oBasketItem;
|
||||||
|
|
||||||
|
//calling update method
|
||||||
|
$this->onUpdate();
|
||||||
|
|
||||||
|
return $this->_aBasketContents[$sItemId];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,14 @@
|
|||||||
|
|
||||||
namespace D3\Devhelper\Modules\Application\Model;
|
namespace D3\Devhelper\Modules\Application\Model;
|
||||||
|
|
||||||
|
use oxArticleInputException;
|
||||||
|
use OxidEsales\Eshop\Application\Model\Article;
|
||||||
|
use OxidEsales\Eshop\Application\Model\OrderArticle;
|
||||||
|
use OxidEsales\Eshop\Core\Exception\ArticleException;
|
||||||
|
use OxidEsales\Eshop\Core\Exception\ArticleInputException;
|
||||||
|
use OxidEsales\Eshop\Core\Exception\NoArticleException;
|
||||||
|
use oxNoArticleException;
|
||||||
|
|
||||||
class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
|
class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
|
||||||
{
|
{
|
||||||
public function d3ClearArticle()
|
public function d3ClearArticle()
|
||||||
@ -25,9 +33,9 @@ class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
* @throws \OxidEsales\Eshop\Core\Exception\ArticleException
|
* @throws ArticleException
|
||||||
* @throws \OxidEsales\Eshop\Core\Exception\ArticleInputException
|
* @throws ArticleInputException
|
||||||
* @throws \OxidEsales\Eshop\Core\Exception\NoArticleException
|
* @throws NoArticleException
|
||||||
*/
|
*/
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
@ -40,4 +48,19 @@ class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
|
|||||||
|
|
||||||
return $this->_sTitle;
|
return $this->_sTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws oxArticleInputException
|
||||||
|
* @throws oxNoArticleException
|
||||||
|
*/
|
||||||
|
public function d3ConvertToArticleObject()
|
||||||
|
{
|
||||||
|
$oEmbeddedArticle = $this->getArticle();
|
||||||
|
|
||||||
|
if ($oEmbeddedArticle instanceof OrderArticle) {
|
||||||
|
$oArticle = oxNew(Article::class);
|
||||||
|
$oArticle->load($oEmbeddedArticle->getFieldData('oxartid'));
|
||||||
|
$this->_oArticle = $oArticle;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace D3\Devhelper\Modules\Application\Model;
|
|
||||||
|
|
||||||
use OxidEsales\Eshop\Application\Model\OrderArticle;
|
|
||||||
use OxidEsales\Eshop\Application\Model\Voucher;
|
|
||||||
use OxidEsales\Eshop\Core\DatabaseProvider;
|
|
||||||
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
|
||||||
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
|
||||||
use OxidEsales\Eshop\Core\Model\ListModel;
|
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
|
||||||
use OxidEsales\Eshop\Core\Request;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This Software is the property of Data Development and is protected
|
* This Software is the property of Data Development and is protected
|
||||||
* by copyright law - it is NOT Freeware.
|
* by copyright law - it is NOT Freeware.
|
||||||
@ -26,6 +15,19 @@ use OxidEsales\Eshop\Core\Request;
|
|||||||
* @link http://www.oxidmodule.com
|
* @link http://www.oxidmodule.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
namespace D3\Devhelper\Modules\Application\Model;
|
||||||
|
|
||||||
|
use oxarticleinputexception;
|
||||||
|
use OxidEsales\Eshop\Application\Model\Basket;
|
||||||
|
use OxidEsales\Eshop\Application\Model\Order;
|
||||||
|
use OxidEsales\Eshop\Application\Model\Voucher;
|
||||||
|
use OxidEsales\Eshop\Core\DatabaseProvider;
|
||||||
|
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
|
||||||
|
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
|
||||||
|
use OxidEsales\Eshop\Core\Model\ListModel;
|
||||||
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
use oxnoarticleexception;
|
||||||
|
|
||||||
class d3_dev_oxorder extends d3_dev_oxorder_parent
|
class d3_dev_oxorder extends d3_dev_oxorder_parent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -36,18 +38,9 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
|
|||||||
/** @var d3_dev_oxbasket $oBasket */
|
/** @var d3_dev_oxbasket $oBasket */
|
||||||
$oBasket = $this->_getOrderBasket();
|
$oBasket = $this->_getOrderBasket();
|
||||||
|
|
||||||
// unsetting bundles
|
|
||||||
/** @var ListModel $oOrderArticles */
|
|
||||||
$oOrderArticles = $this->getOrderArticles();
|
|
||||||
foreach ($oOrderArticles as $sItemId => $oItem) {
|
|
||||||
/** @var $oItem OrderArticle */
|
|
||||||
if ($oItem->isBundle()) {
|
|
||||||
$oOrderArticles->offsetUnset($sItemId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// add this order articles to basket and recalculate basket
|
// add this order articles to basket and recalculate basket
|
||||||
$this->_addOrderArticlesToBasket($oBasket, $oOrderArticles);
|
$this->_d3AddOrderArticlesToBasket($oBasket, $this->getOrderArticles());
|
||||||
|
|
||||||
// recalculating basket
|
// recalculating basket
|
||||||
$oBasket->calculateBasket(true);
|
$oBasket->calculateBasket(true);
|
||||||
$oBasket->d3ClearBasketItemArticles();
|
$oBasket->d3ClearBasketItemArticles();
|
||||||
@ -63,15 +56,20 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
|
|||||||
*/
|
*/
|
||||||
public function d3getLastOrderId()
|
public function d3getLastOrderId()
|
||||||
{
|
{
|
||||||
$orderNr = (int) Registry::get(Request::class)->getRequestEscapedParameter('d3ordernr');
|
$orderNr = (int) Registry::getRequest()->getRequestEscapedParameter('d3ordernr');
|
||||||
$sWhere = 1;
|
$sWhere = 1;
|
||||||
|
$parameters = [];
|
||||||
if ($orderNr) {
|
if ($orderNr) {
|
||||||
$sWhere = ' oxordernr = ' . $orderNr;
|
$sWhere = ' oxordernr = ? ';
|
||||||
|
$parameters[] = $orderNr;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sSelect = "SELECT oxid FROM ".getViewName('oxorder')." WHERE ".$sWhere." ORDER BY oxorderdate DESC LIMIT 1";
|
$sSelect = "SELECT oxid FROM ".oxNew(Order::class)->getViewName()." WHERE ".
|
||||||
|
"oxuserid != '' AND ".
|
||||||
|
"oxshopid = ".Registry::getConfig()->getShopId()." AND ".
|
||||||
|
$sWhere." ORDER BY oxorderdate DESC LIMIT 1";
|
||||||
|
|
||||||
return DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getOne($sSelect);
|
return DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getOne($sSelect, $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,7 +83,7 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return d3_dev_oxbasket|\OxidEsales\Eshop\Application\Model\Basket
|
* @return d3_dev_oxbasket|Basket
|
||||||
*/
|
*/
|
||||||
public function getBasket()
|
public function getBasket()
|
||||||
{
|
{
|
||||||
@ -104,9 +102,12 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
|
|||||||
*/
|
*/
|
||||||
protected function _d3AddVouchers()
|
protected function _d3AddVouchers()
|
||||||
{
|
{
|
||||||
$sSelect = "SELECT oxid FROM oxvouchers WHERE oxorderid = ".DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->quote($this->getId()).";";
|
$sSelect = "SELECT oxid FROM ".oxNew(Voucher::class)->getViewName()." WHERE oxorderid = ?";
|
||||||
|
|
||||||
$aResult = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getAll($sSelect);
|
$aResult = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getAll(
|
||||||
|
$sSelect,
|
||||||
|
[$this->getId()]
|
||||||
|
);
|
||||||
|
|
||||||
foreach ($aResult as $aFields) {
|
foreach ($aResult as $aFields) {
|
||||||
$oVoucher = oxNew(Voucher::class);
|
$oVoucher = oxNew(Voucher::class);
|
||||||
@ -114,4 +115,23 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
|
|||||||
$this->_aVoucherList[$oVoucher->getId()] = $oVoucher;
|
$this->_aVoucherList[$oVoucher->getId()] = $oVoucher;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds order articles back to virtual basket. Needed for recalculating order.
|
||||||
|
*
|
||||||
|
* @param d3_dev_oxbasket $oBasket basket object
|
||||||
|
* @param ListModel $aOrderArticles order articles
|
||||||
|
* @throws oxArticleInputException
|
||||||
|
* @throws oxNoArticleException
|
||||||
|
*/
|
||||||
|
protected function _d3AddOrderArticlesToBasket($oBasket, $aOrderArticles)
|
||||||
|
{
|
||||||
|
// if no order articles, return empty basket
|
||||||
|
if (count($aOrderArticles) > 0) {
|
||||||
|
//adding order articles to basket
|
||||||
|
foreach ($aOrderArticles as $oOrderArticle) {
|
||||||
|
$oBasket->d3addOrderArticleToBasket($oOrderArticle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,9 @@ class d3_dev_oxorderarticle extends d3_dev_oxorderarticle_parent
|
|||||||
{
|
{
|
||||||
$oArticle = $this->getArticle();
|
$oArticle = $this->getArticle();
|
||||||
|
|
||||||
return $oArticle->getCustomerAlsoBoughtThisProducts();
|
/** @var ArticleList $artList */
|
||||||
|
$artList = $oArticle->getCustomerAlsoBoughtThisProducts();
|
||||||
|
|
||||||
|
return $artList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
29
src/Modules/Core/d3_dev_conf.php
Normal file
29
src/Modules/Core/d3_dev_conf.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?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 © D³ Data Development, Thomas Dartsch
|
||||||
|
* @author DÂł Data Development - Daniel Seifert <info@shopmodule.com>
|
||||||
|
* @link http://www.oxidmodule.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace D3\Devhelper\Modules\Core;
|
||||||
|
|
||||||
|
class d3_dev_conf
|
||||||
|
{
|
||||||
|
const OPTION_PREVENTDELBASKET = 'blD3DevAvoidDelBasket';
|
||||||
|
const OPTION_SHOWTHANKYOU = 'blD3DevShowThankyou';
|
||||||
|
|
||||||
|
const OPTION_SHOWMAILSINBROWSER = 'blD3DevShowOrderMailsInBrowser';
|
||||||
|
|
||||||
|
const OPTION_BLOCKMAIL = 'blD3DevBlockMails';
|
||||||
|
const OPTION_REDIRECTMAIL = 'sD3DevRedirectMail';
|
||||||
|
}
|
@ -1,10 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace D3\Devhelper\Modules\Core;
|
|
||||||
|
|
||||||
use D3\Devhelper\Modules\Application\Model as ModuleModel;
|
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This Software is the property of Data Development and is protected
|
* This Software is the property of Data Development and is protected
|
||||||
* by copyright law - it is NOT Freeware.
|
* by copyright law - it is NOT Freeware.
|
||||||
@ -20,6 +15,15 @@ use OxidEsales\Eshop\Core\Registry;
|
|||||||
* @link http://www.oxidmodule.com
|
* @link http://www.oxidmodule.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
namespace D3\Devhelper\Modules\Core;
|
||||||
|
|
||||||
|
use D3\Devhelper\Modules\Application\Model as ModuleModel;
|
||||||
|
use OxidEsales\Eshop\Core\Exception\StandardException;
|
||||||
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
||||||
|
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface;
|
||||||
|
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererInterface;
|
||||||
|
|
||||||
class d3_dev_oxemail extends d3_dev_oxemail_parent
|
class d3_dev_oxemail extends d3_dev_oxemail_parent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -48,7 +52,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
|||||||
$sTpl = $this->_sOrderUserTemplate;
|
$sTpl = $this->_sOrderUserTemplate;
|
||||||
}
|
}
|
||||||
|
|
||||||
$myConfig = $this->getConfig();
|
$myConfig = Registry::getConfig();
|
||||||
|
|
||||||
$oShop = $this->_getShop();
|
$oShop = $this->_getShop();
|
||||||
|
|
||||||
@ -77,83 +81,53 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
|||||||
$this->setSmtp($oShop);
|
$this->setSmtp($oShop);
|
||||||
|
|
||||||
// create messages
|
// create messages
|
||||||
/** @var \Smarty $oSmarty */
|
|
||||||
$oSmarty = $this->_getSmarty();
|
|
||||||
$this->setViewData("order", $oOrder);
|
$this->setViewData("order", $oOrder);
|
||||||
|
|
||||||
// Process view data array through oxoutput processor
|
// Process view data array through oxoutput processor
|
||||||
$this->_processViewArray();
|
$this->_processViewArray();
|
||||||
|
|
||||||
return $oSmarty->fetch($myConfig->getTemplatePath($sTpl, false));
|
$renderer = $this->getRenderer();
|
||||||
|
return $renderer->renderTemplate($myConfig->getTemplatePath($sTpl, false), $this->getViewData());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ModuleModel\d3_dev_d3inquiry $oInquiry
|
* required because private in Email class
|
||||||
|
* Templating instance getter
|
||||||
*
|
*
|
||||||
* @param $sType
|
* @return TemplateRendererInterface
|
||||||
*
|
|
||||||
* @return mixed|string
|
|
||||||
*/
|
*/
|
||||||
public function d3GetInquiryMailContent($oInquiry, $sType)
|
protected function getRenderer()
|
||||||
{
|
{
|
||||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
|
$bridge = ContainerFactory::getInstance()->getContainer()
|
||||||
return '';
|
->get(TemplateRendererBridgeInterface::class);
|
||||||
}
|
$bridge->setEngine($this->_getSmarty());
|
||||||
|
|
||||||
switch (strtolower($sType)) {
|
return $bridge->getTemplateRenderer();
|
||||||
case 'owner_html':
|
|
||||||
$sTpl = $this->_sInquiryOwnerTemplate;
|
|
||||||
break;
|
|
||||||
case 'owner_plain':
|
|
||||||
$sTpl = $this->_sInquiryOwnerPlainTemplate;
|
|
||||||
break;
|
|
||||||
case 'user_plain':
|
|
||||||
$sTpl = $this->_sInquiryUserPlainTemplate;
|
|
||||||
break;
|
|
||||||
case 'user_html':
|
|
||||||
default:
|
|
||||||
$sTpl = $this->_sInquiryUserTemplate;
|
|
||||||
}
|
|
||||||
|
|
||||||
$myConfig = $this->getConfig();
|
|
||||||
|
|
||||||
$oShop = $this->_getShop();
|
|
||||||
|
|
||||||
// cleanup
|
|
||||||
$this->_clearMailer();
|
|
||||||
|
|
||||||
// add user defined stuff if there is any
|
|
||||||
$oInquiry = $this->_addUserInfoOrderEMail($oInquiry);
|
|
||||||
|
|
||||||
$oUser = $oInquiry->getInquiryUser();
|
|
||||||
$this->setUser($oUser);
|
|
||||||
|
|
||||||
// send confirmation to shop owner
|
|
||||||
// send not pretending from order user, as different email domain rise spam filters
|
|
||||||
$this->setFrom($oShop->getFieldData('oxowneremail'));
|
|
||||||
|
|
||||||
$oLang = Registry::getLang();
|
|
||||||
$iOrderLang = $oLang->getObjectTplLanguage();
|
|
||||||
|
|
||||||
// if running shop language is different from admin lang. set in config
|
|
||||||
// we have to load shop in config language
|
|
||||||
if ($oShop->getLanguage() != $iOrderLang) {
|
|
||||||
$oShop = $this->_getShop($iOrderLang);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->setSmtp($oShop);
|
|
||||||
|
|
||||||
// create messages
|
|
||||||
/** @var \Smarty $oSmarty */
|
|
||||||
$oSmarty = $this->_getSmarty();
|
|
||||||
$this->setViewData("inquiry", $oInquiry);
|
|
||||||
|
|
||||||
// Process view data array through oxoutput processor
|
|
||||||
$this->_processViewArray();
|
|
||||||
|
|
||||||
return $oSmarty->fetch($myConfig->getTemplatePath($sTpl, false));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $aRecInfo
|
||||||
|
* @param array $aCc
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function d3ChangeRecipient($aRecInfo, array $aCc): array
|
||||||
|
{
|
||||||
|
if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
|
||||||
|
&& $sNewRecipient != $aRecInfo[0]
|
||||||
|
) {
|
||||||
|
$aRecInfo[1] = $aRecInfo[1] . " (" . $aRecInfo[0] . ")";
|
||||||
|
$aRecInfo[0] = $sNewRecipient;
|
||||||
|
$aCc[] = $aRecInfo;
|
||||||
|
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
|
||||||
|
$aCc[] = $aRecInfo;
|
||||||
|
}
|
||||||
|
return $aCc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws StandardException
|
||||||
|
*/
|
||||||
protected function _sendMail()
|
protected function _sendMail()
|
||||||
{
|
{
|
||||||
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
|
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
|
||||||
@ -161,6 +135,8 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->d3clearRecipients();
|
$this->d3clearRecipients();
|
||||||
|
$this->d3clearReplies();
|
||||||
|
$this->d3clearReplyTo();
|
||||||
$this->d3clearCC();
|
$this->d3clearCC();
|
||||||
$this->d3clearBCC();
|
$this->d3clearBCC();
|
||||||
|
|
||||||
@ -171,39 +147,68 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
* @throws StandardException
|
||||||
|
*/
|
||||||
|
protected function sendMail()
|
||||||
|
{
|
||||||
|
if (Registry::getConfig()->getActiveShop()->isProductiveMode()) {
|
||||||
|
return parent::sendMail();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->d3clearRecipients();
|
||||||
|
$this->d3clearReplies();
|
||||||
|
$this->d3clearReplyTo();
|
||||||
|
$this->d3clearCC();
|
||||||
|
$this->d3clearBCC();
|
||||||
|
|
||||||
|
if (count($this->getRecipient())) {
|
||||||
|
return parent::sendMail();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function d3clearRecipients()
|
public function d3clearRecipients()
|
||||||
{
|
{
|
||||||
$aRecipients = array();
|
$aRecipients = array();
|
||||||
if (is_array($this->_aRecipients) && count($this->_aRecipients)) {
|
if (is_array($this->_aRecipients) && count($this->_aRecipients)) {
|
||||||
foreach ($this->_aRecipients as $aRecInfo) {
|
foreach ($this->_aRecipients as $aRecInfo) {
|
||||||
if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
|
$aRecipients = $this->d3ChangeRecipient($aRecInfo, $aRecipients);
|
||||||
&& $sNewRecipient != $aRecInfo[0]
|
|
||||||
) {
|
|
||||||
$aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")";
|
|
||||||
$aRecInfo[0] = $sNewRecipient;
|
|
||||||
$aRecipients[] = $aRecInfo;
|
|
||||||
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
|
|
||||||
$aRecipients[] = $aRecInfo;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->_aRecipients = $aRecipients;
|
$this->_aRecipients = $aRecipients;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function d3clearReplies()
|
||||||
|
{
|
||||||
|
$aRecipients = array();
|
||||||
|
if (is_array($this->_aReplies) && count($this->_aReplies)) {
|
||||||
|
foreach ($this->_aReplies as $aRecInfo) {
|
||||||
|
$aRecipients = $this->d3ChangeRecipient($aRecInfo, $aRecipients);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->_aReplies = $aRecipients;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function d3clearReplyTo()
|
||||||
|
{
|
||||||
|
$aRecipients = array();
|
||||||
|
if (is_array($this->ReplyTo) && count($this->ReplyTo)) {
|
||||||
|
foreach ($this->ReplyTo as $aRecInfo) {
|
||||||
|
$aRecipients = $this->d3ChangeRecipient($aRecInfo, $aRecipients);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->ReplyTo = $aRecipients;
|
||||||
|
}
|
||||||
|
|
||||||
public function d3clearCC()
|
public function d3clearCC()
|
||||||
{
|
{
|
||||||
$aCc = array();
|
$aCc = array();
|
||||||
if (is_array($this->cc) && count($this->cc)) {
|
if (is_array($this->cc) && count($this->cc)) {
|
||||||
foreach ($this->cc as $aRecInfo) {
|
foreach ($this->cc as $aRecInfo) {
|
||||||
if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
|
$aCc = $this->d3ChangeRecipient($aRecInfo, $aCc);
|
||||||
&& $sNewRecipient != $aRecInfo[0]
|
|
||||||
) {
|
|
||||||
$aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")";
|
|
||||||
$aRecInfo[0] = $sNewRecipient;
|
|
||||||
$aCc[] = $aRecInfo;
|
|
||||||
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
|
|
||||||
$aCc[] = $aRecInfo;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,27 +220,24 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent
|
|||||||
$aCc = array();
|
$aCc = array();
|
||||||
if (is_array($this->bcc) && count($this->bcc)) {
|
if (is_array($this->bcc) && count($this->bcc)) {
|
||||||
foreach ($this->bcc as $aRecInfo) {
|
foreach ($this->bcc as $aRecInfo) {
|
||||||
if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
|
$aCc = $this->d3ChangeRecipient($aRecInfo, $aCc);
|
||||||
&& $sNewRecipient != $aRecInfo[0]
|
|
||||||
) {
|
|
||||||
$aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")";
|
|
||||||
$aRecInfo[0] = $sNewRecipient;
|
|
||||||
$aCc[] = $aRecInfo;
|
|
||||||
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
|
|
||||||
$aCc[] = $aRecInfo;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->bcc = $aCc;
|
$this->bcc = $aCc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $sMailAddress
|
||||||
|
*
|
||||||
|
* @return bool|string
|
||||||
|
*/
|
||||||
public function getNewRecipient($sMailAddress)
|
public function getNewRecipient($sMailAddress)
|
||||||
{
|
{
|
||||||
if (Registry::getConfig()->getConfigParam('blD3DevBlockMails')) {
|
if (Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_BLOCKMAIL)) {
|
||||||
return false;
|
return false;
|
||||||
} elseif (Registry::getConfig()->getConfigParam('sD3DevRedirectMail')) {
|
} elseif (Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_REDIRECTMAIL)) {
|
||||||
return trim(Registry::getConfig()->getConfigParam('sD3DevRedirectMail'));
|
return trim(Registry::getConfig()->getConfigParam(d3_dev_conf::OPTION_REDIRECTMAIL));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $sMailAddress;
|
return $sMailAddress;
|
||||||
|
111
src/metadata.php
111
src/metadata.php
@ -1,5 +1,21 @@
|
|||||||
<?php
|
<?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 <20> D<> Data Development, Thomas Dartsch
|
||||||
|
* @author D<> Data Development - Daniel Seifert <info@shopmodule.com>
|
||||||
|
* @link http://www.oxidmodule.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
use D3\Devhelper\Application\Controller\d3dev;
|
||||||
use D3\Devhelper\Modules\Core as ModuleCore;
|
use D3\Devhelper\Modules\Core as ModuleCore;
|
||||||
use D3\Devhelper\Modules\Application\Controller as ModuleController;
|
use D3\Devhelper\Modules\Application\Controller as ModuleController;
|
||||||
use D3\Devhelper\Modules\Application\Model as ModuleModel;
|
use D3\Devhelper\Modules\Application\Model as ModuleModel;
|
||||||
@ -11,22 +27,25 @@ use OxidEsales\Eshop\Core\Registry;
|
|||||||
/**
|
/**
|
||||||
* Metadata version
|
* Metadata version
|
||||||
*/
|
*/
|
||||||
$sMetadataVersion = '2.0';
|
$sMetadataVersion = '2.1';
|
||||||
|
$sLogo = '<img src="https://logos.oxidmodule.com/d3logo.svg" alt="(D3)" style="height:1em;width:1em"> ';
|
||||||
|
|
||||||
$sStyle = class_exists(D3\Devhelper\Application\Controller\d3dev::class) ? "background-color: darkred; color: white; padding: 0 10px;" : "";
|
$shopUrl = function_exists('oxNew') ? Registry::getConfig()->getCurrentShopUrl(false) : '../';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module information
|
* Module information
|
||||||
*/
|
*/
|
||||||
$aModule = array(
|
$aModule = array(
|
||||||
'id' => 'd3dev',
|
'id' => 'd3dev',
|
||||||
'title' =>
|
'title' => [
|
||||||
(class_exists(D3\ModCfg\Application\Model\d3utils::class) ? D3\ModCfg\Application\Model\d3utils::getInstance()->getD3Logo() : 'D³') .
|
'de' => $sLogo . 'TPL Entwicklerwerkzeug',
|
||||||
' <span style="'.$sStyle.';">TPL Development Tool</span>',
|
'en' => $sLogo . 'TPL Development Tool'
|
||||||
'description' => array(
|
],
|
||||||
|
'description' => [
|
||||||
'de' => '<script type="text/javascript"><!--
|
'de' => '<script type="text/javascript"><!--
|
||||||
function showNote() {
|
function showNote() {
|
||||||
var _oElem = document.getElementById("secnote");
|
let _oElem = document.getElementById("secnote");
|
||||||
if (_oElem.style.display === "block") {
|
if (_oElem.style.display === "block") {
|
||||||
_oElem.style.display = "none";
|
_oElem.style.display = "none";
|
||||||
} else {
|
} else {
|
||||||
@ -37,80 +56,66 @@ $aModule = array(
|
|||||||
<p style="background-color: darkred; padding: 5px;"><a href="#" style="text-decoration: underline; color: white;" onclick="showNote(); return false;"><b>Sicherheitshinweis</b></a></p>
|
<p style="background-color: darkred; padding: 5px;"><a href="#" style="text-decoration: underline; color: white;" onclick="showNote(); return false;"><b>Sicherheitshinweis</b></a></p>
|
||||||
<p style="display: none; background-color: darkred; color: white; padding: 5px;" id="secnote">Diese Shoperweiterung stellt Entwicklungshilfen zur Verfügung, die im Livebetrieb sicherheitskritisch sein können. Es können Kunden- und Bestelldaten ausgelesen und auch Shopfunktionen manipuliert werden. Aktivieren Sie diese Erweiterung daher nur in einem Umfeld, in dem Sie Missbrauch ausschließen können. Für entstandene Schäden lehnen wir jede Haftung ab.</p>
|
<p style="display: none; background-color: darkred; color: white; padding: 5px;" id="secnote">Diese Shoperweiterung stellt Entwicklungshilfen zur Verfügung, die im Livebetrieb sicherheitskritisch sein können. Es können Kunden- und Bestelldaten ausgelesen und auch Shopfunktionen manipuliert werden. Aktivieren Sie diese Erweiterung daher nur in einem Umfeld, in dem Sie Missbrauch ausschließen können. Für entstandene Schäden lehnen wir jede Haftung ab.</p>
|
||||||
<ul><li>unterbindet Löschen des Warenkorbs nach Bestellabschluss</li>'.
|
<ul><li>unterbindet Löschen des Warenkorbs nach Bestellabschluss</li>'.
|
||||||
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=thankyou&d3dev=1&d3ordernr=" target="_new">Thankyou-Seite ist ohne Bestellung aufrufbar*</a></li>'.
|
'<li><a style="text-decoration: underline;" href="'.$shopUrl.'index.php?cl=thankyou&d3dev=1&d3ordernr=" target="_new">Thankyou-Seite ist ohne Bestellung aufrufbar*</a></li>'.
|
||||||
'<li>Mail-Templates können im Browser ausgegeben werden'.
|
'<li>Mail-Templates können im Browser ausgegeben werden'.
|
||||||
'<ul>'.
|
'<ul>'.
|
||||||
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=owner_html&d3ordernr=" target="_new">Order Owner HTML*</a></li>'.
|
'<li><a style="text-decoration: underline;" href="'.$shopUrl.'index.php?cl=d3dev&fnc=showOrderMailContent&type=owner_html&d3ordernr=" target="_new">Order Owner HTML*</a></li>'.
|
||||||
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=owner_plain&d3ordernr=" target="_new">Order Owner Plain*</a></li>'.
|
'<li><a style="text-decoration: underline;" href="'.$shopUrl.'index.php?cl=d3dev&fnc=showOrderMailContent&type=owner_plain&d3ordernr=" target="_new">Order Owner Plain*</a></li>'.
|
||||||
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=user_html&d3ordernr=" target="_new">Order User HTML*</a></li>'.
|
'<li><a style="text-decoration: underline;" href="'.$shopUrl.'index.php?cl=d3dev&fnc=showOrderMailContent&type=user_html&d3ordernr=" target="_new">Order User HTML*</a></li>'.
|
||||||
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=user_plain&d3ordernr=" target="_new">Order User Plain*</a></li>'.
|
'<li><a style="text-decoration: underline;" href="'.$shopUrl.'index.php?cl=d3dev&fnc=showOrderMailContent&type=user_plain&d3ordernr=" target="_new">Order User Plain*</a></li>'.
|
||||||
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=owner_html&d3inquirynr=" target="_new">Inquiry Owner HTML*</a></li>'.
|
|
||||||
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=owner_plain&d3inquirynr=" target="_new">Inquiry Owner Plain*</a></li>'.
|
|
||||||
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=user_html&d3inquirynr=" target="_new">Inquiry User HTML*</a></li>'.
|
|
||||||
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=user_plain&d3inquirynr=" target="_new">Inquiry User Plain*</a></li></ul>'.
|
|
||||||
'</li>'.
|
'</li>'.
|
||||||
'<li>blockiert übers Framework versendete Mails oder leitet diese um</li>'.
|
'<li>blockiert übers Framework versendete Mails oder leitet diese um</li>'.
|
||||||
'</ul><br>Jede dieser Optionen muss aus Sicherheitsgründen unter "Einstell." aktiviert werden. Weiterhin darf der Shop nicht im Produktivmodus betrieben werden.<br><br>'.
|
'</ul><br>Jede dieser Optionen muss aus Sicherheitsgründen unter "Einstell." aktiviert werden. Weiterhin darf der Shop nicht im Produktivmodus betrieben werden.<br><br>'.
|
||||||
'* Ordernummer an URL ergänzen, wenn bestimmte Bestellungen angezeigt werden sollen',
|
'* Ordernummer an URL ergänzen, wenn bestimmte Bestellungen angezeigt werden sollen',
|
||||||
'en' => ''),
|
'en' => ''],
|
||||||
// 'thumbnail' => 'picture.png',
|
'version' => '3.0.0.1',
|
||||||
'version' => '2.0.0.0',
|
|
||||||
'author' => 'D³ Data Development (Inh.: Thomas Dartsch)',
|
'author' => 'D³ Data Development (Inh.: Thomas Dartsch)',
|
||||||
'email' => 'support@shopmodule.com',
|
'email' => 'support@shopmodule.com',
|
||||||
'url' => 'http://www.oxidmodule.com/',
|
'url' => 'http://www.oxidmodule.com/',
|
||||||
'extend' => array(
|
'extend' => [
|
||||||
OxidController\ThankYouController::class => ModuleController\d3_dev_thankyou::class,
|
OxidController\ThankYouController::class => ModuleController\d3_dev_thankyou::class,
|
||||||
OxidModel\Order::class => ModuleModel\d3_dev_oxorder::class,
|
OxidModel\Order::class => ModuleModel\d3_dev_oxorder::class,
|
||||||
OxidModel\OrderArticle::class => ModuleModel\d3_dev_oxorderarticle::class,
|
OxidModel\OrderArticle::class => ModuleModel\d3_dev_oxorderarticle::class,
|
||||||
OxidCore\Email::class => ModuleCore\d3_dev_oxemail::class,
|
OxidCore\Email::class => ModuleCore\d3_dev_oxemail::class,
|
||||||
OxidModel\Basket::class => ModuleModel\d3_dev_oxbasket::class,
|
OxidModel\Basket::class => ModuleModel\d3_dev_oxbasket::class,
|
||||||
OxidModel\BasketItem::class => ModuleModel\d3_dev_oxbasketitem::class,
|
OxidModel\BasketItem::class => ModuleModel\d3_dev_oxbasketitem::class,
|
||||||
),
|
],
|
||||||
'controllers' => array(
|
'controllers' => [
|
||||||
'd3dev' => \D3\Devhelper\Application\Controller\d3dev::class,
|
'd3dev' => d3dev::class,
|
||||||
),
|
],
|
||||||
'templates' => array(
|
'templates' => [],
|
||||||
),
|
'events' => [],
|
||||||
'events' => array(
|
'blocks' => [],
|
||||||
),
|
'settings' => [
|
||||||
'blocks' => array(
|
[
|
||||||
),
|
|
||||||
'settings' => array(
|
|
||||||
array(
|
|
||||||
'group' => 'd3dev_order',
|
'group' => 'd3dev_order',
|
||||||
'name' => 'blD3DevAvoidDelBasket',
|
'name' => ModuleCore\d3_dev_conf::OPTION_PREVENTDELBASKET,
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'value' => 'false'
|
'value' => 'false'
|
||||||
),
|
],
|
||||||
array(
|
[
|
||||||
'group' => 'd3dev_order',
|
'group' => 'd3dev_order',
|
||||||
'name' => 'blD3DevShowThankyou',
|
'name' => ModuleCore\d3_dev_conf::OPTION_SHOWTHANKYOU,
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'value' => 'false'
|
'value' => 'false'
|
||||||
),
|
],
|
||||||
array(
|
[
|
||||||
'group' => 'd3dev_mail',
|
'group' => 'd3dev_mail',
|
||||||
'name' => 'blD3DevShowOrderMailsInBrowser',
|
'name' => ModuleCore\d3_dev_conf::OPTION_SHOWMAILSINBROWSER,
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'value' => 'false'
|
'value' => 'false'
|
||||||
),
|
],
|
||||||
array(
|
[
|
||||||
'group' => 'd3dev_mailblock',
|
'group' => 'd3dev_mailblock',
|
||||||
'name' => 'blD3DevBlockMails',
|
'name' => ModuleCore\d3_dev_conf::OPTION_BLOCKMAIL,
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'value' => 'false'
|
'value' => 'false'
|
||||||
),
|
],
|
||||||
array(
|
[
|
||||||
'group' => 'd3dev_mailblock',
|
'group' => 'd3dev_mailblock',
|
||||||
'name' => 'sD3DevRedirectMail',
|
'name' => ModuleCore\d3_dev_conf::OPTION_REDIRECTMAIL,
|
||||||
'type' => 'str',
|
'type' => 'str',
|
||||||
'value' => 'd3test1@shopmodule.com'
|
'value' => 'd3test1@shopmodule.com'
|
||||||
),
|
],
|
||||||
),
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if (class_exists('d3inquiry')) {
|
|
||||||
$aModule['extend']['d3inquiry'] = ModuleModel\d3_dev_d3inquiry::class;
|
|
||||||
$aModule['extend']['d3inquiryarticle'] = ModuleModel\d3_dev_d3inquiryarticle::class;
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user