migrate metadata, IntelliSenseHelper and class d3dev to oxid V6.0.0

This commit is contained in:
kristianhempel 2018-01-25 10:53:09 +01:00
parent f46ac0e6da
commit 62413d02ef
3 changed files with 47 additions and 42 deletions

View File

@ -14,12 +14,12 @@
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
class d3_dev_thankyou_parent extends thankyou {} 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 oxorder {} class d3_dev_oxorder_parent extends \OxidEsales\Eshop\Application\Model\Order {}
/** /**
* Class d3_dev_d3inquiry_parent * Class d3_dev_d3inquiry_parent
@ -29,24 +29,24 @@ class d3_dev_d3inquiry_parent extends d3inquiry {}
/** /**
* Class d3_dev_oxorderarticle * Class d3_dev_oxorderarticle
*/ */
class d3_dev_oxorderarticle_parent extends oxOrderArticle {} 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 oxemail {} 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 order {} 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 oxbasket {} 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 oxBasketItem {} class d3_dev_oxbasketitem_parent extends \OxidEsales\Eshop\Application\Model\BasketItem {}

View File

@ -1,5 +1,9 @@
<?php <?php
/**
use OxidEsales\Eshop\Core\Registry;
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.
* *
@ -14,7 +18,7 @@
* @link http://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
class d3dev extends oxUBase class d3dev extends \OxidEsales\EshopProfessional\Application\Controller\FrontendController
{ {
public function init() public function init()
{ {
@ -25,11 +29,10 @@ class d3dev extends oxUBase
protected function _authenticate () protected function _authenticate ()
{ {
$oConfig = oxRegistry::getConfig(); $request = oxNew(Request::class);
try { try {
$sUser = $oConfig->getRequestParameter( 'usr' ); $sUser = $request->getRequestParameter( 'usr' );
$sPassword = $oConfig->getRequestParameter( 'pwd' ); $sPassword = $request->getRequestParameter( 'pwd' );
if ( !$sUser || !$sPassword ) { if ( !$sUser || !$sPassword ) {
$sUser = $_SERVER[ 'PHP_AUTH_USER' ]; $sUser = $_SERVER[ 'PHP_AUTH_USER' ];
@ -52,16 +55,16 @@ class d3dev extends oxUBase
} }
} }
} }
/** @var oxUser $oUser */ $oUser = oxNew( \OxidEsales\Eshop\Application\Model\User::class );
$oUser = oxNew( 'oxuser' );
if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) { if ( !$sUser || !$sPassword || !$oUser->login( $sUser, $sPassword ) ) {
$oEx = oxNew( 'oxuserexception' ); /** @var \OxidEsales\Eshop\Core\Exception\UserException $oEx */
$oEx->setMessage( '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 = $oConfig->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 );
@ -70,42 +73,42 @@ class d3dev extends oxUBase
public function showOrderMailContent() public function showOrderMailContent()
{ {
header('Content-type: text/html; charset='.oxRegistry::getLang()->translateString('charset')); header('Content-type: text/html; charset='.Registry::getLang()->translateString('charset'));
if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|| false == oxRegistry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser') || false == Registry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser')
) { ) {
oxRegistry::getUtils()->redirect(oxRegistry::getConfig()->getShopUrl().'index.php?cl=start'); Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start');
} }
$sTpl = oxRegistry::getConfig()->getRequestParameter('type'); $sTpl = oxNew(Request::class)->getRequestParameter('type');
/** @var d3_dev_thankyou $oThankyou */ /** @var d3_dev_thankyou $oThankyou */
$oThankyou = oxNew('thankyou'); $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('oxemail'); $oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
echo $oEmail->d3GetOrderMailContent($oOrder, $sTpl); echo $oEmail->d3GetOrderMailContent($oOrder, $sTpl);
die(); die();
} }
public function showInquiryMailContent() public function showInquiryMailContent()
{ {
if (oxRegistry::getConfig()->getActiveShop()->oxshops__oxproductive->value if (Registry::getConfig()->getActiveShop()->oxshops__oxproductive->value
|| false == oxRegistry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser') || false == Registry::getConfig()->getConfigParam('blD3DevShowOrderMailsInBrowser')
) { ) {
oxRegistry::getUtils()->redirect(oxRegistry::getConfig()->getShopUrl().'index.php?cl=start'); Registry::getUtils()->redirect(Registry::getConfig()->getShopUrl().'index.php?cl=start');
} }
$sTpl = oxRegistry::getConfig()->getRequestParameter('type'); $sTpl = oxNew(Request::class)->getRequestParameter('type');
/** @var d3_dev_thankyou $oThankyou */ /** @var d3_dev_thankyou $oThankyou */
$oThankyou = oxNew('thankyou'); $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('oxemail'); $oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
echo $oEmail->d3GetInquiryMailContent($oOrder, $sTpl); echo $oEmail->d3GetInquiryMailContent($oOrder, $sTpl);
die(); die();
} }

View File

@ -1,4 +1,6 @@
<?php <?php
use OxidEsales\Eshop\Core\Registry;
/** /**
* Metadata version * Metadata version
*/ */
@ -12,7 +14,7 @@ $sStyle = class_exists('d3dev') ? "background-color: darkred; color: white; padd
$aModule = array( $aModule = array(
'id' => 'd3dev', 'id' => 'd3dev',
'title' => 'title' =>
(class_exists('d3utils') ? d3utils::getInstance()->getD3Logo() : 'D&sup3;') . (class_exists(D3\ModCfg\Application\Model\d3utils::class) ? D3\ModCfg\Application\Model\d3utils::getInstance()->getD3Logo() : 'D&sup3;') .
' <span style="'.$sStyle.'">TPL Development Tool</span>', ' <span style="'.$sStyle.'">TPL Development Tool</span>',
'description' => array( 'description' => array(
'de' => '<script type="text/javascript"><!-- 'de' => '<script type="text/javascript"><!--
@ -28,17 +30,17 @@ $aModule = array(
<p style="background-color: darkred; padding: 5px;"><a href="#" style="text-decoration: underline; color: white;" onclick="showNote(); return false;"><b>Sicherheitshinweis</b></a></p> <p style="background-color: darkred; padding: 5px;"><a href="#" style="text-decoration: underline; color: white;" onclick="showNote(); return false;"><b>Sicherheitshinweis</b></a></p>
<p style="display: none; background-color: darkred; color: white; padding: 5px;" id="secnote">Diese Shoperweiterung stellt Entwicklungshilfen zur Verf&uuml;gung, die im Livebetrieb sicherheitskritisch sein k&ouml;nnen. Es k&ouml;nnen Kunden- und Bestelldaten ausgelesen und auch Shopfunktionen manipuliert werden. Aktivieren Sie diese Erweiterung daher nur in einem Umfeld, in dem Sie Missbrauch ausschlie&szligen k&ouml;nnen. F&uuml;r entstandene Sch&auml;den lehnen wir jede Haftung ab.</p> <p style="display: none; background-color: darkred; color: white; padding: 5px;" id="secnote">Diese Shoperweiterung stellt Entwicklungshilfen zur Verf&uuml;gung, die im Livebetrieb sicherheitskritisch sein k&ouml;nnen. Es k&ouml;nnen Kunden- und Bestelldaten ausgelesen und auch Shopfunktionen manipuliert werden. Aktivieren Sie diese Erweiterung daher nur in einem Umfeld, in dem Sie Missbrauch ausschlie&szligen k&ouml;nnen. F&uuml;r entstandene Sch&auml;den lehnen wir jede Haftung ab.</p>
<ul><li>unterbindet L&ouml;schen des Warenkorbs nach Bestellabschluss</li>'. <ul><li>unterbindet L&ouml;schen des Warenkorbs nach Bestellabschluss</li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=thankyou&d3dev=1&d3ordernr=" target="_new">Thankyou-Seite ist ohne Bestellung aufrufbar*</a></li>'. '<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=thankyou&d3dev=1&d3ordernr=" target="_new">Thankyou-Seite ist ohne Bestellung aufrufbar*</a></li>'.
'<li>Mail-Templates k&ouml;nnen im Browser ausgegeben werden'. '<li>Mail-Templates k&ouml;nnen im Browser ausgegeben werden'.
'<ul>'. '<ul>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=owner_html&d3ordernr=" target="_new">Order Owner HTML*</a></li>'. '<li><a style="text-decoration: underline;" href="'.Registry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showOrderMailContent&type=owner_html&d3ordernr=" target="_new">Order Owner HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::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=owner_plain&d3ordernr=" target="_new">Order Owner Plain*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::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_html&d3ordernr=" target="_new">Order User HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::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=showOrderMailContent&type=user_plain&d3ordernr=" target="_new">Order User Plain*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::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_html&d3inquirynr=" target="_new">Inquiry Owner HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::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=owner_plain&d3inquirynr=" target="_new">Inquiry Owner Plain*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::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_html&d3inquirynr=" target="_new">Inquiry User HTML*</a></li>'.
'<li><a style="text-decoration: underline;" href="'.oxRegistry::getConfig()->getCurrentShopUrl(false).'index.php?cl=d3dev&fnc=showInquiryMailContent&type=user_plain&d3inquirynr=" target="_new">Inquiry User Plain*</a></li></ul>'. '<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>'.
'<li>blockiert &uuml;bers Framework versendete Mails oder leitet diese um</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>'. '</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>'.