Add checkbox in Special:ListUsers to display only users in temporary user groups
authorFramawiki <framawiki@tools.wmflabs.org>
Mon, 28 Aug 2017 16:45:49 +0000 (18:45 +0200)
committerFramawiki <framawiki@tools.wmflabs.org>
Sun, 13 May 2018 09:51:50 +0000 (11:51 +0200)
New checkbox "temporaryGroupsOnly" with new message "listusers-temporarygroupsonly"

Bug: T174313
Change-Id: I388a8aab1145dc958ee110da324aeeb03660ff40

RELEASE-NOTES-1.32
includes/specials/pagers/UsersPager.php
languages/i18n/en.json
languages/i18n/qqq.json

index 9fd3161..f9f22d4 100644 (file)
@@ -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 ===
 * …
index 09d4b5e..d17332f 100644 (file)
@@ -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(),
index 43f9386..5073091 100644 (file)
        "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}}",
index 17e26ae..ff38c4d 100644 (file)
        "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",