diff --git a/lib/models/ConsultationBlock.php b/lib/models/ConsultationBlock.php index e7140e303b08ae623ad77bbd4aeb248c31a44604..f35e98b8359dd190ce9a434923c96ad1f4d74b35 100644 --- a/lib/models/ConsultationBlock.php +++ b/lib/models/ConsultationBlock.php @@ -170,6 +170,8 @@ class ConsultationBlock extends SimpleORMap implements PrivacyObject $current = strtotime('+1 day', $current); } + $warnings = []; + while ($current <= $end) { $temp = holiday($current); $holiday = is_array($temp) && $temp['col'] === 3; @@ -201,10 +203,21 @@ class ConsultationBlock extends SimpleORMap implements PrivacyObject $details ); } + } elseif (!$fail_silent) { + $warnings[] = sprintf( + _('Am %1$s können keine Termine erzeugt werden, da es ein Feiertag (%2$s) ist.'), + strftime('%x', $current), + $temp['name'] + ); } $current = strtotime("+{$interval} weeks", $current); } + + $warnings = array_unique($warnings); + foreach ($warnings as $warning) { + PageLayout::postInfo(htmlReady($warning)); + } } /**