[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Allow searching for visible-only/hidden-only/both on abuselo...

2017-08-10 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/368362 )

Change subject: Allow searching for visible-only/hidden-only/both on abuselog 
entries
..


Allow searching for visible-only/hidden-only/both on abuselog entries

Bug: T153065
Change-Id: I44ca86ff8564328ae932ccad9675298b686dc6ab
---
M i18n/en.json
M i18n/qqq.json
M includes/special/SpecialAbuseLog.php
3 files changed, 31 insertions(+), 0 deletions(-)

Approvals:
  Matěj Suchánek: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index be06bcf..a967cd3 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -47,6 +47,10 @@
"abusefilter-log-search-filter": "Filter IDs (separate with pipes):",
"abusefilter-log-search-title": "Title:",
"abusefilter-log-search-wiki": "Wiki:",
+   "abusefilter-log-search-entries-label": "Visibility:",
+   "abusefilter-log-search-entries-all": "All entries",
+   "abusefilter-log-search-entries-hidden": "Hidden entries only",
+   "abusefilter-log-search-entries-visible": "Visible entries only",
"abusefilter-log-search-submit": "Search",
"abusefilter-log-entry": "$1: $2 {{GENDER:$8|triggered}} an abuse 
filter, {{GENDER:$8|performing}} the action \"$3\" on $4.\nActions taken: 
$5;\nFilter description: $6",
"abusefilter-log-entry-withdiff": "$1: $2 {{GENDER:$8|triggered}} an 
abuse filter, {{GENDER:$8|performing}} the action \"$3\" on $4.\nActions taken: 
$5;\nFilter description: $6 ($7)",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ed2698b..7769374 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -78,6 +78,10 @@
"abusefilter-log-search-filter": "Field label in abuse filter log 
page.",
"abusefilter-log-search-title": "Field label in abuse filter log 
page.\n{{Identical|Title}}",
"abusefilter-log-search-wiki": "Label for text field that allows the 
user to limit search results to a specific wiki, by name.\n{{Identical|Wiki}}",
+   "abusefilter-log-search-entries-label": "Label for options allowing to 
find entries with specified visibility.",
+   "abusefilter-log-search-entries-all": "Option allowing to find all 
entries in abuse log.",
+   "abusefilter-log-search-entries-hidden": "Option allowing to find 
hidden entries only in abuse log.",
+   "abusefilter-log-search-entries-visible": "Option allowing to find 
visible entries only in abuse log.",
"abusefilter-log-search-submit": "Button text to search log in abuse 
filter log page.\n{{Identical|Search}}",
"abusefilter-log-entry": "This message is for a log entry. 
Parameters:\n* $1 - timestamp\n* $2 - user\n* $3 - action by user\n* $4 - link 
to page the action that triggered the filter was made on\n* $5 - actions taken 
by the filter\n* $6 - comments in filter description\n* $8 - raw username, for 
GENDER support\n{{Related|Abusefilter-log}}",
"abusefilter-log-entry-withdiff": "This message is for a log entry. 
Parameters:\n* $1 - timestamp\n* $2 - user\n* $3 - action by user\n* $4 - link 
to page the action that triggered the filter was made on\n* $5 - actions taken 
by the filter\n* $6 - comments in filter description\n* $7 - link to diff\n* $8 
- raw username, for GENDER support\n{{Related|Abusefilter-log}}",
diff --git a/includes/special/SpecialAbuseLog.php 
b/includes/special/SpecialAbuseLog.php
index 853424b..61b60c5 100644
--- a/includes/special/SpecialAbuseLog.php
+++ b/includes/special/SpecialAbuseLog.php
@@ -15,6 +15,8 @@
 
protected $mSearchFilter;
 
+   protected $mSearchEntries;
+
public function __construct() {
parent::__construct( 'AbuseLog', 'abusefilter-log' );
}
@@ -95,6 +97,8 @@
if ( self::canSeeDetails() ) {
$this->mSearchFilter = $request->getText( 
'wpSearchFilter' );
}
+
+   $this->mSearchEntries = $request->getText( 'wpSearchEntries' );
}
 
function searchForm() {
@@ -130,6 +134,17 @@
'type' => 'text',
'default' => $this->mSearchWiki,
'size' => 45,
+   ];
+   }
+   if ( self::canSeeHidden() ) {
+   $formDescriptor['SearchEntries'] = [
+   'type' => 'select',
+   'label-message' => 
'abusefilter-log-search-entries-label',
+   'options' => [
+   $this->msg( 
'abusefilter-log-search-entries-all' )->text() => 0,
+   $this->msg( 
'abusefilter-log-search-entries-hidden' )->text() => 1,
+   $this->msg( 
'abusefilter-log-search-entries-visible' )->text() => 2,
+   ],
 

[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Allow searching for visible-only/hidden-only/both on abuselo...

2017-07-28 Thread NoRandom (Code Review)
NoRandom has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368362 )

Change subject: Allow searching for visible-only/hidden-only/both on abuselog 
entries
..

Allow searching for visible-only/hidden-only/both on abuselog entries

Bug: T153065
Change-Id: I44ca86ff8564328ae932ccad9675298b686dc6ab
---
M i18n/en.json
M special/SpecialAbuseLog.php
2 files changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter 
refs/changes/62/368362/2

diff --git a/i18n/en.json b/i18n/en.json
index be06bcf..4146fde 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -47,6 +47,9 @@
"abusefilter-log-search-filter": "Filter IDs (separate with pipes):",
"abusefilter-log-search-title": "Title:",
"abusefilter-log-search-wiki": "Wiki:",
+   "abusefilter-log-search-entries-all": "All entries",
+   "abusefilter-log-search-entries-hidden": "Hidden entries only",
+   "abusefilter-log-search-entries-visible": "Visible entries only",
"abusefilter-log-search-submit": "Search",
"abusefilter-log-entry": "$1: $2 {{GENDER:$8|triggered}} an abuse 
filter, {{GENDER:$8|performing}} the action \"$3\" on $4.\nActions taken: 
$5;\nFilter description: $6",
"abusefilter-log-entry-withdiff": "$1: $2 {{GENDER:$8|triggered}} an 
abuse filter, {{GENDER:$8|performing}} the action \"$3\" on $4.\nActions taken: 
$5;\nFilter description: $6 ($7)",
diff --git a/special/SpecialAbuseLog.php b/special/SpecialAbuseLog.php
index 853424b..c43e5e4 100644
--- a/special/SpecialAbuseLog.php
+++ b/special/SpecialAbuseLog.php
@@ -14,6 +14,8 @@
protected $mSearchWiki;
 
protected $mSearchFilter;
+  
+   protected $mSearchEntries;
 
public function __construct() {
parent::__construct( 'AbuseLog', 'abusefilter-log' );
@@ -95,6 +97,8 @@
if ( self::canSeeDetails() ) {
$this->mSearchFilter = $request->getText( 
'wpSearchFilter' );
}
+  
+   $this->mSearchEntries = $request->getText( 'wpSearchEntries' );
}
 
function searchForm() {
@@ -131,6 +135,16 @@
'default' => $this->mSearchWiki,
'size' => 45,
];
+   }
+   if ( self::canSeeHidden() ) {
+   $formDescriptor['SearchEntries'] = array(
+   'type' => 'select',
+   'options' => array(
+   $this->msg( 
'abusefilter-log-search-entries-all' )->text() => 0,
+   $this->msg( 
'abusefilter-log-search-entries-hidden' )->text() => 1,
+   $this->msg( 
'abusefilter-log-search-entries-visible' )->text() => 2,
+   ),
+   );
}
 
$htmlForm = HTMLForm::factory( 'table', $formDescriptor, 
$this->getContext() );
@@ -275,6 +289,12 @@
$conds['afl_namespace'] = $searchTitle->getNamespace();
$conds['afl_title'] = $searchTitle->getDBkey();
}
+  
+   if ( $this->mSearchEntries == '1' ) {
+   $conds['afl_deleted'] = 1;
+   } else if ( $this->mSearchEntries == '2' ) {
+   $conds['afl_deleted'] = 0;
+   }
 
$pager = new AbuseLogPager( $this, $conds );
$pager->doQuery();

-- 
To view, visit https://gerrit.wikimedia.org/r/368362
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44ca86ff8564328ae932ccad9675298b686dc6ab
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: NoRandom 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits