// Restore shop context in shop list and can filter shop pages per group shop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13579 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+12
-4
@@ -418,10 +418,18 @@ function generateShopList()
|
|||||||
foreach ($tree as $gID => $group_data)
|
foreach ($tree as $gID => $group_data)
|
||||||
{
|
{
|
||||||
$disabled = ($group_data['totalShops'] != count($group_data['shops'])) ? 'disabled="disabled"' : '';
|
$disabled = ($group_data['totalShops'] != count($group_data['shops'])) ? 'disabled="disabled"' : '';
|
||||||
$html .= '<option class="group" value="g-'.$gID.'" '.(($value == 'g-'.$gID) ? 'selected="selected"' : '').' '.$disabled.'>'.translate('Group:').' '.htmlspecialchars($group_data['name']).'</option>';
|
if ($context->controller->multishop_context & Shop::CONTEXT_GROUP)
|
||||||
foreach ($group_data['shops'] as $sID => $shopData)
|
$html .= '<option class="group" value="g-'.$gID.'" '.(($value == 'g-'.$gID) ? 'selected="selected"' : '').' '.$disabled.'>'.translate('Group:').' '.htmlspecialchars($group_data['name']).'</option>';
|
||||||
if ($shopData['active'])
|
else
|
||||||
$html .= '<option value="s-'.$sID.'" class="shop" '.(($value == 's-'.$sID) ? 'selected="selected"' : '').'>» '.$shopData['name'].'</option>';
|
$html .= '<optgroup class="group" label="'.translate('Group:').' '.htmlspecialchars($group_data['name']).'">';
|
||||||
|
|
||||||
|
if ($context->controller->multishop_context & Shop::CONTEXT_SHOP)
|
||||||
|
foreach ($group_data['shops'] as $sID => $shopData)
|
||||||
|
if ($shopData['active'])
|
||||||
|
$html .= '<option value="s-'.$sID.'" class="shop" '.(($value == 's-'.$sID) ? 'selected="selected"' : '').'>» '.$shopData['name'].'</option>';
|
||||||
|
|
||||||
|
if (!($context->controller->multishop_context & Shop::CONTEXT_GROUP))
|
||||||
|
$html .= '</optgroup>';
|
||||||
}
|
}
|
||||||
$html .= '</select>';
|
$html .= '</select>';
|
||||||
|
|
||||||
|
|||||||
@@ -689,16 +689,6 @@ class ShopCore extends ObjectModel
|
|||||||
return self::$context_id_group_shop;
|
return self::$context_id_group_shop;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get ID shop from context
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public static function getContextGroupID()
|
|
||||||
{
|
|
||||||
return Shop::getContext('group');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an sql restriction for shops fields
|
* Add an sql restriction for shops fields
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -237,6 +237,9 @@ class AdminShopControllerCore extends AdminController
|
|||||||
|
|
||||||
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
|
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
|
||||||
{
|
{
|
||||||
|
if (Shop::getContext() == Shop::CONTEXT_GROUP)
|
||||||
|
$this->_where .= ' AND a.id_group_shop = '.(int)Shop::getContextGroupShopID();
|
||||||
|
|
||||||
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
|
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
|
||||||
$shop_delete_list = array();
|
$shop_delete_list = array();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user