{if $queueManager->canRemoveContent($queue->getDecoratedObject())}<li class="jsOnly"><a id="removeContent" class="button"><span class="icon icon16 fa-times"></span> <span>{lang}wcf.moderation.report.removeContent{/lang}</span></a></li>{/if}
<li class="jsOnly"><a id="removeReport" class="button"><span class="icon icon16 fa-check"></span> <span>{lang}wcf.moderation.report.removeReport{/lang}</span></a></li>
{/if}
+ {if $queue->canChangeJustifiedStatus()}
+ <li class="jsOnly"><a id="changeJustifiedStatus" class="button"><span class="icon icon16 fa-pencil"></span> <span>{lang}wcf.moderation.report.changeJustifiedStatus{/lang}</span></a></li>
+ {/if}
{if $queue->getAffectedObject()}<li><a href="{$queue->getAffectedObject()->getLink()}" class="button"><span class="icon icon16 fa-arrow-right"></span> <span>{lang}wcf.moderation.jumpToContent{/lang}</span></a></li>{/if}
{event name='contentHeaderNavigation'}
'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}
+ );
});
</script>
/**
* @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 = $('<div class="section"><dl><dt><label for="message">' + WCF.Language.get('wcf.moderation.report.removeContent.reason') + '</label></dt><dd><textarea name="message" id="message" cols="40" rows="3" /></dd></dl></div>');
this._confirmationTemplate.removeReport = $('<div class="section"><dl><dt></dt><dd><label><input type="checkbox" name="markAsJustified" id="markAsJustified" value="1"> ' + WCF.Language.get('wcf.moderation.report.removeReport.markAsJustified') + '</label></dd></dl></div>');
+ this._confirmationTemplate.changeJustifiedStatus = $('<div class="section"><dl><dt></dt><dd><label><input type="checkbox" name="markAsJustified" id="markAsJustified" value="1"' + (isMarkedAsConfirmed ? ' checked="checked"' : '') + '> ' + WCF.Language.get('wcf.moderation.report.changeJustifiedStatus.markAsJustified') + '</label></dd></dl></div>');
+ },
+
+ /**
+ * @see WCF.Moderation.Management._success()
+ */
+ _success: function (data, textStatus, jqXHR) {
+ if (data.actionName === 'changeJustifiedStatus') {
+ var notification = new WCF.System.Notification();
+ notification.show(() => {
+ window.location.reload();
+ });
+ }
+ else {
+ this._super(data, textStatus, jqXHR);
+ }
}
});
break;
}
}
+
+ /**
+ * Returns `true` if the `justified` status can be changed.
+ *
+ * @since 5.4
+ */
+ public function canChangeJustifiedStatus(): bool
+ {
+ return \in_array($this->status, [self::STATUS_REJECTED, self::STATUS_CONFIRMED]);
+ }
}
'reported' => 1,
];
}
+
+ /**
+ * Validates the `changeJustifiedStatus` action.
+ *
+ * @since 5.4
+ */
+ public function validateChangeJustifiedStatus(): void
+ {
+ $this->queue = $this->getSingleObject();
+ if (!$this->queue->canEdit() || !$this->queue->canChangeJustifiedStatus()) {
+ throw new PermissionDeniedException();
+ }
+
+ $this->readBoolean('markAsJustified', true);
+ }
+
+ /**
+ * Updates the `markAsJustified` status.
+ */
+ public function changeJustifiedStatus(): void
+ {
+ $additionalData = $this->queue->additionalData;
+ if (!\is_array($additionalData)) {
+ $additionalData = [];
+ }
+ $additionalData['markAsJustified'] = $this->parameters['markAsJustified'];
+
+ $this->queue->update([
+ 'additionalData' => \serialize($additionalData),
+ ]);
+ }
}
<item name="wcf.moderation.report.reportedBy"><![CDATA[Gemeldet von]]></item>
<item name="wcf.moderation.report.reportedContent"><![CDATA[Gemeldeter Inhalt]]></item>
<item name="wcf.moderation.report.success"><![CDATA[Der Inhalt wurde den Moderatoren gemeldet.]]></item>
+ <item name="wcf.moderation.report.changeJustifiedStatus"><![CDATA[„Berechtigt“-Status ändern]]></item>
+ <item name="wcf.moderation.report.changeJustifiedStatus.markAsJustified"><![CDATA[Meldung als „Berechtigt“ markieren]]></item>
+ <item name="wcf.moderation.report.changeJustifiedStatus.confirmMessage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Willst du{else}Wollen Sie{/if} den „Berechtigt“-Status dieser Meldung wirklich ändern?]]></item>
</category>
<category name="wcf.notice">
<item name="wcf.notice.button.dismiss"><![CDATA[Hinweis dauerhaft ausblenden]]></item>
<item name="wcf.moderation.report.reportedBy"><![CDATA[Reported by]]></item>
<item name="wcf.moderation.report.reportedContent"><![CDATA[Reported Content]]></item>
<item name="wcf.moderation.report.success"><![CDATA[The content has been reported.]]></item>
+ <item name="wcf.moderation.report.changeJustifiedStatus"><![CDATA[Change “Justified” status]]></item>
+ <item name="wcf.moderation.report.changeJustifiedStatus.markAsJustified"><![CDATA[Mark report as “Justified”]]></item>
+ <item name="wcf.moderation.report.changeJustifiedStatus.confirmMessage"><![CDATA[Do you really want to change the “Justified” status of this report?]]></item>
</category>
<category name="wcf.notice">
<item name="wcf.notice.button.dismiss"><![CDATA[Permanently dismiss this notice]]></item>