Fix show thirdparty if it exists only

This commit is contained in:
Laurent Destailleur 2022-11-14 11:39:03 +01:00
parent a4b32ebe74
commit 9d9799c12e

View File

@ -1892,14 +1892,16 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Thirdparty // Thirdparty
if (!empty($arrayfields['p.fk_soc']['checked'])) { if (!empty($arrayfields['p.fk_soc']['checked'])) {
print '<td class="nowrap">'; print '<td class="nowrap">';
if (empty($conf->cache['thridparty'][$task_time->fk_soc])) { if ($task_time->fk_soc > 0) {
$tmpsociete = new Societe($db); if (empty($conf->cache['thridparty'][$task_time->fk_soc])) {
$tmpsociete->fetch($task_time->fk_soc); $tmpsociete = new Societe($db);
$conf->cache['thridparty'][$task_time->fk_soc] = $tmpsociete; $tmpsociete->fetch($task_time->fk_soc);
} else { $conf->cache['thridparty'][$task_time->fk_soc] = $tmpsociete;
$tmpsociete = $conf->cache['thridparty'][$task_time->fk_soc]; } else {
$tmpsociete = $conf->cache['thridparty'][$task_time->fk_soc];
}
print $tmpsociete->getNomUrl(1);
} }
print $tmpsociete->getNomUrl(1);
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;