diff --git a/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/workunitdocument/mod_workunitdocument_standard.php b/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/workunitdocument/mod_workunitdocument_standard.php index b764b97d9..223ae191e 100644 --- a/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/workunitdocument/mod_workunitdocument_standard.php +++ b/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/workunitdocument/mod_workunitdocument_standard.php @@ -33,7 +33,7 @@ class mod_workunitdocument_standard extends ModeleNumRefSaturne /** * @var string Numbering module ref prefix. */ - public string $prefix = 'WUD'; + public string $prefix = 'UTD'; /** * @var string Name. diff --git a/core/modules/digiriskdolibarr/digiriskelement/workunit/mod_workunit_standard.php b/core/modules/digiriskdolibarr/digiriskelement/workunit/mod_workunit_standard.php index c19a29c1c..fc75c59c1 100644 --- a/core/modules/digiriskdolibarr/digiriskelement/workunit/mod_workunit_standard.php +++ b/core/modules/digiriskdolibarr/digiriskelement/workunit/mod_workunit_standard.php @@ -33,7 +33,7 @@ class mod_workunit_standard extends ModeleNumRefSaturne /** * @var string Numbering module ref prefix. */ - public string $prefix = 'WU'; + public string $prefix = 'UT'; /** * @var string Name. diff --git a/core/modules/modDigiriskDolibarr.class.php b/core/modules/modDigiriskDolibarr.class.php index ca6c04de4..2d7b19147 100644 --- a/core/modules/modDigiriskDolibarr.class.php +++ b/core/modules/modDigiriskDolibarr.class.php @@ -2103,9 +2103,6 @@ public function init($options = '') dolibarr_set_const($this->db, 'MAIN_EXTRAFIELDS_USE_SELECT2', 1, 'integer', 0, '', $conf->entity); } - dolibarr_set_const($this->db, 'DIGIRISKDOLIBARR_VERSION', $this->version, 'chaine', 0, '', $conf->entity); - dolibarr_set_const($this->db, 'DIGIRISKDOLIBARR_DB_VERSION', $this->version, 'chaine', 0, '', $conf->entity); - if ($conf->global->CATEGORIE_RECURSIV_ADD == 0) { dolibarr_set_const($this->db, 'CATEGORIE_RECURSIV_ADD', 1, 'integer', 0, '', $conf->entity); } @@ -2327,7 +2324,7 @@ public function init($options = '') 'RiskSign' => ['greip', 'RS{0}'], 'Evaluator' => ['bebhionn', 'EV{0}'], 'Groupment' => ['sirius', 'GP{0}'], - 'WorkUnit' => ['canopus', 'WU{0}'], + 'WorkUnit' => ['canopus', (version_compare($conf->global->DIGIRISKDOLIBARR_VERSION, '9.14.1') >= 0 ? 'UT{0}' : 'WU{0}')], 'Accident' => ['curtiss', 'ACC{0}'], 'AccidentLesion' => ['wright', 'ACCL{0}'], 'AccidentWorkStop' => ['richthofen', 'ACCW{0}'], @@ -2342,7 +2339,7 @@ public function init($options = '') 'ListingRisksAction' => ['gunnlod', 'RLA{0}'], 'ListingRisksPhoto' => ['fornjot', 'RLP{0}'], 'GroupmentDocument' => ['mundilfari', 'GPD{0}'], - 'WorkUnitDocument' => ['hati', 'WUD{0}'], + 'WorkUnitDocument' => ['hati', (version_compare($conf->global->DIGIRISKDOLIBARR_VERSION, '9.14.1') >= 0 ? 'UTD{0}' : 'WUD{0}')], 'RiskAssessmentDocument' => ['eggther', 'DU{0}'], 'PreventionPlanDocument' => ['bestla', 'PPD{0}'], 'FirePermitDocument' => ['greip', 'FPD{0}'], @@ -2375,7 +2372,10 @@ public function init($options = '') rename($mediaPath . '/accident_investigationdocument', $mediaPath . '/accidentinvestigationdocument'); } - return $this->_init($sql, $options); + dolibarr_set_const($this->db, 'DIGIRISKDOLIBARR_VERSION', $this->version, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($this->db, 'DIGIRISKDOLIBARR_DB_VERSION', $this->version, 'chaine', 0, '', $conf->entity); + + return $this->_init($sql, $options); } /**