Skip to content
Snippets Groups Projects
Commit 55e7ec9f authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

show appropriate info message when a holiday interferes with the creation of blocks, fixes #2265

Closes #2265

Merge request studip/studip!1492
parent f7b14b87
No related branches found
No related tags found
No related merge requests found
......@@ -190,6 +190,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;
......@@ -220,10 +222,21 @@ class ConsultationBlock extends SimpleORMap implements PrivacyObject
$block->end = strtotime("today {$end_time}", $current);
yield $block;
} else {
$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));
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment