Skip to content

Commit

Permalink
Evarisk#3382 [Mod] fix: remove underscore and make compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
evarisk-micka committed Oct 12, 2023
1 parent f33e8f9 commit 860a03c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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.
Expand Down
15 changes: 14 additions & 1 deletion core/modules/modDigiriskDolibarr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,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'],
Expand Down Expand Up @@ -2178,6 +2178,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);
}

Expand Down

0 comments on commit 860a03c

Please sign in to comment.