fix php8 warnings

This commit is contained in:
Frédéric FRANCE 2021-03-20 10:50:02 +01:00 committed by GitHub
parent 5c3b7a249e
commit 8142d76394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1293,10 +1293,24 @@ abstract class CommonObject
if (!$list) {
$transkey = "TypeContact_".$obj->element."_".$obj->source."_".$obj->code;
$libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle);
$tab[$i] = array('source'=>$obj->source, 'socid'=>$obj->socid, 'id'=>$obj->id,
'nom'=>$obj->lastname, // For backward compatibility
'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email, 'login'=>$obj->login, 'photo'=>$obj->photo, 'statuscontact'=>$obj->statuscontact,
'rowid'=>$obj->rowid, 'code'=>$obj->code, 'libelle'=>$libelle_type, 'status'=>$obj->statuslink, 'fk_c_type_contact'=>$obj->fk_c_type_contact);
$tab[$i] = array(
'source' => $obj->source,
'socid' => $obj->socid,
'id' => $obj->id,
'nom' => $obj->lastname, // For backward compatibility
'civility' => $obj->civility,
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'email'=>$obj->email,
'login'=> (empty($obj->login) ? '' : $obj->login),
'photo' => (empty($obj->photo) ? '' : $obj->photo),
'statuscontact' => $obj->statuscontact,
'rowid' => $obj->rowid,
'code' => $obj->code,
'libelle' => $libelle_type,
'status' => $obj->statuslink,
'fk_c_type_contact' => $obj->fk_c_type_contact
);
} else {
$tab[$i] = $obj->id;
}