2022-06-13 15:38:31 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace D3\Heidelpay\Setup;
|
|
|
|
|
|
|
|
use D3\Heidelpay\Models\Configuration\ModProfile;
|
|
|
|
use D3\Heidelpay\Models\Factory;
|
|
|
|
use D3\Heidelpay\Models\Transactionlog\Reader\Heidelpay as TransactionlogReader;
|
|
|
|
use D3\ModCfg\Application\Model\Configuration\d3_cfg_mod;
|
|
|
|
use D3\ModCfg\Application\Model\d3database;
|
|
|
|
use D3\ModCfg\Application\Model\d3str;
|
|
|
|
use D3\ModCfg\Application\Model\Exception\d3_cfg_mod_exception;
|
|
|
|
use D3\ModCfg\Application\Model\Exception\d3ShopCompatibilityAdapterException;
|
|
|
|
use D3\ModCfg\Application\Model\Install\d3install_updatebase;
|
|
|
|
use D3\ModCfg\Application\Model\Installwizzard\d3installconfirmmessage;
|
|
|
|
use D3\ModCfg\Application\Model\Transactionlog\d3transactionlog;
|
|
|
|
use Doctrine\DBAL\DBALException;
|
|
|
|
use Exception;
|
|
|
|
use OxidEsales\Eshop\Core\DatabaseProvider;
|
|
|
|
use OxidEsales\Eshop\Core\Exception\ConnectionException;
|
|
|
|
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\Model\BaseModel;
|
|
|
|
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 (C) D3 Data Development (Inh. Thomas Dartsch)
|
|
|
|
* @author D3 Data Development <support@shopmodule.com>
|
|
|
|
* @link http://www.oxidmodule.com
|
|
|
|
*/
|
|
|
|
class InstallRoutine extends d3install_updatebase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $sModKey = 'd3heidelpay';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $sModName = 'Unzer';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2022-08-31 12:08:04 +02:00
|
|
|
public $sModVersion = '6.3.0.0';
|
2022-06-13 15:38:31 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $sMinModCfgVersion = '5.3.0.0';
|
|
|
|
|
|
|
|
/** @var string @deprecated since 2016-04-13 */
|
2022-08-31 12:08:04 +02:00
|
|
|
public $sModRevision = '6300';
|
2022-06-13 15:38:31 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $sBaseConf = '--------------------------------------------------------------------------------
|
2022-08-31 12:08:04 +02:00
|
|
|
ZNBv2==Z3pRaXlQV2p4QldiYVdhRHozd2preDBrRjlrekNKL09oNG9VdmEzZyt0UVJQZ2NmSlBUaDk2K
|
|
|
|
0ZFUmowWFRPbWk0MTZwK01rU2g3OFc2VWdoV3BodVNDcFdUVTExdkQxYlIyZnprWFNFWk9CMWNXOGtUc
|
|
|
|
3pnYStmU0NaZ3FPTEFaTmdBOXJmajJLUnRnTjRrblcvYTlodWZ4SDh4ZFBtc1B6QzRCSWZmS0dYMnJna
|
|
|
|
VozeXRHTEZiemtjaTNtbGJGeEt1Q3VReDAxbTZkK1VpV2d4M3Y3WXovbll1d3lJc0dNTUdHdDNQTXV6T
|
|
|
|
kgySzFhYW5vQ0lpSzdabUxRRlFqRFJJRzJ6bk5CSlluZU5VcjRMOWFwYS9yL0ZuOE5DWFZRZkpGVEdQU
|
|
|
|
kpkQWJPVVZzUlc1cHV3Tkh3eURZa0FzMEQ0ZFR4b3Z5U3hIRS9sWS9iWkVJenVnPT0=
|
2022-06-13 15:38:31 +02:00
|
|
|
--------------------------------------------------------------------------------';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $sRequirements = '';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $sBaseValue = 'TyUzQTglM0ElMjJzdGRDbGFzcyUyMiUzQTI3JTNBJTdCcyUzQTM0JTNBJTIyZDNfY2ZnX21vZF9fZDNoZWlkZWxwYXlfYmxUZXN0bW9kZSUyMiUzQnMlM0ExJTNBJTIyMSUyMiUzQnMlM0EzOSUzQSUyMmQzX2NmZ19tb2RfX2QzaGVpZGVscGF5X3NTZWN1cml0eVNlbmRlciUyMiUzQnMlM0EwJTNBJTIyJTIyJTNCcyUzQTMxJTNBJTIyZDNfY2ZnX21vZF9fZDNoZWlkZWxwYXlfc1VzZXJJRCUyMiUzQnMlM0EwJTNBJTIyJTIyJTNCcyUzQTMzJTNBJTIyZDNfY2ZnX21vZF9fZDNoZWlkZWxwYXlfc1Bhc3N3b3JkJTIyJTNCcyUzQTAlM0ElMjIlMjIlM0JzJTNBNDMlM0ElMjJkM19jZmdfbW9kX19kM2hlaWRlbHBheV9zU2VjdXJpdHlTZW5kZXJUZXN0JTIyJTNCcyUzQTMyJTNBJTIyMzFIQTA3QkM4MTQyQzVBMTcxNzQ1RDAwQUQ2M0QxODIlMjIlM0JzJTNBMzUlM0ElMjJkM19jZmdfbW9kX19kM2hlaWRlbHBheV9zVXNlcklEVGVzdCUyMiUzQnMlM0EzMiUzQSUyMjMxaGEwN2JjODE0MmM1YTE3MTc0NGU1YWVmMTFmZmQzJTIyJTNCcyUzQTM3JTNBJTIyZDNfY2ZnX21vZF9fZDNoZWlkZWxwYXlfc1Bhc3N3b3JkVGVzdCUyMiUzQnMlM0E4JTNBJTI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MmQzX2NmZ19tb2RfX3NEM0hwSEZPcmRlckNhbmNlbFR5cGUlMjIlM0JzJTNBMTMlM0ElMjJQTEVBU0VfQ0hPT1NFJTIyJTNCcyUzQTM4JTNBJTIyZDNfY2ZnX21vZF9fYmxEM0hwSEZTZXRaZXJvT3JkZXJOdW1iZXIlMjIlM0JzJTNBMSUzQSUyMjAlMjIlM0IlN0Q=';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2022-07-04 16:09:28 +02:00
|
|
|
public $aFields = [
|
|
|
|
'OXID_d3hpuid' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hpuid',
|
|
|
|
'sFieldName' => 'OXID',
|
|
|
|
'sType' => 'VARCHAR(32)',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXUSERID_d3hpuid' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hpuid',
|
|
|
|
'sFieldName' => 'OXUSERID',
|
|
|
|
'sType' => 'VARCHAR(32)',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXPAYMENTID_d3hpuid' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hpuid',
|
|
|
|
'sFieldName' => 'OXPAYMENTID',
|
|
|
|
'sType' => 'VARCHAR(32)',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXUID_d3hpuid' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hpuid',
|
|
|
|
'sFieldName' => 'OXUID',
|
|
|
|
'sType' => 'VARCHAR(50)',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXTIME_d3hpuid' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hpuid',
|
|
|
|
'sFieldName' => 'OXTIME',
|
|
|
|
'sType' => 'DATETIME',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '0000-00-00 00:00:00',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXPAYMENTDATA_d3hpuid' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hpuid',
|
|
|
|
'sFieldName' => 'OXPAYMENTDATA',
|
|
|
|
'sType' => 'TEXT',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXSHOPID_d3hpuid' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hpuid',
|
|
|
|
'sFieldName' => 'OXSHOPID',
|
|
|
|
'sType' => 'INT(11)',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '1',
|
|
|
|
'sComment' => '',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXID_d3hperrortexts' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hperrortexts',
|
|
|
|
'sFieldName' => 'OXID',
|
|
|
|
'sType' => 'VARCHAR(32)',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXCODE_d3hperrortexts' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hperrortexts',
|
|
|
|
'sFieldName' => 'OXCODE',
|
|
|
|
'sType' => 'VARCHAR(20)',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXTYPE_d3hperrortexts' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hperrortexts',
|
|
|
|
'sFieldName' => 'OXTYPE',
|
|
|
|
'sType' => 'INT(1)',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '0',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXTITLE_d3hperrortexts' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hperrortexts',
|
|
|
|
'sFieldName' => 'OXTITLE',
|
|
|
|
'sType' => 'VARCHAR(255)',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXTITLE_1_d3hperrortexts' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hperrortexts',
|
|
|
|
'sFieldName' => 'OXTITLE_1',
|
|
|
|
'sType' => 'VARCHAR(255)',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXREALTEXT_d3hperrortexts' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hperrortexts',
|
|
|
|
'sFieldName' => 'OXREALTEXT',
|
|
|
|
'sType' => 'VARCHAR(255)',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '',
|
|
|
|
'sComment' => 'D3 Heidelpay',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'D3HEIDELPAYVOUCHERS_oxorder' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'oxorder',
|
|
|
|
'sFieldName' => 'D3HEIDELPAYVOUCHERS',
|
|
|
|
'sType' => 'TEXT',
|
|
|
|
'blNull' => false,
|
|
|
|
'sDefault' => '',
|
|
|
|
'sComment' => 'D3 Heidelpay voucherinfos for temporary orders',
|
|
|
|
'sExtra' => '',
|
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
];
|
2022-06-13 15:38:31 +02:00
|
|
|
|
|
|
|
// Standardwerte zum umbenennen Tables
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2022-07-04 16:09:28 +02:00
|
|
|
public $aIndizes = [
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hpuid',
|
|
|
|
'sType' => d3database::INDEX_TYPE_PRIMARY,
|
|
|
|
'sName' => d3database::INDEX_TYPE_PRIMARY,
|
2022-07-04 16:09:28 +02:00
|
|
|
'aFields' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'OXID' => 'OXID',
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
2022-06-13 15:38:31 +02:00
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hpuid',
|
|
|
|
'sType' => 'KEY',
|
|
|
|
'sName' => 'OXSHOPID',
|
2022-07-04 16:09:28 +02:00
|
|
|
'aFields' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'OXSHOPID' => 'OXSHOPID',
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
2022-06-13 15:38:31 +02:00
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hpuid',
|
|
|
|
'sType' => 'KEY',
|
|
|
|
'sName' => 'OXUSERID',
|
2022-07-04 16:09:28 +02:00
|
|
|
'aFields' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'OXUSERID' => 'OXUSERID',
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
2022-06-13 15:38:31 +02:00
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'sTableName' => 'd3hperrortexts',
|
|
|
|
'sType' => 'PRIMARY',
|
|
|
|
'sName' => 'PRIMARY',
|
2022-07-04 16:09:28 +02:00
|
|
|
'aFields' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'OXID' => 'OXID',
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
2022-06-13 15:38:31 +02:00
|
|
|
'blMultilang' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
];
|
2022-06-13 15:38:31 +02:00
|
|
|
|
|
|
|
// Standardwerte fuer checkFields(), _addTable() und fixFields()
|
|
|
|
// Standardwerte fuer checkIndizes() und fixIndizes()
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2022-07-04 16:09:28 +02:00
|
|
|
protected $_aRefreshMetaModuleIds = ['d3heidelpay'];
|
2022-06-13 15:38:31 +02:00
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2022-07-04 16:09:28 +02:00
|
|
|
protected $_aUpdateMethods = [
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'hasToShowNoteForStoredData',
|
|
|
|
'do' => 'showNoteForStoredData'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkModCfgItemExist', // Prueft auf Datenbankeintrag
|
|
|
|
'do' => 'updateModCfgItemExist'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkD3hpuidTableExist',
|
|
|
|
'do' => 'updateD3hpuidTableExist'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkD3hperrortextsTableExist',
|
|
|
|
'do' => 'updateD3hperrortextsTableExist'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'hasEmptyCMSShopId', //0004566: Korrektur der Autoinstallation bei einem Modulupdate
|
|
|
|
'do' => 'removeEmptyCMSShopId' // bug fix for version 5.0.0.2
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkHPerrortextcontent', // UPDATE `d3hperrortexts` SET `OXTYPE` = '2' WHERE `OXCODE` = '800.100.153';
|
|
|
|
'do' => 'updateHPerrortextcontent' // Update 4.0.1.0 XE4 => 4.0.2.0 XE4
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'hasOldTables',
|
|
|
|
'do' => 'deleteOldTables'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkOxcontentEntrysExist', // Pruefte ob oxcontenteintraege schon vorhanden
|
|
|
|
'do' => 'showMessageForCustomerToUpdateManually'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkOxcontentItemsExist', // sql befehle fuer Tabelle oxcontents
|
|
|
|
'do' => 'insertOxcontentItemsIfNotExist'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkOxpaymentsItemsExist', // sql befehle fuer Tabelle oxpayments
|
|
|
|
'do' => 'insertOxpaymentsItemsIfNotExist'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkD3hperrortextsItemsExist', // sql befehle fuer Tabelle d3hperrortexts
|
|
|
|
'do' => 'insertD3hperrortextsItemsIfNotExist'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkForChangeHaendlerKontoMsg',
|
|
|
|
'do' => 'showForChangeHaendlerKontoMsg'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkModCfgorderExecutePostFields',
|
|
|
|
'do' => 'updateModCfgorderExecutePostFields'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'usingModCfgStoredDataWithoutRG',
|
|
|
|
'do' => 'updateModCfStoredDataWithRG'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'hasModProfileEntries',
|
|
|
|
'do' => 'createModProfileEntries'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'hasOldModuleItems', //nicht vorhandene Moduldatei-Eintraege entfernen
|
|
|
|
'do' => 'deleteOldModuleItems'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkFields',
|
|
|
|
'do' => 'fixFields'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkIndizes',
|
|
|
|
'do' => 'fixIndizes'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'checkModCfgSameRevision', // Prueft auf nachgezogene Revisionsnummer
|
|
|
|
'do' => 'updateModCfgSameRevision'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
[ // this has to be the last step
|
2022-06-13 15:38:31 +02:00
|
|
|
'check' => 'hasMultilangConfigButNoSetting',
|
|
|
|
'do' => 'showMultilangConfigButNoSettingMessage'
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
];
|
2022-06-13 15:38:31 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
public function hasToShowNoteForStoredData()
|
|
|
|
{
|
|
|
|
$hasAlreadyCorrectedData = $this->getConfig()->getSystemConfigParameter('d3HeidelpayNoteShownForStoredData');
|
|
|
|
|
|
|
|
if ($hasAlreadyCorrectedData) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->_checkTableNotExist('d3hpuid')) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (DatabaseProvider::getDb()->getOne('SELECT COUNT(*) FROM d3hpuid')) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->getConfig()->saveSystemConfigParameter('bool', 'd3HeidelpayNoteShownForStoredData', true);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
public function showNoteForStoredData()
|
|
|
|
{
|
|
|
|
$this->_confirmMessage('D3HEIDELPAYNOTESHOWNFORSTOREDDATA');
|
|
|
|
|
2022-07-04 16:09:28 +02:00
|
|
|
$aDoList = [];
|
2022-06-13 15:38:31 +02:00
|
|
|
$hasReferenceIndexCreated = $hasOxuidIndexCreated = false;
|
|
|
|
//set indexes
|
|
|
|
if (false == DatabaseProvider::getDb()->getOne('SHOW INDEX FROM d3transactionlog WHERE Column_name=\'D3REFERENCE\';')) {
|
|
|
|
$referenceQuery = 'ALTER TABLE `d3transactionlog` ADD INDEX `D3REFERENCE` (`D3REFERENCE`);';
|
|
|
|
$aDoList[] = $referenceQuery;
|
|
|
|
DatabaseProvider::getDb()->execute($referenceQuery);
|
|
|
|
$hasReferenceIndexCreated = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (false == DatabaseProvider::getDb()->getOne('SHOW INDEX FROM d3hpuid WHERE Column_name=\'OXUID\';')) {
|
|
|
|
$d3huidQuery = 'ALTER TABLE `d3hpuid` ADD INDEX `OXUID` (`OXUID`);';
|
|
|
|
$aDoList[] = $d3huidQuery;
|
|
|
|
DatabaseProvider::getDb()->execute($d3huidQuery);
|
|
|
|
$hasOxuidIndexCreated = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//cleanup non linked entries
|
|
|
|
$aDoList[] = 'DELETE FROM d3hpuid
|
|
|
|
WHERE NOT EXISTS(
|
|
|
|
SELECT NULL
|
|
|
|
FROM d3transactionlog f
|
|
|
|
WHERE f.D3REFERENCE = OXUID);';
|
|
|
|
|
|
|
|
//get all d3transaction entries from d3huid
|
|
|
|
$db = DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC);
|
|
|
|
$result = $db->getAll(
|
|
|
|
'SELECT d3transactionlog.oxid AS oxid FROM d3hpuid
|
|
|
|
LEFT JOIN d3transactionlog ON d3hpuid.`OXUID` = d3transactionlog.D3REFERENCE
|
|
|
|
WHERE d3transactionlog.oxid IS NOT NULL;'
|
|
|
|
);
|
|
|
|
|
2022-07-04 16:09:28 +02:00
|
|
|
$deleteIds = [];
|
2022-06-13 15:38:31 +02:00
|
|
|
/** @var TransactionlogReader $reader */
|
|
|
|
$reader = oxNew(TransactionlogReader::class);
|
|
|
|
foreach ($result as $logdata) {
|
|
|
|
$transaction = oxNew(d3transactionlog::class, $reader);
|
|
|
|
if (false == $transaction->load($logdata['oxid'])) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$reader = $transaction->getTransactiondata();
|
|
|
|
$paymentcode = strtolower($reader->getPaymentcode());
|
2022-07-04 16:09:28 +02:00
|
|
|
if (false == in_array($paymentcode, ['cc.rg', 'dc.rg'])) {
|
2022-06-13 15:38:31 +02:00
|
|
|
$deleteIds[] = $transaction->getFieldData('d3reference');
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (false == empty($deleteIds)) {
|
|
|
|
$ids = join("','", $deleteIds);
|
|
|
|
|
|
|
|
$aDoList[] = "DELETE FROM d3hpuid WHERE OXUID IN ('$ids');";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($hasReferenceIndexCreated) {
|
|
|
|
$referenceQuery = 'ALTER TABLE `d3transactionlog` DROP INDEX `D3REFERENCE`;';
|
|
|
|
$aDoList[] = $referenceQuery;
|
|
|
|
DatabaseProvider::getDb()->execute($referenceQuery);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($hasOxuidIndexCreated) {
|
|
|
|
$d3huidQuery = 'ALTER TABLE `d3hpuid` DROP INDEX `OXUID`;';
|
|
|
|
$aDoList[] = $d3huidQuery;
|
|
|
|
DatabaseProvider::getDb()->execute($d3huidQuery);
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->getConfig()->saveSystemConfigParameter('bool', 'd3HeidelpayNoteShownForStoredData', true);
|
|
|
|
$this->setInitialExecMethod(__METHOD__);
|
|
|
|
$blUseCombinedLogItem = false == $this->hasExecute();
|
|
|
|
|
|
|
|
return $this->_executeMultipleQueries($aDoList, $blUseCombinedLogItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
*/
|
|
|
|
public function checkD3hperrortextsItemsExist()
|
|
|
|
{
|
|
|
|
return $this->_checkUpdateFile('d3/heidelpay/Setup/d3hp_errortextsQuerys.php');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function insertD3hperrortextsItemsIfNotExist()
|
|
|
|
{
|
|
|
|
return $this->_doUpdateFile('d3/heidelpay/Setup/d3hp_errortextsQuerys.php');
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************
|
|
|
|
* Tabellen anlegen *
|
|
|
|
****************************************************/
|
|
|
|
/**
|
|
|
|
* @return bool TRUE, if table exsist
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function hasOldTables()
|
|
|
|
{
|
|
|
|
return $this->_checkTableExist('PrepaymentData')
|
|
|
|
|| $this->_checkTableExist('oxhpprepaymentdata')
|
|
|
|
|| $this->_checkTableExist('oxpaylogs')
|
|
|
|
|| $this->_checkTableExist('oxhpuid')
|
|
|
|
|| $this->_checkTableExist('oxhperrortexts')
|
|
|
|
|| $this->_checkTableExist('oxobject2heidelpay');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function deleteOldTables()
|
|
|
|
{
|
|
|
|
$blRet = true;
|
|
|
|
|
|
|
|
if ($this->_checkTableExist('PrepaymentData')) {
|
|
|
|
$aRet = $this->_dropTable('PrepaymentData');
|
|
|
|
$blRet = $aRet['blRet'];
|
|
|
|
$this->setActionLog('SQL', $aRet['sql'], __METHOD__);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->_checkTableExist('oxhpprepaymentdata')) {
|
|
|
|
$aRet = $this->_dropTable('oxhpprepaymentdata');
|
|
|
|
$blRet = $aRet['blRet'];
|
|
|
|
$this->setActionLog('SQL', $aRet['sql'], __METHOD__);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->_checkTableExist('oxobject2heidelpay')) {
|
|
|
|
$aRet = $this->_dropTable('oxobject2heidelpay');
|
|
|
|
$blRet = $aRet['blRet'];
|
|
|
|
$this->setActionLog('SQL', $aRet['sql'], __METHOD__);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->_checkTableExist('oxhpuid')) {
|
|
|
|
$aRet = $this->_dropTable('oxhpuid');
|
|
|
|
$blRet = $aRet['blRet'];
|
|
|
|
$this->setActionLog('SQL', $aRet['sql'], __METHOD__);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->_checkTableExist('oxhperrortexts')) {
|
|
|
|
$aRet = $this->_dropTable('oxhperrortexts');
|
|
|
|
$blRet = $aRet['blRet'];
|
|
|
|
$this->setActionLog('SQL', $aRet['sql'], __METHOD__);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->_checkTableExist('oxpaylogs')) {
|
|
|
|
$aRet = $this->_dropTable('oxpaylogs');
|
|
|
|
$blRet = $aRet['blRet'];
|
|
|
|
$this->setActionLog('SQL', $aRet['sql'], __METHOD__);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $blRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function updateD3hpuidTableExist()
|
|
|
|
{
|
|
|
|
$blRet = true;
|
|
|
|
|
|
|
|
if ($this->checkD3hpuidTableExist()) {
|
|
|
|
$aRet = $this->_addTable2('d3hpuid', $this->aFields, $this->aIndizes, 'D3 Heidelpay', 'MyISAM');
|
|
|
|
$blRet = $aRet['blRet'];
|
|
|
|
$this->setActionLog('SQL', $aRet['sql'], __METHOD__);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $blRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool TRUE, if table is missing
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function checkD3hpuidTableExist()
|
|
|
|
{
|
|
|
|
return $this->_checkTableNotExist('d3hpuid');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function updateD3hperrortextsTableExist()
|
|
|
|
{
|
|
|
|
$blRet = true;
|
|
|
|
|
|
|
|
if ($this->checkD3hperrortextsTableExist()) {
|
|
|
|
$aRet = $this->_addTable2('d3hperrortexts', $this->aFields, $this->aIndizes, 'D3 Heidelpay', 'MyISAM');
|
|
|
|
$blRet = $aRet['blRet'];
|
|
|
|
$this->setActionLog('SQL', $aRet['sql'], __METHOD__);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $blRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool TRUE, if table is missing
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function checkD3hperrortextsTableExist()
|
|
|
|
{
|
|
|
|
return $this->_checkTableNotExist('d3hperrortexts');
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************
|
|
|
|
* Tabelle oxcontents & oxpayments *
|
|
|
|
* if entrys not exist -> insert *
|
|
|
|
****************************************************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
public function checkOxcontentItemsExist()
|
|
|
|
{
|
|
|
|
return $this->_hasExecuteFileQuery('d3/heidelpay/Setup/d3hp_oxcontentsQuerys.php');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $sFileName
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
protected function _hasExecuteFileQuery($sFileName)
|
|
|
|
{
|
|
|
|
startProfile(__METHOD__);
|
|
|
|
$result = false;
|
|
|
|
|
|
|
|
$sCurrentShopId = $this->getConfig()->getShopId();
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
$this->_changeToShop($oShop->getId());
|
|
|
|
$aList = $this->_parseUpdateFile($sFileName);
|
|
|
|
foreach ($aList['check'] as $sCheckQuery) {
|
|
|
|
if (DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getOne($sCheckQuery)) {
|
|
|
|
$result = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->_changeToShop($sCurrentShopId);
|
|
|
|
stopProfile(__METHOD__);
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
public function insertOxcontentItemsIfNotExist()
|
|
|
|
{
|
|
|
|
Registry::getSession()->setVariable('d3hp_update_skip_oxcontents', 1);
|
|
|
|
|
|
|
|
return $this->_executeFileQueries('d3/heidelpay/Setup/d3hp_oxcontentsQuerys.php');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $sFileName
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
protected function _executeFileQueries($sFileName)
|
|
|
|
{
|
|
|
|
startProfile(__METHOD__);
|
|
|
|
|
|
|
|
$blRet = true;
|
2022-07-04 16:09:28 +02:00
|
|
|
$aDoList = [];
|
2022-06-13 15:38:31 +02:00
|
|
|
|
|
|
|
$sCurrentShopId = $this->getConfig()->getShopId();
|
|
|
|
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
$this->_changeToShop($oShop->getId());
|
|
|
|
$aList = $this->_parseUpdateFile($sFileName);
|
|
|
|
|
|
|
|
$oD3Str = oxNew(d3str::class);
|
|
|
|
$oD3Str->convert2utf_8($aList, false);
|
|
|
|
|
|
|
|
foreach ($aList['check'] as $sKey => $sCheckQuery) {
|
|
|
|
if (DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->getOne($sCheckQuery)) {
|
|
|
|
$aList['do'][$sKey] = utf8_encode($aList['do'][$sKey]);
|
|
|
|
$aDoList[] = $aList['do'][$sKey];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->_changeToShop($sCurrentShopId);
|
|
|
|
|
|
|
|
if ($aDoList && is_array($aDoList) && count($aDoList)) {
|
|
|
|
$this->setInitialExecMethod(__METHOD__);
|
|
|
|
$blUseCombinedLogItem = !$this->hasExecute();
|
|
|
|
$blRet = $this->_executeMultipleQueries($aDoList, $blUseCombinedLogItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
stopProfile(__METHOD__);
|
|
|
|
|
|
|
|
return $blRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************
|
|
|
|
* Tabelle oxcontents *
|
|
|
|
* No Autoupdate if exist -> Message *
|
|
|
|
****************************************************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
*/
|
|
|
|
public function checkOxpaymentsItemsExist()
|
|
|
|
{
|
|
|
|
return $this->_checkUpdateFile('d3/heidelpay/Setup/d3hp_oxpaymentsQuerys.php');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function insertOxpaymentsItemsIfNotExist()
|
|
|
|
{
|
|
|
|
return $this->_doUpdateFile('d3/heidelpay/Setup/d3hp_oxpaymentsQuerys.php');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
*/
|
|
|
|
public function checkOxcontentEntrysExist()
|
|
|
|
{
|
|
|
|
$blRet = false;
|
|
|
|
$bSkipUpdate = Registry::getSession()->getVariable('d3hp_update_skip_oxcontents');
|
|
|
|
|
|
|
|
if ($bSkipUpdate) {
|
|
|
|
return $blRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
|
|
|
|
$query = /** @lang MySQL */
|
|
|
|
<<<MySQL
|
|
|
|
SELECT count(*) FROM oxcontents
|
|
|
|
WHERE oxloadid IN (
|
|
|
|
'd3_hp_vorkassemail_cust_text',
|
|
|
|
'd3_hp_vorkassemail_cust_subject',
|
|
|
|
'd3_hp_vorkassemail_cust_plain',
|
|
|
|
'd3_hp_vorkassemail_owner_text',
|
|
|
|
'd3_hp_vorkassemail_owner_subject',
|
|
|
|
'd3_hp_vorkassemail_owner_plain'
|
|
|
|
)
|
|
|
|
AND oxshopid = '{$oShop->getId()}'
|
|
|
|
MySQL;
|
|
|
|
|
|
|
|
$blInstallationIsNotComplete = $this->checkModCfgSameRevision();
|
|
|
|
|
|
|
|
if ((DatabaseProvider::getDb()->getOne($query)) && $blInstallationIsNotComplete) {
|
|
|
|
$blRet = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $blRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Message for manuelle Updates for CMS-Sites
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function showMessageForCustomerToUpdateManually()
|
|
|
|
{
|
|
|
|
$sMessage = 'D3_HEIDELPAY_UPDATE_OXCONTENTITEMS';
|
|
|
|
$blRet = $this->_confirmMessage($sMessage);
|
|
|
|
|
|
|
|
Registry::getSession()->setVariable('d3hp_update_skip_oxcontents', 1);
|
|
|
|
|
|
|
|
return $blRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function updateHPerrortextcontent()
|
|
|
|
{
|
|
|
|
$blRet = false;
|
|
|
|
|
|
|
|
if ($this->checkHPerrortextcontent()) {
|
2022-07-04 16:09:28 +02:00
|
|
|
$aWhere = [
|
2022-06-13 15:38:31 +02:00
|
|
|
'oxcode' => '800.100.153',
|
2022-07-04 16:09:28 +02:00
|
|
|
];
|
2022-06-13 15:38:31 +02:00
|
|
|
|
|
|
|
if ($this->_checkTableItemNotExist('d3hperrortexts', $aWhere)) {
|
2022-07-04 16:09:28 +02:00
|
|
|
$aInsertFields = [
|
|
|
|
'OXID' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'content' => "366",
|
|
|
|
'force_update' => true,
|
|
|
|
'use_quote' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXCODE' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'content' => '800.100.153',
|
|
|
|
'force_update' => true,
|
|
|
|
'use_quote' => true,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXTYPE' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'content' => "2",
|
|
|
|
'force_update' => true,
|
|
|
|
'use_quote' => true,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXTITLE' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'content' => "Ungültige Prüfziffer",
|
|
|
|
'force_update' => true,
|
|
|
|
'use_quote' => true,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXTITLE_1' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'content' => "transaction declined (invalid CVV)",
|
|
|
|
'force_update' => false,
|
|
|
|
'use_quote' => false,
|
2022-07-04 16:09:28 +02:00
|
|
|
],
|
|
|
|
'OXREALTEXT' => [
|
2022-06-13 15:38:31 +02:00
|
|
|
'content' => "transaction declined (invalid CVV)",
|
|
|
|
'force_update' => true,
|
|
|
|
'use_quote' => true,
|
2022-07-04 16:09:28 +02:00
|
|
|
]
|
|
|
|
];
|
2022-06-13 15:38:31 +02:00
|
|
|
$aRet = $this->_updateTableItem2('d3hperrortexts', $aInsertFields, $aWhere);
|
|
|
|
$blRet = $aRet['blRet'];
|
|
|
|
|
|
|
|
$this->setActionLog('SQL', $aRet['sql'], __METHOD__);
|
|
|
|
$this->setUpdateBreak(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// if actually updated don't update entry a second time
|
|
|
|
Registry::getSession()->setVariable('d3hp_HPerrortext_skip_update', 1);
|
|
|
|
|
|
|
|
return $blRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function checkHPerrortextcontent()
|
|
|
|
{
|
|
|
|
$blRet = false;
|
|
|
|
$bSkipUpdate = Registry::getSession()->getVariable('d3hp_HPerrortext_skip_update');
|
|
|
|
$bSkipUpdateCauseTableNotExist = !$this->checkD3hperrortextsTableExist();
|
|
|
|
|
|
|
|
if ($bSkipUpdate || $bSkipUpdateCauseTableNotExist) {
|
|
|
|
return $blRet;
|
|
|
|
}
|
|
|
|
|
2022-07-04 16:09:28 +02:00
|
|
|
$aWhere = [
|
2022-06-13 15:38:31 +02:00
|
|
|
'oxcode' => '800.100.153',
|
2022-07-04 16:09:28 +02:00
|
|
|
];
|
2022-06-13 15:38:31 +02:00
|
|
|
$blRet1 = $this->_checkTableItemNotExist('d3hperrortexts', $aWhere);
|
|
|
|
|
|
|
|
$blRetX = $this->checkModCfgSameRevision();
|
|
|
|
|
|
|
|
if ($blRet1 && $blRetX) {
|
|
|
|
$blRet = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $blRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function checkRenameD3Tables()
|
|
|
|
{
|
|
|
|
return $this->checkRenameTables();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function renameD3Tables()
|
|
|
|
{
|
|
|
|
/** @param string $sMethodName */
|
|
|
|
return $this->fixRenameTables(__METHOD__);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
public function showForChangeHaendlerKontoMsg()
|
|
|
|
{
|
|
|
|
$oConfirmMessage = oxNew(d3installconfirmmessage::class, $this);
|
|
|
|
if (false == $this->hasExecute()) {
|
|
|
|
$oConfirmMessage->showConfigConfirmMessage('blD3checkForModHaendlerKontoMsg', 'D3_HEIDELPAY_UPDATE_CHANGE_HAENDLERKONTO');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->hasExecute() && $this->checkForChangeHaendlerKontoMsg()) {
|
|
|
|
$sCurrentShopid = $this->getConfig()->getShopId();
|
|
|
|
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
$this->_changeToShop($oShop->getId());
|
|
|
|
$oConfirmMessage->setConfirmMessageConfigRequest('blD3checkForModHaendlerKontoMsg', 1);
|
|
|
|
}
|
|
|
|
$this->_changeToShop($sCurrentShopid);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
public function checkForChangeHaendlerKontoMsg()
|
|
|
|
{
|
|
|
|
$sCurrentShopid = $this->getConfig()->getShopId();
|
|
|
|
|
|
|
|
$result = false;
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
$this->_changeToShop($oShop->getId());
|
|
|
|
$moduleConfiguration = d3_cfg_mod::getNoCache($this->sModKey);
|
|
|
|
if (false === $moduleConfiguration) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$oldVersionNumber = (int)$moduleConfiguration->getFieldData('oxversionnum');
|
|
|
|
|
|
|
|
//check if old module version is new installation or older than 4.0.5.0
|
|
|
|
if ($oldVersionNumber <= 0 || $oldVersionNumber >= 67110144) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$oConfirmMessage = oxNew(d3installconfirmmessage::class, $this);
|
|
|
|
if (false == $oConfirmMessage->hasConfirmMessageConfigRequest('blD3checkForModHaendlerKontoMsg')) {
|
|
|
|
$result = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->_changeToShop($sCurrentShopid);
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
public function checkModCfgorderExecutePostFields()
|
|
|
|
{
|
|
|
|
$blReturn = false;
|
|
|
|
$sCurrentShopid = $this->getConfig()->getShopId();
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
$this->_changeToShop($oShop->getId());
|
|
|
|
$moduleConfiguration = d3_cfg_mod::getNoCache($this->sModKey);
|
|
|
|
if (false === $moduleConfiguration) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (false == is_string(
|
|
|
|
$moduleConfiguration->getValue('d3heidelpay_orderExecutePostFields')
|
2022-07-04 16:09:28 +02:00
|
|
|
) || strlen(
|
2022-06-13 15:38:31 +02:00
|
|
|
$moduleConfiguration->getValue('d3heidelpay_orderExecutePostFields')
|
|
|
|
) == 0
|
|
|
|
) {
|
|
|
|
$blReturn = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->_changeToShop($sCurrentShopid);
|
|
|
|
|
|
|
|
return $blReturn;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws d3ShopCompatibilityAdapterException
|
|
|
|
* @throws d3_cfg_mod_exception
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws StandardException
|
|
|
|
*/
|
|
|
|
public function updateModCfgorderExecutePostFields()
|
|
|
|
{
|
|
|
|
$aDefaultConfig = unserialize(rawurldecode(base64_decode($this->sBaseValue)));
|
|
|
|
|
|
|
|
$sCurrentShopid = $this->getConfig()->getShopId();
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
$this->_changeToShop($oShop->getId());
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
/** @var d3_cfg_mod $moduleConfiguration */
|
|
|
|
$moduleConfiguration = d3_cfg_mod::getNoCache($this->sModKey);
|
|
|
|
if (false === $moduleConfiguration) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$moduleConfiguration->setValue(
|
|
|
|
'd3heidelpay_orderExecutePostFields',
|
|
|
|
$aDefaultConfig->d3_cfg_mod__d3heidelpay_orderExecutePostFields
|
|
|
|
);
|
|
|
|
|
|
|
|
if ($this->hasExecute()) {
|
|
|
|
$moduleConfiguration->save();
|
|
|
|
}
|
|
|
|
|
|
|
|
$sQuery = 'UPDATE ' . $moduleConfiguration->getCoreTableName() //
|
|
|
|
. ' SET oxvalue = ' //
|
|
|
|
. DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->quote($moduleConfiguration->getFieldData('oxvalue')) //
|
|
|
|
. " WHERE oxmodid = " . DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->quote($this->sModKey) //
|
|
|
|
. " AND oxshopid = " . DatabaseProvider::getDb(DatabaseProvider::FETCH_MODE_ASSOC)->quote($oShop->getId()) . ";";
|
|
|
|
|
|
|
|
$this->setActionLog(
|
|
|
|
'SQL',
|
|
|
|
$sQuery,
|
|
|
|
$this->getInitialExecMethod(__METHOD__)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->_changeToShop($sCurrentShopid);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
public function usingModCfgStoredDataWithoutRG()
|
|
|
|
{
|
|
|
|
startProfile(__METHOD__);
|
|
|
|
|
|
|
|
$return = false;
|
|
|
|
$currentShopId = $this->getConfig()->getShopId();
|
|
|
|
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
$this->_changeToShop($oShop->getId());
|
|
|
|
|
|
|
|
$modConfig = d3_cfg_mod::getNoCache($this->sModKey);
|
|
|
|
if (false === $modConfig) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$config = $oShop->getConfig();
|
|
|
|
|
|
|
|
if ($config->getShopConfVar('d3HeidelpayNoteStoredDataWithoutRG')) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($modConfig->getValue('d3heidelpay_blShowStoredHPData') && false == $modConfig->getValue('d3heidelpay_blCardsUseRG')) {
|
|
|
|
$return = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->_changeToShop($currentShopId);
|
|
|
|
|
|
|
|
stopProfile(__METHOD__);
|
|
|
|
|
|
|
|
return $return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws d3ShopCompatibilityAdapterException
|
|
|
|
* @throws d3_cfg_mod_exception
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws StandardException
|
|
|
|
*/
|
|
|
|
public function updateModCfStoredDataWithRG()
|
|
|
|
{
|
|
|
|
startProfile(__METHOD__);
|
|
|
|
|
|
|
|
$return = false;
|
|
|
|
$currentShopId = $this->getConfig()->getShopId();
|
|
|
|
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
$this->_changeToShop($oShop->getId());
|
|
|
|
$modConfig = d3_cfg_mod::getNoCache($this->sModKey);
|
|
|
|
if (false === $modConfig) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$config = $oShop->getConfig();
|
|
|
|
|
|
|
|
if ($config->getShopConfVar('d3HeidelpayNoteStoredDataWithoutRG')) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($modConfig->getValue('d3heidelpay_blShowStoredHPData') && false == $modConfig->getValue('d3heidelpay_blCardsUseRG')) {
|
|
|
|
$oConfirmMessage = oxNew(d3installconfirmmessage::class, $this);
|
|
|
|
$message = Registry::getLang()->translateString('D3HEIDELPAYNOTESTOREDDATAWITHOUTRG');
|
|
|
|
$message .= Registry::getLang()->translateString('HELP_D3DYN_HEIDELPAY_PARAM_CARDS_USE_RG');
|
|
|
|
|
|
|
|
$oConfirmMessage->confirmCustomMessage($message);
|
|
|
|
|
|
|
|
if ($this->hasExecute()) {
|
|
|
|
$modConfig->setValue('d3heidelpay_blCardsUseRG', true);
|
|
|
|
$modConfig->save();
|
|
|
|
$config->saveShopConfVar('bool', 'd3HeidelpayNoteStoredDataWithoutRG', true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->_changeToShop($currentShopId);
|
|
|
|
|
|
|
|
stopProfile(__METHOD__);
|
|
|
|
|
|
|
|
return $return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 0004566: Korrektur der Autoinstallation bei einem Modulupdate
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
*/
|
|
|
|
public function hasEmptyCMSShopId()
|
|
|
|
{
|
|
|
|
$oDb = DatabaseProvider::getDb();
|
|
|
|
$sHasEmptyCMSShopIdQuery = <<<MYSQL
|
|
|
|
SELECT count(1) FROM `oxcontents`
|
|
|
|
WHERE
|
|
|
|
`OXLOADID` LIKE {$oDb->quote('d3%')}
|
|
|
|
AND `OXSHOPID` IN ('0', '')
|
|
|
|
MYSQL;
|
|
|
|
|
|
|
|
return (bool)$oDb->getOne($sHasEmptyCMSShopIdQuery);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 0004566: Korrektur der Autoinstallation bei einem Modulupdate
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
*/
|
|
|
|
public function removeEmptyCMSShopId()
|
|
|
|
{
|
|
|
|
// ggf deleteTableitem benutzen?
|
|
|
|
$oDb = DatabaseProvider::getDb();
|
|
|
|
$sHasEmptyCMSShopIdQuery = <<<MYSQL
|
|
|
|
DELETE FROM `oxcontents`
|
|
|
|
WHERE
|
|
|
|
`OXLOADID` LIKE {$oDb->quote('d3%')}
|
|
|
|
AND `OXSHOPID` IN ('0', '')
|
|
|
|
MYSQL;
|
|
|
|
$return = $this->sqlExecute($sHasEmptyCMSShopIdQuery);
|
|
|
|
$this->setActionLog('SQL', $sHasEmptyCMSShopIdQuery, __METHOD__);
|
|
|
|
|
|
|
|
return $return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
public function hasMultilangConfigButNoSetting()
|
|
|
|
{
|
|
|
|
startProfile(__METHOD__);
|
|
|
|
|
|
|
|
$return = false;
|
|
|
|
$currentShopId = $this->getConfig()->getShopId();
|
|
|
|
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
if ($currentShopId != $oShop->getId()) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$config = $oShop->getConfig();
|
|
|
|
|
|
|
|
if ($config->getShopConfVar('d3hp_allowMultipleLanguages', null, 'd3heidelpay')) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($this->getSession()->getVariable('d3heidelpay_skip_multilangcheck' . $currentShopId)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
$actuallCalledMethod = $this->getConfig()->getActiveView()->getFncName();
|
|
|
|
|
|
|
|
if ('autoinstall' === strtolower($actuallCalledMethod)) {
|
|
|
|
$this->getSession()->setVariable('d3heidelpay_skip_multilangcheck' . $currentShopId, true);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
$modConfig = d3_cfg_mod::getNoCache($this->sModKey);
|
|
|
|
if (false === $modConfig) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$moduleConfig = oxNew(d3_cfg_mod::class);
|
|
|
|
$moduleConfig->setEnableMultilang(false);
|
|
|
|
$moduleConfig->init();
|
|
|
|
$moduleConfig->load($modConfig->getId());
|
|
|
|
$languageCount = count((array)$config->getShopConfVar('aLanguages'));
|
|
|
|
|
|
|
|
for ($i = 1; $languageCount > $i; $i++) {
|
|
|
|
$oxvalue = $moduleConfig->getFieldData('oxvalue_' . $i);
|
|
|
|
if (empty($oxvalue)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$return = true;
|
|
|
|
break 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stopProfile(__METHOD__);
|
|
|
|
|
|
|
|
return $return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
public function showMultilangConfigButNoSettingMessage()
|
|
|
|
{
|
|
|
|
startProfile(__METHOD__);
|
|
|
|
|
|
|
|
$currentShopId = $this->getConfig()->getShopId();
|
|
|
|
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
if ($currentShopId != $oShop->getId()) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$actuallCalledMethod = $this->getConfig()->getActiveView()->getFncName();
|
|
|
|
|
|
|
|
if ('autoinstall' === strtolower($actuallCalledMethod)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
$this->_confirmMessage('D3HEIDELPAY_MULTIPLE_LANGUAGECONFIGURATIONS_FOUND');
|
|
|
|
if ($this->hasExecute()) {
|
|
|
|
$this->getSession()->setVariable('d3heidelpay_skip_multilangcheck' . $currentShopId, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
stopProfile(__METHOD__);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws DBALException
|
|
|
|
* @throws DatabaseConnectionException
|
|
|
|
* @throws DatabaseErrorException
|
|
|
|
* @throws SystemComponentException
|
|
|
|
*/
|
|
|
|
public function hasModProfileEntries()
|
|
|
|
{
|
|
|
|
$blReturn = false;
|
|
|
|
$sCurrentShopid = $this->getConfig()->getShopId();
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
$this->_changeToShop($oShop->getId());
|
|
|
|
/** @var ModProfile $modProfile */
|
|
|
|
$modProfile = oxNew(ModProfile::class);
|
|
|
|
/** @var Factory $factory */
|
|
|
|
$factory = oxNew(Factory::class)->setModuleConfiguration(d3_cfg_mod::getNoCache('d3heidelpay'));
|
|
|
|
$oxid = $factory->getModProfileId();
|
|
|
|
if ($modProfile->exists($oxid)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$blReturn = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
$this->_changeToShop($sCurrentShopid);
|
|
|
|
|
|
|
|
return $blReturn;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
* @throws ConnectionException
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
public function createModProfileEntries()
|
|
|
|
{
|
|
|
|
$blReturn = false;
|
|
|
|
$sCurrentShopid = $this->getConfig()->getShopId();
|
|
|
|
foreach ($this->getShopListByActiveModule($this->sModKey) as $oShop) {
|
|
|
|
/** @var $oShop BaseModel */
|
|
|
|
$this->_changeToShop($oShop->getId());
|
|
|
|
/** @var ModProfile $modProfile */
|
|
|
|
$modProfile = oxNew(ModProfile::class);
|
|
|
|
/** @var Factory $factory */
|
|
|
|
$d3CfgMod = d3_cfg_mod::getNoCache('d3heidelpay');
|
|
|
|
$factory = oxNew(Factory::class)->setModuleConfiguration($d3CfgMod);
|
|
|
|
$oxid = $factory->getModProfileId();
|
|
|
|
if ($modProfile->exists($oxid)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$oldPaymentlist = $d3CfgMod->getValue('d3heidelpay_aPaymentList');
|
|
|
|
$oxValue = '';
|
|
|
|
if (empty($oldPaymentlist)) {
|
|
|
|
$oxValue = 'TyUzQTglM0ElMjJzdGRDbGFzcyUyMiUzQTEwJTNBJTdCcyUzQTMyJTNBJTIyYzY5MzViN2Q3MDUxY2NmNzY5MTcwYTY4MWU3ZDg3ODIlMjIlM0JzJTNBNDgzJTNBJTIyJTdCJTIyY2FyZFR5cGVUaW1lb3V0JTIyJTNBMCUyQyUyMmhlaWRlbHBheVBheW1lbnRDbGFzc25hbWUlMjIlM0ElMjJEMyU1QyU1Q0hlaWRlbHBheSU1QyU1Q01vZGVscyU1QyU1Q1BheW1lbnQlNUMlNUNDcmVkaXRjYXJkJTIyJTJDJTIyaXNVc2luZ1JlZ2lzdHJhdGlvbiUyMiUzQW51bGwlMkMlMjJpc1VzaW5nU3RvcmVkQ2FyZERhdGElMjIlM0FudWxsJTJDJTIyaWQlMjIlM0ElMjJjNjkzNWI3ZDcwNTFjY2Y3NjkxNzBhNjgxZTdkODc4MiUyMiUyQyUyMmlzQWN0aXZlJTIyJTNBJTIyMSUyMiUyQyUyMnRpdGxlJTIyJTNBJTIyS3JlZGl0a2FydGUlMjIlMkMlMjJwYXltZW50VHlwZSUyMiUzQSUyMkQzJTVDJTVDSGVpZGVscGF5JTVDJTVDTW9kZWxzJTVDJTVDU2V0dGluZ3MlNUMlNUNDaGFubmVscyU1QyU1Q0NyZWRpdENhcmQlMjIlMkMlMjJjaGFubmVsJTIyJTNBJTIyMzFIQTA3QkM4MTQyQzVBMTcxNzQ5QTYwRDk3OUI2RTQlMjIlMkMlMjJ0cmFuc2FjdGlvblR5cGUlMjIlM0ElMjIlMjIlMkMlMjJpc1Rlc3RDb25maWclMjIlM0ElMjIxJ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ZmMTczNDYzNjVjYjZhZWViZTVjNzhhJTIyJTNCcyUzQTQyMCUzQSUyMiU3QiUyMmhlaWRlbHBheVBheW1lbnRDbGFzc25
|
|
|
|
}
|
|
|
|
$modProfile->setId($oxid);
|
|
|
|
$modProfile->assign([
|
|
|
|
'oxactive' => '1',
|
|
|
|
'oxtitle' => 'json configuration',
|
|
|
|
'oxmodid' => $this->sModKey,
|
|
|
|
'oxvalue' => $oxValue,
|
|
|
|
]);
|
|
|
|
|
|
|
|
if ($modProfile->save()) {
|
|
|
|
$blReturn = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->_changeToShop($sCurrentShopid);
|
|
|
|
|
|
|
|
return $blReturn;
|
|
|
|
}
|
|
|
|
}
|