[*] BO : when a group is created, every category are linked to this group

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9859 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vChabot
2011-11-03 17:14:16 +00:00
parent c9f065173b
commit ef00a2400b
3 changed files with 13 additions and 1 deletions
+10
View File
@@ -775,7 +775,17 @@ abstract class AdminTabCore
$this->afterAdd($object);
$this->updateAssoShop($object->id);
if ($this->table == 'group')
{
$this->updateRestrictions($object->id);
// assign group access to every categories
$categories = Category::getCategories($this->context->language->id, true);
$rowList = array();$a=0;
foreach ($categories as $category)
foreach ($category as $categ_id => $categ)
if ($categ_id != 1)
$rowList[] = array('id_category' => $categ_id, 'id_group' => $object->id);
Db::getInstance()->autoExecute(_DB_PREFIX_.'category_group', $rowList, 'INSERT');
}
// Save and stay on same form
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay'))
Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&update'.$this->table.'&token='.$token);