remove inquiry mail viewer

This commit is contained in:
Daniel Seifert 2020-11-12 08:50:36 +01:00
parent eac41bc94d
commit 767750a09a
Signed by: DanielS
GPG Key ID: 8A7C4C6ED1915C6F
12 changed files with 28 additions and 352 deletions

View File

@ -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
---

BIN
README.md

Binary file not shown.

View File

@ -10,7 +10,10 @@
"devhelper",
"developer",
"development",
"tools"
"tools",
"template",
"e-mail",
"thankyou"
],
"authors": [
{

View File

@ -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();
}
}

View File

@ -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 {}

View File

@ -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;
}
}

View File

@ -1,178 +0,0 @@
<?php
namespace D3\Devhelper\Modules\Application\Model;
use OxidEsales\Eshop\Application\Model\Basket;
use OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
use OxidEsales\Eshop\Core\Registry;
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_dev_d3inquiry extends d3_dev_d3inquiry_parent
{
protected $_oOrderBasket = null;
/**
* @return d3_dev_oxbasket
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function d3DevGetOrderBasket()
{
/** @var Basket $oBasket */
$this->_getInquiryBasket();
// unsetting bundles
$oOrderArticles = $this->getInquiryArticles();
foreach ($oOrderArticles as $sItemId => $oItem) {
if ($oItem->isBundle()) {
$oOrderArticles->offsetUnset($sItemId);
}
}
// add this order articles to basket and recalculate basket
$oBasket = $this->_addInquiryArticlesToBasket($this->getInquiryUser(), $oOrderArticles);
// recalculating basket
$oBasket->calculateBasket(true);
$oBasket->d3ClearBasketItemArticles();
return $oBasket;
}
/**
* @return string
* @throws DatabaseConnectionException
*/
public function d3getLastInquiryId()
{
$inquiryNr = (int) Registry::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;
}
}

View File

@ -1,42 +0,0 @@
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\Devhelper\Modules\Application\Model;
use OxidEsales\Eshop\Application\Model\ArticleList;
class d3_dev_d3inquiryarticle extends d3_dev_d3inquiryarticle_parent
{
/**
* @return null|ArticleList
*/
public function getCustomerAlsoBoughtThisProducts()
{
$oArticle = $this->getArticle();
return $oArticle->getCustomerAlsoBoughtThisProducts();
}
/**
* Returns true if ordered product is bundle
*
* @return bool
*/
public function isBundle()
{
return ( bool ) $this->getFieldData('oxisbundle');
}
}

View File

@ -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
*/

View File

@ -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);
}
/**

View File

@ -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

View File

@ -1,5 +1,20 @@
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com
*/
use D3\Devhelper\Application\Controller\d3dev;
use D3\Devhelper\Modules\Core as ModuleCore;
use D3\Devhelper\Modules\Application\Controller as ModuleController;
@ -45,16 +60,12 @@ $aModule = array(
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=owner_plain&d3ordernr=" target="_new">Order Owner Plain*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=user_html&d3ordernr=" target="_new">Order User HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=user_plain&d3ordernr=" target="_new">Order User Plain*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=owner_html&d3inquirynr=" target="_new">Inquiry Owner HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=owner_plain&d3inquirynr=" target="_new">Inquiry Owner Plain*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=user_html&d3inquirynr=" target="_new">Inquiry User HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=user_plain&d3inquirynr=" target="_new">Inquiry User Plain*</a></li></ul>'.
'</li>'.
'<li>blockiert &uuml;bers Framework versendete Mails oder leitet diese um</li>'.
'</ul><br>Jede dieser Optionen muss aus Sicherheitsgr&uuml;nden unter "Einstell." aktiviert werden. Weiterhin darf der Shop nicht im Produktivmodus betrieben werden.<br><br>'.
'* Ordernummer an URL erg&auml;nzen, wenn bestimmte Bestellungen angezeigt werden sollen',
'en' => ''],
'version' => '2.1.0.0',
'version' => '3.0.0.0',
'author' => 'D&sup3; 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;
}