Wctaiwan has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/282989

Change subject: Mention source when creating spamlist with imported targets
......................................................................

Mention source when creating spamlist with imported targets

Link the source page/revision or category in the edit summary.

Change-Id: Ic0f187d703bd9f4ae750e3cc5568add6b4eab84d
---
M i18n/en.json
M i18n/qqq.json
M includes/SpecialCreateMassMessageList.php
3 files changed, 18 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage 
refs/changes/89/282989/1

diff --git a/i18n/en.json b/i18n/en.json
index 0129b37..7789f43 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -82,6 +82,8 @@
        "massmessage-create-import": "Import pages from an existing list or 
category",
        "massmessage-create-source": "Source:",
        "massmessage-create-editsummary": "Create mass message delivery list",
+       "massmessage-create-editsummary-import": "Create mass message delivery 
list with targets from [[{{#Special:Permalink}}/$2|$1]]",
+       "massmessage-create-editsummary-catimport": "Create mass message 
delivery list with targets from [[$1]]",
        "massmessage-create-invalidtitle": "The specified title is invalid.",
        "massmessage-create-exists": "A page already exists with the specified 
title.",
        "massmessage-create-nopermission": "You do not have permission to 
create a list with this title.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ee52c5a..fb01efa 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -88,6 +88,8 @@
        "massmessage-create-import": "Label for an option on 
[[Special:CreateMassMessageList]]",
        "massmessage-create-source": "Label for an inputbox on 
[[Special:CreateMassMessageList]]\n{{Identical|Source}}",
        "massmessage-create-editsummary": "Edit summary for creating a delivery 
list",
+       "massmessage-create-editsummary-import": "Edit summary for creating a 
delivery list with imported targets\n* $1 - title of source page containing 
targets\n* $2 - revision ID of source page",
+       "massmessage-create-editsummary-catimport": "Edit summary for creating 
a delivery list with targets imported from a category\n* $1 - name of source 
category",
        "massmessage-create-invalidtitle": "Error message shown on 
[[Special:CreateMassMessageList]] when the title is inavlid",
        "massmessage-create-exists": "Error message shown on 
[[Special:CreateMassMessageList]] when a page with the title already exists",
        "massmessage-create-nopermission": "Error message shown on 
[[Special:CreateMassMessageList]] when the user cannot create a page with the 
title",
diff --git a/includes/SpecialCreateMassMessageList.php 
b/includes/SpecialCreateMassMessageList.php
index 6fee05e..2307253 100644
--- a/includes/SpecialCreateMassMessageList.php
+++ b/includes/SpecialCreateMassMessageList.php
@@ -72,15 +72,28 @@
                        if ( $targets === null || count( $targets ) === 0 ) {
                                return Status::newFatal( 
'massmessage-create-invalidsource' );
                        }
+                       if ( $source->inNamespace( NS_CATEGORY ) ) {
+                               $editSummaryMsg = $this->msg(
+                                       
'massmessage-create-editsummary-catimport',
+                                       $source->getPrefixedText()
+                               );
+                       } else {
+                               $editSummaryMsg = $this->msg(
+                                       'massmessage-create-editsummary-import',
+                                       $source->getPrefixedText(),
+                                       $source->getLatestRevID()
+                               );
+                       }
                } else {
                        $targets = array();
+                       $editSummaryMsg = $this->msg( 
'massmessage-create-editsummary' );
                }
 
                $result = MassMessageListContentHandler::edit(
                        $title,
                        $data['description'],
                        $targets,
-                       $this->msg( 'massmessage-create-editsummary' 
)->inContentLanguage()->plain(),
+                       $editSummaryMsg->inContentLanguage()->text(),
                        $this->getContext()
                );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0f187d703bd9f4ae750e3cc5568add6b4eab84d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Wctaiwan <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to