MDL-71163 mod_forum: Remove duplicate due date info

This commit is contained in:
Shamim Rezaie 2021-04-26 12:05:45 +10:00
parent 2946894701
commit 70ac3b091f
2 changed files with 9 additions and 18 deletions

View File

@ -383,23 +383,25 @@ class discussion {
$notifications = $this->notifications;
$discussion = $this->discussion;
$forum = $this->forum;
$renderer = $this->renderer;
if ($forum->is_cutoff_date_reached()) {
$notifications[] = (new notification(
get_string('cutoffdatereached', 'forum'),
notification::NOTIFY_INFO
))->set_show_closebutton();
} else if ($forum->is_due_date_reached()) {
$notifications[] = (new notification(
} else if ($forum->get_type() != 'single') {
// Due date is already shown at the top of the page for single simple discussion forums.
if ($forum->is_due_date_reached()) {
$notifications[] = (new notification(
get_string('thisforumisdue', 'forum', userdate($forum->get_due_date())),
notification::NOTIFY_INFO
))->set_show_closebutton();
} else if ($forum->has_due_date()) {
$notifications[] = (new notification(
))->set_show_closebutton();
} else if ($forum->has_due_date()) {
$notifications[] = (new notification(
get_string('thisforumhasduedate', 'forum', userdate($forum->get_due_date())),
notification::NOTIFY_INFO
))->set_show_closebutton();
))->set_show_closebutton();
}
}
if ($forum->is_discussion_locked($discussion)) {

View File

@ -337,7 +337,6 @@ class discussion_list {
private function get_notifications(stdClass $user, ?int $groupid) : array {
$notifications = $this->notifications;
$forum = $this->forum;
$renderer = $this->renderer;
$capabilitymanager = $this->capabilitymanager;
if ($forum->is_cutoff_date_reached()) {
@ -345,16 +344,6 @@ class discussion_list {
get_string('cutoffdatereached', 'forum'),
notification::NOTIFY_INFO
))->set_show_closebutton();
} else if ($forum->is_due_date_reached()) {
$notifications[] = (new notification(
get_string('thisforumisdue', 'forum', userdate($forum->get_due_date())),
notification::NOTIFY_INFO
))->set_show_closebutton();
} else if ($forum->has_due_date()) {
$notifications[] = (new notification(
get_string('thisforumhasduedate', 'forum', userdate($forum->get_due_date())),
notification::NOTIFY_INFO
))->set_show_closebutton();
}
if ($forum->has_blocking_enabled()) {