From: Marcel Werk Date: Fri, 23 May 2014 12:30:12 +0000 (+0200) Subject: Multiple user search improvements X-Git-Tag: 2.1.0_Alpha_1~805 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d9e1d8a418f64da60f76e0e1ff8e5217e374f397;p=GitHub%2FWoltLab%2FWCF.git Multiple user search improvements --- diff --git a/wcfsetup/install/files/acp/templates/userList.tpl b/wcfsetup/install/files/acp/templates/userList.tpl index 63e35de881..eecc7761e2 100644 --- a/wcfsetup/install/files/acp/templates/userList.tpl +++ b/wcfsetup/install/files/acp/templates/userList.tpl @@ -116,10 +116,10 @@ {@$user->userID}

{@$user->getAvatar()->getImageTag(24)}

- {if $user->editable}{$user->username}{else}{$user->username}{/if} + {if $user->editable}{$user->username}{else}{$user->username}{/if}{if MODULE_USER_RANK && $user->getUserTitle()} {$user->getUserTitle()}{/if} {foreach from=$columnHeads key=column item=columnLanguageVariable} - {if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if} + {if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if} {/foreach} {event name='columns'} diff --git a/wcfsetup/install/files/acp/templates/userSearch.tpl b/wcfsetup/install/files/acp/templates/userSearch.tpl index f311d6e949..c39b49108a 100644 --- a/wcfsetup/install/files/acp/templates/userSearch.tpl +++ b/wcfsetup/install/files/acp/templates/userSearch.tpl @@ -219,6 +219,12 @@
+ + + + {if MODULE_LIKE} + + {/if} {event name='searchDisplayColumns'}
diff --git a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php index a38c4ed8ab..7c8f634fb2 100755 --- a/wcfsetup/install/files/lib/acp/page/UserListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/UserListPage.class.php @@ -33,10 +33,22 @@ class UserListPage extends SortablePage { public $columnHeads = array(); /** - * list of available columns + * list of selected columns * @var array */ - 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; } diff --git a/wcfsetup/install/files/style/layout.less b/wcfsetup/install/files/style/layout.less index 2525b92599..55093e3099 100644 --- a/wcfsetup/install/files/style/layout.less +++ b/wcfsetup/install/files/style/layout.less @@ -1752,8 +1752,7 @@ html[dir="rtl"] { max-width: 20%; } - &.columnDate, - &.columnRegistrationDate { + &.columnDate { font-size: @wcfSmallFontSize; text-align: right; width: 1px;