diff --git a/controllers/admin/AdminStockConfigurationController.php b/controllers/admin/AdminStockConfigurationController.php index c661b9777..c082f5838 100644 --- a/controllers/admin/AdminStockConfigurationController.php +++ b/controllers/admin/AdminStockConfigurationController.php @@ -552,4 +552,24 @@ class AdminStockConfigurationControllerCore extends AdminController } } } -} \ No newline at end of file + + public function initContent() + { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } + parent::initContent(); + } + + public function initProcess() + { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } + parent::initProcess(); + } +} diff --git a/controllers/admin/AdminStockCoverController.php b/controllers/admin/AdminStockCoverController.php index cd95e5861..0a07d2b36 100644 --- a/controllers/admin/AdminStockCoverController.php +++ b/controllers/admin/AdminStockCoverController.php @@ -351,4 +351,24 @@ class AdminStockCoverControllerCore extends AdminController $quantity = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query); return $quantity; } + + public function initContent() + { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } + parent::initContent(); + } + + public function initProcess() + { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } + parent::initProcess(); + } } diff --git a/controllers/admin/AdminStockInstantStateController.php b/controllers/admin/AdminStockInstantStateController.php index 3e706556c..1c7a961fa 100644 --- a/controllers/admin/AdminStockInstantStateController.php +++ b/controllers/admin/AdminStockInstantStateController.php @@ -442,5 +442,25 @@ class AdminStockInstantStateControllerCore extends AdminController } } } + + public function initContent() + { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } + parent::initContent(); + } + + public function initProcess() + { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } + parent::initProcess(); + } } diff --git a/controllers/admin/AdminStockManagementController.php b/controllers/admin/AdminStockManagementController.php index ca1e1e55f..abdda0194 100644 --- a/controllers/admin/AdminStockManagementController.php +++ b/controllers/admin/AdminStockManagementController.php @@ -951,6 +951,12 @@ class AdminStockManagementControllerCore extends AdminController */ public function initContent() { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } + // Manage the add stock form if ($this->display == 'addstock' || $this->display == 'removestock' || $this->display == 'transferstock') { @@ -1138,4 +1144,14 @@ class AdminStockManagementControllerCore extends AdminController return $this->context->smarty->fetch('helpers/list/list_action_transferstock.tpl'); } + + public function initProcess() + { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } + parent::initProcess(); + } } diff --git a/controllers/admin/AdminStockMvtController.php b/controllers/admin/AdminStockMvtController.php index 4505b6cf9..6486113ab 100644 --- a/controllers/admin/AdminStockMvtController.php +++ b/controllers/admin/AdminStockMvtController.php @@ -293,5 +293,25 @@ class AdminStockMvtControllerCore extends AdminController echo sprintf("%s\n", implode(';', array_map(array('CSVCore', 'wrap'), $row_csv))); } } + + public function initContent() + { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } + parent::initContent(); + } + + public function initProcess() + { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } + parent::initProcess(); + } } diff --git a/controllers/admin/AdminSupplyOrdersController.php b/controllers/admin/AdminSupplyOrdersController.php index 54be43c9b..83962b0db 100644 --- a/controllers/admin/AdminSupplyOrdersController.php +++ b/controllers/admin/AdminSupplyOrdersController.php @@ -845,6 +845,11 @@ class AdminSupplyOrdersControllerCore extends AdminController */ public function initContent() { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } // Manage the add stock form if (Tools::isSubmit('changestate')) $this->initChangeStateContent(); @@ -2164,4 +2169,14 @@ class AdminSupplyOrdersControllerCore extends AdminController return $status; } + + public function initProcess() + { + if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) + { + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + return false; + } + parent::initProcess(); + } }