From cb8947e7f88ea07a15689bcfd7c4f400bb4ed004 Mon Sep 17 00:00:00 2001 From: Moritz Strohm Date: Fri, 27 May 2022 09:04:31 +0000 Subject: fix for BIESt #1064 Merge request studip/studip!642 --- app/controllers/course/forum/forum_controller.php | 6 + app/views/course/forum/area/add.php | 20 ++-- app/views/course/forum/index/_last_post.php | 10 +- app/views/course/forum/index/_like.php | 4 +- app/views/course/forum/index/_new_entry.php | 6 +- app/views/course/forum/index/_post.php | 7 +- app/views/course/forum/index/index.php | 132 +++++++++++----------- lib/classes/ForumEntry.php | 14 ++- lib/classes/ForumLike.php | 38 ++++--- lib/classes/ForumPerm.php | 4 +- lib/classes/ForumVisit.php | 2 +- lib/classes/SmileyFormat.php | 4 +- lib/models/PersonalNotifications.class.php | 4 +- lib/navigation/AutoNavigation.php | 5 +- 14 files changed, 137 insertions(+), 119 deletions(-) diff --git a/app/controllers/course/forum/forum_controller.php b/app/controllers/course/forum/forum_controller.php index d826b25..71d1aa0 100644 --- a/app/controllers/course/forum/forum_controller.php +++ b/app/controllers/course/forum/forum_controller.php @@ -41,5 +41,11 @@ abstract class ForumController extends StudipController { } $this->seminar_id = $this->getId(); + + $this->no_entries = false; + $this->highlight = []; + $this->highlight_topic = ''; + $this->edit_posting = ''; + $this->js = ''; } } diff --git a/app/views/course/forum/area/add.php b/app/views/course/forum/area/add.php index 01cf3dc..9524a65 100644 --- a/app/views/course/forum/area/add.php +++ b/app/views/course/forum/area/add.php @@ -52,13 +52,18 @@ - addLink( - $controller->url_for("course/forum/index/index/{$entry['last_posting']['topic_id']}#{$entry['last_posting']['topic_id']}"), - _('Zur letzten Antwort'), - Icon::create('forum'), - is_array($entry['last_posting']) ? ['class' => 'hidden-small-up'] : ['disabled' => ''] - )->condition(ForumPerm::has('edit_area', $seminar_id) && $issue_id = ForumIssue::getIssueIdForThread($entry['topic_id'])) - ->addLink( + addLink( + $controller->url_for("course/forum/index/index/{$entry['last_posting']['topic_id']}#{$entry['last_posting']['topic_id']}"), + _('Zur letzten Antwort'), + Icon::create('forum'), + is_array($entry['last_posting']) ? ['class' => 'hidden-small-up'] : ['disabled' => ''] + )->condition(ForumPerm::has('edit_area', $seminar_id) && $issue_id); + } + $action_menu->addLink( URLHelper::getURL("dispatch.php/course/topics/edit/{$issue_id}"), _('Zum Ablaufplan'), Icon::create('info-circle', Icon::ROLE_STATUS_RED), @@ -82,6 +87,7 @@ 'onclick' => "STUDIP.Forum.deleteArea(this, '{$entry['topic_id']}'); return false;", ] ) ?> + diff --git a/app/views/course/forum/index/_last_post.php b/app/views/course/forum/index/_last_post.php index 50c5eb2..2f3a38b 100644 --- a/app/views/course/forum/index/_last_post.php +++ b/app/views/course/forum/index/_last_post.php @@ -1,11 +1,11 @@ - + - + - id || $GLOBALS['perm']->have_perm('root')): ?> - - getFullname() : $entry['last_posting']['user_fullname']) ?> + id || $GLOBALS['perm']->have_perm('root')): ?> + + getFullname() : $entry['last_posting']['user_fullname'] ?? '') ?>
diff --git a/app/views/course/forum/index/_like.php b/app/views/course/forum/index/_like.php index eac19a2..6d11acb 100644 --- a/app/views/course/forum/index/_like.php +++ b/app/views/course/forum/index/_like.php @@ -30,10 +30,10 @@ shuffle($likes); } $text .= ''; } - + $text .= '
'; + echo $text; endif ?> - id, $likes)) : ?> diff --git a/app/views/course/forum/index/_new_entry.php b/app/views/course/forum/index/_new_entry.php index 7c2a9ab..64f1c14 100644 --- a/app/views/course/forum/index/_new_entry.php +++ b/app/views/course/forum/index/_new_entry.php @@ -5,14 +5,14 @@
- + - + id == 'nobody') : ?>