Impfverwaltung anpassen

This commit is contained in:
2026-03-30 21:52:10 +02:00
parent 091702c2a2
commit 6360af272a
3 changed files with 117 additions and 77 deletions
+21 -6
View File
@@ -87,6 +87,26 @@ if (!function_exists('impfWeekdayName')) {
}
}
if (!function_exists('impfLimitLabelLength')) {
function impfLimitLabelLength(string $text, int $maxLength = 50): string
{
$text = trim($text);
if ($text === '') {
return $text;
}
if (function_exists('mb_strimwidth')) {
return rtrim(mb_strimwidth($text, 0, $maxLength, '...', 'UTF-8'));
}
if (strlen($text) <= $maxLength) {
return $text;
}
return rtrim(substr($text, 0, max(0, $maxLength - 3))) . '...';
}
}
if (!function_exists('impfWorkflowEnsureTables')) {
function impfWorkflowEnsureTables(PDO $pdo): void
{
@@ -336,12 +356,7 @@ if (!function_exists('impfZeitraumLabel')) {
$zeitText .= ' (' . $ortText . ')';
}
$bezeichnung = trim((string)($zeitraum['bezeichnung'] ?? ''));
if ($includeName && $bezeichnung !== '') {
return $bezeichnung . ': ' . $zeitText;
}
return $zeitText;
return impfLimitLabelLength($zeitText, 50);
}
}