Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3186 [Odt] fix: add elements to risks assessment odt #3711

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ public function RiskAssessmentDocumentFillJSON()
$json['RiskAssessmentDocument']['methodologie'] = $conf->global->DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_METHOD;
$json['RiskAssessmentDocument']['sources'] = $conf->global->DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_SOURCES;
$json['RiskAssessmentDocument']['remarqueImportante'] = $conf->global->DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_IMPORTANT_NOTES;
$json['RiskAssessmentDocument']['risksPrevention'] = $conf->global->DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_RISKS_PREVENTION;

$jsonFormatted = json_encode($json, JSON_UNESCAPED_UNICODE);
$jsonFormatted = json_encode($json, JSON_UNESCAPED_UNICODE);

return $jsonFormatted;
}
Expand Down
3 changes: 2 additions & 1 deletion core/modules/modDigiriskDolibarr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,9 @@ public function __construct($db)
$i++ => ['DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_METHOD', 'chaine', $langs->transnoentities('RiskAssessmentDocumentMethod'), '', 0, 'current'],
$i++ => ['DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_SOURCES', 'chaine', $langs->transnoentities('RiskAssessmentDocumentSources'), '', 0, 'current'],
$i++ => ['DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_IMPORTANT_NOTES', 'chaine', $langs->transnoentities('RiskAssessmentDocumentImportantNote'), '', 0, 'current'],
$i++ => ['DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_RISKS_PREVENTION', 'chaine', $langs->transnoentities('RiskAssessmentDocumentRisksPrevention'), '', 0, 'current'],

$i++ => ['DIGIRISKDOLIBARR_MAIN_AGENDA_ACTIONAUTO_RISKASSESSMENTDOCUMENT_GENERATE', 'integer', 1, '', 0, 'current'],
$i++ => ['DIGIRISKDOLIBARR_MAIN_AGENDA_ACTIONAUTO_RISKASSESSMENTDOCUMENT_GENERATE', 'integer', 1, '', 0, 'current'],
$i++ => ['DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_ADDON','chaine', 'mod_riskassessmentdocument_standard', '', 0, 'current'],
$i++ => ['DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_ADDON_ODT_PATH', 'chaine', 'DOL_DOCUMENT_ROOT/custom/digiriskdolibarr/documents/doctemplates/riskassessmentdocument/', '', 0, 'current'],
$i++ => ['DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_CUSTOM_ADDON_ODT_PATH', 'chaine', 'DOL_DATA_ROOT' . (($conf->entity == 1 ) ? '/' : '/' . $conf->entity . '/') . 'ecm/digiriskdolibarr/riskassessmentdocument/', '', 0, 'current'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@
print saturne_show_medias_linked('digiriskdolibarr', $conf->digiriskdolibarr->multidir_output[$conf->entity] . '/riskassessmentdocument/siteplans', 'small', '', 0, 0, 0, 200, 200, 0, 0, 0, 'riskassessmentdocument/siteplans', null, '', 0, 0);
print '<input class="flat" type="file" name="userfile[]" id="SitePlans" />';
print '</td></tr>';

// Prévention des risques
print '<tr>';
print '<td class="titlefield"><label for="RisksPrevention">' . $langs->trans("RisksPrevention") . '</label></td>';
print '<td>';
$doleditor = new DolEditor('RisksPrevention', $conf->global->DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_RISKS_PREVENTION ? $conf->global->DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_RISKS_PREVENTION : '', '', 90, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%');
$doleditor->Create();
print '</td></tr>';
} else {
print '<tr>';
print '<td class="titlefield">' . $langs->trans("AuditStartDate") . '</td><td colspan="2">';
Expand Down Expand Up @@ -129,6 +137,14 @@
print '<td>';
print saturne_show_medias_linked('digiriskdolibarr', $conf->digiriskdolibarr->multidir_output[$conf->entity] . '/riskassessmentdocument/siteplans', 'small', '', 0, 0, 0, 200, 200, 0, 0, 0, 'riskassessmentdocument/siteplans', null, '', 0, 0);
print '</td></tr>';

// Prévention des risques
print '<tr>';
print '<td class="titlefield">' . $langs->trans("RisksPrevention") . '</td>';
print '<td>';
print $conf->global->DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_RISKS_PREVENTION;
print '</td></tr>';

}

?>
Expand Down
Binary file not shown.
2 changes: 2 additions & 0 deletions langs/fr_FR/digiriskdolibarr.lang
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ AuditEndDate = Date de fin d'audit
Recipient = Destinataire
ImportantNote = Remarque importante
SitePlans = Localisation des plans
RisksPrevention = Prévention des risques
SetStartEndDateBeforeSendEmail = Définissez la date de début et la date de fin d'audit sur cette page pour envoyer un email
NoSitePlans = Aucun plan de la société renseigné
riskassessmentdocument.odt = Document Unique
Expand All @@ -694,6 +695,7 @@ AppliedOn = Actif sur :
RiskAssessmentDocumentMethod = * Étape 1 : Récupération des informations<br />- Visite des locaux<br />- Récupération des données du personnel<br /><br />* Étape 2 : Définition de la méthodologie et de document<br />- Validation des fiches d'unité de travail standard<br />- Validation de l'arborescence des unités<br /><br />* Étape 3 : Réalisation de l'étude de risques<br />- Sensibilisation des personnels aux risques et aux dangers<br />- Création des unités de travail avec le personnel et le ou les responsables<br />- Évaluations des risques par unités de travail avec le personnel<br /><br />* Étape 4<br />- Traitement et rédaction du document unique
RiskAssessmentDocumentSources = La sensibilisation des risques est définie dans l'ED840 édité par L'INRS.<br />Dans ce document vous trouverez:<br />- La définition d'un risque, d'un danger et un schéma explicatif<br />- Les explications concernant les différentes méthodes d'évaluation
RiskAssessmentDocumentImportantNote = Notes importantes :<br />Vous pouvez lire la documentation de DigiRisk ici<br /><a href="https://wiki.dolibarr.org/index.php?title=Module_Digirisk" target="_blank">https://wiki.dolibarr.org/index.php?title=Module_Digirisk</a><br />Vous pouvez suivre le projet ici :<br /><a href="https://github.com/Evarisk/Digirisk/projects?type=classic" target="_blank">https://github.com/Evarisk/Digirisk/projects?type=classic</a><br />Reporter un bug ici<br /><a href="https://github.com/Evarisk/Digirisk/issues" target="_blank">https://github.com/Evarisk/Digirisk/issues</a>
RiskAssessmentDocumentRisksPrevention = Prévention des risques
GenerateZipArchiveWithDigiriskElementDocuments = Génération d'une archive ZIP avec le Document Unique
GenerateZipArchiveWithDigiriskElementDocumentsDescription = Génération automatique d'une archive ZIP contenant le Document Unique et toutes les fiches de poste lors de la génération du Document Unique
RiskAssessmentDocumentDescription = Plan d'action Document Unique
Expand Down
20 changes: 11 additions & 9 deletions view/digiriskstandard/digiriskstandard_riskassessmentdocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,15 @@
$error = 0;

if (($action == 'update' && ! GETPOST("cancel", 'alpha')) || ($action == 'updateedit') && $permissiontoadd) {
$auditStartDate = GETPOST('AuditStartDate', 'none');
$auditEndDate = GETPOST('AuditEndDate', 'none');
$recipent = GETPOST('Recipient', 'alpha');
$method = GETPOST('Method', 'none');
$sources = GETPOST('Sources', 'none');
$importantNote = GETPOST('ImportantNote', 'none');

if ( strlen($auditStartDate) ) {
$auditStartDate = GETPOST('AuditStartDate', 'none');
$auditEndDate = GETPOST('AuditEndDate', 'none');
$recipent = GETPOST('Recipient', 'alpha');
$method = GETPOST('Method', 'none');
$sources = GETPOST('Sources', 'none');
$importantNote = GETPOST('ImportantNote', 'none');
$RisksPrevention = GETPOST('RisksPrevention', 'none');

if ( strlen($auditStartDate) ) {
$auditStartDate = explode('/', $auditStartDate);
$auditStartDate = $auditStartDate[2] . '-' . $auditStartDate[1] . '-' . $auditStartDate[0];
dolibarr_set_const($db, "DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_AUDIT_START_DATE", $auditStartDate, 'date', 0, '', $conf->entity);
Expand All @@ -125,8 +126,9 @@
dolibarr_set_const($db, "DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_METHOD", $method, 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_SOURCES", $sources, 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_IMPORTANT_NOTES", $importantNote, 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_RISKS_PREVENTION", $RisksPrevention, 'chaine', 0, '', $conf->entity);

// Submit file
// Submit file
if ( ! empty($conf->global->MAIN_UPLOAD_DOC)) {
if ( ! empty($_FILES)) {
if (is_array($_FILES['userfile']['tmp_name'])) $userfiles = $_FILES['userfile']['tmp_name'];
Expand Down