// Remove old code and calls to AdminCatalog

This commit is contained in:
tDidierjean
2012-01-10 17:16:54 +00:00
parent 9d4dac5363
commit 2560f50da8
9 changed files with 14 additions and 406 deletions
+10 -10
View File
@@ -273,36 +273,36 @@ class AdminGroupsControllerCore extends AdminController
protected function formatCategoryDiscountList($id)
{
$categorie = GroupReduction::getGroupReductions((int)$id, $this->context->language->id);
$categorie_reductions = array();
$category = GroupReduction::getGroupReductions((int)$id, $this->context->language->id);
$category_reductions = array();
$category_reduction = Tools::getValue('category_reduction');
foreach ($categorie as $category)
foreach ($category as $category)
{
if (is_array($category_reduction) && array_key_exists($category['id_category'], $category_reduction))
$category['reduction'] = $category_reduction[$category['id_category']];
$tmp = array();
$tmp['path'] = getPath(self::$currentIndex.'?tab=AdminCatalog', (int)$category['id_category']);
$tmp['path'] = getPath(self::$currentIndex.'?tab=AdminCategories', (int)$category['id_category']);
$tmp['reduction'] = (float)$category['reduction'] * 100;
$tmp['id_category'] = (int)$category['id_category'];
$categorie_reductions[(int)$category['id_category']] = $tmp;
$category_reductions[(int)$category['id_category']] = $tmp;
}
if (is_array($category_reduction))
foreach ($category_reduction as $key => $val)
{
if (!array_key_exists($key, $categorie_reductions))
if (!array_key_exists($key, $category_reductions))
{
$tmp = array();
$tmp['path'] = getPath(self::$currentIndex.'?tab=AdminCatalog', (int)$key);
$tmp['path'] = getPath(self::$currentIndex.'?tab=AdminCategories', $key);
$tmp['reduction'] = (float)$val * 100;
$tmp['id_category'] = (int)$key;
$categorie_reductions[(int)$category['id_category']] = $tmp;
$category_reductions[(int)$category['id_category']] = $tmp;
}
}
return $categorie_reductions;
return $category_reductions;
}
public function formatModuleListAuth($id_group)
@@ -388,7 +388,7 @@ class AdminGroupsControllerCore extends AdminController
else
{
$result['id_category'] = (int)$id_category;
$result['catPath'] = getPath(self::$currentIndex.'?tab=AdminCatalog', (int)$id_category);
$result['catPath'] = getPath(self::$currentIndex.'?tab=AdminCategories', (int)$id_category);
$result['discount'] = $category_reduction;
$result['hasError'] = false;
}