diff --git a/src/Application/views/flow/tpl/account/inc/mail_option.tpl b/src/Application/views/flow/tpl/account/inc/mail_option.tpl
index abe7bbd..fa2fde0 100644
--- a/src/Application/views/flow/tpl/account/inc/mail_option.tpl
+++ b/src/Application/views/flow/tpl/account/inc/mail_option.tpl
@@ -5,7 +5,7 @@
[{$oViewConf->getHiddenSid()}]
[{$oViewConf->getNavFormParams()}]
-
+
diff --git a/src/Modules/Application/Controller/Admin/d3_ordermain_d3points.php b/src/Modules/Application/Controller/Admin/d3_ordermain_d3points.php
index 07eeae0..c6883b1 100644
--- a/src/Modules/Application/Controller/Admin/d3_ordermain_d3points.php
+++ b/src/Modules/Application/Controller/Admin/d3_ordermain_d3points.php
@@ -37,6 +37,7 @@ class d3_ordermain_d3points extends d3_ordermain_d3points_parent
* Return Points for Order by given Order-Id
*
* @return object
+ * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
* @throws \OxidEsales\Eshop\Core\Exception\SystemComponentException
*/
public function d3GetPointsForOrder()
diff --git a/src/Modules/Application/Controller/d3_account_points.php b/src/Modules/Application/Controller/d3_account_points.php
index f477ad7..ed3f28e 100644
--- a/src/Modules/Application/Controller/d3_account_points.php
+++ b/src/Modules/Application/Controller/d3_account_points.php
@@ -22,10 +22,13 @@
namespace D3\Points\Modules\Application\Controller;
use D3\ModCfg\Application\Model\Configuration\d3_cfg_mod;
-use D3\ModCfg\Application\Model\Log\d3log;
-use OxidEsales\Eshop\Core\Theme;
-use OxidEsales\Eshop\Application\Controller\AccountController;
+use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
+use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
use D3\Points\Application\Model\d3points;
+use Doctrine\DBAL\DBALException;
+use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
+use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
+use OxidEsales\Eshop\Core\Exception\StandardException;
/**
* Class d3_account_points
@@ -38,12 +41,12 @@ class d3_account_points extends d3_account_points_parent
/**
* @return string
- * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
- * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
- * @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
- * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ * @throws d3ShopCompatibilityAdapterException
+ * @throws d3_cfg_mod_exception
+ * @throws DBALException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
+ * @throws StandardException
*/
public function render()
{
@@ -61,12 +64,12 @@ class d3_account_points extends d3_account_points_parent
* Ob Modul aktiv ist
*
* @return bool
- * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
- * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
- * @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
- * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ * @throws d3ShopCompatibilityAdapterException
+ * @throws d3_cfg_mod_exception
+ * @throws DBALException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
+ * @throws StandardException
*/
public function d3IsD3PointsActive()
{
@@ -77,9 +80,9 @@ class d3_account_points extends d3_account_points_parent
* Gibt die Summe der aktuellen Bonuspunkte zurück
*
* @return integer
- * @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ * @throws DBALException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
*/
public function getPointsTotalSum()
{
@@ -90,7 +93,6 @@ class d3_account_points extends d3_account_points_parent
/* @var $oD3UserPoints d3points */
$oD3UserPoints = oxNew(d3points::class);
-
return $oD3UserPoints->d3GetTotalSumPoints($oUser->getId());
}
}
\ No newline at end of file
diff --git a/src/Modules/Application/Controller/d3_details_points.php b/src/Modules/Application/Controller/d3_details_points.php
index 572260d..dfcb805 100644
--- a/src/Modules/Application/Controller/d3_details_points.php
+++ b/src/Modules/Application/Controller/d3_details_points.php
@@ -23,9 +23,14 @@ namespace D3\Points\Modules\Application\Controller;
use D3\ModCfg\Application\Model\Configuration\d3_cfg_mod;
use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
+use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
use D3\ModCfg\Application\Model\Log\d3log;
use OxidEsales\Eshop\Application\Model\Rating;
use OxidEsales\Eshop\Application\Controller\ArticleDetailsController;
+use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
+use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
+use OxidEsales\Eshop\Core\Exception\StandardException;
+use OxidEsales\Eshop\Core\Exception\SystemComponentException;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Request;
use D3\Points\Application\Model\d3points;
@@ -38,7 +43,6 @@ use D3\Points\Application\Model\d3rating;
*/
class d3_details_Points extends d3_details_points_parent
{
-
private $_sModId = 'd3points';
/**
@@ -47,12 +51,12 @@ class d3_details_Points extends d3_details_points_parent
* Option: if user can get points for more reviews for on article
*
* @return null|void
- * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
+ * @throws d3ShopCompatibilityAdapterException
* @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
- * @throws \OxidEsales\Eshop\Core\Exception\StandardException
- * @throws \OxidEsales\Eshop\Core\Exception\SystemComponentException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
+ * @throws StandardException
+ * @throws SystemComponentException
* @throws d3_cfg_mod_exception
*/
public function saveReview()
@@ -81,7 +85,6 @@ class d3_details_Points extends d3_details_points_parent
if ($this->canAcceptFormData() && ($oUser = $this->getUser()) && ($oProduct = $this->getProduct())
) {
-
$dRating = Registry::get(Request::class)->getRequestEscapedParameter('artrating');
if ($dRating !== null) {
$dRating = (int)$dRating;
@@ -99,10 +102,8 @@ class d3_details_Points extends d3_details_points_parent
if ($sReviewText = trim((string)Registry::get(Request::class)->getRequestEscapedParameter('rvw_txt', true))) {
$oD3Rating->d3SetPointsForReview();
}
-
$oD3Rating->d3SendReviewMail();
}
-
$this->getD3Log()->Log(
d3log::INFO,
__CLASS__,
@@ -119,8 +120,8 @@ class d3_details_Points extends d3_details_points_parent
/**
* @return object
* @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
*/
public function getModCfg()
{
@@ -130,8 +131,8 @@ class d3_details_Points extends d3_details_points_parent
/**
* @return d3log
* @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
*/
public function getD3Log()
{
diff --git a/src/Modules/Application/Controller/d3_review_points.php b/src/Modules/Application/Controller/d3_review_points.php
index c4f4a48..b758f6c 100644
--- a/src/Modules/Application/Controller/d3_review_points.php
+++ b/src/Modules/Application/Controller/d3_review_points.php
@@ -142,5 +142,4 @@ class d3_review_points extends d3_review_points_parent
{
return $this->getModCfg()->d3getLog();
}
-
}
diff --git a/src/Modules/Application/Model/d3_oxorder_d3points.php b/src/Modules/Application/Model/d3_oxorder_d3points.php
index 6212378..49b8727 100644
--- a/src/Modules/Application/Model/d3_oxorder_d3points.php
+++ b/src/Modules/Application/Model/d3_oxorder_d3points.php
@@ -22,12 +22,16 @@ namespace D3\Points\Modules\Application\Model;
use D3\ModCfg\Application\Model\Configuration\d3_cfg_mod;
use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
+use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
use D3\ModCfg\Application\Model\Log\d3log;
+use Doctrine\DBAL\DBALException;
use \OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Application\Model\User;
use D3\Points\Application\Model\d3points;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
+use OxidEsales\Eshop\Core\Exception\StandardException;
+use OxidEsales\Eshop\Core\Exception\SystemComponentException;
/**
* Class d3_oxorder_d3points
@@ -74,9 +78,9 @@ class d3_oxorder_d3points extends d3_oxorder_d3points_parent
* @return bool
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
- * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
- * @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ * @throws d3ShopCompatibilityAdapterException
+ * @throws DBALException
+ * @throws StandardException
* @throws d3_cfg_mod_exception
*/
public function d3ResetOrders($iStatus, $blStatus)
@@ -123,14 +127,12 @@ MYSQL;
$rs = $oDb->Execute($sUpdate);
return $rs;
- } else {
- return false;
}
+ return false;
}
/**
* @return User
- * @throws \OxidEsales\Eshop\Core\Exception\SystemComponentException
*/
public function d3getOrderUser()
{
diff --git a/src/Modules/Application/Model/d3_oxuser_points.php b/src/Modules/Application/Model/d3_oxuser_points.php
index 98dbec6..1f5a0fc 100644
--- a/src/Modules/Application/Model/d3_oxuser_points.php
+++ b/src/Modules/Application/Model/d3_oxuser_points.php
@@ -21,9 +21,16 @@
namespace D3\Points\Modules\Application\Model;
use D3\ModCfg\Application\Model\Configuration\d3_cfg_mod;
+use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
+use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
use D3\ModCfg\Application\Model\Log\d3log;
+use Doctrine\DBAL\DBALException;
use OxidEsales\Eshop\Core\Config;
use \OxidEsales\Eshop\Core\DatabaseProvider;
+use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
+use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
+use OxidEsales\Eshop\Core\Exception\StandardException;
+use OxidEsales\Eshop\Core\Exception\SystemComponentException;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Request;
use D3\Points\Application\Model\d3points;
@@ -44,12 +51,12 @@ class d3_oxuser_points extends d3_oxuser_points_parent
* @param bool $blIsMallMode
*
* @return bool
- * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
- * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
- * @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
- * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ * @throws d3ShopCompatibilityAdapterException
+ * @throws d3_cfg_mod_exception
+ * @throws DBALException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
+ * @throws StandardException
*/
public function d3CheckUserWithAccount($blIsMallMode)
{
@@ -80,12 +87,12 @@ class d3_oxuser_points extends d3_oxuser_points_parent
* if "Kunden ohne Kundenkonto erhalten Bonuspunkte" is not set/false --> check for password, it returns fals if not password is set
*
* @return bool
- * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
- * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
- * @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
- * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ * @throws d3ShopCompatibilityAdapterException
+ * @throws d3_cfg_mod_exception
+ * @throws DBALException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
+ * @throws StandardException
*/
protected function _d3blUserHasAccount()
{
@@ -108,12 +115,12 @@ class d3_oxuser_points extends d3_oxuser_points_parent
* if oxactive == 0/false --> return false
*
* @return bool
- * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
- * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
- * @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
- * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ * @throws d3ShopCompatibilityAdapterException
+ * @throws d3_cfg_mod_exception
+ * @throws DBALException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
+ * @throws StandardException
*/
protected function _d3blUserIsActive()
{
@@ -135,12 +142,12 @@ class d3_oxuser_points extends d3_oxuser_points_parent
* @param bool $blIsMallMode
*
* @return bool
- * @throws \D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException
- * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
- * @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
- * @throws \OxidEsales\Eshop\Core\Exception\StandardException
+ * @throws d3ShopCompatibilityAdapterException
+ * @throws d3_cfg_mod_exception
+ * @throws DBALException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
+ * @throws StandardException
*/
protected function _d3blUserHasShopId($blIsMallMode)
{
@@ -168,8 +175,8 @@ class d3_oxuser_points extends d3_oxuser_points_parent
* @param string $sUserId
*
* @return bool
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
*/
public function d3UpdateReminderDate($sUserId)
{
@@ -184,9 +191,9 @@ class d3_oxuser_points extends d3_oxuser_points_parent
* @param string $sRecEmail
*
* @return bool
- * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
+ * @throws d3_cfg_mod_exception
* @throws \Exception
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws DatabaseConnectionException
*/
public function setCreditPointsForRegistrant_( $sUserId,$sRecEmail )
{
@@ -203,9 +210,9 @@ class d3_oxuser_points extends d3_oxuser_points_parent
/**
* @return bool
- * @throws \D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception
+ * @throws d3_cfg_mod_exception
* @throws \Exception
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
+ * @throws DatabaseConnectionException
*/
public function setCreditPointsForInvite_()
{
@@ -223,10 +230,10 @@ class d3_oxuser_points extends d3_oxuser_points_parent
/**
* @return null|object
- * @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
- * @throws \OxidEsales\Eshop\Core\Exception\SystemComponentException
+ * @throws DBALException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
+ * @throws SystemComponentException
*/
public function d3GetAllPoints()
{
@@ -241,9 +248,9 @@ class d3_oxuser_points extends d3_oxuser_points_parent
/**
* @return d3_cfg_mod
- * @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ * @throws DBALException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
*/
public function getModCfg()
{
@@ -252,9 +259,9 @@ class d3_oxuser_points extends d3_oxuser_points_parent
/**
* @return d3log
- * @throws \Doctrine\DBAL\DBALException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseConnectionException
- * @throws \OxidEsales\Eshop\Core\Exception\DatabaseErrorException
+ * @throws DBALException
+ * @throws DatabaseConnectionException
+ * @throws DatabaseErrorException
*/
public function getD3Log()
{
diff --git a/src/Modules/Application/Model/d3_oxvoucher_points.php b/src/Modules/Application/Model/d3_oxvoucher_points.php
index 44be51e..9c91bc3 100644
--- a/src/Modules/Application/Model/d3_oxvoucher_points.php
+++ b/src/Modules/Application/Model/d3_oxvoucher_points.php
@@ -17,10 +17,7 @@
namespace D3\Points\Modules\Application\Model;
-use D3\ModCfg\Application\Model\Configuration\d3_cfg_mod;
-use D3\ModCfg\Application\Model\Log\d3log;
use OxidEsales\Eshop\Application\Model\Voucher;
-use OxidEsales\Eshop\Application\Model\VoucherSerie;
use OxidEsales\Eshop\Core\Exception\VoucherException;
use OxidEsales\Eshop\Core\Exception\oxObjectException;
use OxidEsales\Eshop\Core\Exception\oxVoucherException;
@@ -54,11 +51,10 @@ class d3_oxvoucher_points extends d3_oxvoucher_points_parent
return parent::getDiscountValue($dPrice);
}
+ $dDiscount = $this->getFieldData('oxdiscount') / 100 * $dPrice;
if ($oSeries->getFieldData('oxdiscounttype') == 'absolute') {
$oCur = $this->getConfig()->getActShopCurrencyObject();
$dDiscount = $this->getFieldData('oxdiscount') * $oCur->rate;
- } else {
- $dDiscount = $this->getFieldData('oxdiscount') / 100 * $dPrice;
}
if ($dDiscount > $dPrice) {
@@ -78,9 +74,9 @@ class d3_oxvoucher_points extends d3_oxvoucher_points_parent
*/
public function d3GetVoucherSeriesId()
{
- /* @var $od3_d3points_d3points d3points */
- $od3_d3points_d3points = oxnew(d3points::class);
- return $od3_d3points_d3points->d3GetVoucherSeriesId();
+ /* @var $oD3points d3points */
+ $oD3points = oxnew(d3points::class);
+ return $oD3points->d3GetVoucherSeriesId();
}
}
diff --git a/src/Modules/Core/d3_oxemail_points.php b/src/Modules/Core/d3_oxemail_points.php
index 9301acf..41abe47 100644
--- a/src/Modules/Core/d3_oxemail_points.php
+++ b/src/Modules/Core/d3_oxemail_points.php
@@ -124,6 +124,8 @@ class d3_oxemail_points extends d3_oxemail_points_parent
private $_sModId = 'd3points';
+ private $_sReturnMessage = '';
+
/**
* Mail with VoucherCode
* after voucher is created by user
@@ -229,8 +231,6 @@ class d3_oxemail_points extends d3_oxemail_points_parent
*/
public function d3SendRemindPointsMail(User $oUser, $iLang = 0)
{
- $blSend = false;
-
//sets language of shop
$iCurrLang = $iLang;
@@ -397,8 +397,6 @@ class d3_oxemail_points extends d3_oxemail_points_parent
*/
function d3SendPointsForReviewMail(Article $oProduct, User $oUser)
{
- $blSend = false;
-
//sets language of shop
$iLang = Registry::get(Config::class)->getActiveShop()->getLanguage();
$iCurrLang = $iLang;
@@ -546,7 +544,6 @@ class d3_oxemail_points extends d3_oxemail_points_parent
// add to user history
$this->d3WriteRemark($this->getAltBody(), $oUser->getId(), "r");
-
return $blSend;
}
@@ -680,6 +677,7 @@ class d3_oxemail_points extends d3_oxemail_points_parent
*/
public function d3SendMailForManuelPoints(User $oUser, d3points $oPoint, $iLang = 0)
{
+
$myConfig = Registry::get(Config::class);
//sets language of shop
$iCurrLang = $iLang;
@@ -699,7 +697,6 @@ class d3_oxemail_points extends d3_oxemail_points_parent
//create messages
$oLang = Registry::getLang();
-
// dodger #1469 - we need to patch security here as we do not use standard template dir, so smarty stops working
$aStore['INCLUDE_ANY'] = $oSmarty->security_settings['INCLUDE_ANY'];
//V send email in order language
@@ -746,7 +743,7 @@ class d3_oxemail_points extends d3_oxemail_points_parent
if ($this->getModCfg()->hasTestMode()) {
$sEMailAdress = $this->d3GetEMAILSTEST();
} else {
- $sEMailAdress = $oUser->getFieldData('oxusername');
+ $sEMailAdress = $oUser->getFieldData('oxusername');
}
$sFullName = $oUser->getFieldData('oxfname') . " " . $oUser->getFieldData('oxlname');
@@ -790,8 +787,10 @@ class d3_oxemail_points extends d3_oxemail_points_parent
$sLine,
"Template: " . $sTemplate . " not found"
);
+
if ($this->getModCfg()->hasDebugMode()) {
- echo "Template: " . $sTemplate . " not found";
+ //todo: output as errosmessage
+ $this->_d3AddReturnMessage("Template: " . $sTemplate . " not found");
}
}
@@ -830,7 +829,6 @@ class d3_oxemail_points extends d3_oxemail_points_parent
{
/* @var $od3points d3points */
$od3points = oxnew(d3points::class);
-
return $od3points->d3WriteRemark($sMessage, $sUserId, $sType);
}
@@ -850,7 +848,6 @@ class d3_oxemail_points extends d3_oxemail_points_parent
if ($this->getModCfg()->getValue('d3points_EMAILS_TEST') != '') {
return $this->getModCfg()->getValue('d3points_EMAILS_TEST');
}
-
$sMessage = 'Testmodus is active, but no mailaddress ist set. Us instead Infomailaddress.';
$this->getModCfg()->d3getLog()->Log(
d3log::WARNING,
@@ -862,7 +859,8 @@ class d3_oxemail_points extends d3_oxemail_points_parent
);
if ($this->getModCfg()->hasDebugMode()) {
- echo $sMessage - PHP_EOL;
+ //todo: output as errosmessage
+ $this->_d3AddReturnMessage($sMessage);
}
$oShop = $this->_getShop();
@@ -883,6 +881,48 @@ class d3_oxemail_points extends d3_oxemail_points_parent
return $this->getModCfg()->getValue('d3points_EMAILS_BCC');
}
+ ###########
+ ##Internal-Message-System
+
+ /**
+ * Return Internal-Message
+ * to collect Error and Success-Messages
+ *
+ * @return String
+ */
+ public function d3GetReturnMessage()
+ {
+ return $this->_sReturnMessage;
+ }
+
+ /**
+ * @param $sMessage
+ */
+ public function d3SetReturnMessage($sMessage)
+ {
+ $this->_sReturnMessage = $sMessage;
+ }
+
+ /**
+ * Add Text to Internal-Message
+ * add \n on the end
+ *
+ * @param string $sMessage
+ */
+ protected function _d3AddReturnMessage($sMessage)
+ {
+ $this->_sReturnMessage .= PHP_EOL . $sMessage;
+ }
+
+ /**
+ * Clear Internal-Message
+ *
+ */
+ protected function _d3ClearReturnMessage()
+ {
+ $this->_sReturnMessage = '';
+ }
+
/**
* @return d3_cfg_mod
* @throws \Doctrine\DBAL\DBALException
diff --git a/src/Setup/d3_points_update.php b/src/Setup/d3_points_update.php
index e7373d2..cf8608d 100644
--- a/src/Setup/d3_points_update.php
+++ b/src/Setup/d3_points_update.php
@@ -31,14 +31,14 @@ class d3_points_update extends d3install_updatebase
{
public $sModKey = 'd3points';
public $sModName = 'Bonuspunkte';
- public $sModVersion = '5.0.1.0';
- public $sModRevision = '870';
- public $sBaseConf = 'tM7v2==bEllUTI2UDlma2ZDZkxTRXlEQ1Y5R2Z2c3ZjOUdVRXBxYjBYM3JpeEt5ZEFxT254VkQ0Z2NTc
-HJpL3JGZDVQUm9SYXIzWlF0T2Z1eGlBdFNEZXhMSDBFTzc1dGlZcXkyRmkrd0llVFFJZ2orWGtuWU8zW
-HhIRUFOTko3YUdDVE1Fb1AxenNhbFpURk9meE5uM20raDNlUlpMNVdxTCs3Q2wyMS9JWEY4dHdKS1Fwb
-zdndXdwWGlGU3ZTNWVPaGd2WjllYmtVVTZlQTZ5WFZQV05uckxWRHExcmRpOTBNeGdSN01iVzlDeGsxV
-kw1cUZZR3dnNWh4SGJ1MS9MWlBjR091WElyMm42ck12bDNRZklFMm90cmx5dDJjVU8zdW5RQ3d1SXl5S
-2FIdks1NzRHSGNNQVlxVldSY2JUMzdlVnI=';
+ public $sModVersion = '5.0.2.0';
+ public $sModRevision = '5020';
+ public $sBaseConf = 'ikjv2==eHNaaFNQdmovK0s1RHNxRzZENDhQMnlHNG1TR1pSZDJ2dVR2Q043VExXWTVVZVVkbHVMMGY3M
+UJaQjFTVklTRGpWK0Z3K25mamc5bVIyb21nTGJncE5FT0RjdkhPSEpQMm1NYkJoQ0d0dWI2K3czbVNvS
+DlGOVFRS1VGTnRaY05tWm5BWHkxZVB6VmFlRVkrTUNGcEI0TzF4dE8wWUlHSG9TbUc1TFlCR1RMdGRuU
+UVOUjZUMjV6aFZudUFrZEFsQXJhemh0NFZQZkNlNndHY05oTThtNHgybitFS3JtTUIrdFc5ekx0aVAxZ
+jFYL1h6UUZPMTZXcG0wNHhQaGdFb2hrc0RQWjA2UDRaUmhkNFRWY0dFQ21ZV25RLzE5SUFUSGlKZm94N
+3NuVXdoVGNSODgvTGkxMnQzQ25pWFZDZnk=';
public $sRequirements = '';
public $sBaseValue = '';
diff --git a/src/metadata.php b/src/metadata.php
index 1a79a9e..38a018f 100644
--- a/src/metadata.php
+++ b/src/metadata.php
@@ -24,7 +24,7 @@ $aModule = array(
),
'lang' => 'de',
'thumbnail' => 'picture.png',
- 'version' => '5.0.1.0',
+ 'version' => '5.0.2.0',
'author' => 'D³ Data Development',
'url' => 'http://www.shopmodule.com',
'email' => 'support@shopmodule.com',
@@ -45,6 +45,7 @@ $aModule = array(
'd3rating' => \D3\Points\Application\Model\d3rating::class,
'utils_points' => \D3\Points\Application\Model\utils_points::class,
'd3prerunchecks' => \D3\Points\Application\Model\d3prerunchecks::class,
+ 'd3conditions' => \D3\Points\Application\Model\d3conditions::class,
'd3_d3points_demo' => \D3\Points\Application\Controller\Admin\demo::class,
'd3_d3points_licence' => \D3\Points\Application\Controller\Admin\licence::class,
diff --git a/src/public/d3_cron_points.php b/src/public/d3_cron_points.php
index 5a712d8..599508b 100644
--- a/src/public/d3_cron_points.php
+++ b/src/public/d3_cron_points.php
@@ -25,7 +25,6 @@
namespace D3\Points\publica;
-use Composer\Config;
use D3\ModCfg\Application\Model\Configuration\d3_cfg_mod;
use D3\ModCfg\Application\Model\Log\d3log;
use \Exception;
@@ -35,6 +34,8 @@ use OxidEsales\Eshop\Core\Session;
use D3\Points\Application\Model\utils_points;
use D3\Points\Application\Model\d3points;
use OxidEsales\Eshop\Core\Controller\BaseController;
+use OxidEsales\Eshop\Core\Config;
+use OxidEsales\EshopCommunity\Core\Email;
require_once dirname(__FILE__) . "/../../../../bootstrap.php";
@@ -67,7 +68,7 @@ class d3_Cron_Points extends BaseController
{
//Shopid setzten
$sShopId = utils_points::d3_d3pointsUtils_CheckShopId();
- Registry::get(\OxidEsales\Eshop\Core\Config::class)->setShopId($sShopId);
+ Registry::get(Config::class)->setShopId($sShopId);
//Modul aktiv
if (!$this->getModCfg()->isActive())
@@ -87,11 +88,12 @@ class d3_Cron_Points extends BaseController
$sGetAccessKey = Registry::get(Request::class)->getRequestEscapedParameter('key');
$sValidAccessKey = $this->getModCfg()->getValue('d3points_ACCESSKEY');
- if (!$sValidAccessKey)
+ if (!$sValidAccessKey) {
$sValidAccessKey = $this->_sDefaultAccessKey;
+ }
if (($_SERVER['REMOTE_ADDR'] || $_SERVER['HTTP_USER_AGENT']) && $sValidAccessKey != $sGetAccessKey)
{
- $this->getD3Log()->Log(d3log::CRITICAL, __CLASS__, __FUNCTION__, __LINE__, "shutdown", " access with browser!. ");
+ $this->getD3Log()->Log(d3log::CRITICAL, __CLASS__, __FUNCTION__, __LINE__, "shutdown", "access with browser!.");
die("security shutdown");
}
@@ -106,7 +108,6 @@ class d3_Cron_Points extends BaseController
}
//Go to d3points an perform some actions
-
/** @var d3points $od3points */
$od3points = oxnew(d3points::class);
$ret = 'Start CronJob';
@@ -116,6 +117,12 @@ class d3_Cron_Points extends BaseController
$ret.= $sStatus;
}
+ if(trim($this->getModCfg()->getValue('sd3points_FNC_CRONJOB_SEND_STATUS_TO')) != '') {
+ $oMail = oxNew(Email::class);
+ $sTextAdd = 'CronJob Bonuspunkte - ' . date('H:i:s d.m.Y') . PHP_EOL;
+ $oMail->sendEmail($this->getModCfg()->getValue('sd3points_FNC_CRONJOB_SEND_STATUS_TO'), 'CronJob Bonuspunkte', nl2br($sTextAdd . $sStatus));
+ }
+
$this->getD3Log()->Log(d3log::INFO, __CLASS__, __FUNCTION__, __LINE__, "End CronJob-Bonuspunkte Report", $ret);
$ret.=' End CronJob';
@@ -145,8 +152,6 @@ class d3_Cron_Points extends BaseController
{
return $this->getModCfg()->d3getLog();
}
-
-
}
$oBV = new d3_Cron_Points;
$oBV->init();
\ No newline at end of file