Skip to content

Commit

Permalink
Evarisk#598 [Session] add: remove dead code for certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
evarisk-francois committed Aug 1, 2024
1 parent 7b5b287 commit 94e407d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
4 changes: 0 additions & 4 deletions class/actions_dolimeet.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -834,10 +834,6 @@ public function saturneAdminDocumentData(array $parameters): int
'AttendanceSheetDocument' => [
'documentType' => 'attendancesheetdocument',
'picto' => 'fontawesome_fa-people-arrows_fas_#d35968'
],
'CompletionCertificateDocument' => [
'documentType' => 'completioncertificatedocument',
'picto' => 'fontawesome_fa-people-arrows_fas_#d35968'
]
];
$this->results = $types;
Expand Down
11 changes: 3 additions & 8 deletions view/session/session_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,17 +545,15 @@
$fileList = array_merge($fileList, dol_dir_list($upload_dir . '/' . $documentTypeName . 'document' . '/' . $object->ref, 'files', 0, '', '', 'date', SORT_DESC));
}
if (!empty($fileList)) {
$fileType = ['attendancesheetdocument' => 0, 'completioncertificatedocument' => 0];
$fileType = ['attendancesheetdocument' => 0];
foreach ($fileList as $file) {
if (!strstr($file['name'], 'specimen')) {
if (strstr($file['name'], str_replace(' ', '_', $langs->transnoentities('attendancesheetdocument'))) && $fileType['attendancesheetdocument'] == 0) {
$fileType['attendancesheetdocument'] = 1;
} elseif (strstr($file['name'], str_replace(' ', '_', $langs->transnoentities('completioncertificatedocument'))) && $fileType['completioncertificatedocument'] < $nbTrainee) {
$fileType['completioncertificatedocument']++;
}
}
}
if ($fileType['attendancesheetdocument'] == 1 && $fileType['completioncertificatedocument'] == $nbTrainee) {
if ($fileType['attendancesheetdocument'] == 1) {
$forceBuildDoc = 0;
} else {
$forceBuildDoc = 1;
Expand Down Expand Up @@ -639,15 +637,12 @@
$fileList = array_merge($fileList, dol_dir_list($upload_dir . '/' . $documentTypeName . 'document' . '/' . $ref, 'files', 0, '(\.pdf)', '', 'date', SORT_DESC));
}
if (!empty($fileList) && is_array($fileList)) {
$fileType = ['attendancesheetdocument' => 0, 'completioncertificatedocument' => 0];
$fileType = ['attendancesheetdocument' => 0];
foreach ($fileList as $file) {
if (!strstr($file['name'], 'specimen')) {
if (strstr($file['name'], str_replace(' ', '_', $langs->transnoentities('attendancesheetdocument'))) && $fileType['attendancesheetdocument'] == 0) {
$files[] = $file['fullname'];
$fileType['attendancesheetdocument'] = 1;
} elseif (strstr($file['name'], str_replace(' ', '_', $langs->transnoentities('completioncertificatedocument'))) && $fileType['completioncertificatedocument'] < $nbTrainee) {
$files[] = $file['fullname'];
$fileType['completioncertificatedocument']++;
}
}
}
Expand Down

0 comments on commit 94e407d

Please sign in to comment.