Improved and fixed moderation dropdown
authorAlexander Ebert <ebert@woltlab.com>
Sat, 13 Dec 2014 23:38:51 +0000 (00:38 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 13 Dec 2014 23:38:51 +0000 (00:38 +0100)
com.woltlab.wcf/templates/moderationQueueList.tpl
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php

index 6c0a9818710f33cc8413ad8965b24575927a93c7..4169c18b9270166d1ce1b70bec03b3c2f33b4bee 100644 (file)
@@ -6,7 +6,7 @@
                        </div>
                        <div>
                                <h3><a href="{@$queue->getLink()}">{$queue->getAffectedObject()->getTitle()}</a></h3>
-                               <small>{if $queue->getUserProfile()->userID}<a href="{link controller='User' object=$queue->getUserProfile()->getDecoratedObject()}{/link}">{$queue->getAffectedObject()->getUsername()}</a>{else}{$queue->getAffectedObject()->getUsername()}{/if} - {@$queue->getAffectedObject()->getTime()|time}</small>
+                               <small>{if $queue->getUserProfile()->userID}<a href="{link controller='User' object=$queue->getUserProfile()->getDecoratedObject()}{/link}">{$queue->getAffectedObject()->getUsername()}</a>{else}{$queue->getAffectedObject()->getUsername()}{/if} - {@$queue->lastChangeTime|time}</small>
                        </div>
                </div>
        </li>
index cd361d61e9994f8fff2f94b03922655ba407bd3a..551f8ed4660ff163f551f1c39c7c67cfe16ca80f 100644 (file)
@@ -129,9 +129,12 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                if (!empty($queueIDs)) {
                        $queueList = new ViewableModerationQueueList();
                        $queueList->getConditionBuilder()->add("moderation_queue.queueID IN (?)", array($queueIDs));
+                       $queueList->sqlOrderBy = "moderation_queue.lastChangeTime DESC";
                        $queueList->loadUserProfiles = true;
                        $queueList->readObjects();
-                       $queues = $queueList->getObjects();
+                       foreach ($queueList as $queue) {
+                               $queues[] = $queue;
+                       }
                }
                
                // check if user storage is outdated
@@ -146,7 +149,9 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                        $queueList->sqlLimit = 5 - $count;
                        $queueList->loadUserProfiles = true;
                        $queueList->readObjects();
-                       $queues = array_merge($queues, $queueList->getObjects());
+                       foreach ($queueList as $queue) {
+                               $queues[] = $queue;
+                       }
                        
                        // check if stored count is out of sync
                        if ($count < $totalCount) {