// // Pastèque is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Pastèque is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Pastèque. If not, see <http://www.gnu.org/licenses/>. namespace BaseStocks; $modules = \Pasteque\get_loaded_modules(\Pasteque\get_user_id()); $multilocations = false; $defaultLocationId = null; if (in_array("stock_multilocations", $modules)) { $multilocations = true; } $locSrv = new \Pasteque\LocationsService(); $locations = $locSrv->getAll(); $locNames = array(); $locIds = array(); foreach ($locations as $location) { $locNames[] = $location->label; $locIds[] = $location->id; } $currLocation = null; if (isset($_POST['location'])) {
// // Pastèque is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Pastèque. If not, see <http://www.gnu.org/licenses/>. namespace ModulesManagement; $message = null; $error = null; $modules = null; $mandatoryModules = null; $freeModules = null; $activatedModules = \Pasteque\get_loaded_modules(\Pasteque\get_user_id()); $cfg = \getConfig(); if (!isset($cfg['pp_modules']) || !isset($cfg['mandatory_modules']) || !isset($cfg['free_modules'])) { $error = \i18n("Module list is not configured.", PLUGIN_NAME); $modules = array(); $freeModules = array(); $mandatoryModules = array("module_payment"); } else { $modules = $cfg['pp_modules']; $freeModules = $cfg['free_modules']; $mandatoryModules = $cfg['mandatory_modules']; } if (isset($_POST['modules']) && count($mandatoryModules) > 0) { $pdo = \Pasteque\PDOBuilder::getPDO(); $paidModules = array(); foreach ($modules as $module) {