From 4d986beeba7c03c07e8336b117e59a86d28ae9e2 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 2 Feb 2021 15:22:52 +0100 Subject: [PATCH] Support changing moderation queue status of closed entries (#3924) Close #3227 --- .../templates/moderationReport.tpl | 12 ++++++- wcfsetup/install/files/js/WCF.Moderation.js | 20 ++++++++++-- .../queue/ModerationQueue.class.php | 10 ++++++ .../ModerationQueueReportAction.class.php | 31 +++++++++++++++++++ wcfsetup/install/lang/de.xml | 3 ++ wcfsetup/install/lang/en.xml | 3 ++ 6 files changed, 76 insertions(+), 3 deletions(-) diff --git a/com.woltlab.wcf/templates/moderationReport.tpl b/com.woltlab.wcf/templates/moderationReport.tpl index 8c3942d792..38e354d3ad 100644 --- a/com.woltlab.wcf/templates/moderationReport.tpl +++ b/com.woltlab.wcf/templates/moderationReport.tpl @@ -40,6 +40,9 @@ {if $queueManager->canRemoveContent($queue->getDecoratedObject())}
  • {lang}wcf.moderation.report.removeContent{/lang}
  • {/if}
  • {lang}wcf.moderation.report.removeReport{/lang}
  • {/if} + {if $queue->canChangeJustifiedStatus()} +
  • {lang}wcf.moderation.report.changeJustifiedStatus{/lang}
  • + {/if} {if $queue->getAffectedObject()}
  • {lang}wcf.moderation.jumpToContent{/lang}
  • {/if} {event name='contentHeaderNavigation'} @@ -114,12 +117,19 @@ 'wcf.moderation.report.removeContent.reason': '{jslang}wcf.moderation.report.removeContent.reason{/jslang}', 'wcf.moderation.report.removeReport.confirmMessage': '{jslang}wcf.moderation.report.removeReport.confirmMessage{/jslang}', 'wcf.moderation.report.removeReport.markAsJustified': '{jslang}wcf.moderation.report.removeReport.markAsJustified{/jslang}', + 'wcf.moderation.report.removeReport.confirmMessage': '{jslang}wcf.moderation.report.removeReport.confirmMessage{/jslang}', + 'wcf.moderation.report.changeJustifiedStatus.markAsJustified': '{jslang}wcf.moderation.report.changeJustifiedStatus.markAsJustified{/jslang}', + 'wcf.moderation.report.changeJustifiedStatus.confirmMessage': '{jslang}wcf.moderation.report.changeJustifiedStatus.confirmMessage{/jslang}', 'wcf.moderation.status.outstanding': '{jslang}wcf.moderation.status.outstanding{/jslang}', 'wcf.moderation.status.processing': '{jslang}wcf.moderation.status.processing{/jslang}', 'wcf.user.username.error.notFound': '{jslang __literal=true}wcf.user.username.error.notFound{/jslang}' }); - new WCF.Moderation.Report.Management({@$queue->queueID}, '{link controller='ModerationList' encode=false}{/link}'); + new WCF.Moderation.Report.Management( + {@$queue->queueID}, + '{link controller='ModerationList' encode=false}{/link}', + {if $queue->markAsJustified}true{else}false{/if} + ); }); diff --git a/wcfsetup/install/files/js/WCF.Moderation.js b/wcfsetup/install/files/js/WCF.Moderation.js index 63cf11955a..0386f99bc0 100644 --- a/wcfsetup/install/files/js/WCF.Moderation.js +++ b/wcfsetup/install/files/js/WCF.Moderation.js @@ -667,14 +667,30 @@ if (COMPILER_TARGET_DEFAULT) { /** * @see WCF.Moderation.Management.init() */ - init: function (queueID, redirectURL) { - this._buttonSelector = '#removeContent, #removeReport'; + init: function (queueID, redirectURL, isMarkedAsConfirmed) { + this._buttonSelector = '#removeContent, #removeReport, #changeJustifiedStatus'; this._className = 'wcf\\data\\moderation\\queue\\ModerationQueueReportAction'; this._super(queueID, redirectURL, 'wcf.moderation.report.{actionName}.confirmMessage'); this._confirmationTemplate.removeContent = $('