diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ebd385..d9690d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,10 @@ All notable changes to this project will be documented in this file. --- -## 2.1.0.0 (2020-11-11) +## 3.0.0.0 (2020-11-11) ### Changed -- Modul verwendbar in OXID 6.2 +- Modul verwendbar in OXID 6.2, deprecated Code bestmöglich entfernt +- Anzeige von Anfragemails entfernt, da dazugehöriges Modul nicht weiter entwickelt wird --- diff --git a/README.md b/README.md index 2d8d3cb..3bc10c4 100644 Binary files a/README.md and b/README.md differ diff --git a/composer.json b/composer.json index d88b763..ecc56fc 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,10 @@ "devhelper", "developer", "development", - "tools" + "tools", + "template", + "e-mail", + "thankyou" ], "authors": [ { diff --git a/src/Application/Controller/d3dev.php b/src/Application/Controller/d3dev.php index 02e77cd..4f1a120 100644 --- a/src/Application/Controller/d3dev.php +++ b/src/Application/Controller/d3dev.php @@ -103,27 +103,4 @@ class d3dev extends FrontendController echo $oEmail->d3GetOrderMailContent($oOrder, $sTpl); die(); } - - /** - * @throws DatabaseConnectionException - */ - public function showInquiryMailContent() - { - if (Registry::getConfig()->getActiveShop()->isProductiveMode() - || false == Registry::getConfig()->getConfigParam(ModuleCore\d3_dev_conf::OPTION_SHOWMAILSINBROWSER) - ) { - Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start'); - } - - $sTpl = Registry::getRequest()->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(); - } } diff --git a/src/IntelliSenseHelper.php b/src/IntelliSenseHelper.php index 9cb0aea..38ff8e0 100644 --- a/src/IntelliSenseHelper.php +++ b/src/IntelliSenseHelper.php @@ -16,7 +16,6 @@ namespace D3\Devhelper\Modules\Application\Controller { - use OxidEsales\Eshop\Application\Controller\ThankYouController; class d3_dev_thankyou_parent extends ThankYouController {} @@ -24,7 +23,6 @@ namespace D3\Devhelper\Modules\Application\Controller namespace D3\Devhelper\Modules\Application\Model { - use OxidEsales\Eshop\Application\Controller\OrderController; use OxidEsales\Eshop\Application\Model\Basket; use OxidEsales\Eshop\Application\Model\BasketItem; @@ -33,10 +31,6 @@ namespace D3\Devhelper\Modules\Application\Model class d3_dev_oxorder_parent extends Order {} - class d3_dev_d3inquiry_parent extends d3inquiry {} - - class d3_dev_d3inquiryarticle_parent extends d3inquiryarticle {} - class d3_dev_oxorderarticle_parent extends OrderArticle {} class d3_dev_oxbasket_parent extends Basket {} @@ -48,7 +42,6 @@ namespace D3\Devhelper\Modules\Application\Model namespace D3\Devhelper\Modules\Core { - use OxidEsales\Eshop\Core\Email; class d3_dev_oxemail_parent extends Email {} diff --git a/src/Modules/Application/Controller/d3_dev_thankyou.php b/src/Modules/Application/Controller/d3_dev_thankyou.php index e992a2f..271c22d 100644 --- a/src/Modules/Application/Controller/d3_dev_thankyou.php +++ b/src/Modules/Application/Controller/d3_dev_thankyou.php @@ -3,7 +3,6 @@ namespace D3\Devhelper\Modules\Application\Controller; // .../?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\Core\d3_dev_conf; use Exception; @@ -172,21 +171,4 @@ class d3_dev_thankyou extends d3_dev_thankyou_parent 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; - } } diff --git a/src/Modules/Application/Model/d3_dev_d3inquiry.php b/src/Modules/Application/Model/d3_dev_d3inquiry.php deleted file mode 100644 index 065e8b1..0000000 --- a/src/Modules/Application/Model/d3_dev_d3inquiry.php +++ /dev/null @@ -1,178 +0,0 @@ - - * @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::getRequest()->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; - } -} diff --git a/src/Modules/Application/Model/d3_dev_d3inquiryarticle.php b/src/Modules/Application/Model/d3_dev_d3inquiryarticle.php deleted file mode 100644 index b12f9e7..0000000 --- a/src/Modules/Application/Model/d3_dev_d3inquiryarticle.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @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'); - } -} diff --git a/src/Modules/Application/Model/d3_dev_oxbasket.php b/src/Modules/Application/Model/d3_dev_oxbasket.php index 2c47f3a..1aa38d2 100644 --- a/src/Modules/Application/Model/d3_dev_oxbasket.php +++ b/src/Modules/Application/Model/d3_dev_oxbasket.php @@ -70,7 +70,7 @@ class d3_dev_oxbasket extends d3_dev_oxbasket_parent /** * @param OrderArticle $oOrderArticle * - * @return null + * @return d3_dev_oxbasketitem|null * @throws oxArticleInputException * @throws oxNoArticleException */ diff --git a/src/Modules/Application/Model/d3_dev_oxorder.php b/src/Modules/Application/Model/d3_dev_oxorder.php index 75ce9d2..20eabf5 100644 --- a/src/Modules/Application/Model/d3_dev_oxorder.php +++ b/src/Modules/Application/Model/d3_dev_oxorder.php @@ -59,12 +59,13 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent $orderNr = (int) Registry::getRequest()->getRequestEscapedParameter('d3ordernr'); $sWhere = 1; if ($orderNr) { - $sWhere = ' oxordernr = ' . DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->quote($orderNr); + $sWhere = ' oxordernr = ? '; } + $parameters = [$orderNr]; $sSelect = "SELECT oxid FROM ".oxNew(Order::class)->getViewName()." 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, $parameters); } /** diff --git a/src/Modules/Core/d3_dev_oxemail.php b/src/Modules/Core/d3_dev_oxemail.php index d894833..3398e53 100644 --- a/src/Modules/Core/d3_dev_oxemail.php +++ b/src/Modules/Core/d3_dev_oxemail.php @@ -91,7 +91,7 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent } /** - * from OXID 6.2, required because private in Email class + * required because private in Email class * Templating instance getter * * @return TemplateRendererInterface @@ -105,72 +105,6 @@ class d3_dev_oxemail extends d3_dev_oxemail_parent return $bridge->getTemplateRenderer(); } - /** - * @param ModuleModel\d3_dev_d3inquiry $oInquiry - * - * @param $sType - * - * @return mixed|string - */ - public function d3GetInquiryMailContent($oInquiry, $sType ) - { - if (Registry::getConfig()->getActiveShop()->isProductiveMode()) { - return ''; - } - - switch (strtolower($sType)) { - 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 = Registry::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 - $this->setViewData("inquiry", $oInquiry); - - // Process view data array through oxoutput processor - $this->_processViewArray(); - - $renderer = $this->getRenderer(); - return $renderer->renderTemplate($myConfig->getTemplatePath($sTpl, false), $this->getViewData()); - } - /** * @param $aRecInfo * @param array $aCc diff --git a/src/metadata.php b/src/metadata.php index 094c15a..7f9791d 100644 --- a/src/metadata.php +++ b/src/metadata.php @@ -1,5 +1,20 @@ + * @link http://www.oxidmodule.com + */ + use D3\Devhelper\Application\Controller\d3dev; use D3\Devhelper\Modules\Core as ModuleCore; use D3\Devhelper\Modules\Application\Controller as ModuleController; @@ -45,16 +60,12 @@ $aModule = array( '
  • Order Owner Plain*
  • '. '
  • Order User HTML*
  • '. '
  • Order User Plain*
  • '. - '
  • Inquiry Owner HTML*
  • '. - '
  • Inquiry Owner Plain*
  • '. - '
  • Inquiry User HTML*
  • '. - '
  • Inquiry User Plain*
  • '. ''. '
  • blockiert übers Framework versendete Mails oder leitet diese um
  • '. '
    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' => ''], - 'version' => '2.1.0.0', + 'version' => '3.0.0.0', 'author' => 'D³ Data Development (Inh.: Thomas Dartsch)', 'email' => 'support@shopmodule.com', 'url' => 'http://www.oxidmodule.com/', @@ -105,9 +116,3 @@ $aModule = array( ], ], ); - - -if (class_exists('d3inquiry')) { - $aModule['extend']['d3inquiry'] = ModuleModel\d3_dev_d3inquiry::class; - $aModule['extend']['d3inquiryarticle'] = ModuleModel\d3_dev_d3inquiryarticle::class; -}