Ordermanager/src/Application/Controller/Admin/d3_cfg_ordermanageritem_set...

112 lines
3.4 KiB
PHP
Raw Normal View History

2017-12-20 13:44:53 +01:00
<?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 <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
namespace D3\Ordermanager\Application\Controller\Admin;
2018-02-20 09:37:52 +01:00
use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
2017-12-20 13:44:53 +01:00
use D3\Ordermanager\Application\Model\d3ordermanager;
use D3\ModCfg\Application\Controller\Admin\d3_cfg_mod_main;
use D3\ModCfg\Application\Model\Configuration\d3_cfg_mod;
2018-02-20 09:37:52 +01:00
use Doctrine\DBAL\DBALException;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
use OxidEsales\Eshop\Core\Exception\DatabaseErrorException;
use OxidEsales\Eshop\Core\Exception\StandardException;
2017-12-20 13:44:53 +01:00
use OxidEsales\Eshop\Core\Model\ListModel;
use OxidEsales\Eshop\Core\Model\MultiLanguageModel;
use OxidEsales\Eshop\Core\Registry;
class d3_cfg_ordermanageritem_settings extends d3_cfg_mod_main
{
protected $_sSetModId = 'd3_ordermanager';
protected $_sMenuItemTitle = 'd3mxordermanager';
protected $_blUseOwnOxid = true;
protected $_aNaviItems = array(
'new' => array(
'sScript' => 'top.oxid.admin.editThis( -1 );return false;',
'sTranslationId' => 'D3_TOOLTIPS_NEWORDERMANAGER',
),
);
protected $_sD3ObjectClass = d3ordermanager::class;
/**
* @return array
*/
public function getItemFolders()
{
return Registry::getConfig()->getConfigParam('aOrderfolder');
}
/**
* @return ListModel
*/
public function getGroupsList()
{
/** @var $oGroupsList ListModel */
$oGroupsList = oxNew(ListModel::class);
$oGroupsList->init('oxgroups');
return $this->_getObjectList($oGroupsList);
}
/**
* @param ListModel $oObjectList
*
* @return ListModel
*/
protected function _getObjectList($oObjectList)
{
startProfile(__METHOD__);
/** @var $oObject MultiLanguageModel */
$oObject = $oObjectList->getBaseObject();
if ($oObject->isMultilang()) {
$oObject->setLanguage(Registry::getLang()->getTplLanguage());
}
$sFieldList = $oObject->getSelectFields();
$sQ = "select {$sFieldList} from {$oObject->getViewName()}";
$oObjectList->selectString($sQ);
stopProfile(__METHOD__);
return $oObjectList;
}
/**
* @return bool
*/
public function isEditMode()
{
return true;
}
/**
* @return string
2018-02-20 09:37:52 +01:00
* @throws d3ShopCompatibilityAdapterException
* @throws d3_cfg_mod_exception
* @throws DBALException
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
* @throws StandardException
2017-12-20 13:44:53 +01:00
*/
public function getRestrictionMessage()
{
return sprintf(
Registry::getLang()->translateString('D3_ORDERMANAGER_ERROR_RESTRICTIONS'),
d3_cfg_mod::get($this->_sSetModId)->getLicenseConfigData('sEditionId', 'unknown')
);
}
}