From 0548156a3ff1fc129c4ff1510f384369f8537541 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Fri, 13 Aug 2021 17:03:59 +0800 Subject: [PATCH] MDL-69855 mod_forum: Don't show reply link in email for private replies --- mod/forum/lang/en/forum.php | 2 ++ .../templates/forum_post_email_htmlemail_body.mustache | 4 ++++ mod/forum/templates/forum_post_email_textemail.mustache | 9 +++++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/mod/forum/lang/en/forum.php b/mod/forum/lang/en/forum.php index 0c2e5213305..83bbc17dfe0 100644 --- a/mod/forum/lang/en/forum.php +++ b/mod/forum/lang/en/forum.php @@ -510,10 +510,12 @@ $string['postbymailsuccess'] = 'Your reply "{$a->subject}" was successfully post $string['postbymailsuccess_html'] = 'Your reply {$a->subject} was successfully posted.'; $string['postbyuser'] = '{$a->post} by {$a->user}'; $string['postincontext'] = 'See this post in context'; +$string['postmailinfo'] = 'This is a copy of a message posted in {$a}.'; $string['postmailinfolink'] = 'This is a copy of a message posted in {$a->coursename}. To reply click on this link: {$a->replylink}'; $string['postmailnow'] = '

This post will be mailed out immediately to all forum subscribers.

'; +$string['postmailreply'] = 'To reply click on this link: {$a}'; $string['postmailsubject'] = '{$a->courseshortname}: {$a->subject}'; $string['postrating1'] = 'Mostly separate knowing'; $string['postrating2'] = 'Separate and connected'; diff --git a/mod/forum/templates/forum_post_email_htmlemail_body.mustache b/mod/forum/templates/forum_post_email_htmlemail_body.mustache index 06a280dfdd7..4b58ba2943b 100644 --- a/mod/forum/templates/forum_post_email_htmlemail_body.mustache +++ b/mod/forum/templates/forum_post_email_htmlemail_body.mustache @@ -123,13 +123,17 @@ {{# str }} parent, forum {{/ str }} {{# canreply }} + {{^ isprivatereply }} | + {{/ isprivatereply }} {{/ canreply }} {{/ firstpost }} {{# canreply }} + {{^ isprivatereply }} {{# str }} reply, forum {{/ str }} + {{/ isprivatereply }} {{/ canreply }} diff --git a/mod/forum/templates/forum_post_email_textemail.mustache b/mod/forum/templates/forum_post_email_textemail.mustache index 0f954cd0752..bb2c6bede17 100644 --- a/mod/forum/templates/forum_post_email_textemail.mustache +++ b/mod/forum/templates/forum_post_email_textemail.mustache @@ -58,11 +58,12 @@ {{{ attachments }}} --------------------------------------------------------------------- +{{# str }} postmailinfo, forum, {{{ coursename }}} {{/ str }} + {{# canreply }} -{{# str }} postmailinfolink, forum, { - "coursename": {{# quote }}{{{ coursename }}}{{/ quote }}, - "replylink": {{# quote }}{{ replylink }}{{/ quote }} - } {{/ str }} + {{^ isprivatereply }} + {{# str }} postmailreply, forum, {{{ replylink }}} {{/ str }} + {{/ isprivatereply }} {{/ canreply }} {{# unsubscribeforumlink }} {{# str }} unsubscribelink, forum, {{{ unsubscribeforumlink }}} {{/ str }}