diff --git a/core/modules/modDigiriskDolibarr.class.php b/core/modules/modDigiriskDolibarr.class.php index 0ab83a35d..8e72a1ba2 100644 --- a/core/modules/modDigiriskDolibarr.class.php +++ b/core/modules/modDigiriskDolibarr.class.php @@ -789,7 +789,8 @@ public function __construct($db) $i++ => ['DIGIRISKDOLIBARR_MEDIA_MAX_WIDTH_SMALL', 'integer', 480, '', 0, 'current'], $i++ => ['DIGIRISKDOLIBARR_MEDIA_MAX_HEIGHT_SMALL', 'integer', 270, '', 0, 'current'], $i++ => ['DIGIRISKDOLIBARR_DISPLAY_NUMBER_MEDIA_GALLERY', 'integer', 8, '', 0, 'current'], - $i++ => ['DIGIRISKDOLIBARR_CUSTOM_DOCUMENTS_SET', 'integer', 0, '', 0, 'current'], + // -- Deprecated conf, was used to generate custom template, we can now download default template to customize it + //$i++ => ['DIGIRISKDOLIBARR_CUSTOM_DOCUMENTS_SET', 'integer', 0, '', 0, 'current'], $i++ => ['DIGIRISKDOLIBARR_MANUAL_INPUT_NB_EMPLOYEES', 'integer', 0, '', 0, 'current'], $i++ => ['DIGIRISKDOLIBARR_MANUAL_INPUT_NB_WORKED_HOURS', 'integer', 0, '', 0, 'current'], $i++ => ['DIGIRISKDOLIBARR_SHOW_PATCH_NOTE', 'integer', 1, '', 0, 'current'], diff --git a/core/tpl/digiriskdolibarr_projectcreation_action.tpl.php b/core/tpl/digiriskdolibarr_projectcreation_action.tpl.php index 25ea6216e..83392e706 100644 --- a/core/tpl/digiriskdolibarr_projectcreation_action.tpl.php +++ b/core/tpl/digiriskdolibarr_projectcreation_action.tpl.php @@ -922,47 +922,6 @@ dolibarr_set_const($db, 'DIGIRISKDOLIBARR_ENCODE_BACKWARD_COMPATIBILITY', 1, 'integer', 0, '', $conf->entity); } -if ($conf->global->DIGIRISKDOLIBARR_CUSTOM_DOCUMENTS_SET == 0) { - require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; - require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; - - $ecmfile = new EcmFiles($db); - - $types = array( - 'LegalDisplay' => 'legaldisplay', - 'InformationsSharing' => 'informationssharing', - 'ListingRisksAction' => 'listingrisksaction', - 'ListingRisksPhoto' => 'listingrisksphoto', - 'GroupmentDocument' => 'groupmentdocument', - 'WorkUnitDocument' => 'workunitdocument', - 'RiskAssessmentDocument' => 'riskassessmentdocument', - 'PreventionPlan' => 'preventionplandocument', - 'FirePermit' => 'firepermitdocument', - 'Ticket' => 'ticketdocument' - ); - - foreach ($types as $documentType) { - dolibarr_get_const($db, 'DIGIRISKDOLIBARR_' . strtoupper($documentType) . '_CUSTOM_ADDON_ODT_PATH'); - dolibarr_set_const($db, 'DIGIRISKDOLIBARR_' . strtoupper($documentType) . '_CUSTOM_ADDON_ODT_PATH', 'DOL_DATA_ROOT' . (($conf->entity == 1 ) ? '/' : '/' . $conf->entity . '/') . 'ecm/digiriskdolibarr/'. $documentType . '/', 'chaine', 0, '', $conf->entity); - - $srcfullpath = DOL_DOCUMENT_ROOT . '/custom/digiriskdolibarr/documents/doctemplates/' . $documentType . '/template_' . $documentType . '.odt'; - $ecmdir = $conf->ecm->multidir_output[$conf->entity?:1]; - $destfullpath = $ecmdir . '/digiriskdolibarr/' . $documentType . '/template_' . $documentType . '_custom.odt'; - - $result = dol_copy($srcfullpath, $destfullpath, 0, 0); - if ($result > 0) { - $ecmfile->label = md5_file(dol_osencode($destfullpath)); - $ecmfile->filepath = (($conf->entity == 1 ) ? '' : $conf->entity . '/') . 'ecm/digiriskdolibarr/' . $documentType; - $ecmfile->filename = 'template_' . $documentType . '_custom.odt'; - $ecmfile->fullpath_orig = 'template_' . $documentType . '_custom.odt'; - $ecmfile->gen_or_uploaded = 'uploaded'; - $ecmfile->create($user); - } - } - - dolibarr_set_const($db, 'DIGIRISKDOLIBARR_CUSTOM_DOCUMENTS_SET', 1, 'integer', 0, '', $conf->entity); -} - if ($conf->global->DIGIRISKDOLIBARR_SECURITY_SOCIAL_CONF_UPDATED == 0) { // Security conf if (empty(dolibarr_get_const($db, 'DIGIRISKDOLIBARR_LOCATION_OF_DETAILED_INSTRUCTION'))) {