changed CRLF to LF

changed case to UTF-8
This commit is contained in:
kristianhempel 2018-01-25 11:30:17 +01:00
parent 1187854c86
commit 7d9c9a9837
10 changed files with 999 additions and 999 deletions

View File

@ -1,52 +1,52 @@
<?php <?php
/** /**
* 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.
* *
* Any unauthorized use of this software without a valid license * Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by * is a violation of the license agreement and will be prosecuted by
* civil and criminal law. * civil and criminal law.
* *
* http://www.shopmodule.com * http://www.shopmodule.com
* *
* @copyright © Data Development, Thomas Dartsch * @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com> * @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
class d3_dev_thankyou_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {} class d3_dev_thankyou_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {}
/** /**
* Class d3_dev_oxorder_parent * Class d3_dev_oxorder_parent
*/ */
class d3_dev_oxorder_parent extends \OxidEsales\Eshop\Application\Model\Order {} class d3_dev_oxorder_parent extends \OxidEsales\Eshop\Application\Model\Order {}
/** /**
* Class d3_dev_d3inquiry_parent * Class d3_dev_d3inquiry_parent
*/ */
class d3_dev_d3inquiry_parent extends d3inquiry {} class d3_dev_d3inquiry_parent extends d3inquiry {}
/** /**
* Class d3_dev_oxorderarticle * Class d3_dev_oxorderarticle
*/ */
class d3_dev_oxorderarticle_parent extends \OxidEsales\Eshop\Application\Model\OrderArticle {} class d3_dev_oxorderarticle_parent extends \OxidEsales\Eshop\Application\Model\OrderArticle {}
/** /**
* Class d3_dev_oxemail_parent * Class d3_dev_oxemail_parent
*/ */
class d3_dev_oxemail_parent extends \OxidEsales\Eshop\Core\Email {} class d3_dev_oxemail_parent extends \OxidEsales\Eshop\Core\Email {}
/** /**
* Class d3_dev_order_parent * Class d3_dev_order_parent
*/ */
class d3_dev_order_parent extends \OxidEsales\Eshop\Application\Controller\OrderController {} class d3_dev_order_parent extends \OxidEsales\Eshop\Application\Controller\OrderController {}
/** /**
* Class d3_dev_oxbasket_parent * Class d3_dev_oxbasket_parent
*/ */
class d3_dev_oxbasket_parent extends \OxidEsales\Eshop\Application\Model\Basket {} class d3_dev_oxbasket_parent extends \OxidEsales\Eshop\Application\Model\Basket {}
/** /**
* Class d3_dev_oxbasketitem_parent * Class d3_dev_oxbasketitem_parent
*/ */
class d3_dev_oxbasketitem_parent extends \OxidEsales\Eshop\Application\Model\BasketItem {} class d3_dev_oxbasketitem_parent extends \OxidEsales\Eshop\Application\Model\BasketItem {}

View File

@ -1,122 +1,122 @@
<?php <?php
use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Request; 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.
* *
* Any unauthorized use of this software without a valid license * Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by * is a violation of the license agreement and will be prosecuted by
* civil and criminal law. * civil and criminal law.
* *
* http://www.shopmodule.com * http://www.shopmodule.com
* *
* @copyright © Data Development, Thomas Dartsch * @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com> * @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
class d3dev extends \OxidEsales\EshopProfessional\Application\Controller\FrontendController class d3dev extends \OxidEsales\EshopProfessional\Application\Controller\FrontendController
{ {
public function init() public function init()
{ {
$this->_authenticate(); $this->_authenticate();
parent::init(); parent::init();
} }
protected function _authenticate () protected function _authenticate ()
{ {
$request = oxNew(Request::class); $request = oxNew(Request::class);
try { try {
$sUser = $request->getRequestParameter( 'usr' ); $sUser = $request->getRequestParameter( 'usr' );
$sPassword = $request->getRequestParameter( 'pwd' ); $sPassword = $request->getRequestParameter( 'pwd' );
if ( !$sUser || !$sPassword ) { if ( !$sUser || !$sPassword ) {
$sUser = $_SERVER[ 'PHP_AUTH_USER' ]; $sUser = $_SERVER[ 'PHP_AUTH_USER' ];
$sPassword = $_SERVER[ 'PHP_AUTH_PW' ]; $sPassword = $_SERVER[ 'PHP_AUTH_PW' ];
} }
if ( !$sUser || !$sPassword ) { if ( !$sUser || !$sPassword ) {
$sHttpAuthorization = $_REQUEST[ 'HTTP_AUTHORIZATION' ]; $sHttpAuthorization = $_REQUEST[ 'HTTP_AUTHORIZATION' ];
if ( $sHttpAuthorization ) { if ( $sHttpAuthorization ) {
$sUser = null; $sUser = null;
$sPassword = null; $sPassword = null;
$aHttpAuthorization = explode( ' ', $sHttpAuthorization ); $aHttpAuthorization = explode( ' ', $sHttpAuthorization );
if ( is_array( $aHttpAuthorization ) && count( $aHttpAuthorization ) >= 2 && strtolower( $aHttpAuthorization[ 0 ] ) == 'basic' ) { if ( is_array( $aHttpAuthorization ) && count( $aHttpAuthorization ) >= 2 && strtolower( $aHttpAuthorization[ 0 ] ) == 'basic' ) {
$sBasicAuthorization = base64_decode( $aHttpAuthorization[ 1 ] ); $sBasicAuthorization = base64_decode( $aHttpAuthorization[ 1 ] );
$aBasicAuthorization = explode( ':', $sBasicAuthorization ); $aBasicAuthorization = explode( ':', $sBasicAuthorization );
if ( is_array( $aBasicAuthorization ) && count( $aBasicAuthorization ) >= 2 ) { if ( is_array( $aBasicAuthorization ) && count( $aBasicAuthorization ) >= 2 ) {
$sUser = $aBasicAuthorization[ 0 ]; $sUser = $aBasicAuthorization[ 0 ];
$sPassword = $aBasicAuthorization[ 1 ]; $sPassword = $aBasicAuthorization[ 1 ];
} }
} }
} }
} }
$oUser = oxNew( \OxidEsales\Eshop\Application\Model\User::class ); $oUser = oxNew( \OxidEsales\Eshop\Application\Model\User::class );
if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) { if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) {
/** @var \OxidEsales\Eshop\Core\Exception\UserException $oEx */ /** @var \OxidEsales\Eshop\Core\Exception\UserException $oEx */
$oEx = oxNew( \OxidEsales\Eshop\Core\Exception\UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN' ); $oEx = oxNew( \OxidEsales\Eshop\Core\Exception\UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN' );
throw $oEx; throw $oEx;
} }
} }
catch ( Exception $oEx ) { catch ( Exception $oEx ) {
$oShop = Registry::getConfig()->getActiveShop(); $oShop = Registry::getConfig()->getActiveShop();
header( 'WWW-Authenticate: Basic realm="' . $oShop->oxshops__oxname->value . '"' ); header( 'WWW-Authenticate: Basic realm="' . $oShop->oxshops__oxname->value . '"' );
header( 'HTTP/1.0 401 Unauthorized' ); header( 'HTTP/1.0 401 Unauthorized' );
exit( 1 ); exit( 1 );
} }
} }
/** /**
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
*/ */
public function showOrderMailContent() public function showOrderMailContent()
{ {
header('Content-type: text/html; charset='.Registry::getLang()->translateString('charset')); header('Content-type: text/html; charset='.Registry::getLang()->translateString('charset'));
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|| false == Registry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser') || false == Registry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser')
) { ) {
Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start'); Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start');
} }
$sTpl = oxNew(Request::class)->getRequestParameter('type'); $sTpl = oxNew(Request::class)->getRequestParameter('type');
/** @var d3_dev_thankyou $oThankyou */ /** @var d3_dev_thankyou $oThankyou */
$oThankyou = oxNew(\OxidEsales\Eshop\Application\Controller\ThankYouController::class); $oThankyou = oxNew(\OxidEsales\Eshop\Application\Controller\ThankYouController::class);
$oOrder = $oThankyou->d3GetLastOrder(); $oOrder = $oThankyou->d3GetLastOrder();
/** @var d3_dev_oxemail $oEmail */ /** @var d3_dev_oxemail $oEmail */
$oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class); $oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
echo $oEmail->d3GetOrderMailContent($oOrder, $sTpl); echo $oEmail->d3GetOrderMailContent($oOrder, $sTpl);
die(); die();
} }
/** /**
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
*/ */
public function showInquiryMailContent() public function showInquiryMailContent()
{ {
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|| false == Registry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser') || false == Registry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser')
) { ) {
Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start'); Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start');
} }
$sTpl = oxNew(Request::class)->getRequestParameter('type'); $sTpl = oxNew(Request::class)->getRequestParameter('type');
/** @var d3_dev_thankyou $oThankyou */ /** @var d3_dev_thankyou $oThankyou */
$oThankyou = oxNew(\OxidEsales\Eshop\Application\Controller\ThankYouController::class); $oThankyou = oxNew(\OxidEsales\Eshop\Application\Controller\ThankYouController::class);
$oOrder = $oThankyou->d3GetLastInquiry(); $oOrder = $oThankyou->d3GetLastInquiry();
/** @var d3_dev_oxemail $oEmail */ /** @var d3_dev_oxemail $oEmail */
$oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class); $oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
echo $oEmail->d3GetInquiryMailContent($oOrder, $sTpl); echo $oEmail->d3GetInquiryMailContent($oOrder, $sTpl);
die(); die();
} }
} }

View File

@ -1,131 +1,131 @@
<?php <?php
// .../?cl=thankyou[&d3orderid=23] // .../?cl=thankyou[&d3orderid=23]
use OxidEsales\Eshop\Core\Registry; 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.
* *
* Any unauthorized use of this software without a valid license * Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by * is a violation of the license agreement and will be prosecuted by
* civil and criminal law. * civil and criminal law.
* *
* http://www.shopmodule.com * http://www.shopmodule.com
* *
* @copyright © Data Development, Thomas Dartsch * @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com> * @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
class d3_dev_thankyou extends d3_dev_thankyou_parent class d3_dev_thankyou extends d3_dev_thankyou_parent
{ {
/** /**
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
* @throws object * @throws object
* @throws oxUserException * @throws oxUserException
*/ */
public function init() public function init()
{ {
$sSessChallenge = Registry::getSession()->getVariable('sess_challenge'); $sSessChallenge = Registry::getSession()->getVariable('sess_challenge');
parent::init(); parent::init();
Registry::getSession()->setVariable('sess_challenge', $sSessChallenge); Registry::getSession()->setVariable('sess_challenge', $sSessChallenge);
if (oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3dev') if (oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3dev')
&& false == (bool) Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value && false == (bool) Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value
&& Registry::getConfig()->getConfigParam('blD3DevShowThankyou') && Registry::getConfig()->getConfigParam('blD3DevShowThankyou')
) { ) {
$this->_d3authenticate(); $this->_d3authenticate();
$oOrder = $this->d3GetLastOrder(); $oOrder = $this->d3GetLastOrder();
$oBasket = $oOrder->d3DevGetOrderBasket(); $oBasket = $oOrder->d3DevGetOrderBasket();
$this->_oBasket = $oBasket; $this->_oBasket = $oBasket;
} }
} }
/** /**
* @throws object * @throws object
* @throws oxUserException * @throws oxUserException
*/ */
protected function _d3authenticate () protected function _d3authenticate ()
{ {
$request = oxNew(\OxidEsales\Eshop\Core\Request::class); $request = oxNew(\OxidEsales\Eshop\Core\Request::class);
try { try {
$sUser = $request->getRequestParameter( 'usr' ); $sUser = $request->getRequestParameter( 'usr' );
$sPassword = $request->getRequestParameter( 'pwd' ); $sPassword = $request->getRequestParameter( 'pwd' );
if ( !$sUser || !$sPassword ) { if ( !$sUser || !$sPassword ) {
$sUser = $_SERVER[ 'PHP_AUTH_USER' ]; $sUser = $_SERVER[ 'PHP_AUTH_USER' ];
$sPassword = $_SERVER[ 'PHP_AUTH_PW' ]; $sPassword = $_SERVER[ 'PHP_AUTH_PW' ];
} }
if ( !$sUser || !$sPassword ) { if ( !$sUser || !$sPassword ) {
$sHttpAuthorization = $_REQUEST[ 'HTTP_AUTHORIZATION' ]; $sHttpAuthorization = $_REQUEST[ 'HTTP_AUTHORIZATION' ];
if ( $sHttpAuthorization ) { if ( $sHttpAuthorization ) {
$sUser = null; $sUser = null;
$sPassword = null; $sPassword = null;
$aHttpAuthorization = explode( ' ', $sHttpAuthorization ); $aHttpAuthorization = explode( ' ', $sHttpAuthorization );
if ( is_array( $aHttpAuthorization ) && count( $aHttpAuthorization ) >= 2 && strtolower( $aHttpAuthorization[ 0 ] ) == 'basic' ) { if ( is_array( $aHttpAuthorization ) && count( $aHttpAuthorization ) >= 2 && strtolower( $aHttpAuthorization[ 0 ] ) == 'basic' ) {
$sBasicAuthorization = base64_decode( $aHttpAuthorization[ 1 ] ); $sBasicAuthorization = base64_decode( $aHttpAuthorization[ 1 ] );
$aBasicAuthorization = explode( ':', $sBasicAuthorization ); $aBasicAuthorization = explode( ':', $sBasicAuthorization );
if ( is_array( $aBasicAuthorization ) && count( $aBasicAuthorization ) >= 2 ) { if ( is_array( $aBasicAuthorization ) && count( $aBasicAuthorization ) >= 2 ) {
$sUser = $aBasicAuthorization[ 0 ]; $sUser = $aBasicAuthorization[ 0 ];
$sPassword = $aBasicAuthorization[ 1 ]; $sPassword = $aBasicAuthorization[ 1 ];
} }
} }
} }
} }
/** @var \OxidEsales\Eshop\Application\Model\User $oUser */ /** @var \OxidEsales\Eshop\Application\Model\User $oUser */
$oUser = oxNew( \OxidEsales\Eshop\Application\Model\User::class ); $oUser = oxNew( \OxidEsales\Eshop\Application\Model\User::class );
if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) { if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) {
/** @var \OxidEsales\Eshop\Core\Exception\UserException $oEx */ /** @var \OxidEsales\Eshop\Core\Exception\UserException $oEx */
$oEx = oxNew( \OxidEsales\Eshop\Core\Exception\UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN'); $oEx = oxNew( \OxidEsales\Eshop\Core\Exception\UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN');
throw $oEx; throw $oEx;
} }
} }
catch ( Exception $oEx ) { catch ( Exception $oEx ) {
$oShop = Registry::getConfig()->getActiveShop(); $oShop = Registry::getConfig()->getActiveShop();
header( 'WWW-Authenticate: Basic realm="' . $oShop->oxshops__oxname->value . '"' ); header( 'WWW-Authenticate: Basic realm="' . $oShop->oxshops__oxname->value . '"' );
header( 'HTTP/1.0 401 Unauthorized' ); header( 'HTTP/1.0 401 Unauthorized' );
exit( 1 ); exit( 1 );
} }
} }
/** /**
* @return bool|d3_dev_oxorder * @return bool|d3_dev_oxorder
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
*/ */
public function d3GetLastOrder() public function d3GetLastOrder()
{ {
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
return false; return false;
} }
/** @var d3_dev_oxorder $oOrder */ /** @var d3_dev_oxorder $oOrder */
$oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class); $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
$oOrder->d3getLastOrder(); $oOrder->d3getLastOrder();
return $oOrder; return $oOrder;
} }
/** /**
* @return bool|d3_dev_d3inquiry * @return bool|d3_dev_d3inquiry
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
*/ */
public function d3GetLastInquiry() public function d3GetLastInquiry()
{ {
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
return false; return false;
} }
/** @var d3_dev_d3inquiry $oInquiry */ /** @var d3_dev_d3inquiry $oInquiry */
$oInquiry = oxNew('d3inquiry'); $oInquiry = oxNew('d3inquiry');
$oInquiry->d3getLastInquiry(); $oInquiry->d3getLastInquiry();
return $oInquiry; return $oInquiry;
} }
} }

View File

@ -1,173 +1,173 @@
<?php <?php
use OxidEsales\Eshop\Core\DatabaseProvider; use OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Core\Registry; 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.
* *
* Any unauthorized use of this software without a valid license * Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by * is a violation of the license agreement and will be prosecuted by
* civil and criminal law. * civil and criminal law.
* *
* http://www.shopmodule.com * http://www.shopmodule.com
* *
* @copyright © Data Development, Thomas Dartsch * @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com> * @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
{ {
protected $_oOrderBasket = null; protected $_oOrderBasket = null;
/** /**
* @return d3_dev_oxbasket * @return d3_dev_oxbasket
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
*/ */
public function d3DevGetOrderBasket() public function d3DevGetOrderBasket()
{ {
/** @var oxbasket $oBasket */ /** @var oxbasket $oBasket */
$this->_getInquiryBasket(); $this->_getInquiryBasket();
// unsetting bundles // unsetting bundles
$oOrderArticles = $this->getInquiryArticles(); $oOrderArticles = $this->getInquiryArticles();
foreach ($oOrderArticles as $sItemId => $oItem) { foreach ($oOrderArticles as $sItemId => $oItem) {
if ($oItem->isBundle()) { if ($oItem->isBundle()) {
$oOrderArticles->offsetUnset($sItemId); $oOrderArticles->offsetUnset($sItemId);
} }
} }
// add this order articles to basket and recalculate basket // add this order articles to basket and recalculate basket
$oBasket = $this->_addInquiryArticlesToBasket($this->getInquiryUser(), $oOrderArticles); $oBasket = $this->_addInquiryArticlesToBasket($this->getInquiryUser(), $oOrderArticles);
// recalculating basket // recalculating basket
$oBasket->calculateBasket(true); $oBasket->calculateBasket(true);
$oBasket->d3ClearBasketItemArticles(); $oBasket->d3ClearBasketItemArticles();
return $oBasket; return $oBasket;
} }
/** /**
* @return string * @return string
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
*/ */
public function d3getLastInquiryId() public function d3getLastInquiryId()
{ {
$inquiryNr = (int) oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3inquirynr'); $inquiryNr = (int) oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3inquirynr');
$sWhere = 1; $sWhere = 1;
if ($inquiryNr) { if ($inquiryNr) {
$sWhere = ' oxinquirynr = ' . $inquiryNr; $sWhere = ' oxinquirynr = ' . $inquiryNr;
} }
$sSelect = "SELECT oxid FROM ".getViewName('d3inquiry')." WHERE ".$sWhere." ORDER BY oxinquirydate DESC LIMIT 1"; $sSelect = "SELECT oxid FROM ".getViewName('d3inquiry')." WHERE ".$sWhere." ORDER BY oxinquirydate DESC LIMIT 1";
return DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getOne($sSelect); return DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getOne($sSelect);
} }
/** /**
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
*/ */
public function d3getLastInquiry() public function d3getLastInquiry()
{ {
$this->load($this->d3getLastInquiryId()); $this->load($this->d3getLastInquiryId());
//$this->_d3AddVouchers(); //$this->_d3AddVouchers();
} }
/** /**
* @return oxBasket * @return oxBasket
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
*/ */
public function getBasket() public function getBasket()
{ {
$oBasket = parent::getBasket(); $oBasket = parent::getBasket();
if (false == $oBasket && Registry::getConfig()->getActiveView()->getClassKey() == 'd3dev') { if (false == $oBasket && Registry::getConfig()->getActiveView()->getClassKey() == 'd3dev') {
$oBasket = $this->d3DevGetOrderBasket(); $oBasket = $this->d3DevGetOrderBasket();
} }
return $oBasket; return $oBasket;
} }
/** /**
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
*/ */
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 oxvouchers WHERE oxorderid = ". DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->quote($this->getId()).";";
$aResult = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getAll($sSelect); $aResult = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getAll($sSelect);
foreach ($aResult as $aFields) { foreach ($aResult as $aFields) {
$oVoucher = oxNew('oxvoucher'); $oVoucher = oxNew('oxvoucher');
$oVoucher->load($aFields['oxid']); $oVoucher->load($aFields['oxid']);
$this->_aVoucherList[$oVoucher->getId()] = $oVoucher; $this->_aVoucherList[$oVoucher->getId()] = $oVoucher;
} }
} }
/** /**
* Returns basket object filled up with discount, delivery, wrapping and all other info * Returns basket object filled up with discount, delivery, wrapping and all other info
* *
* @param bool $blStockCheck perform stock check or not (default true) * @param bool $blStockCheck perform stock check or not (default true)
* *
* @return \OxidEsales\Eshop\Application\Model\Basket * @return \OxidEsales\Eshop\Application\Model\Basket
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
*/ */
protected function _getInquiryBasket($blStockCheck = true) protected function _getInquiryBasket($blStockCheck = true)
{ {
/** @var \OxidEsales\Eshop\Application\Model\Basket _oOrderBasket */ /** @var \OxidEsales\Eshop\Application\Model\Basket _oOrderBasket */
$this->_oOrderBasket = oxNew(\OxidEsales\Eshop\Application\Model\Basket::class); $this->_oOrderBasket = oxNew(\OxidEsales\Eshop\Application\Model\Basket::class);
$this->_oOrderBasket->enableSaveToDataBase(false); $this->_oOrderBasket->enableSaveToDataBase(false);
//setting recalculation mode //setting recalculation mode
$this->_oOrderBasket->setCalculationModeNetto($this->isNettoMode()); $this->_oOrderBasket->setCalculationModeNetto($this->isNettoMode());
// setting stock check mode // setting stock check mode
$this->_oOrderBasket->setStockCheckMode($blStockCheck); $this->_oOrderBasket->setStockCheckMode($blStockCheck);
// setting virtual basket user // setting virtual basket user
$this->_oOrderBasket->setBasketUser($this->getInquiryUser()); $this->_oOrderBasket->setBasketUser($this->getInquiryUser());
// transferring order id // transferring order id
$this->_oOrderBasket->setInquiryId($this->getId()); $this->_oOrderBasket->setInquiryId($this->getId());
// setting basket currency order uses // setting basket currency order uses
$aCurrencies = Registry::getConfig()->getCurrencyArray(); $aCurrencies = Registry::getConfig()->getCurrencyArray();
foreach ($aCurrencies as $oCur) { foreach ($aCurrencies as $oCur) {
if ($oCur->name == $this->oxorder__oxcurrency->value) { if ($oCur->name == $this->oxorder__oxcurrency->value) {
$oBasketCur = $oCur; $oBasketCur = $oCur;
break; break;
} }
} }
// setting currency // setting currency
$this->_oOrderBasket->setBasketCurrency($oBasketCur); $this->_oOrderBasket->setBasketCurrency($oBasketCur);
// set basket card id and message // set basket card id and message
$this->_oOrderBasket->setCardId($this->oxorder__oxcardid->value); $this->_oOrderBasket->setCardId($this->oxorder__oxcardid->value);
$this->_oOrderBasket->setCardMessage($this->oxorder__oxcardtext->value); $this->_oOrderBasket->setCardMessage($this->oxorder__oxcardtext->value);
if ($this->_blReloadDiscount) { if ($this->_blReloadDiscount) {
$oDb = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC); $oDb = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC);
// disabling availability check // disabling availability check
$this->_oOrderBasket->setSkipVouchersChecking(true); $this->_oOrderBasket->setSkipVouchersChecking(true);
// add previously used vouchers // add previously used vouchers
$sQ = 'select oxid from oxvouchers where oxorderid = ' . $oDb->quote($this->getId()); $sQ = 'select oxid from oxvouchers where oxorderid = ' . $oDb->quote($this->getId());
$aVouchers = $oDb->getAll($sQ); $aVouchers = $oDb->getAll($sQ);
foreach ($aVouchers as $aVoucher) { foreach ($aVouchers as $aVoucher) {
$this->_oOrderBasket->addVoucher($aVoucher['oxid']); $this->_oOrderBasket->addVoucher($aVoucher['oxid']);
} }
} else { } else {
$this->_oOrderBasket->setDiscountCalcMode(false); $this->_oOrderBasket->setDiscountCalcMode(false);
$this->_oOrderBasket->setVoucherDiscount($this->oxorder__oxvoucherdiscount->value); $this->_oOrderBasket->setVoucherDiscount($this->oxorder__oxvoucherdiscount->value);
$this->_oOrderBasket->setTotalDiscount($this->oxorder__oxdiscount->value); $this->_oOrderBasket->setTotalDiscount($this->oxorder__oxdiscount->value);
} }
return $this->_oOrderBasket; return $this->_oOrderBasket;
} }
} }

View File

@ -1,38 +1,38 @@
<?php <?php
/** /**
* 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.
* *
* Any unauthorized use of this software without a valid license * Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by * is a violation of the license agreement and will be prosecuted by
* civil and criminal law. * civil and criminal law.
* *
* http://www.shopmodule.com * http://www.shopmodule.com
* *
* @copyright © Data Development, Thomas Dartsch * @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com> * @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
class d3_dev_d3inquiryarticle extends d3_dev_d3inquiryarticle_parent class d3_dev_d3inquiryarticle extends d3_dev_d3inquiryarticle_parent
{ {
/** /**
* @return array * @return array
*/ */
public function getCustomerAlsoBoughtThisProducts() public function getCustomerAlsoBoughtThisProducts()
{ {
$oArticle = $this->getArticle(); $oArticle = $this->getArticle();
return $oArticle->getCustomerAlsoBoughtThisProducts(); return $oArticle->getCustomerAlsoBoughtThisProducts();
} }
/** /**
* Returns true if ordered product is bundle * Returns true if ordered product is bundle
* *
* @return bool * @return bool
*/ */
public function isBundle() public function isBundle()
{ {
return ( bool ) $this->d3inquiryarticles__oxisbundle->value; return ( bool ) $this->d3inquiryarticles__oxisbundle->value;
} }
} }

View File

@ -1,62 +1,62 @@
<?php <?php
use OxidEsales\Eshop\Core\Registry; 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.
* *
* Any unauthorized use of this software without a valid license * Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by * is a violation of the license agreement and will be prosecuted by
* civil and criminal law. * civil and criminal law.
* *
* http://www.shopmodule.com * http://www.shopmodule.com
* *
* @copyright © Data Development, Thomas Dartsch * @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com> * @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
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()->oxshops__oxproductive->value if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|| false == Registry::getConfig()->getConfigParam('blD3DevAvoidDelBasket') || false == Registry::getConfig()->getConfigParam('blD3DevAvoidDelBasket')
) { ) {
parent::deleteBasket(); parent::deleteBasket();
} }
// else do nothing; // else do nothing;
} }
public function d3ClearBasketItemArticles() public function d3ClearBasketItemArticles()
{ {
/** @var d3_dev_oxbasketitem $oBasketItem */ /** @var d3_dev_oxbasketitem $oBasketItem */
foreach ($this->_aBasketContents as $oBasketItem) { foreach ($this->_aBasketContents as $oBasketItem) {
$oBasketItem->d3ClearArticle(); $oBasketItem->d3ClearArticle();
} }
} }
/** /**
* Calculates total basket discount value. * Calculates total basket discount value.
*/ */
protected function _calcBasketTotalDiscount() protected function _calcBasketTotalDiscount()
{ {
if ($this->_oTotalDiscount === null || (!$this->isAdmin())) { if ($this->_oTotalDiscount === null || (!$this->isAdmin())) {
$this->_oTotalDiscount = $this->_getPriceObject(); $this->_oTotalDiscount = $this->_getPriceObject();
if (is_array($this->_aDiscounts)) { if (is_array($this->_aDiscounts)) {
foreach ($this->_aDiscounts as $oDiscount) { foreach ($this->_aDiscounts as $oDiscount) {
// skipping bundle discounts // skipping bundle discounts
if ($oDiscount->sType == 'itm') { if ($oDiscount->sType == 'itm') {
continue; continue;
} }
// add discount value to total basket discount // add discount value to total basket discount
$this->_oTotalDiscount->add($oDiscount->dDiscount); $this->_oTotalDiscount->add($oDiscount->dDiscount);
} }
} }
} }
} }
} }

View File

@ -1,41 +1,41 @@
<?php <?php
/** /**
* 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.
* *
* Any unauthorized use of this software without a valid license * Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by * is a violation of the license agreement and will be prosecuted by
* civil and criminal law. * civil and criminal law.
* *
* http://www.shopmodule.com * http://www.shopmodule.com
* *
* @copyright © Data Development, Thomas Dartsch * @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com> * @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent
{ {
public function d3ClearArticle() public function d3ClearArticle()
{ {
$this->_oArticle = null; $this->_oArticle = null;
} }
/** /**
* @return string * @return string
* @throws \OxidEsales\EshopCommunity\Application\Model\oxArticleException * @throws \OxidEsales\EshopCommunity\Application\Model\oxArticleException
* @throws \OxidEsales\Eshop\Core\Exception\StandardException * @throws \OxidEsales\Eshop\Core\Exception\StandardException
* @throws oxNoArticleException * @throws oxNoArticleException
*/ */
public function getTitle() public function getTitle()
{ {
$oArticle = $this->getArticle(); $oArticle = $this->getArticle();
$this->_sTitle = $oArticle->oxarticles__oxtitle->value; $this->_sTitle = $oArticle->oxarticles__oxtitle->value;
if ($oArticle->oxarticles__oxvarselect->value) { if ($oArticle->oxarticles__oxvarselect->value) {
$this->_sTitle = $this->_sTitle . ', ' . $this->getVarSelect(); $this->_sTitle = $this->_sTitle . ', ' . $this->getVarSelect();
} }
return $this->_sTitle; return $this->_sTitle;
} }
} }

View File

@ -1,243 +1,243 @@
<?php <?php
use OxidEsales\Eshop\Core\Registry; 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.
* *
* Any unauthorized use of this software without a valid license * Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by * is a violation of the license agreement and will be prosecuted by
* civil and criminal law. * civil and criminal law.
* *
* http://www.shopmodule.com * http://www.shopmodule.com
* *
* @copyright © Data Development, Thomas Dartsch * @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com> * @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
class d3_dev_oxemail extends d3_dev_oxemail_parent class d3_dev_oxemail extends d3_dev_oxemail_parent
{ {
/** /**
* @param d3_dev_oxorder $oOrder * @param d3_dev_oxorder $oOrder
* *
* @param $sType * @param $sType
* *
* @return mixed|string * @return mixed|string
*/ */
public function d3GetOrderMailContent($oOrder, $sType) public function d3GetOrderMailContent($oOrder, $sType)
{ {
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
return ''; return '';
} }
switch (strtolower($sType)) { switch (strtolower($sType)) {
case 'owner_html': case 'owner_html':
$sTpl = $this->_sOrderOwnerTemplate; $sTpl = $this->_sOrderOwnerTemplate;
break; break;
case 'owner_plain': case 'owner_plain':
$sTpl = $this->_sOrderOwnerPlainTemplate; $sTpl = $this->_sOrderOwnerPlainTemplate;
break; break;
case 'user_plain': case 'user_plain':
$sTpl = $this->_sOrderUserPlainTemplate; $sTpl = $this->_sOrderUserPlainTemplate;
break; break;
case 'user_html': case 'user_html':
default: default:
$sTpl = $this->_sOrderUserTemplate; $sTpl = $this->_sOrderUserTemplate;
} }
$myConfig = $this->getConfig(); $myConfig = $this->getConfig();
$oShop = $this->_getShop(); $oShop = $this->_getShop();
// cleanup // cleanup
$this->_clearMailer(); $this->_clearMailer();
// add user defined stuff if there is any // add user defined stuff if there is any
$oOrder = $this->_addUserInfoOrderEMail($oOrder); $oOrder = $this->_addUserInfoOrderEMail($oOrder);
$oUser = $oOrder->getOrderUser(); $oUser = $oOrder->getOrderUser();
$this->setUser($oUser); $this->setUser($oUser);
// send confirmation to shop owner // send confirmation to shop owner
// send not pretending from order user, as different email domain rise spam filters // send not pretending from order user, as different email domain rise spam filters
$this->setFrom($oShop->oxshops__oxowneremail->value); $this->setFrom($oShop->oxshops__oxowneremail->value);
$oLang = Registry::getLang(); $oLang = Registry::getLang();
$iOrderLang = $oLang->getObjectTplLanguage(); $iOrderLang = $oLang->getObjectTplLanguage();
// if running shop language is different from admin lang. set in config // if running shop language is different from admin lang. set in config
// we have to load shop in config language // we have to load shop in config language
if ($oShop->getLanguage() != $iOrderLang) { if ($oShop->getLanguage() != $iOrderLang) {
$oShop = $this->_getShop($iOrderLang); $oShop = $this->_getShop($iOrderLang);
} }
$this->setSmtp($oShop); $this->setSmtp($oShop);
// create messages // create messages
/** @var Smarty $oSmarty */ /** @var Smarty $oSmarty */
$oSmarty = $this->_getSmarty(); $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)); return $oSmarty->fetch($myConfig->getTemplatePath($sTpl, false));
} }
/** /**
* @param d3_dev_d3inquiry $oInquiry * @param d3_dev_d3inquiry $oInquiry
* *
* @param $sType * @param $sType
* *
* @return mixed|string * @return mixed|string
*/ */
public function d3GetInquiryMailContent($oInquiry, $sType) public function d3GetInquiryMailContent($oInquiry, $sType)
{ {
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
return ''; return '';
} }
switch (strtolower($sType)) { switch (strtolower($sType)) {
case 'owner_html': case 'owner_html':
$sTpl = $this->_sInquiryOwnerTemplate; $sTpl = $this->_sInquiryOwnerTemplate;
break; break;
case 'owner_plain': case 'owner_plain':
$sTpl = $this->_sInquiryOwnerPlainTemplate; $sTpl = $this->_sInquiryOwnerPlainTemplate;
break; break;
case 'user_plain': case 'user_plain':
$sTpl = $this->_sInquiryUserPlainTemplate; $sTpl = $this->_sInquiryUserPlainTemplate;
break; break;
case 'user_html': case 'user_html':
default: default:
$sTpl = $this->_sInquiryUserTemplate; $sTpl = $this->_sInquiryUserTemplate;
} }
$myConfig = $this->getConfig(); $myConfig = $this->getConfig();
$oShop = $this->_getShop(); $oShop = $this->_getShop();
// cleanup // cleanup
$this->_clearMailer(); $this->_clearMailer();
// add user defined stuff if there is any // add user defined stuff if there is any
$oInquiry = $this->_addUserInfoOrderEMail($oInquiry); $oInquiry = $this->_addUserInfoOrderEMail($oInquiry);
$oUser = $oInquiry->getInquiryUser(); $oUser = $oInquiry->getInquiryUser();
$this->setUser($oUser); $this->setUser($oUser);
// send confirmation to shop owner // send confirmation to shop owner
// send not pretending from order user, as different email domain rise spam filters // send not pretending from order user, as different email domain rise spam filters
$this->setFrom($oShop->oxshops__oxowneremail->value); $this->setFrom($oShop->oxshops__oxowneremail->value);
$oLang = Registry::getLang(); $oLang = Registry::getLang();
$iOrderLang = $oLang->getObjectTplLanguage(); $iOrderLang = $oLang->getObjectTplLanguage();
// if running shop language is different from admin lang. set in config // if running shop language is different from admin lang. set in config
// we have to load shop in config language // we have to load shop in config language
if ($oShop->getLanguage() != $iOrderLang) { if ($oShop->getLanguage() != $iOrderLang) {
$oShop = $this->_getShop($iOrderLang); $oShop = $this->_getShop($iOrderLang);
} }
$this->setSmtp($oShop); $this->setSmtp($oShop);
// create messages // create messages
/** @var Smarty $oSmarty */ /** @var Smarty $oSmarty */
$oSmarty = $this->_getSmarty(); $oSmarty = $this->_getSmarty();
$this->setViewData("inquiry", $oInquiry); $this->setViewData("inquiry", $oInquiry);
// 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)); return $oSmarty->fetch($myConfig->getTemplatePath($sTpl, false));
} }
protected function _sendMail() protected function _sendMail()
{ {
if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) {
return parent::_sendMail(); return parent::_sendMail();
} }
$this->d3clearRecipients(); $this->d3clearRecipients();
$this->d3clearCC(); $this->d3clearCC();
$this->d3clearBCC(); $this->d3clearBCC();
if (count($this->getRecipient())) { if (count($this->getRecipient())) {
return parent::_sendMail(); return parent::_sendMail();
} }
return true; 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])) if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
&& $sNewRecipient != $aRecInfo[0] && $sNewRecipient != $aRecInfo[0]
) { ) {
$aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")"; $aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")";
$aRecInfo[0] = $sNewRecipient; $aRecInfo[0] = $sNewRecipient;
$aRecipients[] = $aRecInfo; $aRecipients[] = $aRecInfo;
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) { } elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
$aRecipients[] = $aRecInfo; $aRecipients[] = $aRecInfo;
} }
} }
} }
$this->_aRecipients = $aRecipients; $this->_aRecipients = $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])) if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
&& $sNewRecipient != $aRecInfo[0] && $sNewRecipient != $aRecInfo[0]
) { ) {
$aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")"; $aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")";
$aRecInfo[0] = $sNewRecipient; $aRecInfo[0] = $sNewRecipient;
$aCc[] = $aRecInfo; $aCc[] = $aRecInfo;
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) { } elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
$aCc[] = $aRecInfo; $aCc[] = $aRecInfo;
} }
} }
} }
$this->cc = $aCc; $this->cc = $aCc;
} }
public function d3clearBCC() public function d3clearBCC()
{ {
$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])) if (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))
&& $sNewRecipient != $aRecInfo[0] && $sNewRecipient != $aRecInfo[0]
) { ) {
$aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")"; $aRecInfo[1] = $aRecInfo[1]." (".$aRecInfo[0].")";
$aRecInfo[0] = $sNewRecipient; $aRecInfo[0] = $sNewRecipient;
$aCc[] = $aRecInfo; $aCc[] = $aRecInfo;
} elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) { } elseif (($sNewRecipient = $this->getNewRecipient($aRecInfo[0]))) {
$aCc[] = $aRecInfo; $aCc[] = $aRecInfo;
} }
} }
} }
$this->bcc = $aCc; $this->bcc = $aCc;
} }
public function getNewRecipient($sMailAddress) public function getNewRecipient($sMailAddress)
{ {
if (Registry::getConfig()->getConfigParam('blD3DevBlockMails')) { if (Registry::getConfig()->getConfigParam('blD3DevBlockMails')) {
return false; return false;
} elseif (Registry::getConfig()->getConfigParam('sD3DevRedirectMail')) { } elseif (Registry::getConfig()->getConfigParam('sD3DevRedirectMail')) {
return trim(Registry::getConfig()->getConfigParam('sD3DevRedirectMail')); return trim(Registry::getConfig()->getConfigParam('sD3DevRedirectMail'));
} }
return $sMailAddress; return $sMailAddress;
} }
} }

View File

@ -1,109 +1,109 @@
<?php <?php
use OxidEsales\Eshop\Core\DatabaseProvider; use OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Core\Registry; 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.
* *
* Any unauthorized use of this software without a valid license * Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by * is a violation of the license agreement and will be prosecuted by
* civil and criminal law. * civil and criminal law.
* *
* http://www.shopmodule.com * http://www.shopmodule.com
* *
* @copyright © Data Development, Thomas Dartsch * @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com> * @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
class d3_dev_oxorder extends d3_dev_oxorder_parent class d3_dev_oxorder extends d3_dev_oxorder_parent
{ {
/** /**
* @return d3_dev_oxbasket * @return d3_dev_oxbasket
*/ */
public function d3DevGetOrderBasket() public function d3DevGetOrderBasket()
{ {
/** @var d3_dev_oxbasket $oBasket */ /** @var d3_dev_oxbasket $oBasket */
$oBasket = $this->_getOrderBasket(); $oBasket = $this->_getOrderBasket();
// unsetting bundles // unsetting bundles
/** @var \OxidEsales\Eshop\Core\Model\ListModel $oOrderArticles */ /** @var \OxidEsales\Eshop\Core\Model\ListModel $oOrderArticles */
$oOrderArticles = $this->getOrderArticles(); $oOrderArticles = $this->getOrderArticles();
foreach ($oOrderArticles as $sItemId => $oItem) { foreach ($oOrderArticles as $sItemId => $oItem) {
/** @var $oItem \OxidEsales\Eshop\Application\Model\OrderArticle */ /** @var $oItem \OxidEsales\Eshop\Application\Model\OrderArticle */
if ($oItem->isBundle()) { if ($oItem->isBundle()) {
$oOrderArticles->offsetUnset($sItemId); $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->_addOrderArticlesToBasket($oBasket, $oOrderArticles);
// recalculating basket // recalculating basket
$oBasket->calculateBasket(true); $oBasket->calculateBasket(true);
$oBasket->d3ClearBasketItemArticles(); $oBasket->d3ClearBasketItemArticles();
$this->_oPayment = $this->_setPayment($oBasket->getPaymentId()); $this->_oPayment = $this->_setPayment($oBasket->getPaymentId());
return $oBasket; return $oBasket;
} }
/** /**
* @return string * @return string
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
*/ */
public function d3getLastOrderId() public function d3getLastOrderId()
{ {
$orderNr = (int) oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3ordernr'); $orderNr = (int) oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3ordernr');
$sWhere = 1; $sWhere = 1;
if ($orderNr) { if ($orderNr) {
$sWhere = ' oxordernr = ' . $orderNr; $sWhere = ' oxordernr = ' . $orderNr;
} }
$sSelect = "SELECT oxid FROM ".getViewName('oxorder')." WHERE ".$sWhere." ORDER BY oxorderdate DESC LIMIT 1"; $sSelect = "SELECT oxid FROM ".getViewName('oxorder')." WHERE ".$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);
} }
/** /**
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
*/ */
public function d3getLastOrder() public function d3getLastOrder()
{ {
$this->load($this->d3getLastOrderId()); $this->load($this->d3getLastOrderId());
$this->_d3AddVouchers(); $this->_d3AddVouchers();
} }
/** /**
* @return d3_dev_oxbasket|\OxidEsales\Eshop\Application\Model\Basket * @return d3_dev_oxbasket|\OxidEsales\Eshop\Application\Model\Basket
*/ */
public function getBasket() public function getBasket()
{ {
$oBasket = parent::getBasket(); $oBasket = parent::getBasket();
if (false == $oBasket && Registry::getConfig()->getActiveView()->getClassKey() == 'd3dev') { if (false == $oBasket && Registry::getConfig()->getActiveView()->getClassKey() == 'd3dev') {
$oBasket = $this->d3DevGetOrderBasket(); $oBasket = $this->d3DevGetOrderBasket();
} }
return $oBasket; return $oBasket;
} }
/** /**
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
* @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
*/ */
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 oxvouchers WHERE oxorderid = ".DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->quote($this->getId()).";";
$aResult = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getAll($sSelect); $aResult = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getAll($sSelect);
foreach ($aResult as $aFields) { foreach ($aResult as $aFields) {
$oVoucher = oxNew(\OxidEsales\Eshop\Application\Model\Voucher::class); $oVoucher = oxNew(\OxidEsales\Eshop\Application\Model\Voucher::class);
$oVoucher->load($aFields['oxid']); $oVoucher->load($aFields['oxid']);
$this->_aVoucherList[$oVoucher->getId()] = $oVoucher; $this->_aVoucherList[$oVoucher->getId()] = $oVoucher;
} }
} }
} }

View File

@ -1,28 +1,28 @@
<?php <?php
/** /**
* 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.
* *
* Any unauthorized use of this software without a valid license * Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by * is a violation of the license agreement and will be prosecuted by
* civil and criminal law. * civil and criminal law.
* *
* http://www.shopmodule.com * http://www.shopmodule.com
* *
* @copyright © Data Development, Thomas Dartsch * @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com> * @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
class d3_dev_oxorderarticle extends d3_dev_oxorderarticle_parent class d3_dev_oxorderarticle extends d3_dev_oxorderarticle_parent
{ {
/** /**
* @return null|\OxidEsales\EshopCommunity\Application\Model\ArticleList * @return null|\OxidEsales\EshopCommunity\Application\Model\ArticleList
*/ */
public function getCustomerAlsoBoughtThisProducts() public function getCustomerAlsoBoughtThisProducts()
{ {
$oArticle = $this->getArticle(); $oArticle = $this->getArticle();
return $oArticle->getCustomerAlsoBoughtThisProducts(); return $oArticle->getCustomerAlsoBoughtThisProducts();
} }
} }