// Fix multishop context in BO
This commit is contained in:
@@ -255,7 +255,7 @@ class AdminControllerCore extends Controller
|
|||||||
*/
|
*/
|
||||||
public $controller_name;
|
public $controller_name;
|
||||||
|
|
||||||
public $multishop_context;
|
public $multishop_context = -1;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -266,7 +266,8 @@ class AdminControllerCore extends Controller
|
|||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->multishop_context = Shop::CONTEXT_ALL | Shop::CONTEXT_GROUP | Shop::CONTEXT_SHOP;
|
if ($this->multishop_context == -1)
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL | Shop::CONTEXT_GROUP | Shop::CONTEXT_SHOP;
|
||||||
|
|
||||||
$this->bo_theme = ((Validate::isLoadedObject($this->context->employee) && $this->context->employee->bo_theme) ? $this->context->employee->bo_theme : 'default');
|
$this->bo_theme = ((Validate::isLoadedObject($this->context->employee) && $this->context->employee->bo_theme) ? $this->context->employee->bo_theme : 'default');
|
||||||
$this->context->smarty->setTemplateDir(_PS_BO_ALL_THEMES_DIR_.$this->bo_theme.'/template');
|
$this->context->smarty->setTemplateDir(_PS_BO_ALL_THEMES_DIR_.$this->bo_theme.'/template');
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ class AdminCurrenciesControllerCore extends AdminController
|
|||||||
$this->table = 'currency';
|
$this->table = 'currency';
|
||||||
$this->className = 'Currency';
|
$this->className = 'Currency';
|
||||||
$this->lang = false;
|
$this->lang = false;
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->multishop_context = Shop::CONTEXT_ALL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class AdminGroupShopControllerCore extends AdminController
|
|||||||
$this->className = 'GroupShop';
|
$this->className = 'GroupShop';
|
||||||
$this->lang = false;
|
$this->lang = false;
|
||||||
$this->requiredDatabase = true;
|
$this->requiredDatabase = true;
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
|
|
||||||
$this->addRowAction('edit');
|
$this->addRowAction('edit');
|
||||||
|
|
||||||
@@ -67,8 +68,6 @@ class AdminGroupShopControllerCore extends AdminController
|
|||||||
);
|
);
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->multishop_context = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderForm()
|
public function renderForm()
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ class AdminHomeControllerCore extends AdminController
|
|||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->multishop_context = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function _displayOptimizationTips()
|
protected function _displayOptimizationTips()
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class AdminLanguagesControllerCore extends AdminController
|
|||||||
$this->className = 'Language';
|
$this->className = 'Language';
|
||||||
$this->lang = false;
|
$this->lang = false;
|
||||||
$this->deleted = false;
|
$this->deleted = false;
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
|
|
||||||
$this->requiredDatabase = true;
|
$this->requiredDatabase = true;
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class AdminShopControllerCore extends AdminController
|
|||||||
$this->context = Context::getContext();
|
$this->context = Context::getContext();
|
||||||
$this->table = 'shop';
|
$this->table = 'shop';
|
||||||
$this->className = 'Shop';
|
$this->className = 'Shop';
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL | Shop::CONTEXT_SHOP;
|
||||||
|
|
||||||
$this->fieldsDisplay = array(
|
$this->fieldsDisplay = array(
|
||||||
'id_shop' => array(
|
'id_shop' => array(
|
||||||
@@ -92,8 +93,6 @@ class AdminShopControllerCore extends AdminController
|
|||||||
);
|
);
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->multishop_context ^= Shop::CONTEXT_SHOP;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initToolbar()
|
public function initToolbar()
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class AdminShopUrlControllerCore extends AdminController
|
|||||||
$this->className = 'ShopUrl';
|
$this->className = 'ShopUrl';
|
||||||
$this->lang = false;
|
$this->lang = false;
|
||||||
$this->requiredDatabase = true;
|
$this->requiredDatabase = true;
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
|
|
||||||
$this->context = Context::getContext();
|
$this->context = Context::getContext();
|
||||||
|
|
||||||
@@ -88,8 +89,6 @@ class AdminShopUrlControllerCore extends AdminController
|
|||||||
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
|
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->multishop_context = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderList()
|
public function renderList()
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class AdminStockConfigurationControllerCore extends AdminController
|
|||||||
$this->table = 'stock_mvt_reason';
|
$this->table = 'stock_mvt_reason';
|
||||||
$this->className = 'StockMvtReason';
|
$this->className = 'StockMvtReason';
|
||||||
$this->lang = true;
|
$this->lang = true;
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
|
|
||||||
// defines fields
|
// defines fields
|
||||||
$this->fieldsDisplay = array(
|
$this->fieldsDisplay = array(
|
||||||
@@ -121,8 +122,6 @@ class AdminStockConfigurationControllerCore extends AdminController
|
|||||||
);
|
);
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->multishop_context = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class AdminStockCoverControllerCore extends AdminController
|
|||||||
$this->className = 'Product';
|
$this->className = 'Product';
|
||||||
$this->lang = true;
|
$this->lang = true;
|
||||||
$this->colorOnBackground = true;
|
$this->colorOnBackground = true;
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
|
|
||||||
$this->fieldsDisplay = array(
|
$this->fieldsDisplay = array(
|
||||||
'reference' => array(
|
'reference' => array(
|
||||||
@@ -103,8 +104,6 @@ class AdminStockCoverControllerCore extends AdminController
|
|||||||
array_unshift($this->stock_cover_warehouses, array('id_warehouse' => -1, 'name' => $this->l('All Warehouses')));
|
array_unshift($this->stock_cover_warehouses, array('id_warehouse' => -1, 'name' => $this->l('All Warehouses')));
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->multishop_context = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class AdminStockInstantStateControllerCore extends AdminController
|
|||||||
$this->table = 'stock';
|
$this->table = 'stock';
|
||||||
$this->className = 'Stock';
|
$this->className = 'Stock';
|
||||||
$this->lang = false;
|
$this->lang = false;
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
|
|
||||||
$this->fieldsDisplay = array(
|
$this->fieldsDisplay = array(
|
||||||
'reference' => array(
|
'reference' => array(
|
||||||
@@ -102,8 +103,6 @@ class AdminStockInstantStateControllerCore extends AdminController
|
|||||||
array_unshift($this->stock_instant_state_warehouses, array('id_warehouse' => -1, 'name' => $this->l('All Warehouses')));
|
array_unshift($this->stock_instant_state_warehouses, array('id_warehouse' => -1, 'name' => $this->l('All Warehouses')));
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->multishop_context = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class AdminStockManagementControllerCore extends AdminController
|
|||||||
$this->table = 'product';
|
$this->table = 'product';
|
||||||
$this->className = 'Product';
|
$this->className = 'Product';
|
||||||
$this->lang = true;
|
$this->lang = true;
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
|
|
||||||
$this->fieldsDisplay = array(
|
$this->fieldsDisplay = array(
|
||||||
'reference' => array(
|
'reference' => array(
|
||||||
@@ -71,8 +72,6 @@ class AdminStockManagementControllerCore extends AdminController
|
|||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->multishop_context = null;
|
|
||||||
|
|
||||||
// overrides confirmation messages specifically for this controller
|
// overrides confirmation messages specifically for this controller
|
||||||
$this->_conf = array(
|
$this->_conf = array(
|
||||||
1 => $this->l('The product was successfully added to stock'),
|
1 => $this->l('The product was successfully added to stock'),
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class AdminStockMvtControllerCore extends AdminController
|
|||||||
$this->className = 'StockMvt';
|
$this->className = 'StockMvt';
|
||||||
$this->identifier = 'id_stock_mvt';
|
$this->identifier = 'id_stock_mvt';
|
||||||
$this->lang = false;
|
$this->lang = false;
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
|
|
||||||
$this->list_no_link = true;
|
$this->list_no_link = true;
|
||||||
$this->displayInformation($this->l('This interface allows you to display the stock movements for a selected warehouse.').'<br />');
|
$this->displayInformation($this->l('This interface allows you to display the stock movements for a selected warehouse.').'<br />');
|
||||||
@@ -115,8 +116,6 @@ class AdminStockMvtControllerCore extends AdminController
|
|||||||
);
|
);
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->multishop_context = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
|||||||
$this->identifier = 'id_supply_order';
|
$this->identifier = 'id_supply_order';
|
||||||
$this->lang = false;
|
$this->lang = false;
|
||||||
$this->is_template_list = false;
|
$this->is_template_list = false;
|
||||||
|
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||||
|
|
||||||
$this->addRowAction('updatereceipt');
|
$this->addRowAction('updatereceipt');
|
||||||
$this->addRowAction('changestate');
|
$this->addRowAction('changestate');
|
||||||
@@ -113,8 +114,6 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
|||||||
array_unshift($this->warehouses, array('id_warehouse' => -1, 'name' => $this->l('All Warehouses')));
|
array_unshift($this->warehouses, array('id_warehouse' => -1, 'name' => $this->l('All Warehouses')));
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->multishop_context = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user