aktualizacja modułu dpd
This commit is contained in:
32
modules/dpdshipping/upgrade/Upgrade-0.2.3.php
Normal file
32
modules/dpdshipping/upgrade/Upgrade-0.2.3.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_0_2_3($module)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
32
modules/dpdshipping/upgrade/Upgrade-0.2.4.php
Normal file
32
modules/dpdshipping/upgrade/Upgrade-0.2.4.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_0_2_4($module)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
32
modules/dpdshipping/upgrade/Upgrade-1.0.0.php
Normal file
32
modules/dpdshipping/upgrade/Upgrade-1.0.0.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_0_0($module)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
32
modules/dpdshipping/upgrade/Upgrade-1.1.0.php
Normal file
32
modules/dpdshipping/upgrade/Upgrade-1.1.0.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_0($module)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
38
modules/dpdshipping/upgrade/Upgrade-1.1.2.php
Normal file
38
modules/dpdshipping/upgrade/Upgrade-1.1.2.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_2($module)
|
||||
{
|
||||
$alterContent = Db::getInstance()->execute(
|
||||
'ALTER TABLE ' . _DB_PREFIX_ . 'dpdshipping_shipping_history_parcel MODIFY COLUMN content VARCHAR(500) NULL');
|
||||
|
||||
$alterCustomerData = Db::getInstance()->execute(
|
||||
'ALTER TABLE ' . _DB_PREFIX_ . 'dpdshipping_shipping_history_parcel MODIFY COLUMN customer_data VARCHAR(500) NULL');
|
||||
|
||||
return $alterContent && $alterCustomerData;
|
||||
}
|
||||
40
modules/dpdshipping/upgrade/Upgrade-1.6.0.php
Normal file
40
modules/dpdshipping/upgrade/Upgrade-1.6.0.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
use DpdShipping\Install\DatabaseInstaller;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_6_0($module)
|
||||
{
|
||||
$db = Db::getInstance();
|
||||
$createConnectionTable = $db->execute(DatabaseInstaller::getDpdshippingConnectionCreateTable());
|
||||
|
||||
$alterPayer = $db->execute(
|
||||
'ALTER TABLE ' . _DB_PREFIX_ . 'dpdshipping_payer ADD COLUMN id_connection int(11) NULL AFTER id_shop;');
|
||||
|
||||
return $createConnectionTable && $alterPayer;
|
||||
}
|
||||
77
modules/dpdshipping/upgrade/Upgrade-1.6.3.php
Normal file
77
modules/dpdshipping/upgrade/Upgrade-1.6.3.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
use DpdShipping\Install\DatabaseInstaller;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_6_3($module)
|
||||
{
|
||||
$db = Db::getInstance();
|
||||
$config = _DB_PREFIX_ . 'dpdshipping_configuration';
|
||||
$conn = _DB_PREFIX_ . 'dpdshipping_connection';
|
||||
$payer = _DB_PREFIX_ . 'dpdshipping_payer';
|
||||
|
||||
$queries = [];
|
||||
|
||||
$queries[] = 'INSERT IGNORE INTO `'.$conn.'` (`id_shop`, `name`, `login`, `password`, `master_fid`, `environment`, `is_default`)
|
||||
SELECT
|
||||
s.id_shop,
|
||||
"DPD API" AS name,
|
||||
MAX(CASE WHEN s.name = "DPD_API_LOGIN" THEN s.value END) AS login,
|
||||
MAX(CASE WHEN s.name = "DPD_API_PASSWORD" THEN s.value END) AS password,
|
||||
MAX(CASE WHEN s.name = "DPD_API_MASTER_FID" THEN s.value END) AS master_fid,
|
||||
MAX(CASE WHEN s.name = "DPD_API_ENVIRONMENT" THEN s.value END) AS environment,
|
||||
1 AS is_default
|
||||
FROM `'.$config.'` s
|
||||
WHERE s.name IN ("DPD_API_LOGIN","DPD_API_PASSWORD","DPD_API_MASTER_FID","DPD_API_ENVIRONMENT")
|
||||
GROUP BY s.id_shop';
|
||||
|
||||
$queries[] = 'UPDATE `'.$payer.'` p
|
||||
INNER JOIN `'.$conn.'` c
|
||||
ON c.id_shop = p.id_shop AND c.name = "DPD API"
|
||||
SET p.id_connection = c.id';
|
||||
|
||||
$queries[] = 'DELETE c1 FROM `'.$config.'` c1
|
||||
WHERE c1.name IN ("DPD_API_LOGIN","DPD_API_PASSWORD","DPD_API_MASTER_FID","DPD_API_ENVIRONMENT")
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM `'.$conn.'` cx
|
||||
WHERE cx.id_shop = c1.id_shop AND cx.name = "DPD API"
|
||||
)';
|
||||
|
||||
foreach ($queries as $q) {
|
||||
if (!$db->execute($q)) {
|
||||
if (strpos($db->getMsgError(), 'Duplicate') === false
|
||||
&& strpos($db->getMsgError(), 'already exists') === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
34
modules/dpdshipping/upgrade/Upgrade-1.6.5.php
Normal file
34
modules/dpdshipping/upgrade/Upgrade-1.6.5.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_6_5($module)
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'ALTER TABLE ' . _DB_PREFIX_ . 'dpdshipping_shipping_history ADD COLUMN id_connection int(11) NULL');
|
||||
|
||||
}
|
||||
33
modules/dpdshipping/upgrade/index.php
Normal file
33
modules/dpdshipping/upgrade/index.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2024 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* Licensed under the EUPL-1.2 or later.
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
*
|
||||
* You may obtain a copy of the Licence at:
|
||||
* https://joinup.ec.europa.eu/software/page/eupl
|
||||
* It is also bundled with this package in the file LICENSE.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an AS IS basis,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Licence for the specific language governing permissions
|
||||
* and limitations under the Licence.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2024 DPD Polska Sp. z o.o.
|
||||
* @license https://joinup.ec.europa.eu/software/page/eupl
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
Reference in New Issue
Block a user