WCF.Language.addObject({
'wcf.moderation.activation.enableContent.confirmMessage': '{lang}wcf.moderation.activation.enableContent.confirmMessage{/lang}',
- 'wcf.moderation.activation.removeContent.confirmMessage': '{lang}wcf.moderation.activation.removeContent.confirmMessage{/lang}'
+ 'wcf.moderation.activation.removeContent.confirmMessage': '{lang}wcf.moderation.activation.removeContent.confirmMessage{/lang}',
+ 'wcf.moderation.assignedUser': '{lang}wcf.moderation.assignedUser{/lang}',
+ 'wcf.moderation.assignedUser.change': '{lang}wcf.moderation.assignedUser.change{/lang}',
+ 'wcf.moderation.assignedUser.error.notAffected': '{lang}wcf.moderation.assignedUser.error.notAffected{/lang}',
+ 'wcf.moderation.status.outstanding': '{lang}wcf.moderation.status.outstanding{/lang}',
+ 'wcf.moderation.status.processing': '{lang}wcf.moderation.status.processing{/lang}'
});
});
//]]>
<body id="tpl{$templateName|ucfirst}">
-{capture assign='sidebar'}
- <form method="post" action="{link controller='ModerationActivation' id=$queue->queueID}{/link}">
- <fieldset>
- <legend>{lang}wcf.moderation.report.details{/lang}</legend>
-
- <dl>
- <dt>{lang}wcf.moderation.assignedUser{/lang}</dt>
- <dd>
- <ul>
- {if $assignedUserID && ($assignedUserID != $__wcf->getUser()->userID)}
- <li><label><input type="radio" name="assignedUserID" value="{@$assignedUserID}" checked="checked" /> {$queue->assignedUsername}</label></li>
- {/if}
- <li><label><input type="radio" name="assignedUserID" value="{@$__wcf->getUser()->userID}"{if $assignedUserID == $__wcf->getUser()->userID} checked="checked"{/if} /> {$__wcf->getUser()->username}</label></li>
- <li><label><input type="radio" name="assignedUserID" value="0"{if !$assignedUserID} checked="checked"{/if} /> {lang}wcf.moderation.assignedUser.nobody{/lang}</label></li>
- </ul>
- </dd>
- </dl>
- {if $queue->assignedUser}
- <dl>
- <dt></dt>
- <dd><a href="{link controller='User' id=$assignedUserID}{/link}" class="userLink" data-user-id="{@$assignedUserID}">{$queue->assignedUsername}</a></dd>
- </dl>
- {/if}
-
- {event name='detailsFields'}
-
- <div class="formSubmit">
- <input type="submit" value="{lang}wcf.global.button.submit{/lang}" />
- {@SECURITY_TOKEN_INPUT_TAG}
- </div>
- </fieldset>
-
- {event name='fieldsets'}
- </form>
-
- {event name='boxes'}
-{/capture}
-
-{include file='header' sidebarOrientation='right'}
+{include file='header'}
<header class="boxHeadline">
<h1>{lang}wcf.moderation.activation{/lang}: {$queue->getTitle()}</h1>
<dd>{@$queue->lastChangeTime|time}</dd>
</dl>
{/if}
+
+ <dl class="plain inlineDataList" id="moderationAssignedUserContainer">
+ <dt>{lang}wcf.moderation.assignedUser{/lang}</dt>
+ <dd>
+ <span>
+ {if $queue->assignedUserID}
+ <a href="{link controller='User' id=$assignedUserID}{/link}" class="userLink" data-user-id="{@$assignedUserID}">{$queue->assignedUsername}</a>
+ {else}
+ {lang}wcf.moderation.assignedUser.nobody{/lang}
+ {/if}
+ </span>
+ </dd>
+ </dl>
+
+ <dl class="plain inlineDataList" id="moderationStatusContainer">
+ <dt>{lang}wcf.moderation.status{/lang}</dt>
+ <dd>{$queue->getStatus()}</dd>
+ </dl>
</header>
{include file='userNotice'}
--- /dev/null
+<fieldset>
+ <dl>
+ <dt>{lang}wcf.moderation.assignedUser{/lang}</dt>
+ <dd>
+ <ul>
+ {if $assignedUser && $assignedUser->userID != $__wcf->getUser()->userID}
+ <li><label><input type="radio" name="assignedUserID" value="{@$assignedUser->userID}" checked="checked" /> {$assignedUser->username}</label></li>
+ {/if}
+ <li><label><input type="radio" name="assignedUserID" value="{@$__wcf->getUser()->userID}"{if $assignedUser && $assignedUser->userID == $__wcf->getUser()->userID} checked="checked"{/if} /> {$__wcf->getUser()->username}</label></li>
+ <li><label><input type="radio" name="assignedUserID" value="0"{if !$assignedUser} checked="checked"{/if} /> {lang}wcf.moderation.assignedUser.nobody{/lang}</label></li>
+ <li>
+ <label><input type="radio" name="assignedUserID" value="-1"{if !$assignedUser} checked="checked"{/if} />
+ <input type="text" id="assignedUsername" name="assignedUsername" value="{if $assignedUser}{$assignedUser->username}{/if}" />
+ {*if $errorField == 'assignedUsername'}
+ <small class="innerError">
+ {if $errorType == 'empty'}
+ {lang}wcf.global.form.error.empty{/lang}
+ {elseif $errorType == 'notAffected'}
+ {lang}wcf.moderation.assignedUser.error.{@$errorType}{/lang}
+ {else}
+ {lang username=$assignedUsername}wcf.user.username.error.{@$errorType}{/lang}
+ {/if}
+ </small>
+ {/if*}
+ </label>
+ </li>
+ </ul>
+ </dd>
+ </dl>
+
+ <div class="formSubmit">
+ <button data-type="submit">{lang}wcf.global.button.submit{/lang}</button>
+ </div>
+</fieldset>
+<script>
+ $(function() {
+ new WCF.Search.User('#assignedUsername');
+ $('#assignedUsername').click(function() {
+ $(this).parents('li').find('input[type=radio]').click();
+ });
+ });
+</script>
//<![CDATA[
$(function() {
WCF.Language.addObject({
+ 'wcf.moderation.assignedUser': '{lang}wcf.moderation.assignedUser{/lang}',
+ 'wcf.moderation.assignedUser.change': '{lang}wcf.moderation.assignedUser.change{/lang}',
+ 'wcf.moderation.assignedUser.error.notAffected': '{lang}wcf.moderation.assignedUser.error.notAffected{/lang}',
'wcf.moderation.report.removeContent.confirmMessage': '{lang}wcf.moderation.report.removeContent.confirmMessage{/lang}',
'wcf.moderation.report.removeContent.reason': '{lang}wcf.moderation.report.removeContent.reason{/lang}',
- 'wcf.moderation.report.removeReport.confirmMessage': '{lang}wcf.moderation.report.removeReport.confirmMessage{/lang}'
+ 'wcf.moderation.report.removeReport.confirmMessage': '{lang}wcf.moderation.report.removeReport.confirmMessage{/lang}',
+ 'wcf.moderation.status.outstanding': '{lang}wcf.moderation.status.outstanding{/lang}',
+ 'wcf.moderation.status.processing': '{lang}wcf.moderation.status.processing{/lang}'
});
new WCF.Moderation.Report.Management({@$queue->queueID}, '{link controller='ModerationList'}{/link}');
-
- new WCF.Search.User('#assignedUsername');
- $('#assignedUsername').click(function() {
- $(this).parents('li').find('input[type=radio]').click();
- });
});
//]]>
</script>
<body id="tpl{$templateName|ucfirst}">
-{capture assign='sidebar'}
- <form method="post" action="{link controller='ModerationReport' id=$queue->queueID}{/link}">
- <fieldset>
- <legend>{lang}wcf.moderation.report.details{/lang}</legend>
-
- <dl>
- <dt>{lang}wcf.moderation.assignedUser{/lang}</dt>
- <dd>
- <ul>
- {if $assignedUserID && $assignedUserID != -1 && $assignedUserID != $__wcf->getUser()->userID}
- <li><label><input type="radio" name="assignedUserID" value="{@$assignedUserID}" checked="checked" /> {$queue->assignedUsername}</label></li>
- {/if}
- <li><label><input type="radio" name="assignedUserID" value="{@$__wcf->getUser()->userID}"{if $assignedUserID == $__wcf->getUser()->userID} checked="checked"{/if} /> {$__wcf->getUser()->username}</label></li>
- <li><label><input type="radio" name="assignedUserID" value="0"{if !$assignedUserID} checked="checked"{/if} /> {lang}wcf.moderation.assignedUser.nobody{/lang}</label></li>
- <li>
- <label><input type="radio" name="assignedUserID" value="-1"{if $assignedUserID == -1} checked="checked"{/if} />
- <input type="text" id="assignedUsername" name="assignedUsername" value="{$assignedUsername}" />
- {if $errorField == 'assignedUsername'}
- <small class="innerError">
- {if $errorType == 'empty'}
- {lang}wcf.global.form.error.empty{/lang}
- {elseif $errorType == 'notAffected'}
- {lang}wcf.moderation.assignedUser.error.{@$errorType}{/lang}
- {else}
- {lang username=$assignedUsername}wcf.user.username.error.{@$errorType}{/lang}
- {/if}
- </small>
- {/if}
- </label>
- </li>
- </ul>
- </dd>
- </dl>
- {if $queue->assignedUser}
- <dl>
- <dt></dt>
- <dd><a href="{link controller='User' id=$assignedUserID}{/link}" class="userLink" data-user-id="{@$assignedUserID}">{$queue->assignedUsername}</a></dd>
- </dl>
- {/if}
-
- {event name='detailsFields'}
-
- <div class="formSubmit">
- <input type="submit" value="{lang}wcf.global.button.submit{/lang}" />
- {@SECURITY_TOKEN_INPUT_TAG}
- </div>
- </fieldset>
-
- {event name='fieldsets'}
- </form>
-
- {event name='boxes'}
-{/capture}
-
-{include file='header' sidebarOrientation='right'}
+{include file='header'}
<header class="boxHeadline">
<h1>{lang}wcf.moderation.report{/lang}: {$queue->getTitle()}</h1>
<dd>{@$queue->lastChangeTime|time}</dd>
</dl>
{/if}
+
+ <dl class="plain inlineDataList" id="moderationAssignedUserContainer">
+ <dt>{lang}wcf.moderation.assignedUser{/lang}</dt>
+ <dd>
+ <span>
+ {if $queue->assignedUserID}
+ <a href="{link controller='User' id=$assignedUserID}{/link}" class="userLink" data-user-id="{@$assignedUserID}">{$queue->assignedUsername}</a>
+ {else}
+ {lang}wcf.moderation.assignedUser.nobody{/lang}
+ {/if}
+ </span>
+ </dd>
+ </dl>
+
+ <dl class="plain inlineDataList" id="moderationStatusContainer">
+ <dt>{lang}wcf.moderation.status{/lang}</dt>
+ <dd>{$queue->getStatus()}</dd>
+ </dl>
</header>
{include file='userNotice'}
*/
_confirmationTemplate: { },
+ /**
+ * dialog overlay
+ * @var jQuery
+ */
+ _dialog: null,
+
/**
* language item pattern
* @var string
return;
}
+ this._dialog = null;
this._queueID = queueID;
this._redirectURL = redirectURL;
this._languageItem = languageItem;
this._proxy = new WCF.Action.Proxy({
+ failure: $.proxy(this._failure, this),
success: $.proxy(this._success, this)
});
$(this._buttonSelector).click($.proxy(this._click, this));
+
+ $('<a>' + WCF.Language.get('wcf.moderation.assignedUser.change') + '</a>').click($.proxy(this._clickAssignedUser, this)).insertAfter($('#moderationAssignedUserContainer > dd > span'));
},
/**
}, this), { }, $innerTemplate);
},
+ /**
+ * Handles clicks on the assign user link.
+ */
+ _clickAssignedUser: function() {
+ this._proxy.setOption('data', {
+ actionName: 'getAssignUserForm',
+ className: 'wcf\\data\\moderation\\queue\\ModerationQueueAction',
+ objectIDs: [ this._queueID ]
+ });
+ this._proxy.sendRequest();
+ },
+
/**
* Handles successful AJAX requests.
*
* @param jQuery jqXHR
*/
_success: function(data, textStatus, jqXHR) {
- var $notification = new WCF.System.Notification(WCF.Language.get('wcf.global.success'));
- var self = this;
- $notification.show(function() {
- window.location = self._redirectURL;
+ switch (data.actionName) {
+ case 'getAssignUserForm':
+ if (this._dialog === null) {
+ this._dialog = $('<div />').hide().appendTo(document.body);
+ this._dialog.html(data.returnValues.template).wcfDialog({
+ title: WCF.Language.get('wcf.moderation.assignedUser')
+ });
+ }
+ else {
+ this._dialog.html(data.returnValues.template).wcfDialog('open');
+ }
+
+ this._dialog.find('button[data-type=submit]').click($.proxy(this._assignUser, this));
+ break;
+
+ case 'assignUser':
+ var $span = $('#moderationAssignedUserContainer > dd > span').empty();
+ if (data.returnValues.userID) {
+ $('<a href="' + data.returnValues.link + '" data-user-id="' + data.returnValues.userID + '" class="userLink">' + WCF.String.escapeHTML(data.returnValues.username) + '</a>').appendTo($span);
+ }
+ else {
+ $span.append(data.returnValues.username)
+ }
+
+ $span.append(' ');
+
+ if (data.returnValues.newStatus) {
+ $('#moderationStatusContainer > dd').text(WCF.Language.get('wcf.moderation.status.' + data.returnValues.newStatus));
+ }
+
+ this._dialog.wcfDialog('close');
+
+ new WCF.System.Notification().show();
+ break;
+
+ default:
+ var $notification = new WCF.System.Notification(WCF.Language.get('wcf.global.success'));
+ var self = this;
+ $notification.show(function() {
+ window.location = self._redirectURL;
+ });
+ break;
+ }
+ },
+
+ /**
+ * Handles errorneus AJAX requests.
+ *
+ * @param object data
+ * @param jQuery jqXHR
+ * @param string textStatus
+ * @param string errorThrown
+ */
+ _failure: function(data, jqXHR, textStatus, errorThrown) {
+ if (data.returnValues && data.returnValues.fieldName && data.returnValues.fieldName == 'assignedUsername') {
+ this._dialog.find('small.innerError').remove();
+
+ var $errorString = '';
+ switch (data.returnValues.errorType) {
+ case 'empty':
+ $errorString = WCF.Language.get('wcf.global.form.error.empty');
+ break;
+
+ case 'notAffected':
+ $errorString = WCF.Language.get('wcf.moderation.assignedUser.error.notAffected');
+ break;
+
+ default:
+ $errorString = WCF.Language.get('wcf.user.username.error.' + data.returnValues.errorType, { username: this._dialog.find('#assignedUsername').val() });
+ break;
+ }
+
+ $('<small class="innerError">' + $errorString + '</small>').insertAfter(this._dialog.find('#assignedUsername'));
+
+ return false;
+ }
+
+ return true;
+ },
+
+ /**
+ * Submits the assign user form.
+ */
+ _assignUser: function() {
+ var $assignedUserID = this._dialog.find('input[name=assignedUserID]:checked').val();
+ var $assignedUsername = '';
+ if ($assignedUserID == -1) {
+ $assignedUsername = $.trim(this._dialog.find('#assignedUsername').val());
+ }
+
+ if ($assignedUserID == -1 && $assignedUsername.length == 0) {
+ this._dialog.find('small.innerError').remove();
+ $('<small class="innerError">' + WCF.Language.get('wcf.global.form.error.empty') + '</small>').insertAfter(this._dialog.find('#assignedUsername'));
+ return;
+ }
+
+ this._proxy.setOption('data', {
+ actionName: 'assignUser',
+ className: 'wcf\\data\\moderation\\queue\\ModerationQueueAction',
+ objectIDs: [ this._queueID ],
+ parameters: {
+ assignedUserID: $assignedUserID,
+ assignedUsername: $assignedUsername
+ }
});
+ this._proxy.sendRequest();
}
});
namespace wcf\data\moderation\queue;
use wcf\data\DatabaseObject;
use wcf\system\WCF;
+use wcf\data\object\type\ObjectTypeCache;
/**
* Represents a moderation queue entry.
const STATUS_OUTSTANDING = 0;
const STATUS_PROCESSING = 1;
const STATUS_DONE = 2;
+ const STATUS_REJECTED = 3;
+ const STATUS_CONFIRMED = 4;
/**
* @see \wcf\data\IStorableObject::__get()
public function isDone() {
return ($this->status == self::STATUS_DONE);
}
+
+ /**
+ * Returns status text.
+ *
+ * @param integer $status
+ * @return string
+ */
+ public function getStatus($status = null) {
+ $status = ($status === null) ? $this->status : $status;
+ switch ($status) {
+ case self::STATUS_OUTSTANDING:
+ return WCF::getLanguage()->get('wcf.moderation.status.outstanding');
+ break;
+
+ case self::STATUS_PROCESSING:
+ return WCF::getLanguage()->get('wcf.moderation.status.processing');
+ break;
+
+ case self::STATUS_DONE:
+ return WCF::getLanguage()->get('wcf.moderation.status.done');
+ break;
+
+ case self::STATUS_REJECTED:
+ case self::STATUS_CONFIRMED:
+ $objectType = ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID);
+ $definition = ObjectTypeCache::getInstance()->getDefinition($objectType->definitionID);
+
+ return WCF::getLanguage()->get('wcf.moderation.status.' . ($status == self::STATUS_REJECTED ? 'rejected' : 'confirmed') . '.' . $definition->definitionName);
+ break;
+ }
+ }
}
<?php
namespace wcf\data\moderation\queue;
+use wcf\data\object\type\ObjectTypeCache;
+use wcf\data\user\User;
use wcf\data\AbstractDatabaseObjectAction;
use wcf\system\database\util\PreparedStatementConditionBuilder;
+use wcf\system\exception\PermissionDeniedException;
+use wcf\system\exception\UserInputException;
use wcf\system\moderation\queue\ModerationQueueManager;
use wcf\system\user\storage\UserStorageHandler;
use wcf\system\WCF;
+use wcf\system\request\LinkHandler;
+
/**
* Executes moderation queue-related actions.
*/
protected $className = 'wcf\data\moderation\queue\ModerationQueueEditor';
+ /**
+ * moderation queue editor object
+ * @var \wcf\data\moderation\queue\ModerationQueueEditor
+ */
+ public $moderationQueueEditor = null;
+
+ /**
+ * user object
+ * @var \wcf\data\user\User
+ */
+ public $user = null;
+
/**
* @see \wcf\data\AbstractDatabaseObjectAction::create()
*/
'totalCount' => $totalCount
);
}
+
+ /**
+ * Validates parameters to show the user assign form.
+ */
+ public function validateGetAssignUserForm() {
+ $this->moderationQueueEditor = $this->getSingleObject();
+
+ // check if queue is accessible for current user
+ if (!$this->moderationQueueEditor->canEdit()) {
+ throw new PermissionDeniedException();
+ }
+ }
+
+ /**
+ * Returns the user assign form.
+ *
+ * @return array<string>
+ */
+ public function getAssignUserForm() {
+ $assignedUser = ($this->moderationQueueEditor->assignedUserID) ? new User($this->moderationQueueEditor->assignedUserID) : null;
+
+ WCF::getTPL()->assign(array(
+ 'assignedUser' => $assignedUser,
+ 'queue' => $this->moderationQueueEditor
+ ));
+
+ return array(
+ 'template' => WCF::getTPL()->fetch('moderationQueueAssignUser')
+ );
+ }
+
+ /**
+ * Validates parameters to assign a user.
+ */
+ public function validateAssignUser() {
+ $this->moderationQueueEditor = $this->getSingleObject();
+ $this->readInteger('assignedUserID', true);
+
+ if ($this->parameters['assignedUserID'] && $this->parameters['assignedUserID'] != -1) {
+ if ($this->parameters['assignedUserID'] != WCF::getUser()->userID && $this->parameters['assignedUserID'] != $this->moderationQueueEditor->assignedUserID) {
+ // user id is either faked or changed during viewing, use database value instead
+ $this->parameters['assignedUserID'] = $this->moderationQueueEditor->assignedUserID;
+ }
+ }
+
+ if ($this->parameters['assignedUserID'] == -1) {
+ $this->readString('assignedUsername');
+
+ $this->user = User::getUserByUsername($this->parameters['assignedUsername']);
+ if (!$this->user->userID) {
+ throw new UserInputException('assignedUsername', 'notFound');
+ }
+
+ // get handler
+ $objectType = ObjectTypeCache::getInstance()->getObjectType($this->moderationQueueEditor->objectTypeID);
+ if (!$objectType->getProcessor()->isAffectedUser($this->moderationQueueEditor->getDecoratedObject(), $this->user->userID)) {
+ throw new UserInputException('assignedUsername', 'notAffected');
+ }
+
+ $this->parameters['assignedUserID'] = $this->user->userID;
+ $this->parameters['assignedUsername'] = '';
+ }
+ else {
+ $this->user = new User($this->parameters['assignedUserID']);
+ }
+ }
+
+ /**
+ * Returns the data for the newly assigned user.
+ *
+ * @return array<string>
+ */
+ public function assignUser() {
+ $data = array('assignedUserID' => ($this->parameters['assignedUserID'] ?: null));
+ if ($this->user->userID) {
+ if ($this->moderationQueueEditor->status == ModerationQueue::STATUS_OUTSTANDING) {
+ $data['status'] = ModerationQueue::STATUS_PROCESSING;
+ }
+ }
+ else {
+ if ($this->moderationQueueEditor->status == ModerationQueue::STATUS_PROCESSING) {
+ $data['status'] = ModerationQueue::STATUS_OUTSTANDING;
+ }
+ }
+
+ $this->moderationQueueEditor->update($data);
+
+ $username = ($this->user->userID) ? $this->user->username : WCF::getLanguage()->get('wcf.moderation.assignedUser.nobody');
+ $link = '';
+ if ($this->user->userID) {
+ $link = LinkHandler::getInstance()->getLink('User', array('object' => $this->user));
+ }
+
+ $newStatus = '';
+ if (isset($data['status'])) {
+ $newStatus = ($data['status'] == ModerationQueue::STATUS_OUTSTANDING) ? 'outstanding' : 'processing';
+ }
+
+ return array(
+ 'link' => $link,
+ 'newStatus' => $newStatus,
+ 'userID' => $this->user->userID,
+ 'username' => $username
+ );
+ }
}
// enable content
ModerationQueueActivationManager::getInstance()->enableContent($this->queue->getDecoratedObject());
- $this->queue->markAsDone();
+ $this->queue->markAsConfirmed();
}
/**
// mark content as deleted
ModerationQueueActivationManager::getInstance()->removeContent($this->queue->getDecoratedObject(), $this->parameters['message']);
- $this->queue->markAsDone();
+ $this->queue->markAsRejected();
}
}
/**
* Marks this entry as done.
+ *
+ * @deprecated 2.1 - Please use markAsConfirmed() or markAsRejected()
*/
public function markAsDone() {
$this->update(array('status' => ModerationQueue::STATUS_DONE));
ModerationQueueManager::getInstance()->resetModerationCount();
}
+ /**
+ * Marks this entry as confirmed, e.g. report was justified and content was deleted or
+ * content was approved.
+ */
+ public function markAsConfirmed() {
+ $this->update(array('status' => ModerationQueue::STATUS_CONFIRMED));
+
+ // reset moderation count
+ ModerationQueueManager::getInstance()->resetModerationCount();
+ }
+
+ /**
+ * Marks this entry as rejected, e.g. report was unjustified or content approval was denied.
+ */
+ public function markAsRejected() {
+ $this->update(array('status' => ModerationQueue::STATUS_REJECTED));
+
+ // reset moderation count
+ ModerationQueueManager::getInstance()->resetModerationCount();
+ }
+
/**
* Marks this entry as in progress.
*/
// mark content as deleted
ModerationQueueReportManager::getInstance()->removeContent($this->queue->getDecoratedObject(), $this->parameters['message']);
- $this->queue->markAsDone();
+ $this->queue->markAsConfirmed();
}
/**
* Removes this report by marking it as done without further processing.
*/
public function removeReport() {
- $this->queue->markAsDone();
+ $this->queue->markAsRejected();
}
/**
* @category Community Framework
*/
abstract class AbstractModerationForm extends AbstractForm {
- /**
- * assigned user id
- * @var integer
- */
- public $assignedUserID = 0;
-
- /**
- * assigned user's name
- * @var string
- */
- public $assignedUsername = '';
-
/**
* data used for moderation queue update
* @var array
}
}
- /**
- * @see \wcf\form\IForm::readFormParameters()
- */
- public function readFormParameters() {
- parent::readFormParameters();
-
- if (isset($_POST['assignedUsername'])) $this->assignedUsername = StringUtil::trim($_POST['assignedUsername']);
-
- // verify assigned user id
- if (isset($_POST['assignedUserID'])) {
- $this->assignedUserID = intval($_POST['assignedUserID']);
- if ($this->assignedUserID && $this->assignedUserID != -1) {
- if ($this->assignedUserID != WCF::getUser()->userID && $this->assignedUserID != $this->queue->assignedUserID) {
- // user id is either faked or changed during viewing, use database value instead
- $this->assignedUserID = $this->queue->assignedUserID;
- }
- }
- }
- }
-
- /**
- * @see \wcf\form\IForm::validate()
- */
- public function validate() {
- parent::validate();
-
- if ($this->assignedUserID == -1) {
- if (empty($this->assignedUsername)) {
- throw new UserInputException('assignedUsername');
- }
-
- $assignedUser = User::getUserByUsername($this->assignedUsername);
- if (!$assignedUser->userID) {
- throw new UserInputException('assignedUsername', 'notFound');
- }
-
- // get handler
- $objectType = ObjectTypeCache::getInstance()->getObjectType($this->queue->objectTypeID);
- if (!$objectType->getProcessor()->isAffectedUser($this->queue->getDecoratedObject(), $assignedUser->userID)) {
- throw new UserInputException('assignedUsername', 'notAffected');
- }
-
- $this->assignedUserID = $assignedUser->userID;
- $this->assignedUsername = '';
- }
- }
-
/**
* @see \wcf\page\IPage::readData()
*/
'commentObjectTypeID' => $this->commentObjectTypeID,
'lastCommentTime' => ($this->commentList ? $this->commentList->getMinCommentTime() : 0),
'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'com.woltlab.wcf.ModerationForm'),
- 'sidebarName' => 'com.woltlab.wcf.ModerationForm',
- 'assignedUsername' => $this->assignedUsername
+ 'sidebarName' => 'com.woltlab.wcf.ModerationForm'
));
}
- /**
- * @see \wcf\form\IForm::save()
- */
- public function save() {
- parent::save();
-
- $this->data = array(
- 'assignedUserID' => ($this->assignedUserID ?: null),
- );
- if ($this->queue->status != ModerationQueue::STATUS_DONE) {
- if ($this->assignedUserID) {
- // queue item is being processed
- if ($this->assignedUserID != $this->queue->assignedUserID) {
- $this->data['status'] = ModerationQueue::STATUS_PROCESSING;
- }
- }
- else {
- // queue is no longer processed, mark as outstanding
- if ($this->queue->assignedUserID) {
- $this->data['status'] = ModerationQueue::STATUS_OUTSTANDING;
- }
- }
- }
-
- $this->prepareSave();
- $this->objectAction = new ModerationQueueAction(array($this->queue->getDecoratedObject()), 'update', array('data' => $this->data));
- $this->objectAction->executeAction();
-
- // call saved event
- $this->saved();
-
- // reload queue to update assignment
- if ($this->assignedUserID != $this->queue->assignedUserID) {
- $this->queue = ViewableModerationQueue::getViewableModerationQueue($this->queue->queueID);
- }
- }
-
/**
* Prepares update of moderation queue item.
*/
<category name="wcf.moderation">
<item name="wcf.moderation.assignedUser"><![CDATA[Zugewiesener Benutzer]]></item>
+ <item name="wcf.moderation.assignedUser.change"><![CDATA[(Ändern)]]></item>
+ <item name="wcf.moderation.assignedUser.error.notAffected"><![CDATA[Dieser Benutzer hat unzureichende Zugriffsrechte]]></item>
<item name="wcf.moderation.assignedUser.nobody"><![CDATA[Niemand]]></item>
<item name="wcf.moderation.filterByType"><![CDATA[Typ]]></item>
<item name="wcf.moderation.filterByUser"><![CDATA[Zugewiesener Benutzer]]></item>
<item name="wcf.moderation.noMoreItems"><![CDATA[Keine weiteren Einträge]]></item>
<item name="wcf.moderation.status"><![CDATA[Status]]></item>
<item name="wcf.moderation.status.outstanding"><![CDATA[Ausstehend]]></item>
+ <item name="wcf.moderation.status.processing"><![CDATA[In Bearbeitung]]></item>
<item name="wcf.moderation.status.done"><![CDATA[Erledigt]]></item>
+ <item name="wcf.moderation.status.confirmed.com.woltlab.wcf.moderation.activation"><![CDATA[Inhalt wurde freigeschaltet]]></item>
+ <item name="wcf.moderation.status.confirmed.com.woltlab.wcf.moderation.report"><![CDATA[Meldung berechtigt, Inhalt wurde gelöscht]]></item>
+ <item name="wcf.moderation.status.rejected.com.woltlab.wcf.moderation.activation"><![CDATA[Freischaltung wurde abgelehnt]]></item>
+ <item name="wcf.moderation.status.rejected.com.woltlab.wcf.moderation.report"><![CDATA[Meldung unberechtigt]]></item>
<item name="wcf.moderation.time"><![CDATA[Datum]]></item>
<item name="wcf.moderation.title"><![CDATA[Titel]]></item>
<item name="wcf.moderation.type"><![CDATA[Typ]]></item>
<category name="wcf.moderation">
<item name="wcf.moderation.assignedUser"><![CDATA[Assigned User]]></item>
+ <item name="wcf.moderation.assignedUser.change"><![CDATA[(Change)]]></item>
+ <item name="wcf.moderation.assignedUser.error.notAffected"><![CDATA[This user does not have sufficient privileges]]></item>
<item name="wcf.moderation.assignedUser.nobody"><![CDATA[Nobody]]></item>
<item name="wcf.moderation.filterByType"><![CDATA[Type]]></item>
<item name="wcf.moderation.filterByUser"><![CDATA[Assigned User]]></item>
<item name="wcf.moderation.noMoreItems"><![CDATA[No more items]]></item>
<item name="wcf.moderation.status"><![CDATA[Status]]></item>
<item name="wcf.moderation.status.outstanding"><![CDATA[Pending]]></item>
+ <item name="wcf.moderation.status.processing"><![CDATA[In Progress]]></item>
<item name="wcf.moderation.status.done"><![CDATA[Done]]></item>
+ <item name="wcf.moderation.status.confirmed.com.woltlab.wcf.moderation.activation"><![CDATA[Content has been approved]]></item>
+ <item name="wcf.moderation.status.confirmed.com.woltlab.wcf.moderation.report"><![CDATA[Report was justified, content has been deleted]]></item>
+ <item name="wcf.moderation.status.rejected.com.woltlab.wcf.moderation.activation"><![CDATA[Approval was denied]]></item>
+ <item name="wcf.moderation.status.rejected.com.woltlab.wcf.moderation.report"><![CDATA[Report was unjustified]]></item>
<item name="wcf.moderation.time"><![CDATA[Time]]></item>
<item name="wcf.moderation.title"><![CDATA[Title]]></item>
<item name="wcf.moderation.type"><![CDATA[Type]]></item>