diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 3d3f0aeebd7642d23432c571bfb45e9dcd5f63dc..1b104ee5921d3421b108bbdf1a8c43bae2823d36 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -1001,6 +1001,16 @@ class PageController extends Controller { if (empty($this->_dematpayslipConfigList['payslip_dir']) || empty($this->_dematpayslipConfigList['user_id'])) { $this->_msgList['error'][] = $this->l->t('Veuillez vérifier la configuration de cette application.'); } + + $pastellUse = OC::$server->getConfig()->getAppValue($this->appName, 'pastell_use', ''); + if (!empty($pastellUse)) { + // check Pastell API config + $pastellConfigFlow1Id = OC::$server->getConfig()->getAppValue($this->appName, 'pastell_config_f1_id', ''); + $pastellConfigFlow2Id = OC::$server->getConfig()->getAppValue($this->appName, 'pastell_config_f2_id', ''); + if (!($pastellConfigFlow1Id > 0) || !($pastellConfigFlow2Id > 0)) { + $this->_msgList['error'][] = $this->l->t('Veuillez vérifier la configuration de cette application.'); + } + } } /** diff --git a/lib/Settings/AdminSettings.php b/lib/Settings/AdminSettings.php index f93e255496fae9626aeed5c5c4974fdc42346136..22a67747555b899788ebaf98a6ed7172b3c71224 100644 --- a/lib/Settings/AdminSettings.php +++ b/lib/Settings/AdminSettings.php @@ -276,6 +276,16 @@ class AdminSettings implements ISettings { } if (count($this->_msgList['error']) <= 0) { + $pastellConfigF1Id = $this->config->getAppValue($this->appName, 'pastell_config_f1_id'); + // FIX -- Pastell config flow is NULL + if (empty($pastellConfigF1Id)) { + $this->config->deleteAppValue($this->appName,'pastell_config_f1_id'); + } + $pastellConfigF2Id = $this->config->getAppValue($this->appName, 'pastell_config_f2_id'); + // FIX -- Pastell config flow is NULL + if (empty($pastellConfigF2Id)) { + $this->config->deleteAppValue($this->appName,'pastell_config_f2_id'); + } $this->config->setAppValue($this->appName, 'pastell_config_f1_id', $pastellConfigFlow1Id); $this->config->setAppValue($this->appName, 'pastell_config_f2_id', $pastellConfigFlow2Id); }