From 6a82cbc6abff3161b52e19f9a59404cf31dcc464 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Fri, 13 Aug 2021 17:03:59 +0800 Subject: [PATCH 1/2] 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 47b90416507..791bdfc19bb 100644 --- a/mod/forum/lang/en/forum.php +++ b/mod/forum/lang/en/forum.php @@ -514,10 +514,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 }} From 6bd3db4fb59159a819f7a6bf24bcf78cb7949dc0 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Fri, 13 Aug 2021 18:14:47 +0800 Subject: [PATCH 2/2] MDL-69855 mod_forum: Deprecate postmailinfolink lang string With the info text and reply link text being split, this lang string is no longer being used and should be deprecated. --- mod/forum/lang/en/deprecated.txt | 1 + mod/forum/lang/en/forum.php | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mod/forum/lang/en/deprecated.txt b/mod/forum/lang/en/deprecated.txt index 14723276ea8..567a8b544ea 100644 --- a/mod/forum/lang/en/deprecated.txt +++ b/mod/forum/lang/en/deprecated.txt @@ -2,3 +2,4 @@ cannotdeletediscussioninsinglediscussion,mod_forum inpagereplysubject,mod_forum overviewnumpostssince,mod_forum overviewnumunread,mod_forum +postmailinfolink,mod_forum diff --git a/mod/forum/lang/en/forum.php b/mod/forum/lang/en/forum.php index 791bdfc19bb..46749953763 100644 --- a/mod/forum/lang/en/forum.php +++ b/mod/forum/lang/en/forum.php @@ -515,9 +515,6 @@ $string['postbymailsuccess_html'] = 'Your reply {$ $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}'; @@ -778,6 +775,11 @@ $string['showmoreusers'] = 'Show more users'; $string['viewconversation'] = 'View discussion'; $string['viewgrades'] = 'View grades'; +// Deprecated since Moodle 4.0. +$string['postmailinfolink'] = 'This is a copy of a message posted in {$a->coursename}. + +To reply click on this link: {$a->replylink}'; + // Deprecated since Moodle 3.8. $string['cannotdeletediscussioninsinglediscussion'] = 'You cannot delete the first post in a single discussion'; $string['inpagereplysubject'] = 'Re: {$a}';