// Fix added GroupShop Manufacturer

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9711 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2011-10-28 13:01:20 +00:00
parent 9fb10416f4
commit c044aea666
2 changed files with 15 additions and 4 deletions
@@ -101,7 +101,7 @@ function check_all_shop() {ldelim}
</td>
</tr>
{if $input.type = 'shop'}
{if $input.type == 'shop'}
{assign var=j value=0}
{foreach $groupData['shops'] as $shopID => $shopData}
{if ((isset($fields_value.shop[$shopID]) && in_array($form_id, $fields_value.shop[$shopID])) || !$form_id)}
@@ -303,6 +303,9 @@ class AdminManufacturersControllerCore extends AdminController
)
);
if (!($manufacturer = $this->loadObject(true)))
return;
/*
* Where it used? You can not insert into a table or in the fields of a table
*/
@@ -321,9 +324,6 @@ class AdminManufacturersControllerCore extends AdminController
'class' => 'button'
);
if (!($manufacturer = $this->loadObject(true)))
return;
$image = cacheImage(_PS_MANU_IMG_DIR_.'/'.$manufacturer->id.'.jpg', $this->table.'_'.(int)$manufacturer->id.'.'.$this->imageType, 350, $this->imageType, true);
$this->fields_value = array(
@@ -346,6 +346,17 @@ class AdminManufacturersControllerCore extends AdminController
)), ENT_COMPAT, 'UTF-8');
}
//Added values of object Shop
if ($manufacturer->id)
{
$assos = array();
$sql = 'SELECT `id_group_shop`, `'.pSQL($this->identifier).'`
FROM `'._DB_PREFIX_.pSQL($this->table).'_group_shop`
WHERE `'.pSQL($this->identifier).'` = '.(int)$manufacturer->id;
foreach (Db::getInstance()->executeS($sql) as $row)
$this->fields_value['shop'][$row['id_group_shop']][] = $row[$this->identifier];
}
return parent::initForm();
}