fix warnings

This commit is contained in:
Frédéric France
2024-03-12 22:48:12 +01:00
parent 996f915192
commit ea4054b42e
2 changed files with 11 additions and 4 deletions

View File

@@ -524,8 +524,11 @@ if (empty($reshook)) {
}
$typeleaves = $object->getTypes(1, -1);
$labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']);
if (empty($typeleaves[$object->fk_type])) {
$labeltoshow = $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type);
} else {
$labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']);
}
if ($object->halfday == 2) {
$starthalfdaykey = "Afternoon";
$endhalfdaykey = "Morning";

View File

@@ -1366,8 +1366,12 @@ class Holiday extends CommonObject
// show type for this record only in ajax to not overload lists
if (!$nofetch && !empty($this->fk_type)) {
$typeleaves = $this->getTypes(1, -1);
$labeltoshow = (($typeleaves[$this->fk_type]['code'] && $langs->trans($typeleaves[$this->fk_type]['code']) != $typeleaves[$this->fk_type]['code']) ? $langs->trans($typeleaves[$this->fk_type]['code']) : $typeleaves[$this->fk_type]['label']);
$datas['type'] = '<br><b>'.$langs->trans("Type") . ':</b> ' . (empty($labeltoshow) ? $langs->trans("TypeWasDisabledOrRemoved", $this->fk_type) : $labeltoshow);
if (empty($typeleaves[$this->fk_type])) {
$labeltoshow = $langs->trans("TypeWasDisabledOrRemoved", $this->fk_type);
} else {
$labeltoshow = (($typeleaves[$this->fk_type]['code'] && $langs->trans($typeleaves[$this->fk_type]['code']) != $typeleaves[$this->fk_type]['code']) ? $langs->trans($typeleaves[$this->fk_type]['code']) : $typeleaves[$this->fk_type]['label']);
}
$datas['type'] = '<br><b>'.$langs->trans("Type") . ':</b> ' . $labeltoshow;
}
if (isset($this->halfday) && !empty($this->date_debut) && !empty($this->date_fin)) {
$listhalfday = array(