Skip to content
Commits on Source (2)
...@@ -175,6 +175,7 @@ class ilCalendarPresentationGUI ...@@ -175,6 +175,7 @@ class ilCalendarPresentationGUI
protected function initAndRedirectToConsultationHours() protected function initAndRedirectToConsultationHours()
{ {
$visibility = ilCalendarVisibility::_getInstanceByUserId($this->user->getId(), $this->ref_id); $visibility = ilCalendarVisibility::_getInstanceByUserId($this->user->getId(), $this->ref_id);
$consultation_hours_initialized = false;
foreach ($this->cats->getCategoriesInfo() as $info) { foreach ($this->cats->getCategoriesInfo() as $info) {
if ( if (
$info["type"] == ilCalendarCategory::TYPE_CH && $info["type"] == ilCalendarCategory::TYPE_CH &&
...@@ -190,8 +191,14 @@ class ilCalendarPresentationGUI ...@@ -190,8 +191,14 @@ class ilCalendarPresentationGUI
$this->ctrl->redirectToURL( $this->ctrl->redirectToURL(
$this->ctrl->getLinkTargetByClass(\ilCalendarMonthGUI::class, '') $this->ctrl->getLinkTargetByClass(\ilCalendarMonthGUI::class, '')
); );
$consultation_hours_initialized = true;
} }
} }
if (!$consultation_hours_initialized) {
$this->ctrl->redirectToURL(
$this->ctrl->getLinkTargetByClass(\ilCalendarMonthGUI::class, '')
);
}
} }
/** /**
......