diff --git a/app/controllers/course/timesrooms.php b/app/controllers/course/timesrooms.php index b959ff5e6c4c7492544547825ca1a67215dac8e9..9b124697cf625097549f433e432197b5683edd38 100644 --- a/app/controllers/course/timesrooms.php +++ b/app/controllers/course/timesrooms.php @@ -516,7 +516,7 @@ class Course_TimesroomsController extends AuthenticatedController '<strong>' . htmlReady($singledate->toString()) . '</strong>' )); } - if ($singledate->messages['error']) { + if (!empty($singledate->messages['error'])) { PageLayout::postError( _('Die folgenden Fehler traten beim Bearbeiten des Termins auf:'), htmlReady($singledate->messages['error']) @@ -1687,7 +1687,7 @@ class Course_TimesroomsController extends AuthenticatedController } else { $user_rooms = RoomManager::getUserRooms($current_user); foreach ($user_rooms as $room) { - if ($room->userHasBookingRights($current_user, $begin, $end)) { + if ($room->userHasBookingRights($current_user, $begin ?? null, $end ?? null)) { $rooms_with_booking_permissions++; if ($only_bookable_rooms) { foreach ($all_time_intervals as $interval) { diff --git a/app/controllers/profile.php b/app/controllers/profile.php index 31494ae3e42c67a8a78d4fe0996c4e6df7f4d478..c12512f64ba0e419cf753325cb46527a498806d4 100644 --- a/app/controllers/profile.php +++ b/app/controllers/profile.php @@ -45,14 +45,14 @@ class ProfileController extends AuthenticatedController // set the page title depending on user selection if ( - $this->user + isset($this->user, $this->current_user) && $this->current_user->id === $this->user->id && !$this->current_user->locked ) { PageLayout::setTitle(_('Mein Profil')); UserConfig::get($this->user->id)->store('PROFILE_LAST_VISIT', time()); } elseif ( - $this->current_user->id + !empty($this->current_user->id) && ( $this->perm->have_perm('root') || ( @@ -144,17 +144,16 @@ class ProfileController extends AuthenticatedController } // calendar - $this->dates = ''; - if (Config::get()->CALENDAR_ENABLE) { - if (!in_array($this->current_user->perms, ['admin', 'root'])) { - if (Visibility::verify('termine', $this->current_user->user_id)) { - $start = time(); - $end = strtotime('+1 week 23:59:59'); - - $response = $this->relay('calendar/contentbox/display/' . $this->current_user->user_id . '/' . ($end - $start)); - $this->dates = $response->body; - } - } + if ( + Config::get()->CALENDAR_ENABLE + && !in_array($this->current_user->perms, ['admin', 'root']) + && Visibility::verify('termine', $this->current_user->user_id) + ) { + $start = time(); + $end = strtotime('+1 week 23:59:59'); + + $response = $this->relay('calendar/contentbox/display/' . $this->current_user->user_id . '/' . ($end - $start)); + $this->dates = $response->body; } // include and show votes and tests diff --git a/app/views/profile/index.php b/app/views/profile/index.php index 82a001a48af2c443c14e3a2e9d29858716ad2eae..d36940afc3d3cd01dcca8f86ba6ad0f6a1111659 100644 --- a/app/views/profile/index.php +++ b/app/views/profile/index.php @@ -83,9 +83,9 @@ </section> -<?= $news ?> +<?= $news ?? '' ?> -<?= $dates ?> +<?= $dates ?? '' ?> <?= $evaluations ?? '' ?> diff --git a/lib/activities/Context.php b/lib/activities/Context.php index 170552872662ad8caf3b46c927b2d5b67007fe9c..dba0d0f9eb62c31145a6a1ae0760b9d58099a661 100644 --- a/lib/activities/Context.php +++ b/lib/activities/Context.php @@ -147,7 +147,7 @@ abstract class Context } else { foreach ($providers as $provider) { $ctype = $this->getContextType(); - $filtered_classes = $filter->getType()->$ctype; + $filtered_classes = $filter->getType()->$ctype ?? null; if (is_array($filtered_classes)) { foreach ($filtered_classes as $class) { diff --git a/lib/filesystem/CourseGroupFolder.php b/lib/filesystem/CourseGroupFolder.php index 81867f6649142a56474db9f2a47a2d2449f190ce..36bbb922a84bd22fd7f3d36ab6b35fe9b89acc69 100644 --- a/lib/filesystem/CourseGroupFolder.php +++ b/lib/filesystem/CourseGroupFolder.php @@ -123,7 +123,7 @@ class CourseGroupFolder extends StandardFolder public function getEditTemplate() { $template = $GLOBALS['template_factory']->open('filesystem/group_folder/edit.php'); - $group = Statusgruppen::find($this->folderdata['data_content']['group']); + $group = Statusgruppen::find($this->folderdata['data_content']['group'] ?? null); $template->set_attribute('group', $group); $template->set_attribute('folder', $this); return $template; @@ -151,7 +151,7 @@ class CourseGroupFolder extends StandardFolder */ public function getDescriptionTemplate() { - $group = new Statusgruppen($this->folderdata['data_content']['group']); + $group = new Statusgruppen($this->folderdata['data_content']['group'] ?? null); $template = $GLOBALS['template_factory']->open('filesystem/group_folder/description.php'); $template->type = self::getTypeName(); diff --git a/templates/layouts/dialog.php b/templates/layouts/dialog.php index ddf9280eed0d0ccf577563fe4a4d23b709c98776..147f69d7579b7fed4b11da4f20b2cfa0281b0673 100644 --- a/templates/layouts/dialog.php +++ b/templates/layouts/dialog.php @@ -1,2 +1,2 @@ -<?= implode(PageLayout::getMessages()) ?> -<?= $content_for_layout ?> \ No newline at end of file +<?= implode('', PageLayout::getMessages()) ?> +<?= $content_for_layout ?>