Multiple user search improvements
authorMarcel Werk <burntime@woltlab.com>
Fri, 23 May 2014 12:30:12 +0000 (14:30 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 23 May 2014 12:30:12 +0000 (14:30 +0200)
wcfsetup/install/files/acp/templates/userList.tpl
wcfsetup/install/files/acp/templates/userSearch.tpl
wcfsetup/install/files/lib/acp/page/UserListPage.class.php
wcfsetup/install/files/style/layout.less

index 63e35de881b67c11a145aeb33365a28edeeb3d2f..eecc7761e2c2c341970864156a564f14b61c8475 100644 (file)
                                                </td>
                                                <td class="columnID columnUserID">{@$user->userID}</td>
                                                <td class="columnIcon"><p class="framed">{@$user->getAvatar()->getImageTag(24)}</p></td>
-                                               <td class="columnTitle columnUsername">{if $user->editable}<a title="{lang}wcf.acp.user.edit{/lang}" href="{link controller='UserEdit' id=$user->userID}{/link}">{$user->username}</a>{else}{$user->username}{/if}</td>
+                                               <td class="columnTitle columnUsername">{if $user->editable}<a title="{lang}wcf.acp.user.edit{/lang}" href="{link controller='UserEdit' id=$user->userID}{/link}">{$user->username}</a>{else}{$user->username}{/if}{if MODULE_USER_RANK && $user->getUserTitle()} <span class="badge userTitleBadge{if $user->getRank() && $user->getRank()->cssClassName} {@$user->getRank()->cssClassName}{/if}">{$user->getUserTitle()}</span>{/if}</td>
                                                
                                                {foreach from=$columnHeads key=column item=columnLanguageVariable}
-                                                       <td class="column{$column|ucfirst}">{if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if}</td>
+                                                       <td class="column{$column|ucfirst}{if $columnStyling[$column]|isset} {$columnStyling[$column]}{/if}">{if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if}</td>
                                                {/foreach}
                                                
                                                {event name='columns'}
index f311d6e9498667b07b364aae1fc84b1e2a0417eb..c39b49108a4e583aecf7a52fd1f95dc38d052601 100644 (file)
                                        <dd>
                                                <label><input type="checkbox" name="columns[]" value="email" {if "email"|in_array:$columns}checked="checked" {/if}/> {lang}wcf.user.email{/lang}</label>
                                                <label><input type="checkbox" name="columns[]" value="registrationDate" {if "registrationDate"|in_array:$columns}checked="checked"{/if}/> {lang}wcf.user.registrationDate{/lang}</label>
+                                               <label><input type="checkbox" name="columns[]" value="lastActivityTime" {if "lastActivityTime"|in_array:$columns}checked="checked"{/if}/> {lang}wcf.user.lastActivityTime{/lang}</label>
+                                               <label><input type="checkbox" name="columns[]" value="profileHits" {if "profileHits"|in_array:$columns}checked="checked"{/if}/> {lang}wcf.user.profileHits{/lang}</label>
+                                               <label><input type="checkbox" name="columns[]" value="activityPoints" {if "activityPoints"|in_array:$columns}checked="checked"{/if}/> {lang}wcf.user.activityPoint{/lang}</label>
+                                               {if MODULE_LIKE}
+                                                       <label><input type="checkbox" name="columns[]" value="likesReceived" {if "likesReceived"|in_array:$columns}checked="checked"{/if}/> {lang}wcf.like.likesReceived{/lang}</label>
+                                               {/if}
                                                {event name='searchDisplayColumns'}
                                        </dd>
                                </dl>
index a38c4ed8ab5d5b1df87699ef3a9be42f97c5264f..7c8f634fb2c270d47b9a4aeb30a322d835a9d195 100755 (executable)
@@ -33,10 +33,22 @@ class UserListPage extends SortablePage {
        public $columnHeads = array();
        
        /**
-        * list of available columns
+        * list of selected columns
         * @var array<string>
         */
-       public $columns = array('email', 'registrationDate');
+       public $columns = array('email', 'registrationDate', 'lastActivityTime', 'profileHits', 'activityPoints', 'likesReceived');
+       
+       /**
+        * applies special CSS classes for selected columns
+        * @var array
+        */
+       public $columnStyling = array(
+               'registrationDate' => 'columnDate',
+               'lastActivityTime' => 'columnDate',
+               'profileHits' => 'columnDigits',
+               'activityPoints' => 'columnDigits',
+               'likesReceived' => 'columnDigits'
+       );
        
        /**
         * list of column values
@@ -104,7 +116,7 @@ class UserListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('email', 'userID', 'registrationDate', 'username');
+       public $validSortFields = array('email', 'userID', 'registrationDate', 'username', 'lastActivityTime', 'profileHits', 'activityPoints', 'likesReceived');
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -169,7 +181,8 @@ class UserListPage extends SortablePage {
                        'hasMarkedItems' => ClipboardHandler::getInstance()->hasMarkedItems(ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user')),
                        'url' => $this->url,
                        'columnHeads' => $this->columnHeads,
-                       'columnValues' => $this->columnValues
+                       'columnValues' => $this->columnValues,
+                       'columnStyling' => $this->columnStyling
                ));
        }
        
@@ -269,6 +282,18 @@ class UserListPage extends SortablePage {
                                                        $this->columnValues[$user->userID][$column] = DateUtil::format(DateUtil::getDateTimeByTimestamp($user->{$column}), DateUtil::DATE_FORMAT);
                                                break;
                                                
+                                               case 'lastActivityTime':
+                                                       if ($user->{$column}) {
+                                                               $this->columnValues[$user->userID][$column] = DateUtil::format(DateUtil::getDateTimeByTimestamp($user->{$column}), DateUtil::DATE_FORMAT) . ' ' . DateUtil::format(DateUtil::getDateTimeByTimestamp($user->{$column}), DateUtil::TIME_FORMAT);
+                                                       }
+                                               break;
+                                               
+                                               case 'profileHits':
+                                               case 'activityPoints':
+                                               case 'likesReceived':
+                                                       $this->columnValues[$user->userID][$column] = StringUtil::formatInteger($user->{$column});
+                                               break;
+                                               
                                                default:
                                                        if (isset($this->options[$column])) {
                                                                if ($this->options[$column]->outputClass) {
@@ -332,6 +357,15 @@ class UserListPage extends SortablePage {
         */
        protected function readColumnsHeads() {
                foreach ($this->columns as $column) {
+                       if ($column == 'likesReceived') {
+                               $this->columnHeads[$column] = 'wcf.like.likesReceived';
+                               continue;
+                       }
+                       if ($column == 'activityPoints') {
+                               $this->columnHeads[$column] = 'wcf.user.activityPoint';
+                               continue;
+                       }
+                       
                        if (isset($this->options[$column]) && $column != 'email') {
                                $this->columnHeads[$column] = 'wcf.user.option.'.$column;
                        }
index 2525b92599882d5cecd92dfad4bef4db2158c338..55093e30996ccd7aea7c958a76097613d54ec143 100644 (file)
@@ -1752,8 +1752,7 @@ html[dir="rtl"] {
                        max-width: 20%;
                }
                
-               &.columnDate,
-               &.columnRegistrationDate {
+               &.columnDate {
                        font-size: @wcfSmallFontSize;
                        text-align: right;
                        width: 1px;