<div>
<p{if $entry->isNew()} title="{lang}wcf.moderation.markAsRead.doubleClick{/lang}"{/if}>{@$entry->getUserProfile()->getAvatar()->getImageTag(48)}</p>
- {if $entry->assignedUserID == $__wcf->user->userID}
- {if $__wcf->getUserProfileHandler()->getAvatar()}
- <small class="myAvatar jsTooltip" title="{lang}wcf.moderation.assignedUser{/lang}">{@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(24)}</small>
- {/if}
+ {if $entry->assignedUserID}
+ <small class="myAvatar jsTooltip" title="{lang}wcf.moderation.assignedUser{/lang}">{@$entry->getAssignedUserProfile()->getAvatar()->getImageTag(24)}</small>
{/if}
</div>
</li>
$queueList = new ViewableModerationQueueList();
$queueList->getConditionBuilder()->add("moderation_queue.queueID IN (?)", [$queueIDs]);
$queueList->sqlOrderBy = "moderation_queue.lastChangeTime DESC";
- $queueList->loadUserProfiles = true;
$queueList->readObjects();
foreach ($queueList as $queue) {
$queues[] = $queue;
if (!empty($queueIDs)) $queueList->getConditionBuilder()->add("moderation_queue.queueID NOT IN (?)", [$queueIDs]);
$queueList->sqlOrderBy = "moderation_queue.lastChangeTime DESC";
$queueList->sqlLimit = $MAX_ITEMS - $count;
- $queueList->loadUserProfiles = true;
$queueList->readObjects();
foreach ($queueList as $queue) {
$queues[] = $queue;
return $this->userProfile;
}
+ /**
+ * Returns assigned user profile object.
+ *
+ * @return UserProfile|null
+ */
+ public function getAssignedUserProfile() {
+ if ($this->assignedUserID) {
+ return UserProfileRuntimeCache::getInstance()->getObject($this->assignedUserID);
+ }
+
+ return null;
+ }
+
/**
* Returns true if associated object was removed.
*
* @property ViewableModerationQueue[] $objects
*/
class ViewableModerationQueueList extends ModerationQueueList {
- /**
- * true, if objects should be populated with associated user profiles
- * @var boolean
- */
- public $loadUserProfiles = false;
-
/**
* @inheritDoc
*/
ModerationQueueManager::getInstance()->removeOrphans($queueIDs);
}
- if ($this->loadUserProfiles) {
- $userIDs = [];
- foreach ($this->objects as $object) {
- $userIDs[] = $object->getAffectedObject()->getUserID();
- }
-
- UserProfileRuntimeCache::getInstance()->cacheObjectIDs(array_unique($userIDs));
+ $userIDs = [];
+ foreach ($this->objects as $object) {
+ $userIDs[] = $object->getAffectedObject()->getUserID();
+ if ($object->assignedUserID) $userIDs[] = $object->assignedUserID;
}
+
+ UserProfileRuntimeCache::getInstance()->cacheObjectIDs(array_unique($userIDs));
}
}