// Fix auth issues for multishop

This commit is contained in:
rMalie
2012-02-27 17:03:58 +00:00
parent ebdf5e92bd
commit f1d8763d35
3 changed files with 3 additions and 7 deletions
+2 -6
View File
@@ -412,15 +412,11 @@ function generateShopList()
$url = $_SERVER['REQUEST_URI'].(($_SERVER['QUERY_STRING']) ? '&' : '?').'setShopContext=';
$html = '<select class="shopList chosen" onchange="location.href = \''.$url.'\'+$(this).val();">';
if ($context->employee->id_profile == _PS_ADMIN_PROFILE_ ||
$context->shop->getTotalShopsWhoExists() == Employee::getTotalEmployeeShopById($context->employee->id))
$html .= '<option value="" class="first">'.translate('All shops').'</option>';
/*$html .= (Context::getContext()->employee->id_profile == _PS_ADMIN_PROFILE_) ? '<option value="" class="first">'.translate('All shops').'</option>' : '';*/
$html .= '<option value="" class="first">'.translate('All shops').'</option>';
foreach ($tree as $gID => $group_data)
{
$disabled = ($group_data['totalShops'] != count($group_data['shops'])) ? 'disabled="disabled"' : '';
if ($context->controller->multishop_context & Shop::CONTEXT_GROUP)
$html .= '<option class="group" value="g-'.$gID.'" '.(($value == 'g-'.$gID) ? 'selected="selected"' : '').' '.$disabled.'>'.translate('Group:').' '.htmlspecialchars($group_data['name']).'</option>';
$html .= '<option class="group" value="g-'.$gID.'" '.(($value == 'g-'.$gID) ? 'selected="selected"' : '').'>'.translate('Group:').' '.htmlspecialchars($group_data['name']).'</option>';
else
$html .= '<optgroup class="group" label="'.translate('Group:').' '.htmlspecialchars($group_data['name']).'">';