[-] MO : #PSCFV-2437 : Shop ID configuration changed

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15729 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
fGaillard
2012-05-29 09:52:16 +00:00
parent 3de1c372a6
commit cdafc9190c
3 changed files with 7 additions and 6 deletions
-1
View File
@@ -1,4 +1,3 @@
SET NAMES 'utf8';
/* PHP:add_missing_image_key(); */;
ALTER TABLE `PREFIX_cms_block_shop` ADD COLUMN `id_group_shop` int(10) unsigned DEFAULT 0 AFTER `id_cms_block`;
+3 -4
View File
@@ -119,7 +119,6 @@ class BlockCMSModel extends ObjectModel
{
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_shop` (
`id_cms_block` int(10) unsigned NOT NULL auto_increment,
`id_group_shop` int(10) unsigned NOT NULL,
`id_shop` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_cms_block`, `id_shop`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
@@ -158,10 +157,10 @@ class BlockCMSModel extends ObjectModel
return Db::getInstance()->Insert_ID();
}
public static function insertCMSBlockShop($id_cms_block, $id_group_shop, $id_shop)
public static function insertCMSBlockShop($id_cms_block, $id_shop)
{
$sql = 'INSERT INTO `'._DB_PREFIX_.'cms_block_shop` (`id_cms_block`, `id_group_shop`, `id_shop`)
VALUES('.(int)$id_cms_block.', '.(int)$id_group_shop.', '.(int)$id_shop.')';
$sql = 'INSERT INTO `'._DB_PREFIX_.'cms_block_shop` (`id_cms_block`, `id_shop`)
VALUES('.(int)$id_cms_block.', '.(int)$id_shop.')';
Db::getInstance()->execute($sql);
+4 -1
View File
@@ -559,7 +559,10 @@ class BlockCms extends Module
foreach ($this->context->controller->_languages as $language)
BlockCMSModel::insertCMSBlockLang($id_cms_block, $language['id_lang']);
BlockCMSModel::insertCMSBlockShop($id_cms_block, $this->context->shop->id_shop_group, $this->context->shop->id);
$shops = Shop::getContextListShopID();
foreach ($shops as $shop)
BlockCMSModel::insertCMSBlockShop($id_cms_block, $shop);
}
$this->_errors[] = $this->l('New block cannot be created !');