Skip to content

Commit

Permalink
Evarisk#3864 [Audit] fix: code imprecision
Browse files Browse the repository at this point in the history
  • Loading branch information
evarisk-micka committed Jun 20, 2024
1 parent 5344da1 commit 857f956
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function write_file(SaturneDocuments $objectDocument, Translate $outputLa
$riskSign = new RiskSign($this->db);
$evaluator = new Evaluator($this->db);
$accident = new Accident($this->db);
$user = new User($this->db);
$userTmp = new User($this->db);

$arraySoc = $this->get_substitutionarray_mysoc($mysoc, $outputLangs);
$tmpArray['mycompany_photo_fullsize'] = $arraySoc['mycompany_logo'];
Expand All @@ -134,18 +134,18 @@ public function write_file(SaturneDocuments $objectDocument, Translate $outputLa
$moreParam['specificFilter'] = $specificFilter;
}

if (!empty($moreParam['recipient']) && is_array($moreParam['recipient'])) {
if (is_array($moreParam['recipient']) && !empty($moreParam['recipient'])) {
$userRecipient = $moreParam['recipient'];

$tmpArray['destinataireDUER'] = '';
$tmpArray['telephone'] = '';
$tmpArray['portable'] = '';
foreach ($userRecipient as $recipientId) {
$user->fetch($recipientId);
$userTmp->fetch($recipientId);

$tmpArray['destinataireDUER'] .= dol_strtoupper($user->lastname) . ' ' . ucfirst($user->firstname) . chr(0x0A);
$tmpArray['telephone'] .= (dol_strlen($user->office_phone) > 0 ? $user->office_phone : '-') . chr(0x0A);
$tmpArray['portable'] .= (dol_strlen($user->user_mobile) > 0 ? $user->user_mobile : '-') . chr(0x0A);
$tmpArray['destinataireDUER'] .= dol_strtoupper($userTmp->lastname) . ' ' . ucfirst($userTmp->firstname) . chr(0x0A);
$tmpArray['telephone'] .= (dol_strlen($userTmp->office_phone) > 0 ? $userTmp->office_phone : '-') . chr(0x0A);
$tmpArray['portable'] .= (dol_strlen($userTmp->user_mobile) > 0 ? $userTmp->user_mobile : '-') . chr(0x0A);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@
print '</td></tr>';

// Destinataire
$userRecipient = json_decode($conf->global->DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_RECIPIENT);
print '<tr class="oddeven"><td>' . $langs->trans("Recipient") . '</td>';
$userRecipient = json_decode(getDolGlobalString('DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_RECIPIENT'));
print '<tr class="oddeven"><td>' . $langs->trans('Recipient') . '</td>';
print '<td>' . $form->select_dolusers($userRecipient, 'recipient', 0, null, 0, '', '', 0, 0, 0, '', 0, '', 'minwidth400', 0, 0, true);
print '</td></tr>';
print '</table>';
Expand Down

0 comments on commit 857f956

Please sign in to comment.