diff --git a/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/accidentinvestigationdocument/mod_accidentinvestigationdocument_standard.php b/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/accidentinvestigationdocument/mod_accidentinvestigationdocument_standard.php index e9cd377bf..c49aa4550 100644 --- a/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/accidentinvestigationdocument/mod_accidentinvestigationdocument_standard.php +++ b/core/modules/digiriskdolibarr/digiriskdolibarrdocuments/accidentinvestigationdocument/mod_accidentinvestigationdocument_standard.php @@ -17,7 +17,7 @@ */ /** - * \file core/modules/digiriskdolibarr/address/mod_accident_investigation_document_standard.php + * \file core/modules/digiriskdolibarr/address/mod_accidentinvestigationdocument_standard.php * \ingroup digiriskdolibarr * \brief File of class to manage accident investigation document numbering rules standard. */ @@ -28,7 +28,7 @@ /** * Class to manage accident investigation document numbering rules standard. */ -class mod_accident_investigation_document_standard extends ModeleNumRefSaturne +class mod_accidentinvestigationdocument_standard extends ModeleNumRefSaturne { /** * @var string Numbering module ref prefix. diff --git a/core/modules/modDigiriskDolibarr.class.php b/core/modules/modDigiriskDolibarr.class.php index dc1cd2461..3e4041b1e 100644 --- a/core/modules/modDigiriskDolibarr.class.php +++ b/core/modules/modDigiriskDolibarr.class.php @@ -849,7 +849,7 @@ public function __construct($db) $i++ => ['DIGIRISKDOLIBARR_MAIN_AGENDA_ACTIONAUTO_ACCIDENTINVESTIGATION_SENTBYMAIL', 'integer', 1, '', 0, 'current'], // CONST ACCIDENT INVESTIGATION DOCUMENT - $i++ => ['DIGIRISKDOLIBARR_ACCIDENTINVESTIGATIONDOCUMENT_ADDON', 'chaine', 'mod_accident_investigation_document_standard', '', 0, 'current'], + $i++ => ['DIGIRISKDOLIBARR_ACCIDENTINVESTIGATIONDOCUMENT_ADDON', 'chaine', 'mod_accidentinvestigationdocument_standard', '', 0, 'current'], $i++ => ['DIGIRISKDOLIBARR_ACCIDENTINVESTIGATIONDOCUMENT_ADDON_ODT_PATH','chaine', 'DOL_DOCUMENT_ROOT/custom/digiriskdolibarr/documents/doctemplates/accidentinvestigationdocument/', '', 0, 'current'], $i++ => ['DIGIRISKDOLIBARR_ACCIDENTINVESTIGATIONDOCUMENT_CUSTOM_ADDON_ODT_PATH', 'chaine', 'DOL_DATA_ROOT' . (($conf->entity == 1 ) ? '/' : '/' . $conf->entity . '/') . 'ecm/digiriskdolibarr/accidentinvestigationdocument/', '', 0, 'current'], $i++ => ['DIGIRISKDOLIBARR_ACCIDENTINVESTIGATIONDOCUMENT_DEFAULT_MODEL', 'chaine', 'template_accidentinvestigationdocument_odt', '', 0, 'current'], @@ -2182,6 +2182,19 @@ public function init($options = '') dolibarr_set_const($this->db, 'DIGIRISKDOLIBARR_CUSTOM_NUM_REF_SET', 1, 'integer', 0, '', $conf->entity); } + $documentsPath = DOL_DATA_ROOT . ($conf->entity > 1 ? '/' . $conf->entity : ''); + $mediaPath = $documentsPath . '/digiriskdolibarr'; + $ecmPath = $documentsPath . '/ecm/digiriskdolibarr'; + + if (is_dir($mediaPath . '/accident_investigation')) { + chmod($mediaPath . '/accident_investigation', 0755); + rename($mediaPath . '/accident_investigation', $mediaPath . '/accidentinvestigation'); + } + if (is_dir($ecmPath . '/accident_investigationdocument')) { + chmod($ecmPath . '/accident_investigationdocument', 0755); + rename($ecmPath . '/accident_investigationdocument', $ecmPath . '/accidentinvestigationdocument'); + } + return $this->_init($sql, $options); }