From 1187854c8625cb4f1a63fd38820e5693f7bb6505 Mon Sep 17 00:00:00 2001 From: kristianhempel Date: Thu, 25 Jan 2018 11:27:47 +0100 Subject: [PATCH] migrate classes to OXID-eSales/oxideshop_ce V6.0.0 added .gitignore --- .gitignore | 53 +++++ .../modules/d3/d3dev/controllers/d3dev.php | 7 + copy_this/modules/d3/d3dev/metadata.php | 218 +++++++++--------- .../modules/controllers/d3_dev_thankyou.php | 52 +++-- .../d3dev/modules/models/d3_dev_d3inquiry.php | 51 ++-- .../d3dev/modules/models/d3_dev_oxbasket.php | 9 +- .../modules/models/d3_dev_oxbasketitem.php | 6 + .../d3dev/modules/models/d3_dev_oxemail.php | 27 ++- .../d3dev/modules/models/d3_dev_oxorder.php | 41 ++-- .../modules/models/d3_dev_oxorderarticle.php | 2 +- .../d3/d3dev/views/admin/de/d3dev_lang.php | 114 ++++----- 11 files changed, 353 insertions(+), 227 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a696e38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,53 @@ +# Created by .ignore support plugin (hsz.mobi) +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ +cmake-build-release/ + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + diff --git a/copy_this/modules/d3/d3dev/controllers/d3dev.php b/copy_this/modules/d3/d3dev/controllers/d3dev.php index 34b395f..5e9ae60 100644 --- a/copy_this/modules/d3/d3dev/controllers/d3dev.php +++ b/copy_this/modules/d3/d3dev/controllers/d3dev.php @@ -71,6 +71,10 @@ class d3dev extends \OxidEsales\EshopProfessional\Application\Controller\Fronten } } + /** + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException + */ public function showOrderMailContent() { header('Content-type: text/html; charset='.Registry::getLang()->translateString('charset')); @@ -93,6 +97,9 @@ class d3dev extends \OxidEsales\EshopProfessional\Application\Controller\Fronten die(); } + /** + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException + */ public function showInquiryMailContent() { if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value diff --git a/copy_this/modules/d3/d3dev/metadata.php b/copy_this/modules/d3/d3dev/metadata.php index ef8348a..1cd52f9 100644 --- a/copy_this/modules/d3/d3dev/metadata.php +++ b/copy_this/modules/d3/d3dev/metadata.php @@ -1,109 +1,109 @@ - 'd3dev', - 'title' => - (class_exists(D3\ModCfg\Application\Model\d3utils::class) ? D3\ModCfg\Application\Model\d3utils::getInstance()->getD3Logo() : 'D³') . - ' TPL Development Tool', - 'description' => array( - 'de' => ' -

Sicherheitshinweis

- -
Jede dieser Optionen muss aus Sicherheitsgründen unter "Einstell." aktiviert werden. Weiterhin darf der Shop nicht im Produktivmodus betrieben werden.

'. - '* Ordernummer an URL ergänzen, wenn bestimmte Bestellungen angezeigt werden sollen', - 'en' => ''), - // 'thumbnail' => 'picture.png', - 'version' => '1.2.0.0', - 'author' => 'D³ Data Development (Inh.: Thomas Dartsch)', - 'email' => 'support@shopmodule.com', - 'url' => 'http://www.oxidmodule.com/', - 'extend' => array( - 'thankyou' => 'd3/d3dev/modules/controllers/d3_dev_thankyou', - 'oxorder' => 'd3/d3dev/modules/models/d3_dev_oxorder', - 'oxorderarticle' => 'd3/d3dev/modules/models/d3_dev_oxorderarticle', - 'oxemail' => 'd3/d3dev/modules/models/d3_dev_oxemail', - 'oxbasket' => 'd3/d3dev/modules/models/d3_dev_oxbasket', - 'oxbasketitem' => 'd3/d3dev/modules/models/d3_dev_oxbasketitem', - ), - 'files' => array( - 'd3dev' => 'd3/d3dev/controllers/d3dev.php', - ), - 'templates' => array( - ), - 'events' => array( - ), - 'blocks' => array( - ), - 'settings' => array( - array( - 'group' => 'd3dev_order', - 'name' => 'blD3DevAvoidDelBasket', - 'type' => 'bool', - 'value' => 'false' - ), - array( - 'group' => 'd3dev_order', - 'name' => 'blD3DevShowThankyou', - 'type' => 'bool', - 'value' => 'false' - ), - array( - 'group' => 'd3dev_mail', - 'name' => 'blD3DevShowOrderMailsInBrowser', - 'type' => 'bool', - 'value' => 'false' - ), - array( - 'group' => 'd3dev_mailblock', - 'name' => 'blD3DevBlockMails', - 'type' => 'bool', - 'value' => 'false' - ), - array( - 'group' => 'd3dev_mailblock', - 'name' => 'sD3DevRedirectMail', - 'type' => 'str', - 'value' => 'd3test1@shopmodule.com' - ), - ), -); - - -if (class_exists('d3inquiry')) { - $aModule['extend']['d3inquiry'] = 'd3/d3dev/modules/models/d3_dev_d3inquiry'; - $aModule['extend']['d3inquiryarticle'] = 'd3/d3dev/modules/models/d3_dev_d3inquiryarticle'; -} + 'd3dev', + 'title' => + (class_exists(D3\ModCfg\Application\Model\d3utils::class) ? D3\ModCfg\Application\Model\d3utils::getInstance()->getD3Logo() : 'D³') . + ' TPL Development Tool', + 'description' => array( + 'de' => ' +

Sicherheitshinweis

+ +
Jede dieser Optionen muss aus Sicherheitsgründen unter "Einstell." aktiviert werden. Weiterhin darf der Shop nicht im Produktivmodus betrieben werden.

'. + '* Ordernummer an URL ergänzen, wenn bestimmte Bestellungen angezeigt werden sollen', + 'en' => ''), + // 'thumbnail' => 'picture.png', + 'version' => '1.2.0.0', + 'author' => 'D³ Data Development (Inh.: Thomas Dartsch)', + 'email' => 'support@shopmodule.com', + 'url' => 'http://www.oxidmodule.com/', + 'extend' => array( + 'thankyou' => 'd3/d3dev/modules/controllers/d3_dev_thankyou', + 'oxorder' => 'd3/d3dev/modules/models/d3_dev_oxorder', + 'oxorderarticle' => 'd3/d3dev/modules/models/d3_dev_oxorderarticle', + 'oxemail' => 'd3/d3dev/modules/models/d3_dev_oxemail', + 'oxbasket' => 'd3/d3dev/modules/models/d3_dev_oxbasket', + 'oxbasketitem' => 'd3/d3dev/modules/models/d3_dev_oxbasketitem', + ), + 'files' => array( + 'd3dev' => 'd3/d3dev/controllers/d3dev.php', + ), + 'templates' => array( + ), + 'events' => array( + ), + 'blocks' => array( + ), + 'settings' => array( + array( + 'group' => 'd3dev_order', + 'name' => 'blD3DevAvoidDelBasket', + 'type' => 'bool', + 'value' => 'false' + ), + array( + 'group' => 'd3dev_order', + 'name' => 'blD3DevShowThankyou', + 'type' => 'bool', + 'value' => 'false' + ), + array( + 'group' => 'd3dev_mail', + 'name' => 'blD3DevShowOrderMailsInBrowser', + 'type' => 'bool', + 'value' => 'false' + ), + array( + 'group' => 'd3dev_mailblock', + 'name' => 'blD3DevBlockMails', + 'type' => 'bool', + 'value' => 'false' + ), + array( + 'group' => 'd3dev_mailblock', + 'name' => 'sD3DevRedirectMail', + 'type' => 'str', + 'value' => 'd3test1@shopmodule.com' + ), + ), +); + + +if (class_exists('d3inquiry')) { + $aModule['extend']['d3inquiry'] = 'd3/d3dev/modules/models/d3_dev_d3inquiry'; + $aModule['extend']['d3inquiryarticle'] = 'd3/d3dev/modules/models/d3_dev_d3inquiryarticle'; +} diff --git a/copy_this/modules/d3/d3dev/modules/controllers/d3_dev_thankyou.php b/copy_this/modules/d3/d3dev/modules/controllers/d3_dev_thankyou.php index 7aa9b23..60e6e5a 100644 --- a/copy_this/modules/d3/d3dev/modules/controllers/d3_dev_thankyou.php +++ b/copy_this/modules/d3/d3dev/modules/controllers/d3_dev_thankyou.php @@ -1,8 +1,9 @@ getVariable('sess_challenge'); + $sSessChallenge = Registry::getSession()->getVariable('sess_challenge'); parent::init(); - oxRegistry::getSession()->setVariable('sess_challenge', $sSessChallenge); + Registry::getSession()->setVariable('sess_challenge', $sSessChallenge); - if (oxRegistry::getConfig()->getRequestParameter('d3dev') - && false == (bool) oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value - && oxRegistry::getConfig()->getConfigParam('blD3DevShowThankyou') + if (oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3dev') + && false == (bool) Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value + && Registry::getConfig()->getConfigParam('blD3DevShowThankyou') ) { $this->_d3authenticate(); $oOrder = $this->d3GetLastOrder(); @@ -38,13 +45,17 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent } } + /** + * @throws object + * @throws oxUserException + */ protected function _d3authenticate () { - $oConfig = oxRegistry::getConfig(); + $request = oxNew(\OxidEsales\Eshop\Core\Request::class); try { - $sUser = $oConfig->getRequestParameter( 'usr' ); - $sPassword = $oConfig->getRequestParameter( 'pwd' ); + $sUser = $request->getRequestParameter( 'usr' ); + $sPassword = $request->getRequestParameter( 'pwd' ); if ( !$sUser || !$sPassword ) { $sUser = $_SERVER[ 'PHP_AUTH_USER' ]; @@ -67,16 +78,16 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent } } } - /** @var oxUser $oUser */ - $oUser = oxNew( 'oxuser' ); + /** @var \OxidEsales\Eshop\Application\Model\User $oUser */ + $oUser = oxNew( \OxidEsales\Eshop\Application\Model\User::class ); if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) { - $oEx = oxNew( 'oxuserexception' ); - $oEx->setMessage( 'EXCEPTION_USER_NOVALIDLOGIN' ); + /** @var \OxidEsales\Eshop\Core\Exception\UserException $oEx */ + $oEx = oxNew( \OxidEsales\Eshop\Core\Exception\UserException::class, 'EXCEPTION_USER_NOVALIDLOGIN'); throw $oEx; } } catch ( Exception $oEx ) { - $oShop = $oConfig->getActiveShop(); + $oShop = Registry::getConfig()->getActiveShop(); header( 'WWW-Authenticate: Basic realm="' . $oShop->oxshops__oxname->value . '"' ); header( 'HTTP/1.0 401 Unauthorized' ); exit( 1 ); @@ -84,27 +95,30 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent } /** - * @return d3_dev_oxorder + * @return bool|d3_dev_oxorder + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException */ public function d3GetLastOrder() { - if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { + if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { return false; } /** @var d3_dev_oxorder $oOrder */ - $oOrder = oxNew('oxorder'); + $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class); $oOrder->d3getLastOrder(); return $oOrder; } /** - * @return d3_dev_d3inquiry + * @return bool|d3_dev_d3inquiry + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException */ public function d3GetLastInquiry() { - if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { + if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { return false; } diff --git a/copy_this/modules/d3/d3dev/modules/models/d3_dev_d3inquiry.php b/copy_this/modules/d3/d3dev/modules/models/d3_dev_d3inquiry.php index b931c91..5cf0abe 100644 --- a/copy_this/modules/d3/d3dev/modules/models/d3_dev_d3inquiry.php +++ b/copy_this/modules/d3/d3dev/modules/models/d3_dev_d3inquiry.php @@ -1,5 +1,9 @@ _getInquiryBasket(); + $this->_getInquiryBasket(); // unsetting bundles $oOrderArticles = $this->getInquiryArticles(); @@ -45,20 +51,24 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent /** * @return string + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException */ public function d3getLastInquiryId() { - if (oxRegistry::getConfig()->getRequestParameter('d3inquirynr')) { - $sWhere = ' oxinquirynr = ' . (int) oxRegistry::getConfig()->getRequestParameter('d3inquirynr'); - } else { - $sWhere = 1; + $inquiryNr = (int) oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3inquirynr'); + $sWhere = 1; + if ($inquiryNr) { + $sWhere = ' oxinquirynr = ' . $inquiryNr; } $sSelect = "SELECT oxid FROM ".getViewName('d3inquiry')." WHERE ".$sWhere." ORDER BY oxinquirydate DESC LIMIT 1"; - return oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getOne($sSelect); + return DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getOne($sSelect); } + /** + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException + */ public function d3getLastInquiry() { $this->load($this->d3getLastInquiryId()); @@ -67,23 +77,29 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent /** * @return oxBasket + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException */ public function getBasket() { $oBasket = parent::getBasket(); - if (false == $oBasket && oxRegistry::getConfig()->getActiveView()->getClassName() == 'd3dev') { + if (false == $oBasket && Registry::getConfig()->getActiveView()->getClassKey() == 'd3dev') { $oBasket = $this->d3DevGetOrderBasket(); } return $oBasket; } - + + /** + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException + */ protected function _d3AddVouchers() { - $sSelect = "SELECT oxid FROM oxvouchers WHERE oxorderid = ".oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->quote($this->getId()).";"; - - $aResult = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getArray($sSelect); + $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'); @@ -97,11 +113,14 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent * * @param bool $blStockCheck perform stock check or not (default true) * - * @return oxBasket + * @return \OxidEsales\Eshop\Application\Model\Basket + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException */ protected function _getInquiryBasket($blStockCheck = true) { - $this->_oOrderBasket = oxNew("oxBasket"); + /** @var \OxidEsales\Eshop\Application\Model\Basket _oOrderBasket */ + $this->_oOrderBasket = oxNew(\OxidEsales\Eshop\Application\Model\Basket::class); $this->_oOrderBasket->enableSaveToDataBase(false); //setting recalculation mode @@ -117,7 +136,7 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent $this->_oOrderBasket->setInquiryId($this->getId()); // setting basket currency order uses - $aCurrencies = $this->getConfig()->getCurrencyArray(); + $aCurrencies = Registry::getConfig()->getCurrencyArray(); foreach ($aCurrencies as $oCur) { if ($oCur->name == $this->oxorder__oxcurrency->value) { $oBasketCur = $oCur; @@ -133,7 +152,7 @@ class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent $this->_oOrderBasket->setCardMessage($this->oxorder__oxcardtext->value); if ($this->_blReloadDiscount) { - $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); + $oDb = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC); // disabling availability check $this->_oOrderBasket->setSkipVouchersChecking(true); diff --git a/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxbasket.php b/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxbasket.php index e70f18a..c754f3e 100644 --- a/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxbasket.php +++ b/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxbasket.php @@ -1,5 +1,8 @@ getActiveShop()->oxshops__oxproductive->value - || false == oxRegistry::getConfig()->getConfigParam('blD3DevAvoidDelBasket') + if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value + || false == Registry::getConfig()->getConfigParam('blD3DevAvoidDelBasket') ) { parent::deleteBasket(); } diff --git a/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxbasketitem.php b/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxbasketitem.php index 20ec6b7..cec6afd 100644 --- a/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxbasketitem.php +++ b/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxbasketitem.php @@ -21,6 +21,12 @@ class d3_dev_oxbasketitem extends d3_dev_oxbasketitem_parent $this->_oArticle = null; } + /** + * @return string + * @throws \OxidEsales\EshopCommunity\Application\Model\oxArticleException + * @throws \OxidEsales\Eshop\Core\Exception\StandardException + * @throws oxNoArticleException + */ public function getTitle() { $oArticle = $this->getArticle(); diff --git a/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxemail.php b/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxemail.php index 924ad3f..8622853 100644 --- a/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxemail.php +++ b/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxemail.php @@ -1,5 +1,8 @@ getActiveShop()->oxshops__oxproductive->value) { + if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { return ''; } @@ -59,7 +64,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent // send not pretending from order user, as different email domain rise spam filters $this->setFrom($oShop->oxshops__oxowneremail->value); - $oLang = oxRegistry::getLang(); + $oLang = Registry::getLang(); $iOrderLang = $oLang->getObjectTplLanguage(); // if running shop language is different from admin lang. set in config @@ -71,6 +76,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent $this->setSmtp($oShop); // create messages + /** @var Smarty $oSmarty */ $oSmarty = $this->_getSmarty(); $this->setViewData("order", $oOrder); @@ -83,11 +89,13 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent /** * @param d3_dev_d3inquiry $oInquiry * + * @param $sType + * * @return mixed|string */ public function d3GetInquiryMailContent($oInquiry, $sType) { - if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { + if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { return ''; } @@ -123,7 +131,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent // send not pretending from order user, as different email domain rise spam filters $this->setFrom($oShop->oxshops__oxowneremail->value); - $oLang = oxRegistry::getLang(); + $oLang = Registry::getLang(); $iOrderLang = $oLang->getObjectTplLanguage(); // if running shop language is different from admin lang. set in config @@ -135,6 +143,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent $this->setSmtp($oShop); // create messages + /** @var Smarty $oSmarty */ $oSmarty = $this->_getSmarty(); $this->setViewData("inquiry", $oInquiry); @@ -146,7 +155,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent protected function _sendMail() { - if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { + if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value) { return parent::_sendMail(); } @@ -223,10 +232,10 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent public function getNewRecipient($sMailAddress) { - if (oxRegistry::getConfig()->getConfigParam('blD3DevBlockMails')) { + if (Registry::getConfig()->getConfigParam('blD3DevBlockMails')) { return false; - } elseif (oxRegistry::getConfig()->getConfigParam('sD3DevRedirectMail')) { - return trim(oxRegistry::getConfig()->getConfigParam('sD3DevRedirectMail')); + } elseif (Registry::getConfig()->getConfigParam('sD3DevRedirectMail')) { + return trim(Registry::getConfig()->getConfigParam('sD3DevRedirectMail')); } return $sMailAddress; diff --git a/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxorder.php b/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxorder.php index 2ef868c..5a17af7 100644 --- a/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxorder.php +++ b/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxorder.php @@ -1,5 +1,9 @@ _getOrderBasket(); // unsetting bundles + /** @var \OxidEsales\Eshop\Core\Model\ListModel $oOrderArticles */ $oOrderArticles = $this->getOrderArticles(); foreach ($oOrderArticles as $sItemId => $oItem) { + /** @var $oItem \OxidEsales\Eshop\Application\Model\OrderArticle */ if ($oItem->isBundle()) { $oOrderArticles->offsetUnset($sItemId); } @@ -45,20 +51,25 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent /** * @return string + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException */ public function d3getLastOrderId() { - if (oxRegistry::getConfig()->getRequestParameter('d3ordernr')) { - $sWhere = ' oxordernr = ' . (int) oxRegistry::getConfig()->getRequestParameter('d3ordernr'); - } else { - $sWhere = 1; + $orderNr = (int) oxNew(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('d3ordernr'); + $sWhere = 1; + if ($orderNr) { + $sWhere = ' oxordernr = ' . $orderNr; } $sSelect = "SELECT oxid FROM ".getViewName('oxorder')." WHERE ".$sWhere." ORDER BY oxorderdate DESC LIMIT 1"; - return oxDb::getDb(oxDb::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\DatabaseErrorException + */ public function d3getLastOrder() { $this->load($this->d3getLastOrderId()); @@ -66,27 +77,31 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent } /** - * @return oxBasket + * @return d3_dev_oxbasket|\OxidEsales\Eshop\Application\Model\Basket */ public function getBasket() { $oBasket = parent::getBasket(); - if (false == $oBasket && oxRegistry::getConfig()->getActiveView()->getClassName() == 'd3dev') { + if (false == $oBasket && Registry::getConfig()->getActiveView()->getClassKey() == 'd3dev') { $oBasket = $this->d3DevGetOrderBasket(); } return $oBasket; } - + + /** + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException + * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException + */ protected function _d3AddVouchers() { - $sSelect = "SELECT oxid FROM oxvouchers WHERE oxorderid = ".oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->quote($this->getId()).";"; - - $aResult = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getArray($sSelect); + $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 = oxNew(\OxidEsales\Eshop\Application\Model\Voucher::class); $oVoucher->load($aFields['oxid']); $this->_aVoucherList[$oVoucher->getId()] = $oVoucher; } diff --git a/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxorderarticle.php b/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxorderarticle.php index 8595bcd..bfd0b49 100644 --- a/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxorderarticle.php +++ b/copy_this/modules/d3/d3dev/modules/models/d3_dev_oxorderarticle.php @@ -17,7 +17,7 @@ class d3_dev_oxorderarticle extends d3_dev_oxorderarticle_parent { /** - * @return array + * @return null|\OxidEsales\EshopCommunity\Application\Model\ArticleList */ public function getCustomerAlsoBoughtThisProducts() { diff --git a/copy_this/modules/d3/d3dev/views/admin/de/d3dev_lang.php b/copy_this/modules/d3/d3dev/views/admin/de/d3dev_lang.php index 7bc5f24..092b8bc 100644 --- a/copy_this/modules/d3/d3dev/views/admin/de/d3dev_lang.php +++ b/copy_this/modules/d3/d3dev/views/admin/de/d3dev_lang.php @@ -1,57 +1,57 @@ - - * @link http://www.oxidmodule.com - */ - -$sLangName = "Deutsch"; - -// ------------------------------- -// RESOURCE IDENTITFIER = STRING -// ------------------------------- -$aLang = array( - //Navigation - 'charset' => 'ISO-8859-15', - - 'SHOP_MODULE_GROUP_d3dev_order' => 'Bestellungsablauf manipulieren', - 'SHOP_MODULE_blD3DevAvoidDelBasket' => 'Warenkorb wird nach Bestellabschluss nicht geleert', - 'HELP_SHOP_MODULE_blD3DevAvoidDelBasket' => 'Damit kann auf der Bestellbestätigungsseite '. - '(Thankyou) durch den "zurück"-Button in den Warenkorb Schritt 4 gewechselt werden und die Bestellung erneut '. - 'abgeschickt werden. Eine erneute Bestückung des Warenkorbs ist nicht nötig. Beim erneuten Absenden wird '. - 'jeweils eine weitere Bestellung angelegt werden. Eventuell verwendete Gutscheine müssen so eingestellt '. - 'werden, dass diese mehrfach verwendet werden können.', - 'SHOP_MODULE_blD3DevShowThankyou' => 'Thankyou-Seite kann auch ohne Bestellung '. - 'aufgerufen werden', - 'HELP_SHOP_MODULE_blD3DevShowThankyou' => 'Ohne abgesendete Bestellung läßt sich die '. - 'Thankyou-Seite im Standardshop nicht aufrufen. Diese Option stellt dies für Entwicklungszwecke zur '. - 'Verfügung.
Den Link zum Seitenaufruf haben wir hier im Stamm-Tab hinterlegt. Die Seite öffnet sich in '. - 'einem neuen Browserfenster.
Für die Anzeige wird die letzte vorliegende Bestellung geladen. Über den '. - 'Parameter "d3ordernr=X" kann eine bestimmten Bestellung vorgegeben werden.', - - 'SHOP_MODULE_GROUP_d3dev_mail' => 'Mailanzeige', - 'SHOP_MODULE_blD3DevShowOrderMailsInBrowser' => 'Bestellbestätigungsmails können im Browser '. - 'angezeigt werden', - 'HELP_SHOP_MODULE_blD3DevShowOrderMailsInBrowser' => 'Die Links zu den '. - 'jeweiligen Mails sind im Stamm-Tab aufgelistet.
Für die Anzeige wird ohne Angabe der Bestellnummer die '. - 'letzte vorliegende Bestellung geladen. Über den Parameter "d3ordernr=X" kann eine bestimmten Bestellung '. - 'vorgegeben werden.', - - 'SHOP_MODULE_GROUP_d3dev_mailblock' => 'Mailversand', - 'SHOP_MODULE_blD3DevBlockMails' => 'Mails an beliebige Mailadressen werden nicht '. - 'versandt', - 'HELP_SHOP_MODULE_blD3DevBlockMails' => 'Der Mailversand wird komplett geblockt.', - 'SHOP_MODULE_sD3DevRedirectMail' => 'versendete Mails an diese Adresse umleiten', - 'HELP_SHOP_MODULE_sD3DevRedirectMail' => 'Wenn leer, erfolgt keine Umleitung. Ohne '. - 'zusätzliche Blockieroption werden die Mails dann an den original Empfänger gesendet.', -); + + * @link http://www.oxidmodule.com + */ + +$sLangName = "Deutsch"; + +// ------------------------------- +// RESOURCE IDENTITFIER = STRING +// ------------------------------- +$aLang = array( + //Navigation + 'charset' => 'UTF-8', + + 'SHOP_MODULE_GROUP_d3dev_order' => 'Bestellungsablauf manipulieren', + 'SHOP_MODULE_blD3DevAvoidDelBasket' => 'Warenkorb wird nach Bestellabschluss nicht geleert', + 'HELP_SHOP_MODULE_blD3DevAvoidDelBasket' => 'Damit kann auf der Bestellbestätigungsseite '. + '(Thankyou) durch den "zurück"-Button in den Warenkorb Schritt 4 gewechselt werden und die Bestellung erneut '. + 'abgeschickt werden. Eine erneute Bestückung des Warenkorbs ist nicht nötig. Beim erneuten Absenden wird '. + 'jeweils eine weitere Bestellung angelegt werden. Eventuell verwendete Gutscheine müssen so eingestellt '. + 'werden, dass diese mehrfach verwendet werden können.', + 'SHOP_MODULE_blD3DevShowThankyou' => 'Thankyou-Seite kann auch ohne Bestellung '. + 'aufgerufen werden', + 'HELP_SHOP_MODULE_blD3DevShowThankyou' => 'Ohne abgesendete Bestellung läßt sich die '. + 'Thankyou-Seite im Standardshop nicht aufrufen. Diese Option stellt dies für Entwicklungszwecke zur '. + 'Verfügung.
Den Link zum Seitenaufruf haben wir hier im Stamm-Tab hinterlegt. Die Seite öffnet sich in '. + 'einem neuen Browserfenster.
Für die Anzeige wird die letzte vorliegende Bestellung geladen. Über den '. + 'Parameter "d3ordernr=X" kann eine bestimmten Bestellung vorgegeben werden.', + + 'SHOP_MODULE_GROUP_d3dev_mail' => 'Mailanzeige', + 'SHOP_MODULE_blD3DevShowOrderMailsInBrowser' => 'Bestellbestätigungsmails können im Browser '. + 'angezeigt werden', + 'HELP_SHOP_MODULE_blD3DevShowOrderMailsInBrowser' => 'Die Links zu den '. + 'jeweiligen Mails sind im Stamm-Tab aufgelistet.
Für die Anzeige wird ohne Angabe der Bestellnummer die '. + 'letzte vorliegende Bestellung geladen. Über den Parameter "d3ordernr=X" kann eine bestimmten Bestellung '. + 'vorgegeben werden.', + + 'SHOP_MODULE_GROUP_d3dev_mailblock' => 'Mailversand', + 'SHOP_MODULE_blD3DevBlockMails' => 'Mails an beliebige Mailadressen werden nicht '. + 'versandt', + 'HELP_SHOP_MODULE_blD3DevBlockMails' => 'Der Mailversand wird komplett geblockt.', + 'SHOP_MODULE_sD3DevRedirectMail' => 'versendete Mails an diese Adresse umleiten', + 'HELP_SHOP_MODULE_sD3DevRedirectMail' => 'Wenn leer, erfolgt keine Umleitung. Ohne '. + 'zusätzliche Blockieroption werden die Mails dann an den original Empfänger gesendet.', +);