first commit

This commit is contained in:
2024-11-11 18:46:54 +01:00
commit a630d17338
25634 changed files with 4923715 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_3_10_0($module)
{
$result = true;
$sql = [
'DROP TABLE IF EXISTS `PREFIX_freshmail_list_field`',
'DROP TABLE IF EXISTS `PREFIX_freshmail_form`',
'CREATE TABLE `PREFIX_freshmail_form` (
`id_freshmail_form` int(11) NOT NULL AUTO_INCREMENT,
`id_shop` INT NOT NULL ,
`form_hash` char(10) COLLATE utf8_general_ci NOT NULL,
`hook` varchar(50) COLLATE utf8_general_ci NOT NULL,
`position` int(11) NOT NULL,
`last` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`active` tinyint(4) NOT NULL,
PRIMARY KEY (`id_freshmail_form`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
',
];
foreach ($sql as $s){
$result &= Db::getInstance()->execute(
str_replace('PREFIX_', _DB_PREFIX_, $s)
);
}
foreach ($module->getHooksForm() as $hook){
$result &= $module->registerHook($hook);
}
return $result;
}

View File

@@ -0,0 +1,10 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_3_10_5($module)
{
return $module->registerHook('actionObjectCustomerUpdateBefore');
}

View File

@@ -0,0 +1,40 @@
<?php
/**
* 2007-2019 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
/**
* This function updates your module from previous versions to the version 1.1,
* usefull when you modify your database, or register a new hook ...
* Don't forget to create one file per version.
*/
function upgrade_module_3_7_0($module)
{
return \FreshMail\Installer\InstallerFactory::getInstaller($module)->installTab(
'AdminFreshmailAbandonedCartConfig', 'Abandoned cart', 'AdminFreshmail', false,'shopping_cart'
);
}

View File

@@ -0,0 +1,44 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_3_9_0($module)
{
$result = true;
$sql = [
'CREATE TABLE IF NOT EXISTS `PREFIX_freshmail_birthday`(
`id_freshmail_birthday` INT NOT NULL AUTO_INCREMENT ,
`id_shop` INT NOT NULL ,
`enable` TINYINT(1) NOT NULL DEFAULT 0,
`tpl` VARCHAR(32),
`date_add` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`date_upd` TIMESTAMP NULL,
PRIMARY KEY (`id_freshmail_birthday`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci',
'CREATE TABLE IF NOT EXISTS `PREFIX_freshmail_birthday_lang`(
`id_freshmail_birthday` INT NOT NULL AUTO_INCREMENT ,
`id_lang` INT NOT NULL ,
`content` TEXT,
PRIMARY KEY (`id_freshmail_birthday`, `id_lang`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;',
];
foreach ($sql as $s){
$result &= Db::getInstance()->execute(
str_replace('PREFIX_', _DB_PREFIX_, $s)
);
}
$fs = (new \FreshMail\Repository\FreshmailSettings())->findForShop(Context::getContext()->shop->id);
if(!Validate::isLoadedObject($fs)){
return $result;
}
return $result
&& \FreshMail\Installer\InstallerFactory::getInstaller($module)->installTab(
'AdminFreshmailBirthday', 'Birthday', 'FreshmailConfig', false, ''
)
;
}