[-] BO : super admins are now added to all shops #PSCFV-3561
This commit is contained in:
@@ -219,6 +219,7 @@ class ShopCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
$res = parent::add($autodate, $null_values);
|
$res = parent::add($autodate, $null_values);
|
||||||
Shop::cacheShops(true);
|
Shop::cacheShops(true);
|
||||||
|
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'employee_shop (id_employee, id_shop) (SELECT id_employee, '.(int)$this->id.' FROM '._DB_PREFIX_.'employee WHERE id_profile = '.(int)_PS_ADMIN_PROFILE_.')');
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -412,6 +412,21 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_POST['id_profile'] == _PS_ADMIN_PROFILE_)
|
||||||
|
{
|
||||||
|
$result = Db::getInstance()->executeS('SELECT id_shop FROM '._DB_PREFIX_.'shop');
|
||||||
|
foreach ($result as $row)
|
||||||
|
{
|
||||||
|
$key = 'checkBoxShopAsso_'.$this->table;
|
||||||
|
if (!isset($_POST[$key]))
|
||||||
|
$_POST[$key] = array();
|
||||||
|
if (!isset($_GET[$key]))
|
||||||
|
$_GET[$key] = array();
|
||||||
|
$_POST[$key][$row['id_shop']] = 1;
|
||||||
|
$_GET[$key][$row['id_shop']] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($employee->isLastAdmin())
|
if ($employee->isLastAdmin())
|
||||||
{
|
{
|
||||||
if (Tools::getValue('id_profile') != (int)_PS_ADMIN_PROFILE_)
|
if (Tools::getValue('id_profile') != (int)_PS_ADMIN_PROFILE_)
|
||||||
|
|||||||
Reference in New Issue
Block a user