From e0c498621ac8376b5283df81f415b4f310d4578f Mon Sep 17 00:00:00 2001
From: Matthias Schmidt
Date: Sat, 5 Aug 2017 10:46:13 +0200
Subject: [PATCH] Add comment permalinks to moderation user notification events
See #2223
---
...mentResponseUserNotificationEvent.class.php | 5 ++++-
...QueueCommentUserNotificationEvent.class.php | 1 +
wcfsetup/install/lang/de.xml | 18 +++++++++---------
wcfsetup/install/lang/en.xml | 18 +++++++++---------
4 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentResponseUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentResponseUserNotificationEvent.class.php
index 8684dee622..a877dd8140 100644
--- a/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentResponseUserNotificationEvent.class.php
+++ b/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentResponseUserNotificationEvent.class.php
@@ -101,7 +101,7 @@ class ModerationQueueCommentResponseUserNotificationEvent extends AbstractShared
* @inheritDoc
*/
public function getLink() {
- return $this->getModerationQueue()->getLink() . '#comments';
+ return $this->getModerationQueue()->getLink() . '#comment' . $this->getUserNotificationObject()->commentID;
}
/**
@@ -117,6 +117,7 @@ class ModerationQueueCommentResponseUserNotificationEvent extends AbstractShared
return $this->getLanguage()->getDynamicVariable($this->getLanguageItemPrefix().'.commentResponse.message.stacked', [
'authors' => array_values($authors),
+ 'commentID' => $this->getUserNotificationObject()->commentID,
'count' => $count,
'others' => $count - 1,
'moderationQueue' => $this->getModerationQueue()
@@ -134,6 +135,8 @@ class ModerationQueueCommentResponseUserNotificationEvent extends AbstractShared
return $this->getLanguage()->getDynamicVariable($this->getLanguageItemPrefix().'.commentResponse.message', [
'author' => $this->author,
'commentAuthor' => $commentAuthor,
+ 'commentID' => $this->getUserNotificationObject()->commentID,
+ 'responseID' => $this->getUserNotificationObject()->responseID,
'moderationQueue' => $this->getModerationQueue()
]);
}
diff --git a/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentUserNotificationEvent.class.php
index 8db7009247..3f5ffc1d04 100644
--- a/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentUserNotificationEvent.class.php
+++ b/wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentUserNotificationEvent.class.php
@@ -108,6 +108,7 @@ class ModerationQueueCommentUserNotificationEvent extends AbstractUserNotificati
return $this->getLanguage()->getDynamicVariable($this->languageItemPrefix.'.comment.message', [
'author' => $this->author,
+ 'commentID' => $this->getUserNotificationObject()->commentID,
'moderationQueue' => $this->moderationQueue
]);
}
diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml
index dc7bede960..b091d44c95 100644
--- a/wcfsetup/install/lang/de.xml
+++ b/wcfsetup/install/lang/de.xml
@@ -3110,14 +3110,14 @@ Fehler sind beispielsweise:
- - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat einen Kommentar zum Moderationseintrag {$moderationQueue->getTitle()} verfasst.]]>
+ - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat einen Kommentar zum Moderationseintrag {$moderationQueue->getTitle()} verfasst.]]>
- getAnchorTag()}{if $count != 1}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weitere Benutzer{/if} haben Kommentare zum Moderationseintrag {$moderationQueue->getTitle()} verfasst.]]>
- getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}] verfasst{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} {if $count == 1 && !$guestTimesTriggered}hat einen Kommentar{else}haben Kommentare{/if} zum Moderationseintrag {$notificationContent[variables][moderationQueue]->getTitle()} verfasst:
]]>
- - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat eine Antwort zum Kommentar von {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} zum Moderationseintrag {$moderationQueue->getTitle()} verfasst.]]>
- - getAnchorTag()}{if $count != 1}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3}und {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weitere Benutzer{/if} haben Kommentare zum Moderationseintrag {$moderationQueue->getTitle()} verfasst.]]>
+ - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat eine Antwort zum Kommentar von {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} zum Moderationseintrag {$moderationQueue->getTitle()} verfasst.]]>
+ - getAnchorTag()}{if $count != 1}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3}und {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weitere Benutzer{/if} haben Kommentare zum Moderationseintrag {$moderationQueue->getTitle()} verfasst.]]>
- username}{if $notificationContent[variables][commentAuthor]->userID} [URL:{link controller='User' object=$notificationContent[variables][commentAuthor] isEmail=true}{/link}]{/if} zum Moderationseintrag {$notificationContent[variables][moderationQueue]->getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}] verfasst{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} {if $count == 1 && !$guestTimesTriggered}hat eine Antwort{else}haben Antworten{/if} zum Kommentar von {if $notificationContent[variables][commentAuthor]->userID}{$notificationContent[variables][commentAuthor]->username}{else}{$notificationContent[variables][commentAuthor]->username}{/if} zum Moderationseintrag {$notificationContent[variables][moderationQueue]->getTitle()} verfasst:]]>
@@ -3156,14 +3156,14 @@ Fehler sind beispielsweise:
- - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat einen Kommentar zum freizuschaltenden Inhalt {$moderationQueue->getTitle()} verfasst.]]>
+ - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat einen Kommentar zum freizuschaltenden Inhalt {$moderationQueue->getTitle()} verfasst.]]>
- getAnchorTag()}{if $count != 1}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3}und {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weitere Benutzer{/if} haben Kommentare zum freizuschaltenden Inhalt {$moderationQueue->getTitle()} verfasst.]]>
- getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}] verfasst{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} {if $count == 1 && !$guestTimesTriggered}hat einen Kommentar{else}haben Kommentare{/if} zum freizuschaltenden Inhalt {$notificationContent[variables][moderationQueue]->getTitle()} verfasst:]]>
- - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat eine Antwort zum Kommentar von {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} zum freizuschaltenden Inhalt {$moderationQueue->getTitle()} verfasst.]]>
- - getAnchorTag()}{if $count != 1}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weitere Benutzer{/if} haben Antworten zu Kommentare zum freizuschaltenden Inhalt {$moderationQueue->getTitle()} verfasst.]]>
+ - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat eine Antwort zum Kommentar von {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} zum freizuschaltenden Inhalt {$moderationQueue->getTitle()} verfasst.]]>
+ - getAnchorTag()}{if $count != 1}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weitere Benutzer{/if} haben Antworten zu Kommentare zum freizuschaltenden Inhalt {$moderationQueue->getTitle()} verfasst.]]>
- username}{if $notificationContent[variables][commentAuthor]->userID} [URL:{link controller='User' object=$notificationContent[variables][commentAuthor] isEmail=true}{/link}]{/if} zum freizuschaltenden Inhalt {$notificationContent[variables][moderationQueue]->getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}] verfasst{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} {if $count == 1 && !$guestTimesTriggered}hat eine Antwort{else}haben Antworten{/if} zum Kommentar von {if $notificationContent[variables][commentAuthor]->userID}{$notificationContent[variables][commentAuthor]->username}{else}{$notificationContent[variables][commentAuthor]->username}{/if} zum freizuschaltenden Inhalt {$notificationContent[variables][moderationQueue]->getTitle()} verfasst:]]>
@@ -3176,14 +3176,14 @@ Fehler sind beispielsweise:
- - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat einen Kommentar zur Meldung {$moderationQueue->getTitle()} verfasst.]]>
+ - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat einen Kommentar zur Meldung {$moderationQueue->getTitle()} verfasst.]]>
- getAnchorTag()}{if $count != 1}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weitere Benutzer{/if} haben Kommentare zur Meldung {$moderationQueue->getTitle()} verfasst.]]>
- getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}] verfasst{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} {if $count == 1 && !$guestTimesTriggered}hat einen Kommentar{else}haben Kommentare{/if} zu der Meldung {$notificationContent[variables][moderationQueue]->getTitle()} verfasst:]]>
- - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat eine Antwort zum Kommentar von {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} zur Meldung {$moderationQueue->getTitle()} verfasst.]]>
- - getAnchorTag()}{if $count != 1}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3}und {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weitere Benutzer{/if} haben Antworten zu Kommentare zur Meldung {$moderationQueue->getTitle()} verfasst.]]>
+ - userID}Ein Gast{else}{@$author->getAnchorTag()}{/if} hat eine Antwort zum Kommentar von {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} zur Meldung {$moderationQueue->getTitle()} verfasst.]]>
+ - getAnchorTag()}{if $count != 1}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3}und {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$others} weitere Benutzer{/if} haben Antworten zu Kommentare zur Meldung {$moderationQueue->getTitle()} verfasst.]]>
- username}{if $notificationContent[variables][commentAuthor]->userID} [URL:{link controller='User' object=$notificationContent[variables][commentAuthor] isEmail=true}{/link}]{/if} zur Meldung {$notificationContent[variables][moderationQueue]->getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}] verfasst{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} {if $count == 1 && !$guestTimesTriggered}hat eine Antwort{else}haben Antworten{/if} zum Kommentar von {if $notificationContent[variables][commentAuthor]->userID}{$notificationContent[variables][commentAuthor]->username}{else}{$notificationContent[variables][commentAuthor]->username}{/if} zur Meldung {$notificationContent[variables][moderationQueue]->getTitle()} verfasst:]]>
diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml
index 1c8b7977bb..fe3ddc51e9 100644
--- a/wcfsetup/install/lang/en.xml
+++ b/wcfsetup/install/lang/en.xml
@@ -3056,14 +3056,14 @@ Errors are:
- - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a comment on the moderation entry {$moderationQueue->getTitle()}.]]>
+ - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a comment on the moderation entry {$moderationQueue->getTitle()}.]]>
- getAnchorTag()}{if $count != 1}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} other users{/if} wrote comments on the moderation entry {$moderationQueue->getTitle()}.]]>
- getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}]{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} wrote {if $count == 1 && !$guestTimesTriggered}a comment{else}comments{/if} on the moderation entry {$notificationContent[variables][moderationQueue]->getTitle()}:]]>
- - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a reply to a comment by {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} on the moderation entry {$moderationQueue->getTitle()}.]]>
- - getAnchorTag()}{if $count != 1}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} other users{/if} wrote replies to comments on the moderation entry {$moderationQueue->getTitle()}.]]>
+ - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a reply to a comment by {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} on the moderation entry {$moderationQueue->getTitle()}.]]>
+ - getAnchorTag()}{if $count != 1}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} other users{/if} wrote replies to comments on the moderation entry {$moderationQueue->getTitle()}.]]>
- username}âs{if $notificationContent[variables][commentAuthor]->userID} [URL:{link controller='User' object=$notificationContent[variables][commentAuthor] isEmail=true}{/link}]{/if} comment on the moderation entry {$notificationContent[variables][moderationQueue]->getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}]{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} wrote {if $count == 1 && !$guestTimesTriggered}a reply{else}replies{/if} to {if $notificationContent[variables][commentAuthor]->userID}{$notificationContent[variables][commentAuthor]->username}{else}{$notificationContent[variables][commentAuthor]->username}{/if}âs comment on the moderation entry {$notificationContent[variables][moderationQueue]->getTitle()}:]]>
@@ -3102,14 +3102,14 @@ Errors are:
- - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a comment on {$moderationQueue->getTitle()} waiting for approval.]]>
+ - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a comment on {$moderationQueue->getTitle()} waiting for approval.]]>
- getAnchorTag()}{if $count != 1}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} other users{/if} wrote comments on {$moderationQueue->getTitle()} waiting for approval.]]>
- getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}] waiting for approval{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} wrote {if $count == 1 && !$guestTimesTriggered}a comment{else}comments{/if} on the moderation entry {$notificationContent[variables][moderationQueue]->getTitle()} waiting for approval:]]>
- - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a reply to a comment by {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} on {$moderationQueue->getTitle()} waiting for approval.]]>
- - getAnchorTag()}{if $count != 1}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} other users{/if} wrote replies to comments on {$moderationQueue->getTitle()} waiting for approval.]]>
+ - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a reply to a comment by {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} on {$moderationQueue->getTitle()} waiting for approval.]]>
+ - getAnchorTag()}{if $count != 1}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} other users{/if} wrote replies to comments on {$moderationQueue->getTitle()} waiting for approval.]]>
- username}âs{if $notificationContent[variables][commentAuthor]->userID} [URL:{link controller='User' object=$notificationContent[variables][commentAuthor] isEmail=true}{/link}]{/if} comment on {$notificationContent[variables][moderationQueue]->getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}] waiting for approval{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} wrote {if $count == 1 && !$guestTimesTriggered}a reply{else}replies{/if} to {if $notificationContent[variables][commentAuthor]->userID}{$notificationContent[variables][commentAuthor]->username}{else}{$notificationContent[variables][commentAuthor]->username}{/if}âs comment on {$notificationContent[variables][moderationQueue]->getTitle()} waiting for approval:]]>
@@ -3122,14 +3122,14 @@ Errors are:
- - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a comment on the report {$moderationQueue->getTitle()}.]]>
+ - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a comment on the report {$moderationQueue->getTitle()}.]]>
- getAnchorTag()}{if $count != 1}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} other users{/if} wrote comments on the report {$moderationQueue->getTitle()}.]]>
- getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}]{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} wrote {if $count == 1 && !$guestTimesTriggered}a comment{else}comments{/if} on the report {$notificationContent[variables][moderationQueue]->getTitle()}:]]>
- - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a reply to a comment by {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} on the report {$moderationQueue->getTitle()}.]]>
- - getAnchorTag()}{if $count != 1}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} other users{/if} wrote replies to comments on the report {$moderationQueue->getTitle()}.]]>
+ - userID}A guest{else}{@$author->getAnchorTag()}{/if} wrote a reply to a comment by {if $commentAuthor->userID}{$commentAuthor->username}{else}{$commentAuthor->username}{/if} on the report {$moderationQueue->getTitle()}.]]>
+ - getAnchorTag()}{if $count != 1}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$others} other users{/if} wrote replies to comments on the report {$moderationQueue->getTitle()}.]]>
- username}âs{if $notificationContent[variables][commentAuthor]->userID} [URL:{link controller='User' object=$notificationContent[variables][commentAuthor] isEmail=true}{/link}]{/if} comment on the report {$notificationContent[variables][moderationQueue]->getTitle()} [URL:{$notificationContent[variables][moderationQueue]->getLink()}]{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} wrote {if $count == 1 && !$guestTimesTriggered}a reply{else}replies{/if} to {if $notificationContent[variables][commentAuthor]->userID}{$notificationContent[variables][commentAuthor]->username}{else}{$notificationContent[variables][commentAuthor]->username}{/if}âs comment on the report {$notificationContent[variables][moderationQueue]->getTitle()}:]]>
--
2.20.1