[-] MO : #PSCFV-2567 - Module CMS block was not merged with new shop

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15678 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-05-25 08:58:11 +00:00
parent 81f87e0bfe
commit 27ca8f5481
2 changed files with 37 additions and 25 deletions
+13 -1
View File
@@ -39,7 +39,7 @@ class BlockCms extends Module
{ {
$this->name = 'blockcms'; $this->name = 'blockcms';
$this->tab = 'front_office_features'; $this->tab = 'front_office_features';
$this->version = 1.1; $this->version = '1.1.1';
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->need_instance = 0; $this->need_instance = 0;
@@ -54,6 +54,7 @@ class BlockCms extends Module
{ {
if (!parent::install() || if (!parent::install() ||
!$this->registerHooks() || !$this->registerHooks() ||
!$this->registerHook('actionShopDataDuplication') ||
!BlockCMSModel::createTables() || !BlockCMSModel::createTables() ||
!Configuration::updateValue('FOOTER_CMS', '') || !Configuration::updateValue('FOOTER_CMS', '') ||
!Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', 1) || !Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', 1) ||
@@ -103,6 +104,7 @@ class BlockCms extends Module
{ {
if (!parent::uninstall() || if (!parent::uninstall() ||
!BlockCMSModel::DropTables() || !BlockCMSModel::DropTables() ||
!$this->unregisterHook('actionShopDataDuplication') ||
!Configuration::deleteByName('FOOTER_CMS') || !Configuration::deleteByName('FOOTER_CMS') ||
!Configuration::deleteByName('FOOTER_BLOCK_ACTIVATION') || !Configuration::deleteByName('FOOTER_BLOCK_ACTIVATION') ||
!Configuration::deleteByName('FOOTER_POWEREDBY')) !Configuration::deleteByName('FOOTER_POWEREDBY'))
@@ -733,4 +735,14 @@ class BlockCms extends Module
BlockCMSModel::updateCMSBlockPosition($pos[2], $position); BlockCMSModel::updateCMSBlockPosition($pos[2], $position);
} }
} }
public function hookActionShopDataDuplication($params)
{
Db::getInstance()->execute('
INSERT INTO '._DB_PREFIX_.'cms_block_shop (id_cms_block, id_shop)
SELECT id_cms_block, '.(int)$params['new_id_shop'].'
FROM '._DB_PREFIX_.'cms_block_shop
WHERE id_shop = '.(int)$params['old_id_shop'].'
');
}
} }
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>blockcms</name> <name>blockcms</name>
<displayName><![CDATA[CMS Block]]></displayName> <displayName><![CDATA[CMS Block]]></displayName>
<version><![CDATA[1.1]]></version> <version><![CDATA[1.1.1]]></version>
<description><![CDATA[Adds a block with several CMS links.]]></description> <description><![CDATA[Adds a block with several CMS links.]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab> <tab><![CDATA[front_office_features]]></tab>