Skip to content

Commit

Permalink
#270 [ODT] add: column attendance
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Mar 21, 2023
1 parent 2e29f48 commit 47307e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,14 +382,26 @@ public function write_file(SessionDocument $objectDocument, Translate $outputlan
if (!empty($object)) {
$listlines = $odfHandler->setSegment('attendants');
$signatory = new SaturneSignature($this->db);
$signatoriesArray = $signatory->fetchSignatories($object->id, $object->element);
$signatoriesArray = $signatory->fetchSignatories($object->id, $object->element);
if (!empty($signatoriesArray) && is_array($signatoriesArray)) {
$k = 1;
foreach ($signatoriesArray as $objectSignatory) {
if ($objectSignatory->role != 'SessionTrainer') {
$tmparray['attendant_number'] = $k;
$tmparray['attendant_lastname'] = strtoupper($objectSignatory->lastname);
$tmparray['attendant_firstname'] = $objectSignatory->firstname;
switch ($objectSignatory->attendance) {
case 1:
$attendance = $langs->trans('Delay');
break;
case 2:
$attendance = $langs->trans('Absent');
break;
default:
$attendance = $langs->transnoentities('Present');
break;
}
$tmparray['attendant_attendance'] = $attendance;
if (dol_strlen($objectSignatory->signature) > 0 && $objectSignatory->signature != $langs->transnoentities('FileGenerated')) {
if ($moreparam['specimen'] == 0 || ($moreparam['specimen'] == 1 && $conf->global->DOLIMEET_SHOW_SIGNATURE_SPECIMEN == 1)) {
$encodedImage = explode(',', $objectSignatory->signature)[1];
Expand Down Expand Up @@ -428,10 +440,11 @@ public function write_file(SessionDocument $objectDocument, Translate $outputlan
}
}
} else {
$tmparray['attendant_number'] = '';
$tmparray['attendant_lastname'] = '';
$tmparray['attendant_firstname'] = '';
$tmparray['attendant_signature'] = '';
$tmparray['attendant_number'] = '';
$tmparray['attendant_lastname'] = '';
$tmparray['attendant_firstname'] = '';
$tmparray['attendant_attendance'] = '';
$tmparray['attendant_signature'] = '';
foreach ($tmparray as $key => $val) {
try {
if (empty($val)) {
Expand Down
Binary file not shown.

0 comments on commit 47307e8

Please sign in to comment.