75 lines
2.6 KiB
PHP
75 lines
2.6 KiB
PHP
<?php
|
|
/**
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* module source file is subject to a commercial license.
|
|
* Use, copy, modification or distribution of module source file without written
|
|
* license agreement is strictly forbidden.
|
|
* In order to obtain a license, please contact us: simon@daig.re
|
|
* ...........................................................................
|
|
* INFORMATION SUR LA LICENCE D'UTILISATION
|
|
*
|
|
* L'utilisation de ce fichier source est soumise a une licence commerciale.
|
|
* Toute utilisation, reproduction, modification ou distribution du present
|
|
* fichier source sans contrat de licence ecrit est expressement interdite.
|
|
* Pour obtenir une licence, veuillez nous contacter a l'adresse: simon@daig.re
|
|
*
|
|
* @package Colissimo Suivi
|
|
* @author Agencya
|
|
* @copyright Copyright(c) 2015-2018
|
|
* @license See Readme.md
|
|
* Contact by Email : simon@daig.re
|
|
*/
|
|
|
|
if (!defined('_PS_VERSION_')) {
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* @param Module $module
|
|
* @return bool
|
|
*/
|
|
function upgrade_module_1_1_0($module)
|
|
{
|
|
if (Shop::isFeatureActive()) {
|
|
Shop::setContext(Shop::CONTEXT_ALL);
|
|
}
|
|
|
|
Configuration::updateValue('COLISSIMOSUIVI_MAPPING', '');
|
|
Configuration::updateValue('COLISSIMOSUIVI_CARRIERS', '');
|
|
Configuration::updateValue('COLISSIMOSUIVI_UPDSTATES', true);
|
|
Configuration::updateValue('COLISSIMOSUIVI_INSTALLED', '');
|
|
|
|
$module->unregisterHook('displayOrderDetailDisplayed');
|
|
$module->registerHook('displayOrderDetail');
|
|
$module->registerHook('actionAdminOrdersTrackingNumberUpdate');
|
|
$module->registerHook('displayAdminOrderTabShip');
|
|
$module->registerHook('displayAdminOrderContentShip');
|
|
$module->registerHook('actionCarrierUpdate');
|
|
|
|
$tab = new Tab();
|
|
$tab->class_name = 'AdminColissimoSuivi';
|
|
$tab->name[1] = $module->l('Colissimo • Suivi');
|
|
$tab->id_parent = (int)Tab::getIdFromClassName('AdminParentShipping');
|
|
$tab->module = $module->name;
|
|
$tab->add();
|
|
|
|
Db::getInstance()->execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'colissimo_suivi');
|
|
Db::getInstance()->execute('
|
|
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'colissimo_suivi` (
|
|
`id_colissimo_suivi` INT(10) NOT NULL AUTO_INCREMENT,
|
|
`id_order` INT(10) NOT NULL,
|
|
`tracking` VARCHAR(13) NOT NULL,
|
|
`error_code` INT(10) NOT NULL DEFAULT \'0\',
|
|
`event_code` VARCHAR(6) NULL,
|
|
`event_site` VARCHAR(30) NULL,
|
|
`event_date` DATETIME NOT NULL,
|
|
`date_add` DATETIME NOT NULL,
|
|
`date_upd` DATETIME NOT NULL,
|
|
PRIMARY KEY ( `id_colissimo_suivi` )
|
|
) ENGINE = '._MYSQL_ENGINE_.' DEFAULT CHARSET = utf8;'
|
|
);
|
|
|
|
return true;
|
|
}
|