From 503a2669aef57a5b25e15f62f99a8e75382fc600 Mon Sep 17 00:00:00 2001 From: Tobi406 Date: Mon, 21 Dec 2020 19:08:32 +0100 Subject: [PATCH] Special:BlockList: Option to hide autoblocks Add a new option to Special:BlockList for hiding autoblocks. Bug: T270623 Change-Id: I7a00a08974b9f8ed8655b516c3b4a19da524d8a1 --- includes/specials/SpecialBlockList.php | 5 +++++ languages/i18n/en.json | 1 + languages/i18n/qqq.json | 1 + 3 files changed, 7 insertions(+) diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php index 106afab0a7e..763e7ec9d78 100644 --- a/includes/specials/SpecialBlockList.php +++ b/includes/specials/SpecialBlockList.php @@ -122,6 +122,7 @@ class SpecialBlockList extends SpecialPage { 'options-messages' => [ 'blocklist-tempblocks' => 'tempblocks', 'blocklist-indefblocks' => 'indefblocks', + 'blocklist-autoblocks' => 'autoblocks', 'blocklist-userblocks' => 'userblocks', 'blocklist-addressblocks' => 'addressblocks', 'blocklist-rangeblocks' => 'rangeblocks', @@ -210,6 +211,10 @@ class SpecialBlockList extends SpecialPage { if ( in_array( 'userblocks', $this->options ) ) { $conds['ipb_user'] = 0; } + if ( in_array( 'autoblocks', $this->options ) ) { + // ipb_parent_block_id = 0 because of T282890 + $conds[] = "ipb_parent_block_id IS NULL OR ipb_parent_block_id = 0"; + } if ( in_array( 'addressblocks', $this->options ) ) { $conds[] = "ipb_user != 0 OR ipb_range_end > ipb_range_start"; } diff --git a/languages/i18n/en.json b/languages/i18n/en.json index ed997cc6fda..9fad7a741ce 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2762,6 +2762,7 @@ "autoblocklist-otherblocks": "Other {{PLURAL:$1|autoblock|autoblocks}}", "ipblocklist": "Blocked users", "ipblocklist-legend": "Find a blocked user", + "blocklist-autoblocks": "Hide autoblocks", "blocklist-userblocks": "Hide account blocks", "blocklist-tempblocks": "Hide temporary blocks", "blocklist-indefblocks": "Hide indefinite blocks", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 53d92e05e59..0e32f6ee9e5 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2982,6 +2982,7 @@ "autoblocklist-otherblocks": "[[File:Special AutoBlockList new.png|thumb|Example]]\nUsed on [[Special:AutoblockList]] as header for other blocks, i.e. from GlobalBlocking or TorBlocks.\n\nParameters:\n* $1 - number of blocks", "ipblocklist": "Title of [[Special:Ipblocklist]].", "ipblocklist-legend": "Used as legend of the form in [[Special:BlockList]].\n\nSee also:\n* {{msg-mw|Ipblocklist-legend}}\n* {{msg-mw|Ipblocklist-submit}}", + "blocklist-autoblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]]. \n{{Related|Blocklist-blocks}}", "blocklist-userblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]].\n{{Related|Blocklist-blocks}}", "blocklist-tempblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]].\n{{Related|Blocklist-blocks}}", "blocklist-indefblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]].\n{{Related|Blocklist-blocks}}",