Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Mar 12, 2024
1 parent 996f915 commit ea4054b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions htdocs/holiday/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,11 @@
}

$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";
Expand Down
8 changes: 6 additions & 2 deletions htdocs/holiday/class/holiday.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1366,8 +1366,12 @@ public function getTooltipContentArray($params)
// 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(
Expand Down

0 comments on commit ea4054b

Please sign in to comment.