diff --git a/README.md b/README.md index 2b648ba3f..588c466af 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Informations - Numéro du module : 436302 -- Dernière mise à jour : 08/04/2024 +- Dernière mise à jour : 23/04/2024 - Éditeur : [Evarisk](https://evarisk.com) - Thème : Eldy Menu - Licence : GPLv3 @@ -11,7 +11,7 @@ ### Version -- Version : 9.15.0 +- Version : 10.0.0 - PHP : 7.4.33 - Compatibilité : Dolibarr 16.0.0 - 19.0.1 - Saturne Framework : 1.3.0 diff --git a/admin/config/riskassessmentdocument.php b/admin/config/riskassessmentdocument.php index 4ab9e6f16..413d402e7 100644 --- a/admin/config/riskassessmentdocument.php +++ b/admin/config/riskassessmentdocument.php @@ -81,6 +81,8 @@ if (($action == 'update' && ! GETPOST("cancel", 'alpha')) || ($action == 'updateedit')) { $DUProject = GETPOST('DUProject', 'none'); $DUProject = preg_split('/_/', $DUProject); + $EnvironmentProject = GETPOST('EnvironmentProject', 'none'); + $EnvironmentProject = preg_split('/_/', $EnvironmentProject); $evaluatorDuration = GETPOST('EvaluatorDuration', 'alpha'); $taskTimeSpentDuration = GETPOST('TaskTimeSpentDuration', 'alpha'); @@ -101,6 +103,23 @@ } } + if ($EnvironmentProject[0] > 0 && $EnvironmentProject[0] != $conf->global->DIGIRISKDOLIBARR_ENVIRONMENT_PROJECT) { + dolibarr_set_const($db, "DIGIRISKDOLIBARR_ENVIRONMENT_PROJECT", $EnvironmentProject[0], 'integer', 0, '', $conf->entity); + + $url = '/projet/tasks.php?id=' . $EnvironmentProject[0]; + + $sql = "UPDATE ".MAIN_DB_PREFIX."menu SET"; + $sql .= " url='".$db->escape($url)."'"; + $sql .= " WHERE leftmenu='digiriskenvironmentalactionplan'"; + $sql .= " AND entity=" . $conf->entity; + + $resql = $db->query($sql); + if (!$resql) { + $error = "Error ".$db->lasterror(); + return -1; + } + } + if (!empty($evaluatorDuration) || $evaluatorDuration === '0') { dolibarr_set_const($db, "DIGIRISKDOLIBARR_EVALUATOR_DURATION", $evaluatorDuration, 'integer', 0, '', $conf->entity); } @@ -193,6 +212,11 @@ 'name' => 'RiskListParentView', 'description' => 'RiskListParentViewDescription', 'code' => 'DIGIRISKDOLIBARR_RISK_LIST_PARENT_VIEW', + ], + 'CategoryOnRisk' => [ + 'name' => 'CategoryOnRisk', + 'description' => 'CategoryOnRiskDescription', + 'code' => 'DIGIRISKDOLIBARR_CATEGORY_ON_RISK', ], 'ShowInheritedRisksInDocuments' => [ 'name' => 'ShowInheritedRisksInDocuments', @@ -278,6 +302,12 @@ print '