Skip to content

Commit

Permalink
Evarisk#2842 [InformationsSharing] add: deficiency report info in vie…
Browse files Browse the repository at this point in the history
…w/ODT
  • Loading branch information
nicolas-eoxia committed May 12, 2023
1 parent 561ad53 commit d03c922
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 29 deletions.
1 change: 1 addition & 0 deletions class/digiriskdocuments/informationssharing.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public function InformationsSharingFillJSON($object)
}

// CSE
$json['InformationsSharing']['deficiency_report_date'] = (dol_strlen($conf->global->DIGIRISKDOLIBARR_CSE_SUBMISSION_ELECTION_DATE) > 0 && $conf->global->DIGIRISKDOLIBARR_CSE_SUBMISSION_ELECTION_DATE != '--' && dol_now() > dol_time_plus_duree(dol_stringtotime($conf->global->DIGIRISKDOLIBARR_CSE_SUBMISSION_ELECTION_DATE), '30', 'd') ? dol_time_plus_duree(dol_stringtotime($conf->global->DIGIRISKDOLIBARR_CSE_SUBMISSION_ELECTION_DATE), '30', 'd') : '');
$json['InformationsSharing']['membres_du_comite_entreprise_date'] = (dol_strlen($conf->global->DIGIRISKDOLIBARR_CSE_ELECTION_DATE) > 0 && $conf->global->DIGIRISKDOLIBARR_CSE_ELECTION_DATE != '--' ? $conf->global->DIGIRISKDOLIBARR_CSE_ELECTION_DATE : '');
$json['InformationsSharing']['membres_du_comite_entreprise_titulaires'] = '';
if (!empty ($digirisk_resources['TitularsCSE']->id )) {
Expand Down
1 change: 1 addition & 0 deletions core/substitutions/functions_digiriskdolibarr.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function digiriskdolibarr_completesubstitutionarray(&$substitutionarray, $langs,
$substitutionarray['referant_harcelement_nom'] = $informationssharing->harassment_officer_cse->name;
$substitutionarray['referant_harcelement_telephone'] = $informationssharing->harassment_officer_cse->phone;

$substitutionarray['deficiency_report_date'] = dol_print_date($informationssharing->deficiency_report_date, 'day');
$substitutionarray['membres_du_comite_entreprise_date'] = dol_print_date($informationssharing->membres_du_comite_entreprise_date, 'day');
$substitutionarray['membres_du_comite_entreprise_titulaires'] = dol_htmlentitiesbr_decode(strip_tags($informationssharing->membres_du_comite_entreprise_titulaires, '<br>'));
$substitutionarray['membres_du_comite_entreprise_suppleants'] = dol_htmlentitiesbr_decode(strip_tags($informationssharing->membres_du_comite_entreprise_suppleants, '<br>'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,39 +68,46 @@
}
print '</td></tr>';

// Harassment officer CSE
print '<tr>';
print '<td class="titlefield"><i class="fas fa-user"></i> ' . $form->textwithpicto($langs->trans("HarassmentOfficerCSE"), $langs->trans('HowToSetDataInformationsSharing')) . '</td>';
print '<td>';
if ($informationssharing->harassment_officer_cse->id > 0) {
$user->fetch($informationssharing->harassment_officer_cse->id);
print $user->getNomUrl(1) . ' ';
print '<i class="fas fa-phone"></i> ' . $informationssharing->harassment_officer_cse->phone;
}
print '</td></tr>';
if (dol_now() > dol_time_plus_duree(dol_stringtotime($conf->global->DIGIRISKDOLIBARR_CSE_SUBMISSION_ELECTION_DATE), '30', 'd')) {
// Deficiency report date
print '<tr><td class="titlefield"><i class="fas fa-calendar-alt"></i> ' . $form->textwithpicto($langs->trans('DeficiencyReportDate'), $langs->trans('HowToSetDataInformationsSharing')) . '</td><td>';
print img_picto('', 'calendar', 'class="pictofixedwidth"') . dol_print_date($informationssharing->deficiency_report_date, 'day');
print '</td></tr>';
} else {
// Harassment officer CSE
print '<tr>';
print '<td class="titlefield"><i class="fas fa-user"></i> ' . $form->textwithpicto($langs->trans("HarassmentOfficerCSE"), $langs->trans('HowToSetDataInformationsSharing')) . '</td>';
print '<td>';
if ($informationssharing->harassment_officer_cse->id > 0) {
$user->fetch($informationssharing->harassment_officer_cse->id);
print $user->getNomUrl(1) . ' ';
print '<i class="fas fa-phone"></i> ' . $informationssharing->harassment_officer_cse->phone;
}
print '</td></tr>';

// CSE
// CSE

// Date
print '<tr>';
print '<td class="titlefield"><i class="fas fa-calendar-alt"></i> ' . $form->textwithpicto($langs->trans("ElectionDateCSE"), $langs->trans('HowToSetDataInformationsSharing')) . '</td>';
print '<td>';
print '<i class="fas fa-calendar-alt"></i> ' . dol_print_date($informationssharing->membres_du_comite_entreprise_date, 'day');
print '</td></tr>';
// Date
print '<tr>';
print '<td class="titlefield"><i class="fas fa-calendar-alt"></i> ' . $form->textwithpicto($langs->trans("ElectionDate"), $langs->trans('HowToSetDataInformationsSharing')) . '</td>';
print '<td>';
print '<i class="fas fa-calendar-alt"></i> ' . dol_print_date($informationssharing->membres_du_comite_entreprise_date, 'day');
print '</td></tr>';

// Titulars
print '<tr>';
print '<td class="titlefield"><i class="fas fa-user"></i> ' . $form->textwithpicto($langs->trans("Titulars"), $langs->trans('HowToSetDataInformationsSharing')) . '</td>';
print '<td>';
print $informationssharing->membres_du_comite_entreprise_titulairesFullName;
print '</td></tr>';
// Titulars
print '<tr>';
print '<td class="titlefield"><i class="fas fa-user"></i> ' . $form->textwithpicto($langs->trans("Titulars"), $langs->trans('HowToSetDataInformationsSharing')) . '</td>';
print '<td>';
print $informationssharing->membres_du_comite_entreprise_titulairesFullName;
print '</td></tr>';

// Alternates
print '<tr>';
print '<td class="titlefield"><i class="fas fa-user"></i> ' . $form->textwithpicto($langs->trans("Alternates"), $langs->trans('HowToSetDataInformationsSharing')) . '</td>';
print '<td>';
print $informationssharing->membres_du_comite_entreprise_suppleantsFullName;
print '</td></tr>';
// Alternates
print '<tr>';
print '<td class="titlefield"><i class="fas fa-user"></i> ' . $form->textwithpicto($langs->trans("Alternates"), $langs->trans('HowToSetDataInformationsSharing')) . '</td>';
print '<td>';
print $informationssharing->membres_du_comite_entreprise_suppleantsFullName;
print '</td></tr>';
}

// DP
//Date
Expand Down
Binary file not shown.

0 comments on commit d03c922

Please sign in to comment.