From: Framawiki Date: Mon, 28 Aug 2017 16:45:49 +0000 (+0200) Subject: Add checkbox in Special:ListUsers to display only users in temporary user groups X-Git-Tag: 1.34.0-rc.0~5391^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=7de963cb83ba73985839aeec51f2f4d9ee61d48e;p=lhc%2Fweb%2Fwiklou.git Add checkbox in Special:ListUsers to display only users in temporary user groups New checkbox "temporaryGroupsOnly" with new message "listusers-temporarygroupsonly" Bug: T174313 Change-Id: I388a8aab1145dc958ee110da324aeeb03660ff40 --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index 9fd3161f1e..f9f22d41ce 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -22,6 +22,8 @@ production. * (T112474) Generalized the ResourceLoader mechanism for overriding modules using a particular page during edit previews. * Added 'ApiParseMakeOutputPage' hook. +* (T174313) Added checkbox on Special:ListUsers to display only users in temporary + user groups. === External library changes in 1.32 === * … diff --git a/includes/specials/pagers/UsersPager.php b/includes/specials/pagers/UsersPager.php index 09d4b5e3eb..d17332f6e7 100644 --- a/includes/specials/pagers/UsersPager.php +++ b/includes/specials/pagers/UsersPager.php @@ -70,6 +70,7 @@ class UsersPager extends AlphabeticPager { $this->requestedGroup = ''; } $this->editsOnly = $request->getBool( 'editsOnly' ); + $this->temporaryGroupsOnly = $request->getBool( 'temporaryGroupsOnly' ); $this->creationSort = $request->getBool( 'creationSort' ); $this->including = $including; $this->mDefaultDirection = $request->getBool( 'desc' ) @@ -110,9 +111,13 @@ class UsersPager extends AlphabeticPager { $options = []; + if ( $this->requestedGroup != '' || $this->temporaryGroupsOnly ) { + $conds[] = 'ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() ) . + ( !$this->temporaryGroupsOnly ? ' OR ug_expiry IS NULL' : '' ); + } + if ( $this->requestedGroup != '' ) { $conds['ug_group'] = $this->requestedGroup; - $conds[] = 'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() ); } if ( $this->requestedUser != '' ) { @@ -296,6 +301,13 @@ class UsersPager extends AlphabeticPager { 'id' => 'editsOnly', 'default' => $this->editsOnly ], + 'temporaryGroupsOnly' => [ + 'type' => 'check', + 'label' => $this->msg( 'listusers-temporarygroupsonly' )->text(), + 'name' => 'temporaryGroupsOnly', + 'id' => 'temporaryGroupsOnly', + 'default' => $this->temporaryGroupsOnly + ], 'creationSort' => [ 'type' => 'check', 'label' => $this->msg( 'listusers-creationsort' )->text(), diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 43f9386c79..50730913e8 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2039,6 +2039,7 @@ "listusers": "User list", "listusers-summary": "", "listusers-editsonly": "Show only users with edits", + "listusers-temporarygroupsonly": "Show only users in temporary user groups", "listusers-creationsort": "Sort by creation date", "listusers-desc": "Sort in descending order", "usereditcount": "$1 {{PLURAL:$1|edit|edits}}", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 17e26ae75d..ff38c4dca5 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2237,6 +2237,7 @@ "listusers": "{{doc-special|ListUsers}}", "listusers-summary": "{{notranslate}}\nThe summary displayed at the top of [[Special:Listusers]]. [[mw:Manual:Interface/Special pages summary|mw manual]].", "listusers-editsonly": "Option in [[Special:ListUsers]].", + "listusers-temporarygroupsonly": "Option in [[Special:ListUsers]].", "listusers-creationsort": "Option in [[Special:ListUsers]].", "listusers-desc": "Used as label for the checkbox on [[Special:ListUsers]].", "usereditcount": "Shown behind every username on [[Special:ListUsers]]. Parameters:\n* $1 - number of edits",