[MediaWiki-commits] [Gerrit] [Draft] Add AbuseFilter to Extension:Newsletter - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/293625 Change subject: [Draft] Add AbuseFilter to Extension:Newsletter .. [Draft] Add AbuseFilter to Extension:Newsletter This patch creates a new AbuseFilterGroup for Newsletter and checks if the newsletter description matches with any of the filters when a newsletter is created. If the current implementation is approved, the same could be extended for when the description of an existing newsletter is edited. Bug: T132022 Change-Id: I5c42433a1d62ebbf0c80d3ac65bb6cca53527a5b --- M Newsletter.php M extension.json M i18n/en.json A includes/AbuseFilterCheck.php M includes/specials/SpecialNewsletterCreate.php 5 files changed, 43 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/25/293625/1 diff --git a/Newsletter.php b/Newsletter.php index 5bb248a..955d796 100755 --- a/Newsletter.php +++ b/Newsletter.php @@ -5,6 +5,15 @@ // Keep i18n globals so mergeMessageFileList.php doesn't break $wgMessagesDirs['Newsletter'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['NewsletterAlias'] = __DIR__ . '/Newsletter.alias.php'; + //newsletter group for AbuseFilter + $wgAbuseFilterValidGroups[] = 'newsletter'; + // disable filters that hit > 10% of articles + $wgAbuseFilterEmergencyDisableThreshold['newsletter'] = .1; + // If threshold is >10%, we make sure it has tested at least 50 articles + // in the last day (=86400 seconds) + $wgAbuseFilterEmergencyDisableCount['newsletter'] = 50; + $wgAbuseFilterEmergencyDisableAge['newsletter'] = 86400; + /* wfWarn( 'Deprecated PHP entry point used for Newsletter extension. Please use wfLoadExtension instead, ' . 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' diff --git a/extension.json b/extension.json index f6959e5..59fd3bf 100644 --- a/extension.json +++ b/extension.json @@ -81,7 +81,8 @@ "EchoNewsletterFormatter": "includes/Echo/EchoNewsletterFormatter.php", "BaseNewsletterPresentationModel": "includes/Echo/BaseNewsletterPresentationModel.php", "EchoNewsletterPresentationModel": "includes/Echo/EchoNewsletterPresentationModel.php", - "EchoNewsletterPublisherPresentationModel": "includes/Echo/EchoNewsletterPublisherPresentationModel.php" + "EchoNewsletterPublisherPresentationModel": "includes/Echo/EchoNewsletterPublisherPresentationModel.php", + "AbuseFilterCheck": "/includes/AbuseFilterCheck.php" }, "DefaultUserOptions": { "echo-subscriptions-web-newsletter": true, diff --git a/i18n/en.json b/i18n/en.json index f089464..96646ef 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -153,5 +153,6 @@ "log-action-filter-newsletter-publisher-removed": "Publisher removal", "log-action-filter-newsletter-newsletter-added": "Newsletter creation", "log-action-filter-newsletter-newsletter-removed": "Newsletter deletion", - "log-action-filter-newsletter-issue-added": "New issue announcements" + "log-action-filter-newsletter-issue-added": "New issue announcements", + "newsletter-abuse-found": "The description seems to have inappropriate content. Please rectify your description." } diff --git a/includes/AbuseFilterCheck.php b/includes/AbuseFilterCheck.php new file mode 100644 index 000..c6f2e60 --- /dev/null +++ b/includes/AbuseFilterCheck.php @@ -0,0 +1,25 @@ +group = $group; + } + + public function validate( IContextSource $context, $new_wikitext ) { + $title = $context->getTitle(); + $user = $context->getUser(); + $vars = \AbuseFilter::getEditVars( $title ); + $vars->addHolders( \AbuseFilter::generateUserVars( $user ), \AbuseFilter::generateTitleVars( $title , 'ARTICLE' ) ); + $vars->setVar( 'new_text', $new_wikitext ); + + return \AbuseFilter::filterAction( $vars, $title, $this->group ); + } + + +} \ No newline at end of file diff --git a/includes/specials/SpecialNewsletterCreate.php b/includes/specials/SpecialNewsletterCreate.php index afd6e54..336b96d 100644 --- a/includes/specials/SpecialNewsletterCreate.php +++ b/includes/specials/SpecialNewsletterCreate.php @@ -86,6 +86,11 @@ $mainPageId = $data['MainPage']->getArticleID(); + $status = AbuseFilterCheck::validate( $this->getContext(), $data['description'] ); + if ( !$status->isOK() ) { + return Status::newFatal( 'newsletter-abuse-found' ); + } + $dbr = wfGetDB( DB_SLAVE ); $rows = $dbr->select( 'nl_newsletters', -- To view, visit
[MediaWiki-commits] [Gerrit] Better labels in Special:Newsletters - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/281300 Change subject: Better labels in Special:Newsletters .. Better labels in Special:Newsletters Improve labels of table headers in Special:Newsletters Bug: T131680 Change-Id: I87693689e283d760e4eda5beaffda292672476a2 --- M i18n/en.json M i18n/qqq.json M includes/specials/pagers/NewsletterTablePager.php 3 files changed, 3 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/00/281300/1 diff --git a/i18n/en.json b/i18n/en.json index be33eb2..a43b288 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -102,10 +102,9 @@ "newsletter-notification-link-text-view-newsletter": "View newsletter", "newsletter-email-subject": "A new issue of $1 has been announced.", "newsletter-email-batch-body": "$2 {{GENDER:$3|has announced}} a new issue of $1.", - "newsletter-header-name": "Name of newsletter", + "newsletter-header-name": "Name", "newsletter-header-description": "Description", - "newsletter-header-action": "Subscribed?", - "newsletter-header-subscriber_count": "Subscriber count", + "newsletter-header-subscriber_count": "Subscribers", "newsletter-delete-confirmation": "Are you sure you want to delete this newsletter?", "newsletter-delete-confirm-details": "Note that this action is not reversible and data cannot be restored once it has been deleted.", "newsletter-delete-confirm-cancel": "Cancel", diff --git a/i18n/qqq.json b/i18n/qqq.json index b928c3b..449b323 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -108,7 +108,6 @@ "newsletter-email-batch-body": "First line of the email body when a new newsletter is announced Parameters:\n* $1 is the name of the newsletter.\n* $2 is the username of the user who announced the new issue, not used for GENDER\n* $3 is the username of the user who announced the new issue, used for GENDER", "newsletter-header-name": "Label of the newsletter name column of table in [[Special:Newsletters]] which lists the names of newsletters", "newsletter-header-description": "Label of the description column of table in [[Special:Newsletters]] which displays a description about the newsletter\n{{Identical|Description}}", - "newsletter-header-action": "Label of the subscribe column of table in [[Special:Newsletters]] which provides radio buttons to subscribe/unsubscribe newsletters\n{{Identical|Subscribed}}", "newsletter-header-subscriber_count": "Label of the subscriber count column of table in [[Special:Newsletters]] which gives the subscriber count of corresponding newsletter", "newsletter-delete-confirmation": "Confirmation message shown when attempting to delete a newsletter.", "newsletter-delete-confirm-details": "Information message shown after {{msg-mw|newsletter-delete-confirmation}}.", diff --git a/includes/specials/pagers/NewsletterTablePager.php b/includes/specials/pagers/NewsletterTablePager.php index e115008..4c5abf5 100644 --- a/includes/specials/pagers/NewsletterTablePager.php +++ b/includes/specials/pagers/NewsletterTablePager.php @@ -34,7 +34,7 @@ if ( $this->getUser()->isLoggedIn() ) { // Only logged-in users can (un)subscribe - $this->fieldNames['action'] = $this->msg( 'newsletter-header-action' )->escaped(); + $this->fieldNames['action'] = null; } } -- To view, visit https://gerrit.wikimedia.org/r/281300 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I87693689e283d760e4eda5beaffda292672476a2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Reorder and rename fields in Special:CreateNewsletter - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/281290 Change subject: Reorder and rename fields in Special:CreateNewsletter .. Reorder and rename fields in Special:CreateNewsletter 'Title of Main Page' changed to 'Wiki page to be linked as Main page' and repositioned it to right below the 'Name of Newsletter' field. Bug: T131698 Change-Id: Ifbced0a0432830e31a0595a9c7d41b15ce861d80 --- M i18n/en.json M includes/specials/SpecialNewsletterCreate.php 2 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/90/281290/1 diff --git a/i18n/en.json b/i18n/en.json index be33eb2..6961f87 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -9,7 +9,7 @@ "newsletter-extension-desc": "Enables users to publish and subscribe to newsletters", "newsletter-name": "Name of newsletter", "newsletter-desc": "Description", - "newsletter-title": "Title of Main Page", + "newsletter-title": "Wiki page to be linked as Main page", "newsletter-exist-error": "A newsletter with the name \"$1\" already exists. Please try again with another name.", "newsletter-create-error": "An error occured while trying to create a new newsletter. Please try again.", "newsletter-input-required": "Required input was not entered. Please try again.", diff --git a/includes/specials/SpecialNewsletterCreate.php b/includes/specials/SpecialNewsletterCreate.php index b7e978b..afd6e54 100644 --- a/includes/specials/SpecialNewsletterCreate.php +++ b/includes/specials/SpecialNewsletterCreate.php @@ -46,17 +46,17 @@ 'label-message' => 'newsletter-name', 'maxlength' => 120 ), + 'mainpage' => array( + 'type' => 'title', + 'required' => true, + 'label-message' => 'newsletter-title', + ), 'description' => array( 'type' => 'textarea', 'required' => true, 'label-message' => 'newsletter-desc', 'rows' => 15, 'maxlength' => 60, - ), - 'mainpage' => array( - 'type' => 'title', - 'required' => true, - 'label-message' => 'newsletter-title', ), ); } -- To view, visit https://gerrit.wikimedia.org/r/281290 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifbced0a0432830e31a0595a9c7d41b15ce861d80 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Change text-align in Special:Newsletters - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/281218 Change subject: Change text-align in Special:Newsletters .. Change text-align in Special:Newsletters text-align:center doesn't look good with the table content. Hence setting it to left align. Change-Id: Ib3a7f7fdf0753ac3eabce5aa7d4c9742eac299cd --- M modules/ext.newsletter.newsletters.styles.css 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/18/281218/1 diff --git a/modules/ext.newsletter.newsletters.styles.css b/modules/ext.newsletter.newsletters.styles.css index 52d2095..2c05939 100644 --- a/modules/ext.newsletter.newsletters.styles.css +++ b/modules/ext.newsletter.newsletters.styles.css @@ -53,5 +53,4 @@ .mw-special-Newsletters .mw-datatable, .mw-special-Newsletters .mw-datatable tr { border: solid #AA; border-width: 0 0 1px 0; - text-align: center; } \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/281218 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3a7f7fdf0753ac3eabce5aa7d4c9742eac299cd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove description text area - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/281135 Change subject: Remove description text area .. Remove description text area Description should'nt be a textarea but instead just text. Bug: T131489 Change-Id: I1bbd5bade02f47e0f67b9746a694eb6724b8d9c5 --- M includes/specials/SpecialNewsletter.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/35/281135/1 diff --git a/includes/specials/SpecialNewsletter.php b/includes/specials/SpecialNewsletter.php index cd14ed4..559c9e4 100644 --- a/includes/specials/SpecialNewsletter.php +++ b/includes/specials/SpecialNewsletter.php @@ -200,7 +200,7 @@ 'raw' => true, ), 'description' => array( - 'type' => 'textarea', + 'type' => 'info', 'label-message' => 'newsletter-view-description', 'default' => $this->newsletter->getDescription(), 'rows' => 6, -- To view, visit https://gerrit.wikimedia.org/r/281135 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1bbd5bade02f47e0f67b9746a694eb6724b8d9c5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Redesign table on Special:Newsletters - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/28 Change subject: Redesign table on Special:Newsletters .. Redesign table on Special:Newsletters Removed column borders of the table on Special: Newsletters. Bug: T131462 Change-Id: I60f51e67b100e7a505d21110b910f38690db0db4 --- M includes/specials/SpecialNewsletters.php M modules/ext.newsletter.newsletters.styles.css 2 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/11/28/1 diff --git a/includes/specials/SpecialNewsletters.php b/includes/specials/SpecialNewsletters.php index c2c1a79..138b232 100644 --- a/includes/specials/SpecialNewsletters.php +++ b/includes/specials/SpecialNewsletters.php @@ -21,6 +21,7 @@ $this->setHeaders(); $out = $this->getOutput(); + $out->addModuleStyles( 'ext.newsletter.newsletters.styles' ); $user = $this->getUser(); if ( $user->isAllowed( 'newsletter-create' ) ) { diff --git a/modules/ext.newsletter.newsletters.styles.css b/modules/ext.newsletter.newsletters.styles.css index 0e697b2..eea4ee6 100644 --- a/modules/ext.newsletter.newsletters.styles.css +++ b/modules/ext.newsletter.newsletters.styles.css @@ -45,3 +45,13 @@ pointer-events: none; cursor: default; } + +.mw-special-Newsletters .mw-datatable, .mw-special-Newsletters .mw-datatable td, .mw-special-Newsletters .mw-datatable th { +border: none; +} + +.mw-special-Newsletters .mw-datatable, .mw-special-Newsletters .mw-datatable tr { +border: solid #AA; +border-width: 0 0 1px 0; +text-align: center; +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/28 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I60f51e67b100e7a505d21110b910f38690db0db4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixing label of "Manage" button to avoid confusion - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/280837 Change subject: Fixing label of "Manage" button to avoid confusion .. Fixing label of "Manage" button to avoid confusion Changing the label of the "Manage" button to "Collaborators" to avoid confusion. Bug: T131457 Change-Id: I6b40a848ef659665dadaaaf66f7531b21a53d59f --- M i18n/en.json M i18n/qqq.json M includes/specials/SpecialNewsletter.php 3 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/37/280837/1 diff --git a/i18n/en.json b/i18n/en.json index 3ab0bd4..22d207d 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -41,7 +41,7 @@ "newsletter-view-subscriber-count": "Subscriber count:", "newsletter-view-no-publishers": "No publishers.", "newsletter-delete-button": "Delete", - "newsletter-manage-button": "Manage", + "newsletter-collaborators-button": "Collaborators", "newsletter-unsubscribe-button": "Unsubscribe", "newsletter-subscribe-button": "Subscribe", "newsletter-announce-button": "Announce", diff --git a/i18n/qqq.json b/i18n/qqq.json index 7f554be..ac0a095 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -45,7 +45,7 @@ "newsletter-view-subscriber-count": "Label for newsletter's subscriber count field. Shown on Special:Newsletter/.", "newsletter-view-no-publishers": "Message shown on Special:Newsletter if there are no publishers for the newsletter.", "newsletter-delete-button": "Label for \"Delete\" button shown on Special:Newsletter/. Links to Special:Newsletter//delete. Only shown if the current user has permissions to delete the newsletter.\n{{Identical|Delete}}", - "newsletter-manage-button": "Label for \"Manage\" button shown on Special:Newsletter/. Links to Special:Newsletter//manage. Only shown if the current user has permissions to manage the newsletter. Manage actions include adding publishers, removing publishers and announcing new issues.", + "newsletter-collaborators-button": "Label for \"Collaborators\" button shown on Special:Newsletter/. Links to Special:Newsletter//manage. Only shown if the current user has permissions to manage the newsletter. Actions include adding publishers, removing publishers by editing the textbox.", "newsletter-unsubscribe-button": "Label for \"Unsubscribe\" button shown on Special:Newsletter/. Links to Special:Newsletter//unsubscribe. Shown only for logged-in users and if the user is currently subscribed to the newsletter.\n{{Identical|Unsubscribe}}", "newsletter-subscribe-button": "Label for \"Subscribe\" button shown on Special:Newsletter/. Links to Special:Newsletter//unsubscribe. Shown only for logged-in users and if the user is currently not subscribed to the newsletter.", "newsletter-announce-button": "Label of \"Announce\" button shown on Special:Newsletter/id.\n{{Identical|Announce}}", diff --git a/includes/specials/SpecialNewsletter.php b/includes/specials/SpecialNewsletter.php index f77c517..617c44a 100644 --- a/includes/specials/SpecialNewsletter.php +++ b/includes/specials/SpecialNewsletter.php @@ -266,7 +266,7 @@ if ( $this->newsletter->canManage( $user ) ) { $buttons[] = new OOUI\ButtonWidget( array( - 'label' => $this->msg( 'newsletter-manage-button' )->escaped(), + 'label' => $this->msg( 'newsletter-collaborators-button' )->escaped(), 'icon' => 'settings', 'href' => $this->getPageTitle( $id . '/' . self::NEWSLETTER_MANAGE )->getFullURL() ) @@ -668,7 +668,7 @@ ->rawParams( $this->getEscapedName() )->parse() ); $form->setId( 'newsletter-manage-form' ); - $form->setSubmitID( 'newsletter-manage-button' ); + $form->setSubmitID( 'newsletter-collaborators-button' ); $form->setSubmitTextMsg( 'newsletter-managenewsletter-button' ); $form->show(); } -- To view, visit https://gerrit.wikimedia.org/r/280837 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6b40a848ef659665dadaaaf66f7531b21a53d59f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Validating parameter passed to database from API - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/267666 Change subject: Validating parameter passed to database from API .. Validating parameter passed to database from API User input is directly passed to database for insertion/deletion. Added quotes to the passed values before inserting to handle unexpected and peculiar inputs. Bug: T110491 Change-Id: Ifa78bc1b17482e9225733d9c7205a327ecaa2926 --- M includes/NewsletterDb.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/66/267666/1 diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php index 3289444..ce6b4cf 100644 --- a/includes/NewsletterDb.php +++ b/includes/NewsletterDb.php @@ -59,7 +59,7 @@ */ public function addPublisher( $userId, $newsletterId ) { $rowData = array( - 'nlp_newsletter_id' => $newsletterId, + 'nlp_newsletter_id' => $this->writeDb->addQuotes( $newsletterId ), 'nlp_publisher_id' => $userId, ); $this->writeDb->insert( 'nl_publishers', $rowData, __METHOD__, array( 'IGNORE' ) ); @@ -76,7 +76,7 @@ */ public function removePublisher( $userId, $newsletterId ) { $rowData = array( - 'nlp_newsletter_id' => $newsletterId, + 'nlp_newsletter_id' => $this->writeDb->addQuotes( $newsletterId ), 'nlp_publisher_id' => $userId, ); $this->writeDb->delete( 'nl_publishers', $rowData, __METHOD__ ); -- To view, visit https://gerrit.wikimedia.org/r/267666 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa78bc1b17482e9225733d9c7205a327ecaa2926 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add minimum length for description field - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/266049 Change subject: Add minimum length for description field .. Add minimum length for description field To avoid one word or very short descriptions for newsletters, added a test to check if the text is atleast 30 characters. Bug: T110491 Change-Id: I82d8645b652a79854d836dc7cbd4741ed7d44526 --- M i18n/en.json M i18n/qqq.json M includes/specials/SpecialNewsletterCreate.php 3 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/49/266049/1 diff --git a/i18n/en.json b/i18n/en.json index 007a6ad..ced66c7 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -22,6 +22,7 @@ "newsletter-create-submit": "Create newsletter", "newsletter-create-confirmation": "A new newsletter has been successfully created. You can manage newsletters through [[Special:ManageNewsletter]].", "newsletter-create-mainpage-error": "Invalid newsletter main page entered. Please try again.", + "newsletter-create-short-description-error": "The description is too short.", "newsletter-subtitlelinks-list": "List of newsletters", "newsletter-subtitlelinks-create": "Create a new newsletter", "newsletter-subtitlelinks-manage": "Manage newsletter", diff --git a/i18n/qqq.json b/i18n/qqq.json index 775d00a..47a6bfc 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -26,6 +26,7 @@ "newsletter-create-submit": "Label of submit button on [[Special:CreateNewsletter]]", "newsletter-create-confirmation": "Confirmation message displayed after creation of a newsletter", "newsletter-create-mainpage-error": "Error message shown on [[Special:CreateNewsletter]] if the page entered on main page field does not exist.", + "newsletter-create-short-description-error": "Error message shown on [[Special:CreateNewsletter]] if the text entered in the description field is too short.", "newsletter-subtitlelinks-list": "Label for link to [[Special:Newsletters]] shown under the header on Newsletter special pages.\n\nSee also:\n* {{msg-mw|newsletter-subtitlelinks-create}}\n*{{msg-mw|newsletter-subtitlelinks-manage}}", "newsletter-subtitlelinks-create": "Label for link to [[Special:CreateNewsletter]] shown under the header on Newsletter special pages.\n\nSee also:\n* {{msg-mw|newsletter-subtitlelinks-list}}\n*{{msg-mw|newsletter-subtitlelinks-manage}}", "newsletter-subtitlelinks-manage": "Label for link to [[Special:ManageNewsletter]] shown under the header on Newsletter special pages.\n\nSee also:\n* {{msg-mw|newsletter-subtitlelinks-create}}\n*{{msg-mw|newsletter-subtitlelinks-list}}", diff --git a/includes/specials/SpecialNewsletterCreate.php b/includes/specials/SpecialNewsletterCreate.php index 9c4f0fd..6e97d23 100644 --- a/includes/specials/SpecialNewsletterCreate.php +++ b/includes/specials/SpecialNewsletterCreate.php @@ -84,6 +84,10 @@ ( $articleId !== 0 ) && isset( $data['mainpage'] ) ) { + if ( strlen($data['description'] ) < 30 ) { + return array( 'newsletter-create-short-description-error' ); + } + $db = NewsletterDb::newFromGlobalState(); // nl_newsletters.nl_desc is a blob but put some limit -- To view, visit https://gerrit.wikimedia.org/r/266049 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I82d8645b652a79854d836dc7cbd4741ed7d44526 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Minor clean up - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/257639 Change subject: Minor clean up .. Minor clean up Added space before and after parenthesis. Change-Id: I2ecd75daa2078a4f9138750d9560b62821893a13 --- M modules/ext.newslettermanage.js 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/39/257639/1 diff --git a/modules/ext.newslettermanage.js b/modules/ext.newslettermanage.js index f650cdd..5da67b6 100644 --- a/modules/ext.newslettermanage.js +++ b/modules/ext.newslettermanage.js @@ -5,9 +5,9 @@ ( function ( $, mw ) { 'use strict'; var api = new mw.Api(); - $( 'input[type=button]').click( function() { - var confirmBox = confirm("Are you certain you wish to remove this publisher?"); - if (confirmBox === true) { + $( 'input[type=button]' ).click( function() { + var confirmBox = confirm( "Are you certain you wish to remove this publisher?" ); + if ( confirmBox === true ) { var remNewsletterId = this.name; var publisherId = this.id; var $that = $( this ); -- To view, visit https://gerrit.wikimedia.org/r/257639 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2ecd75daa2078a4f9138750d9560b62821893a13 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Send out echo notifications when a publisher is added - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/252262 Change subject: Send out echo notifications when a publisher is added .. Send out echo notifications when a publisher is added Notify a user when he/she is added as a publisher of a newsletter Bug: T108301 Change-Id: Ib2ea35cb421734cc9ea407ce3cc4a50fa01e3fc7 --- M Newsletter.hooks.php M i18n/en.json M includes/Echo/EchoNewsletterFormatter.php M includes/Echo/EchoNewsletterUserLocator.php M includes/specials/SpecialNewsletterManage.php 5 files changed, 41 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/62/252262/1 diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php index 84719e4..33f7144 100755 --- a/Newsletter.hooks.php +++ b/Newsletter.hooks.php @@ -33,6 +33,21 @@ 'flyout-params' => array( 'newsletter', 'title' ), ); + + $notifications['newsletter-newpublisher'] = array( + 'primary-link' => array( + 'message' => 'newsletter-notification-link-text-new-publisher', + 'destination' => 'new-publisher' + ), + 'user-locators' => array( + 'EchoNewsletterUserLocator::locateNewsletterPublisher', + ), + 'formatter-class' => 'EchoNewsletterFormatter', + 'title-message' => 'newsletter-notification-new-publisher-title', + 'title-params' => array( 'newsletter' ), + 'flyout-message' => 'newsletter-notification-new-publisher-flyout', + 'flyout-params' => array( 'newsletter' ), + ); return true; } diff --git a/i18n/en.json b/i18n/en.json index 1f811af..c4fd2b9 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -96,5 +96,8 @@ "apihelp-newslettersubscribe-param-id": "ID of the newsletter for which the subscription should be changed.", "apihelp-newslettersubscribe-param-do": "Action to do. Should be either subscribe or unsubscribe.", "apihelp-newslettersubscribe-example-1": "Subscribe to newsletter with id 1.", - "apihelp-newslettersubscribe-example-2": "Unsubscribe from newsletter with id 2." + "apihelp-newslettersubscribe-example-2": "Unsubscribe from newsletter with id 2.", + "newsletter-notification-link-text-new-publisher": "You have been added as a publisher", + "newsletter-notification-new-publisher-title": "You have been added as a publisher of $1 newsletter!", + "newsletter-notification-new-publisher-flyout": "You are now a publisher of $1 newsletter!" } diff --git a/includes/Echo/EchoNewsletterFormatter.php b/includes/Echo/EchoNewsletterFormatter.php index 5c20dde..1aa3246 100644 --- a/includes/Echo/EchoNewsletterFormatter.php +++ b/includes/Echo/EchoNewsletterFormatter.php @@ -40,6 +40,8 @@ ), array(), ); + } elseif ( $destination === 'new-publisher' ) { + return array( SpecialPage::getTitleFor( 'NewsletterManage' ), array() ); } else { return parent::getLinkParams( $event, $user, $destination ); } diff --git a/includes/Echo/EchoNewsletterUserLocator.php b/includes/Echo/EchoNewsletterUserLocator.php index 285bd24..3b4c0ab 100644 --- a/includes/Echo/EchoNewsletterUserLocator.php +++ b/includes/Echo/EchoNewsletterUserLocator.php @@ -15,4 +15,11 @@ return UserArray::newFromIDs( $ids ); } + + public static function locateNewsletterPublisher( EchoEvent $event ) { + $extra = $event->getExtra(); + $id = array( $extra['newPublisherId'] ); + + return array( User::newFromID( $id ) ); + } } diff --git a/includes/specials/SpecialNewsletterManage.php b/includes/specials/SpecialNewsletterManage.php index 1d1fcd8..d6b32b5 100644 --- a/includes/specials/SpecialNewsletterManage.php +++ b/includes/specials/SpecialNewsletterManage.php @@ -204,6 +204,19 @@ $db->addSubscription( $user->getId(), $pubNewsletterId ); $this->getOutput()->addWikiMsg( 'newsletter-new-publisher-confirmation' ); + $newsletter = $db->getNewsletter( $pubNewsletterId ); + + if ( class_exists( 'EchoEvent' ) ) { + EchoEvent::create( + array( + 'type' => 'newsletter-newpublisher', + 'extra' => array( + 'newsletter' =>
[MediaWiki-commits] [Gerrit] Sort newsletter names and few minor changes on ManageNewsletter - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/249996 Change subject: Sort newsletter names and few minor changes on ManageNewsletter .. Sort newsletter names and few minor changes on ManageNewsletter Sort the newsletters alphabetically and also display only the newsletters to which the logged in user is a publisher. Bug: T117043 Change-Id: I892c00c855593bcb4ff79cf9259a79d8bc1f77c7 --- M includes/specials/pagers/NewsletterManageTablePager.php 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/96/249996/1 diff --git a/includes/specials/pagers/NewsletterManageTablePager.php b/includes/specials/pagers/NewsletterManageTablePager.php index 152d9fe..e9cc4aa 100644 --- a/includes/specials/pagers/NewsletterManageTablePager.php +++ b/includes/specials/pagers/NewsletterManageTablePager.php @@ -36,11 +36,12 @@ } public function getQueryInfo() { + $userId = $this->getUser()->getId(); $this->newslettersOfPublisher = $this->mDb->selectFieldValues( 'nl_publishers', 'nlp_newsletter_id', - array( 'nlp_publisher_id' => $this->getUser()->getId() ), + array( 'nlp_publisher_id' => $userId ), __METHOD__ ); @@ -51,6 +52,7 @@ 'nl_name', 'nlp_publisher_id', ), + 'conds' => array( 'nlp_publisher_id' => $userId ), 'join_conds' => array( 'nl_newsletters' => array( 'LEFT JOIN', 'nlp_newsletter_id = nl_id' ), ), @@ -107,7 +109,7 @@ } public function getDefaultSort() { - return 'nl_id'; + return 'nl_name'; } public function isFieldSortable( $field ) { -- To view, visit https://gerrit.wikimedia.org/r/249996 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I892c00c855593bcb4ff79cf9259a79d8bc1f77c7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add filters to customize the search of newsletters - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/247843 Change subject: Add filters to customize the search of newsletters .. Add filters to customize the search of newsletters To-be done * Find an easier way to do the same (optimize code) * Add qqq entries Bug: T107557 Change-Id: I78529be036ec58646dab14d6e638356b110f696f --- M i18n/en.json M includes/specials/SpecialNewsletters.php M includes/specials/pagers/NewsletterTablePager.php 3 files changed, 46 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/43/247843/1 diff --git a/i18n/en.json b/i18n/en.json index b533160..34831c9 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -103,5 +103,11 @@ "apihelp-newslettersubscribe-param-id": "ID of the newsletter for which the subscription should be changed.", "apihelp-newslettersubscribe-param-do": "Action to do. Should be either subscribe or unsubscribe.", "apihelp-newslettersubscribe-example-1": "Subscribe to newsletter with id 1.", - "apihelp-newslettersubscribe-example-2": "Unsubscribe from newsletter with id 2." + "apihelp-newslettersubscribe-example-2": "Unsubscribe from newsletter with id 2.", + "newsletter-filter-table": "Filter table by: ", + "newsletter-filtertableform-filter-section": "Search for Newsletters", + "newsletter-filtertable-option-1": "All newsletters", + "newsletter-filtertable-option-2": "Newsletters I'm subscribed to", + "newsletter-filtertable-option-3": "Newsletters I'm not subscribed to", + "newsletter-go-button": "Go" } diff --git a/includes/specials/SpecialNewsletters.php b/includes/specials/SpecialNewsletters.php index 17ead7c..fd2ddfe 100644 --- a/includes/specials/SpecialNewsletters.php +++ b/includes/specials/SpecialNewsletters.php @@ -8,6 +8,8 @@ */ class SpecialNewsletters extends SpecialPage { + private $option = null; + public function __construct() { parent::__construct( 'Newsletters' ); } @@ -23,7 +25,19 @@ } $out->setSubtitle( LinksGenerator::getSubtitleLinks() ); + $filterTableForm = new HTMLForm( + $this->getFormFields(), + $this->getContexT(), + 'newsletter-filtertableform' + ); + $filterTableForm->setSubmitText( $this->msg( 'newsletter-go-button' ) ); + $filterTableForm->setSubmitCallback( array( $this, 'onSubmit') ); + $filterTableForm->setWrapperLegendMsg( 'newsletter-filtertableform-filter-section' ); + $filterTableForm->show(); + $pager = new NewsletterTablePager(); + $pager->getUserOption( $this->option ); + if ( $pager->getNumRows() > 0 ) { $out->addParserOutput( $pager->getFullOutput() ); } else { @@ -31,4 +45,21 @@ } } + public function getFormFields() { + return array( + 'filter' => array( + 'type' => 'select', + 'label-message' => 'newsletter-filter-table', + 'options' => array( + $this->msg( 'newsletter-filtertable-option-1' )->parse() => 0, + $this->msg( 'newsletter-filtertable-option-2' )->parse() => 1, + $this->msg( 'newsletter-filtertable-option-3' )->parse() => 2 + ), + ), + ); + } + + public function onSubmit( array $formData ) { + $this->option = $formData['filter']; + } } diff --git a/includes/specials/pagers/NewsletterTablePager.php b/includes/specials/pagers/NewsletterTablePager.php index 2b3a315..4208481 100644 --- a/includes/specials/pagers/NewsletterTablePager.php +++ b/includes/specials/pagers/NewsletterTablePager.php @@ -11,6 +11,7 @@ * @var null|string[] */ private $fieldNames = null; + private $option = null; public function __construct( IContextSource $context = null, IDatabase $readDb = null ) { if ( $readDb !== null ) { @@ -48,6 +49,10 @@ 'nl_frequency', 'subscribers' => ( '( SELECT COUNT(*) FROM nl_subscriptions WHERE nls_newsletter_id = nl_id )' ), ), + 'conds' => ( $this->option == 1 ) ? array( $this->mDb->addQuotes( $this->getUser()->getId() ) . + ' IN (SELECT nls_subscriber_id FROM nl_subscriptions WHERE nls_newsletter_id = nl_id )' ) : + ( ( $this->option == 2
[MediaWiki-commits] [Gerrit] Add new user rights to Newsletter extension - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/238753 Change subject: Add new user rights to Newsletter extension .. Add new user rights to Newsletter extension Bug: T108482 Change-Id: I00c15c5cbbb7fcfbed5593a61422560f4f854324 --- M Newsletter.php M i18n/en.json M i18n/qqq.json 3 files changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/53/238753/1 diff --git a/Newsletter.php b/Newsletter.php index 5bb248a..7dd102d 100755 --- a/Newsletter.php +++ b/Newsletter.php @@ -5,6 +5,8 @@ // Keep i18n globals so mergeMessageFileList.php doesn't break $wgMessagesDirs['Newsletter'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['NewsletterAlias'] = __DIR__ . '/Newsletter.alias.php'; + $wgAvailableRights[] = 'newsletter-addpublisher'; + $wgGroupPermissions['sysop']['newsletter-addpublisher'] = true; /* wfWarn( 'Deprecated PHP entry point used for Newsletter extension. Please use wfLoadExtension instead, ' . 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' diff --git a/i18n/en.json b/i18n/en.json index 75f17ab..c8a2ecf 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -60,5 +60,7 @@ "newsletter-manage-header-action": "Action", "newsletter-owner-radiobutton-label": "Owner", "newsletter-publisher-radiobutton-label": "Publisher", - "newsletter-dropdown-default-message": "Please select one" + "newsletter-dropdown-default-message": "Please select one", + "right-newsletter-addpublisher": "Give publisher rights to another user", + "action-newsletter-addpublisher": "give publisher rights to another user" } diff --git a/i18n/qqq.json b/i18n/qqq.json index a1d7fbe..0186612 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -60,5 +60,7 @@ "newsletter-manage-header-action": "{{Identical|Action}}", "newsletter-owner-radiobutton-label": "Label of radio button in 'Permissions' column in [[Special:NewsletterManage]] which is checked if the user is the owner of the newsletter\n{{Identical|Owner}}", "newsletter-publisher-radiobutton-label": "Label of radio button in 'Permissions' column in [[Special:NewsletterManage]] which is checked if the user is a publisher of the newsletter\n{{Identical|Publisher}}", - "newsletter-dropdown-default-message": "Default option of drop down menus to select newsletters in [[Special:NewsletterManage]]" + "newsletter-dropdown-default-message": "Default option of drop down menus to select newsletters in [[Special:NewsletterManage]]", + "right-newsletter-addpublisher": "{{doc-right|newsletter-addpublisher}}", + "action-newsletter-addpublisher": "{{doc-action|newsletter-addpublisher}}" } -- To view, visit https://gerrit.wikimedia.org/r/238753 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I00c15c5cbbb7fcfbed5593a61422560f4f854324 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Correct sorting of newsletters in Special: Newsletters - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/235420 Change subject: Correct sorting of newsletters in Special: Newsletters .. Correct sorting of newsletters in Special: Newsletters Newsletters the user has subscribed come first, followed by the rest. Bug: T107557 Change-Id: I267cf468392678cd9f0739e9db1f4fe818ef98f4 --- M includes/specials/pagers/NewsletterTablePager.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/20/235420/1 diff --git a/includes/specials/pagers/NewsletterTablePager.php b/includes/specials/pagers/NewsletterTablePager.php index de23adb..fab47ff 100644 --- a/includes/specials/pagers/NewsletterTablePager.php +++ b/includes/specials/pagers/NewsletterTablePager.php @@ -98,7 +98,8 @@ } public function getDefaultSort() { - return 'nl_name'; + $this->mDefaultDirection = IndexPager::DIR_DESCENDING; + return 'current_user_subscribed'; } public function isFieldSortable( $field ) { -- To view, visit https://gerrit.wikimedia.org/r/235420 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I267cf468392678cd9f0739e9db1f4fe818ef98f4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Handle entirely numeric newsletter names correctly - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/235275 Change subject: Handle entirely numeric newsletter names correctly .. Handle entirely numeric newsletter names correctly Bug: T110671 Change-Id: Id21e0d8e4a759d4a77ec550b82c86bae6f117315 --- M includes/specials/SpecialNewsletterManage.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/75/235275/1 diff --git a/includes/specials/SpecialNewsletterManage.php b/includes/specials/SpecialNewsletterManage.php index f95eae8..2a489f5 100644 --- a/includes/specials/SpecialNewsletterManage.php +++ b/includes/specials/SpecialNewsletterManage.php @@ -64,7 +64,7 @@ 'type' => 'select', 'section' => 'announceissue-section', 'label-message' => 'newsletter-name', - 'options' => array_merge( array( '' => null ), $newsletterNameMap ), + 'options' => array( 'Please select one' => null ) + $newsletterNameMap, ), 'issue-page' => array( 'type' => 'text', @@ -97,7 +97,7 @@ 'type' => 'select', 'section' => 'addpublisher-section', 'label-message' => 'newsletter-name', - 'options' => array_merge( array( '' => null ), $ownedNewsletterMap ), + 'options' => array( 'Please select one' => null ) + $ownedNewsletterMap, ), 'publisher-name' => array( 'section' => 'addpublisher-section', -- To view, visit https://gerrit.wikimedia.org/r/235275 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id21e0d8e4a759d4a77ec550b82c86bae6f117315 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add secondary indexes and some minor issues with database - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/234281 Change subject: Add secondary indexes and some minor issues with database .. Add secondary indexes and some minor issues with database Change-Id: I8c58d99ed1ec1f8be47b6d0acf22562652181e5f --- M sql/nl_newsletters.sql M sql/nl_publishers.sql 2 files changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/81/234281/1 diff --git a/sql/nl_newsletters.sql b/sql/nl_newsletters.sql index 257b0c4..8441921 100644 --- a/sql/nl_newsletters.sql +++ b/sql/nl_newsletters.sql @@ -3,9 +3,12 @@ CREATE TABLE /*_*/nl_newsletters( --Primary key nl_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, - nl_name VARCHAR (50) NOT NULL UNIQUE, - nl_desc VARCHAR (256), + nl_name varchar(50) NOT NULL UNIQUE, + nl_desc varbinary(767), nl_main_page_id int NOT NULL, - nl_frequency VARCHAR (50) NOT NULL, + nl_frequency varchar(50) NOT NULL, nl_owner_id int NOT NULL -)/*$wgDBTableOptions*/; \ No newline at end of file +)/*$wgDBTableOptions*/; + +CREATE INDEX /*i*/nl_id ON /*_*/nl_newsletters(nl_name); +CREATE INDEX /*i*/nl_owner_id ON /*_*/nl_newsletters(nl_owner_id); \ No newline at end of file diff --git a/sql/nl_publishers.sql b/sql/nl_publishers.sql index 2c5cef0..d6cef4b 100644 --- a/sql/nl_publishers.sql +++ b/sql/nl_publishers.sql @@ -4,5 +4,5 @@ --Primary key newsletter_id int REFERENCES nl_newsletter(nl_id), publisher_id int NOT NULL, - PRIMARY KEY (newsletter_id, publisher_id) + PRIMARY KEY (publisher_id, newsletter_id) )/*$wgDBTableOptions*/; -- To view, visit https://gerrit.wikimedia.org/r/234281 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c58d99ed1ec1f8be47b6d0acf22562652181e5f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Automatically subscriber owners and publishers of a newslett... - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/234213 Change subject: Automatically subscriber owners and publishers of a newsletter to it .. Automatically subscriber owners and publishers of a newsletter to it Bug: T108791 Change-Id: I3724aa7c3181305a412439d31aa15b07797129a2 --- M includes/SpecialNewsletterCreate.php M includes/SpecialNewsletterManage.php 2 files changed, 33 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/13/234213/1 diff --git a/includes/SpecialNewsletterCreate.php b/includes/SpecialNewsletterCreate.php index b89adc1..ac9862e 100644 --- a/includes/SpecialNewsletterCreate.php +++ b/includes/SpecialNewsletterCreate.php @@ -115,16 +115,36 @@ foreach ( $res as $row ) { $newsletterId = $row-nl_id; } - - $pubRowData = array( - 'newsletter_id' = $newsletterId, - 'publisher_id' = $formData['publisher'] - ); - $dbw-insert( 'nl_publishers', $pubRowData, __METHOD__ ); + $this-autoSubscribe( $newsletterId, $formData['publisher'] ); return true; } return array( 'newsletter-mainpage-not-found-error' ); } + + /** +* Automatically subscribe and add owner as publisher of the newsletter +* +* @param int $newsletterId Id of the newsletter +* @param int $ownerId User Id of the owner +* @return bool +*/ + function autoSubscribe( $newsletterId, $ownerId ) { + $dbw = wfGetDB( DB_MASTER ); + //add owner as a publisher + $pubRowData = array( + 'newsletter_id' = $newsletterId, + 'publisher_id' = $ownerId + ); + $dbw-insert( 'nl_publishers', $pubRowData, __METHOD__ ); + //add owner as a subscriber + $subRowData = array( + 'newsletter_id' = $newsletterId, + 'subscriber_id' = $ownerId + ); + $dbw-insert( 'nl_subscriptions', $subRowData, __METHOD__ ); + + return true; + } } diff --git a/includes/SpecialNewsletterManage.php b/includes/SpecialNewsletterManage.php index 07c44a3..c47e7e0 100644 --- a/includes/SpecialNewsletterManage.php +++ b/includes/SpecialNewsletterManage.php @@ -203,12 +203,19 @@ 'newsletter_id' = $pubNewsletterId, 'publisher_id' = $user-getId() ); + //Automatically subscribe publishers to the newsletter + $subscribeRowData = array( + 'newsletter_id' = $pubNewsletterId, + 'subscriber_id' = $user-getId() + ); try { $dbww-insert( 'nl_publishers', $rowData, __METHOD__ ); + $dbww-insert( 'nl_subscriptions', $subscribeRowData, __METHOD__ ); $this-getOutput()-addWikiMsg( 'newsletter-new-publisher-confirmation' ); return true; } catch ( DBQueryError $e ) { + print_r($e); return array( 'newsletter-invalid-username-error' ); } } else { -- To view, visit https://gerrit.wikimedia.org/r/234213 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3724aa7c3181305a412439d31aa15b07797129a2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Avoid error message when new publisher is already subscribed... - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/234222 Change subject: Avoid error message when new publisher is already subscribed to newsletter .. Avoid error message when new publisher is already subscribed to newsletter Currently a wrong error message is shown when a user whose is already subscribed to the newsletter is added as publisher. This patch removes that. Bug: T108791 Change-Id: If54f2334d1561d88c901bc750a18d9f190b7d973 --- M includes/SpecialNewsletterManage.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/22/234222/1 diff --git a/includes/SpecialNewsletterManage.php b/includes/SpecialNewsletterManage.php index 4cc1f11..3344bf4 100644 --- a/includes/SpecialNewsletterManage.php +++ b/includes/SpecialNewsletterManage.php @@ -210,13 +210,13 @@ ); try { $dbww-insert( 'nl_publishers', $rowData, __METHOD__ ); - $dbww-insert( 'nl_subscriptions', $subscribeRowData, __METHOD__ ); $this-getOutput()-addWikiMsg( 'newsletter-new-publisher-confirmation' ); - - return true; } catch ( DBQueryError $e ) { return array( 'newsletter-invalid-username-error' ); } + $dbww-insert( 'nl_subscriptions', $subscribeRowData, __METHOD__ ); + + return true; } else { return array( 'newsletter-unconfirmed-email-error' ); } -- To view, visit https://gerrit.wikimedia.org/r/234222 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If54f2334d1561d88c901bc750a18d9f190b7d973 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace console.log() with mw.log() - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/234209 Change subject: Replace console.log() with mw.log() .. Replace console.log() with mw.log() Change-Id: Iae8e0eebc233016ea4f1fa26ec9a8621cdfdfe2f --- M modules/ext.newsletter.js M modules/ext.newslettermanage.js 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/09/234209/1 diff --git a/modules/ext.newsletter.js b/modules/ext.newsletter.js index 7b2d94d..d402070 100644 --- a/modules/ext.newsletter.js +++ b/modules/ext.newsletter.js @@ -12,7 +12,7 @@ newsletterId: newsletterId, todo: 'subscribe' } ).done( function ( data ) { - console.log( data ); + mw.log( data ); } ); document.getElementById( 'newsletter-' + newsletterId ).value++; } ); @@ -25,7 +25,7 @@ todo: 'unsubscribe' } ).done( function ( data ) { - console.log( data ); + mw.log( data ); } ); document.getElementById( 'newsletter-' + newsletterId ).value--; } ); diff --git a/modules/ext.newslettermanage.js b/modules/ext.newslettermanage.js index 968bdcd..b835785 100644 --- a/modules/ext.newslettermanage.js +++ b/modules/ext.newslettermanage.js @@ -15,7 +15,7 @@ todo: 'removepublisher' } ).done( function ( data ) { - console.log( data ); + mw.log( data ); } ); $( this ).closest( 'tr' ).remove(); } ); -- To view, visit https://gerrit.wikimedia.org/r/234209 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iae8e0eebc233016ea4f1fa26ec9a8621cdfdfe2f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add a text message above the form on Special:GlobalUsage - change (mediawiki...GlobalUsage)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/233105 Change subject: Add a text message above the form on Special:GlobalUsage .. Add a text message above the form on Special:GlobalUsage Added a text message above the form describing what the special page does. Bug: T109882 Change-Id: I6d4863aadc93a37eac802da5307324ad4d051e48 --- M SpecialGlobalUsage.php M i18n/en.json M i18n/qqq.json 3 files changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalUsage refs/changes/05/233105/1 diff --git a/SpecialGlobalUsage.php b/SpecialGlobalUsage.php index 7d3fb5c..5d7fc51 100644 --- a/SpecialGlobalUsage.php +++ b/SpecialGlobalUsage.php @@ -30,7 +30,7 @@ $this-filterLocal = $this-getRequest()-getCheck( 'filterlocal' ); $this-setHeaders(); - + $this-getOutput()-addWikiMsg('globalusage-header'); $this-showForm(); if ( is_null( $this-target ) ) { diff --git a/i18n/en.json b/i18n/en.json index cf08333..ebe2658 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -23,5 +23,6 @@ apihelp-query+globalusage-param-prop: Which properties to return:\n;url:Adds url.\n;pageid:Adds page ID.\n;namespace:Adds namespace ID., apihelp-query+globalusage-param-limit: How many links to return., apihelp-query+globalusage-param-filterlocal: Filter local usage of the file., - apihelp-query+globalusage-example-1: Get usage of [[:File:Example.jpg]] + apihelp-query+globalusage-example-1: Get usage of [[:File:Example.jpg]], + globalusage-header: This is a page to view global file usage of images. } diff --git a/i18n/qqq.json b/i18n/qqq.json index 5e9331c..f9a69f2 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -34,5 +34,7 @@ apihelp-query+globalusage-param-prop: {{doc-apihelp-param|query+globalusage|prop}}, apihelp-query+globalusage-param-limit: {{doc-apihelp-param|query+globalusage|limit}}, apihelp-query+globalusage-param-filterlocal: {{doc-apihelp-param|query+globalusage|filterlocal}}, - apihelp-query+globalusage-example-1: {{doc-apihelp-example|query+globalusage}} + apihelp-query+globalusage-example-1: {{doc-apihelp-example|query+globalusage}}, + globalusage-header: Text message used in [Special:GlobalUsage]] right above the form describing the purpose of special page. + } -- To view, visit https://gerrit.wikimedia.org/r/233105 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6d4863aadc93a37eac802da5307324ad4d051e48 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GlobalUsage Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add Newsletter extension to translatewiki.net - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/231756 Change subject: Add Newsletter extension to translatewiki.net .. Add Newsletter extension to translatewiki.net Added prefix, 'newsletter-' to all the i18n keys. Bug: T102945 Change-Id: I504a29b2de43c19356a3b452f537188da4dda186 --- M Newsletter.hooks.php M i18n/en.json M i18n/qqq.json M includes/SpecialNewsletterCreate.php M includes/SpecialNewsletterManage.php M includes/SpecialNewsletters.php 6 files changed, 47 insertions(+), 47 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/56/231756/1 diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php index 390b6c4..3e97278 100755 --- a/Newsletter.hooks.php +++ b/Newsletter.hooks.php @@ -17,13 +17,13 @@ ); $notifications['subscribe-newsletter'] = array( 'primary-link' = array( - 'message' = 'notification-link-text-new-issue', + 'message' = 'newsletter-notification-link-text-new-issue', 'destination' = 'new-issue' ), 'formatter-class' = 'EchoNewsletterFormatter', - 'title-message' = 'notification-newsletter-title', + 'title-message' = 'newsletter-notification-title', 'title-params' = array( 'newsletter', 'title' ), - 'flyout-message' = 'notification-newsletter-flyout', + 'flyout-message' = 'newsletter-notification-flyout', 'flyout-params' = array( 'newsletter', 'title' ), ); diff --git a/i18n/en.json b/i18n/en.json index dda5810..5e1c851 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -7,34 +7,34 @@ newsletter-desc: Adds a preference for users to subscribe to a newsletter, newslettercreate: Create newsletters, newslettermanage: Manage newsletters, - announceissueform-announceissue-section: Announce new issue, - announceissueform-addpublisher-section: Add Publishers, - createnewsletter-section: Create newsletter, + newsletter-announceissueform-announceissue-section: Announce new issue, + newsletter-announceissueform-addpublisher-section: Add Publishers, + newsletter-create-section: Create newsletter, newsletter-create-confirmation: Good job! You just created a new newsletter., - issue-announce-confirmation: Good job! You just announced a new issue of your newsletter., + newsletter-issue-announce-confirmation: Good job! You just announced a new issue of your newsletter., newsletters: Newsletters, newsletter-subscribe-section: Subscribe newsletters, newsletter-unsubscribe-section: Unsubscribe newsletters, newsletter-subscribe-confirmation: You are now subscribed to the newsletter., newsletter-unsubscribe-confirmation: You are now unsubscribed from the newsletter., - subscribe-button-label: Yes, - unsubscribe-button-label: No, - available-newsletters-field-label: Available newsletters, - subscribed-newsletters-field-label: Subscribed newsletters, + newsletter-subscribe-button-label: Yes, + newsletter-unsubscribe-button-label: No, + newsletter-available-newsletters-field-label: Available newsletters, + newsletter-subscribed-newsletters-field-label: Subscribed newsletters, echo-category-title-newsletter: Newsletters, echo-pref-tooltip-newsletter: Notify me when any of the newsletters to which I have subscribed to announces a new issue., - notification-newsletter-title: $1 has announced an issue. In this issue: [[:$2]], - notification-newsletter-flyout: $1 has announced a new issue. \n\nIn this issue: [[:$2]], - notification-link-text-new-issue: View new issue, + newsletter-notification-title: $1 has announced an issue, + newsletter-notification-flyout: $1 has announced a new issue, + newsletter-notification-link-text-new-issue: View new issue, newsletter-header-name: Name of Newsletter, newsletter-header-description: Description, newsletter-header-action: Subscribed ?, newsletter-header-subscriber_count: Subscriber count, - new-publisher-confirmation: A new publisher has just been added to your newsletter !, - newslettermanage-header-name: Newsletter, - newslettermanage-header-publisher: Contributors, - newslettermanage-header-permissions: Permissions, - newslettermanage-header-action: Action, - owner-radiobutton-label: Owner, - publisher-radiobutton-label: Publisher + newsletter-new-publisher-confirmation: A new publisher has just been added to your newsletter !, + newsletter-manage-header-name:
[MediaWiki-commits] [Gerrit] Unit testing for Newsletter extension - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/231599 Change subject: Unit testing for Newsletter extension .. Unit testing for Newsletter extension Version 1 of unit test to check the case of unconfirmed user trying to subscribe to newsletters. Bug: T108202 Change-Id: I048e0feaf0879403bb7c4c28b076f323a17092e9 --- M Newsletter.hooks.php M includes/ApiNewsletter.php A tests/ApiNewsletterTest.php 3 files changed, 51 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/99/231599/1 diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php index 0ccfac6..b25e66f 100755 --- a/Newsletter.hooks.php +++ b/Newsletter.hooks.php @@ -73,4 +73,10 @@ return true; } + + public static function onUnitTestsList( $files ) { + $files = array_merge( $files, glob( __DIR__ . '/tests/*Test.php' ) ); + + return true; + } } diff --git a/includes/ApiNewsletter.php b/includes/ApiNewsletter.php index f93d8de..842ccf1 100644 --- a/includes/ApiNewsletter.php +++ b/includes/ApiNewsletter.php @@ -2,13 +2,19 @@ class ApiNewsletter extends ApiBase { public function execute() { + $res = $this-getResult(); $dbw = wfGetDB( DB_MASTER ); if ( $this-getMain()-getVal( 'todo' ) === 'subscribe' ) { - $rowData = array( - 'newsletter_id' = $this-getMain()-getVal( 'newsletterId' ), - 'subscriber_id' = $this-getUser()-getId() - ); - $dbw-insert( 'nl_subscriptions', $rowData, __METHOD__ ); + if ( $this-getMain()-getVal('newsletterId' ) $this-getUser()-isEmailConfirmed() ) { + $rowData = array( + 'newsletter_id' = $this-getMain()-getVal( 'newsletterId' ), + 'subscriber_id' = $this-getUser()-getId() + ); + $dbw-insert( 'nl_subscriptions', $rowData, __METHOD__ ); + $res-addValue( 'newsletterapi', 'insert', 'ok' ); + } else { + $res-addValue( 'newsletterapi', 'insert', 'fail' ); + } } if ( $this-getMain()-getVal( 'todo' ) === 'unsubscribe' ) { @@ -18,6 +24,7 @@ ); $dbw-delete( 'nl_subscriptions', $rowData, __METHOD__ ); } + } public function getAllowedParams() { diff --git a/tests/ApiNewsletterTest.php b/tests/ApiNewsletterTest.php new file mode 100644 index 000..f5f3b86 --- /dev/null +++ b/tests/ApiNewsletterTest.php @@ -0,0 +1,33 @@ +?php +/** + * Unit test to test Api module - ApiNewsletter + * + */ + +class ApiNewsletterTest extends ApiTestCase { + +public function testApiNewsletter() { +$subscribed = array(); +$dbr = wfGetDB( DB_SLAVE ); + +$query = $dbr-select( +'nl_subscriptions', +array( 'newsletter_id', 'subscriber_id'), +array( ), +__METHOD__, +array() +); + +foreach ($query as $row) { +$subscribed[$row-newsletter_id] = $row-subscriber_id; +} + +list( $apiResult ) = $this-doApiRequest( array( +'action' = 'newsletterapi', +'newsletterId' = array_keys( end( $subscribed ) ), +'todo' = 'subscribe' +) ); + +$this-assertEquals( 'ok', $apiResult['newsletterapi']['insert'] ); +} +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/231599 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I048e0feaf0879403bb7c4c28b076f323a17092e9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add short tagline to Newsletter's Echo notifications - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/230772 Change subject: Add short tagline to Newsletter's Echo notifications .. Add short tagline to Newsletter's Echo notifications Added the title of the issue's main page to the echo notifications. Bug: T104829 Change-Id: I908d973e7db61b2c24d636e014adde567c2333ad --- M Newsletter.hooks.php M i18n/en.json M i18n/qqq.json M includes/EchoNewsletterFormatter.php 4 files changed, 10 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/72/230772/1 diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php index 0ccfac6..390b6c4 100755 --- a/Newsletter.hooks.php +++ b/Newsletter.hooks.php @@ -22,9 +22,9 @@ ), 'formatter-class' = 'EchoNewsletterFormatter', 'title-message' = 'notification-newsletter-title', - 'title-params' = array( 'newsletter' ), + 'title-params' = array( 'newsletter', 'title' ), 'flyout-message' = 'notification-newsletter-flyout', - 'flyout-params' = array( 'newsletter' ), + 'flyout-params' = array( 'newsletter', 'title' ), ); return true; diff --git a/i18n/en.json b/i18n/en.json index 79d10e8..cf9e804 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -23,8 +23,8 @@ subscribed-newsletters-field-label: Subscribed newsletters, echo-category-title-newsletter: Newsletters, echo-pref-tooltip-newsletter: Notify me when any of the newsletters to which I have subscribed to announces a new issue., - notification-newsletter-title: $1 has announced an issue, - notification-newsletter-flyout: $1 has announced a new issue, + notification-newsletter-title: $1 has announced an issue. In this issue: $2, + notification-newsletter-flyout: $1 has announced a new issue. In this issue: $2, notification-link-text-new-issue: View new issue, newsletter-header-name: Name of Newsletter, newsletter-header-description: Description, diff --git a/i18n/qqq.json b/i18n/qqq.json index 623911b..bfa1ed2 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -23,8 +23,8 @@ subscribed-newsletters-field-label: Label of HTML form field which lists all newsletters to which user is subscribed to., echo-category-title-newsletter: Title of the notification category used by Newsletter extension.\n{{Related|Echo-category-title}}, echo-pref-tooltip-newsletter: Short description of the newsletter notification category.\n{{Related|Echo-pref-tooltip}}, - notification-newsletter-title: Title message of Echo notification to notify a user of a new issue from a newsletter he/she has subscribed to. Parameters:\n* $1 is is the name of the newsletter., - notification-newsletter-flyout: Flyout message of Echo notification to notify the user of a new issue from a newsletter he/she has subscribed to. Parameters:\n* $1 is the name of the newsletter., + notification-newsletter-title: Title message of Echo notification to notify a user of a new issue from a newsletter he/she has subscribed to. Parameters:\n* $1 is is the name of the newsletter \n* $2 is the title of the Main page of the issue., + notification-newsletter-flyout: Flyout message of Echo notification to notify the user of a new issue from a newsletter he/she has subscribed to. Parameters:\n* $1 is the name of the newsletter \n* $2 is the title of the Main page of the issue., notification-link-text-new-issue: Label of the primary link of the notification-newsletter-flyout, which on clicking navigates the user to the newly announced issue of a newsletter., newsletter-header-name: Label of the first column of table in [[Special:Newsletters]] which lists the names of newsletters, newsletter-header-description: Label of the second column of table in [[Special:Newsletters]] which displays a description about the newsletter, diff --git a/includes/EchoNewsletterFormatter.php b/includes/EchoNewsletterFormatter.php index 72c298f..f1ba8bb 100644 --- a/includes/EchoNewsletterFormatter.php +++ b/includes/EchoNewsletterFormatter.php @@ -10,7 +10,10 @@ protected function processParam( $event, $param, $message, $user ) { if ( $param === 'newsletter' ) { $message-params( $event-getExtraParam( 'newsletter' ) ); - } else { + } else if ( $param === 'title') { + $message-params( $event-getExtraParam( 'issuePageTitle' ) ); + } + else { parent::processParam( $event, $param, $message, $user ); } } -- To view, visit https://gerrit.wikimedia.org/r/230772
[MediaWiki-commits] [Gerrit] Fix errors in table in Special:NewsletterManage - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/230586 Change subject: Fix errors in table in Special:NewsletterManage .. Fix errors in table in Special:NewsletterManage Fixed discrepencies in table and reduced use of static variables. Change-Id: I14889dd8e6292e68c19d1464e73b4842e0e5364b --- M includes/SpecialNewsletterManage.php 1 file changed, 3 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/86/230586/1 diff --git a/includes/SpecialNewsletterManage.php b/includes/SpecialNewsletterManage.php index 6a9eb7b..fdf7273 100644 --- a/includes/SpecialNewsletterManage.php +++ b/includes/SpecialNewsletterManage.php @@ -278,7 +278,6 @@ function formatValue( $field, $value ) { static $previous; - static $isOwner; switch( $field ) { case 'newsletter_id': @@ -304,11 +303,6 @@ } case 'publisher_id' : $user = User::newFromId( $value ); - if ( self::$newsletterOwners[$previous] === $value ) { - $isOwner = true; - } else if ( self::$newsletterPublishers[$previous] === $value ) { - $isOwner = false; - } return $user-getName(); case 'permissions' : @@ -318,7 +312,7 @@ 'type' = 'checkbox', 'disabled' = 'true', 'id' = 'newslettermanage', - 'checked' = $isOwner ? true : false, ) + 'checked' = ( self::$newsletterOwners[$this-mCurrentRow-newsletter_id] === $this-mCurrentRow-publisher_id ) ? true : false, ) ) . $this-msg( 'owner-radiobutton-label' ); $radioPublisher = HTML::element( @@ -327,7 +321,7 @@ 'type' = 'checkbox', 'disabled' = 'true', 'id' = 'newslettermanage', - 'checked' = $isOwner ? false : true, ) + 'checked' = ( self::$newsletterOwners[$this-mCurrentRow-newsletter_id] === $this-mCurrentRow-publisher_id ) ? false : true, ) ) . $this-msg( 'publisher-radiobutton-label' ); return $radioOwner . $radioPublisher; @@ -342,7 +336,7 @@ ) ); - return $isOwner ? '' : $remButton; + return ( self::$newsletterOwners[$this-mCurrentRow-newsletter_id] === $this-mCurrentRow-publisher_id ) ? '' : $remButton; } } -- To view, visit https://gerrit.wikimedia.org/r/230586 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I14889dd8e6292e68c19d1464e73b4842e0e5364b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve UI for handling Newsletter permissions - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/230383 Change subject: Improve UI for handling Newsletter permissions .. Improve UI for handling Newsletter permissions Included a table in Special: NewsletterManage to improve the UI. Bug: T108456 Change-Id: I2e5ef9046c59692c933c31018bb4b408fda39825 --- M Newsletter.php M i18n/en.json M includes/SpecialNewsletterManage.php 3 files changed, 70 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/83/230383/1 diff --git a/Newsletter.php b/Newsletter.php index 56b9a6f..669bf46 100755 --- a/Newsletter.php +++ b/Newsletter.php @@ -32,6 +32,7 @@ $wgAutoloadClasses['EchoNewsletterFormatter'] = __DIR__ . '/includes/EchoNewsletterFormatter.php'; $wgAutoloadClasses['NewsletterTablePager'] = __DIR__ . '/includes/SpecialNewsletters.php'; $wgAutoloadClasses['ApiNewsletter'] = __DIR__ . '/includes/ApiNewsletter.php'; +$wgAutoloadClasses['NewsletterManageTable'] = __DIR__ . '/includes/SpecialNewsletterManage.php'; $wgSpecialPages['NewsletterCreate'] = 'SpecialNewsletterCreate'; $wgSpecialPages['NewsletterManage'] = 'SpecialNewsletterManage'; diff --git a/i18n/en.json b/i18n/en.json index d8914df..d951633 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -32,5 +32,8 @@ newsletter-header-action: Subscribed ?, newsletter-header-subscriber_count: Subscriber count, new-publisher-confirmation: A new publisher has just been added to your newsletter !, - remove-publisher-confirmation: A publisher was removed from your newsletter. + remove-publisher-confirmation: A publisher was removed from your newsletter., + newslettermanage-header-name: Newsletter, + newslettermanage-header-publisher: Contributors, + newslettermanage-header-permissions: Permissions } diff --git a/includes/SpecialNewsletterManage.php b/includes/SpecialNewsletterManage.php index 5e50f9b..1d3c1b7 100644 --- a/includes/SpecialNewsletterManage.php +++ b/includes/SpecialNewsletterManage.php @@ -4,6 +4,11 @@ * */ class SpecialNewsletterManage extends SpecialPage { + static $fields = array( + 'nl_name' = 'name', + 'publisher_id' = 'publisher', + //'permissions' = 'permissions', + ); function __construct() { parent::__construct( 'NewsletterManage' ); } @@ -18,6 +23,14 @@ $announceIssueForm = new HTMLForm( $announceIssueArray, $this-getContext(), 'announceissueform' ); $announceIssueForm-setSubmitCallback( array( 'SpecialNewsletterManage', 'onSubmitIssue' ) ); + $table = new NewsletterManageTable(); + if ( $table-getNumRows() 0 ) { + $output-addHTML( + $table-getNavigationBar() . + $table-getBody() . + $table-getNavigationBar() + ); + } # Show HTML forms $announceIssueForm-show(); $output-returnToMain(); @@ -252,4 +265,56 @@ return Required fields are empty.; } +} + +class NewsletterManageTable extends TablePager { + function getFieldNames() { + $header = null; + if ( is_null( $header ) ) { + $header = array(); + foreach ( SpecialNewsletterManage::$fields as $key = $value ) { + $header[$key]= $this-msg( newslettermanage-header-$value )-text(); + } + } + + return $header; + + } + + function getQueryInfo() { + $info = array( + 'tables' = array( 'nl_newsletters', 'nl_publishers' ), + 'fields' = array( + 'nl_name', + 'publisher_id' + ) + ); + + return $info; + } + + function formatValue( $field, $value ) { + static $previous; + switch( $field ) { + case 'nl_name': if( $previous === $value ){ + return null; + } else { + $previous = $value; + + return $value; + } + case 'publisher_id' : + $user = User::newFromId( $value ); + return $user-getName(); + } + } + + function getDefaultSort() { + return 'nl_name'; + } + + function isFieldSortable( $field ) { + return false; + } + } \ No newline at end of file -- To view, visit
[MediaWiki-commits] [Gerrit] Removing collaborators from an existing newsletter - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/230141 Change subject: Removing collaborators from an existing newsletter .. Removing collaborators from an existing newsletter Added new section in Special:NewsletterManage to allow owners of newsletters to remove publishers. Bug: T101832 Change-Id: I320c2903fbe9c232d870ff1f4b123d843523484d --- M i18n/en.json M includes/SpecialNewsletterManage.php 2 files changed, 46 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/41/230141/1 diff --git a/i18n/en.json b/i18n/en.json index e0c7070..7b10b22 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -9,6 +9,7 @@ newslettermanage: Manage newsletters, announceissueform-announceissue-section: Announce new issue, announceissueform-addpublisher-section: Add Publishers, + announceissueform-removepublisher-section: Remove Publishers, createnewsletter-section: Create newsletter, newsletter-create-confirmation: Good job! You just created a new newsletter., issue-announce-confirmation: Good job! You just announced a new issue of your newsletter., @@ -30,5 +31,6 @@ newsletter-header-description: Description, newsletter-header-action: Subscribed ?, newsletter-header-subscriber_count: Subscriber count, - new-publisher-confirmation: New publisher added + new-publisher-confirmation: New publisher added, + remove-publisher-confirmation: Publisher removed } diff --git a/includes/SpecialNewsletterManage.php b/includes/SpecialNewsletterManage.php index 84ca0ba..dd4e2d7 100644 --- a/includes/SpecialNewsletterManage.php +++ b/includes/SpecialNewsletterManage.php @@ -52,9 +52,20 @@ __METHOD__ ); - foreach ($resl as $row) { + foreach ( $resl as $row ) { $newsletterNames[$row-nl_name] = $row-nl_id; } + } + + $newsletters = array(); + $result = $dbr-select( + 'nl_newsletters', + array( 'nl_name','nl_id' ), + array( 'nl_owner_id' = $this-getUser()-getId() ), + __METHOD__ + ); + foreach ( $result as $row ) { + $newsletters[$row-nl_name] = $row-nl_id; } return array( @@ -77,12 +88,24 @@ 'type' = 'select', 'section' = 'addpublisher-section', 'label' = 'Name of newsletter', - 'options' = array_merge( $defaultOption, $newsletterNames ) + 'options' = array_merge( $defaultOption, $newsletterNames ), + 'label' = Name of newsletter ), 'publisher-name' = array( 'section' = 'addpublisher-section', 'type' = 'text', 'label' = Username, + ), + 'remove-publisher-newsletter' = array( + 'type' = 'select', + 'section' = 'removepublisher-section', + 'options' = array_merge( $defaultOption,$newsletters ), + 'label' = Name of newsletter + ), + 'remove-publisher-name' = array( + 'type' = 'text', + 'section' = 'removepublisher-section', + 'label' = Username ) ); } @@ -129,8 +152,6 @@ __METHOD__, array() ); - - $newsletterName = array(); foreach( $res as $row ) { $newsletterName = $row-nl_name; } @@ -156,24 +177,39 @@ $pubNewsletterId = $formData['newsletter-name']; $user = User::newFromName( $formData['publisher-name'] ); if ( $user-isEmailConfirmed() ) { - $dbw = wfGetDB(DB_MASTER); + $dbww = wfGetDB( DB_MASTER ); $rowData = array( 'newsletter_id' = $pubNewsletterId, 'publisher_id' = $user-getId() ); try { -
[MediaWiki-commits] [Gerrit] Add publishers to existing newsletters - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/228789 Change subject: Add publishers to existing newsletters .. Add publishers to existing newsletters Added a new section to Special:NewsletterManage to allow owners of newsletters to add publishers. Many functions of 'Manage Newsletters' yet to be implemented. Bug: T101832 Change-Id: If9c1d13a76dd28bc384cf9d14e2c11294c91687a --- M Newsletter.hooks.php M i18n/en.json M includes/SpecialNewsletterCreate.php M includes/SpecialNewsletterManage.php M sql/nl_newsletters.sql A sql/nl_publishers.sql 6 files changed, 28 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/89/228789/1 diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php index 93c82e4..0ccfac6 100755 --- a/Newsletter.hooks.php +++ b/Newsletter.hooks.php @@ -69,6 +69,7 @@ $updater-addExtensionTable( 'nl_newsletters', __DIR__ . '/sql/nl_newsletters.sql', true ); $updater-addExtensionTable( 'nl_issues', __DIR__ . '/sql/nl_issues.sql', true ); $updater-addExtensionTable( 'nl_subscriptions', __DIR__ . '/sql/nl_subscriptions.sql', true ); + $updater-addExtensionTable( 'nl_publishers', __DIR__ . '/sql/nl_publishers.sql', true ); return true; } diff --git a/i18n/en.json b/i18n/en.json index a9380ca..e543c8c 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -7,7 +7,8 @@ newsletter-desc: Adds a preference for users to subscribe to a newsletter, newslettercreate: Create newsletters, newslettermanage: Manage newsletters, - announceissue-section: Announce new issue, + announceissueform-announceissue-section: Announce new issue, + announceissueform-addPublisher-section: Add Publishers, createnewsletter-section: Create newsletter, newsletter-create-confirmation: Good job! You just created a new newsletter., issue-announce-confirmation: Good job! You just announced a new issue of your newsletter., diff --git a/includes/SpecialNewsletterCreate.php b/includes/SpecialNewsletterCreate.php index 3863df2..e8a2c31 100644 --- a/includes/SpecialNewsletterCreate.php +++ b/includes/SpecialNewsletterCreate.php @@ -90,7 +90,7 @@ 'nl_desc' = $formData['description'], 'nl_main_page_id' = $pageId, 'nl_frequency' = $formData['frequency'], - 'nl_publisher_id' = $formData['publisher'] + 'nl_owner_id' = $formData['publisher'] ); try { $dbw-insert( 'nl_newsletters', $rowData, __METHOD__ ); diff --git a/includes/SpecialNewsletterManage.php b/includes/SpecialNewsletterManage.php index 1351fcd..1124b5c 100644 --- a/includes/SpecialNewsletterManage.php +++ b/includes/SpecialNewsletterManage.php @@ -16,9 +16,7 @@ # Create HTML forms $announceIssueForm = new HTMLForm( $announceIssueArray, $this-getContext(), 'announceissueform' ); - $announceIssueForm-setSubmitText( 'Announce issue' ); $announceIssueForm-setSubmitCallback( array( 'SpecialNewsletterManage', 'onSubmitIssue' ) ); - $announceIssueForm-setWrapperLegendMsg( 'announceissue-section' ); # Show HTML forms $announceIssueForm-show(); @@ -35,7 +33,7 @@ $res = $dbr-select( 'nl_newsletters', array( 'nl_name', 'nl_id' ), - '', + array( 'nl_owner_id' = $this-getUser()-getId() ), __METHOD__ ); $newsletterNames = array(); @@ -46,18 +44,32 @@ return array( 'issue-newsletter' = array( 'type' = 'select', + 'section' = 'announceissue-section', 'label' = 'Name of newsletter', 'options' = $newsletterNames, 'required' = true ), 'issue-page' = array( 'type' = 'text', + 'section' = 'announceissue-section', 'label' = Title of issue's main page, 'required' = true ), 'publisher' = array( 'type' = 'hidden', 'default' = $this-getUser()-getId() + ), + 'newsletter-name' = array( + 'type' = 'select', +
[MediaWiki-commits] [Gerrit] Replace drop down menus in Special:Newsletters with table - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/223951 Change subject: Replace drop down menus in Special:Newsletters with table .. Replace drop down menus in Special:Newsletters with table First version of table with two columns, name of newsletter and description of the newsletter. New columns to be added in later patches. Bug: T103813 Change-Id: Ic52ead998363dc0a8860fcdb5d46bb30ae590dc0 --- M Newsletter.php M i18n/en.json M includes/SpecialNewsletters.php 3 files changed, 50 insertions(+), 162 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/51/223951/1 diff --git a/Newsletter.php b/Newsletter.php index 87b260b..d197eb0 100755 --- a/Newsletter.php +++ b/Newsletter.php @@ -30,6 +30,7 @@ $wgAutoloadClasses['SpecialNewsletterManage'] = __DIR__ . '/includes/SpecialNewsletterManage.php'; $wgAutoloadClasses['SpecialNewsletters'] = __DIR__ . '/includes/SpecialNewsletters.php'; $wgAutoloadClasses['EchoNewsletterFormatter'] = __DIR__ . '/includes/EchoNewsletterFormatter.php'; +$wgAutoloadClasses['NewsletterTablePager'] = __DIR__ . '/includes/SpecialNewsletters.php'; $wgSpecialPages['NewsletterCreate'] = 'SpecialNewsletterCreate'; $wgSpecialPages['NewsletterManage'] = 'SpecialNewsletterManage'; diff --git a/i18n/en.json b/i18n/en.json index 74c99e8..3e87b83 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -24,5 +24,7 @@ echo-pref-tooltip-newsletter: Notify me when any of the newsletters to which I have subscribed to announces a new issue., notification-newsletter-title: $1 has announced an issue, notification-newsletter-flyout: $1 has announced a new issue, - notification-link-text-new-issue: View new issue + notification-link-text-new-issue: View new issue, + newsletter-header-name: Name of Newsletter, + newsletter-header-description: Description } diff --git a/includes/SpecialNewsletters.php b/includes/SpecialNewsletters.php index 7b979d7..a76084f 100644 --- a/includes/SpecialNewsletters.php +++ b/includes/SpecialNewsletters.php @@ -4,6 +4,12 @@ * */ class SpecialNewsletters extends SpecialPage { + + static $fields = array( + 'nl_name' = 'name', + 'nl_desc' = 'description', + ); + public function __construct() { parent::__construct( 'Newsletters' ); } @@ -11,180 +17,59 @@ public function execute( $par ) { $this-setHeaders(); $this-requireLogin(); - $subscribeNewsletterArray = $this-getSubscribeFormFields(); + $out = $this-getOutput(); - # Create HTML form - $subscribeNewsletterForm = new HTMLForm( $subscribeNewsletterArray, $this-getContext(), 'subscribenewsletterform' ); - $subscribeNewsletterForm-setSubmitCallback( array( 'SpecialNewsletters', 'onSubscribe' ) ); - $subscribeNewsletterForm-setWrapperLegendMsg( 'newsletter-subscribe-section' ); - $subscribeNewsletterForm-setSubmitText( $this-msg( 'subscribe-button-label' )-text() ); - $subscribeNewsletterForm-show(); + $pager = new NewsletterTablePager(); - $userSubscriptionsArray = $this-getSubscriptionsFormFields( $this-getUser()-getId() ); - $userSubscriptionsForm = new HTMLForm( $userSubscriptionsArray, $this-getContext(), 'usersubscriptionsform' ); - $userSubscriptionsForm-setSubmitCallback( array( 'SpecialNewsletters', 'onUnSubscribe' ) ); - $userSubscriptionsForm-setWrapperLegendMsg( 'newsletter-unsubscribe-section' ); - $userSubscriptionsForm-setSubmitText( $this-msg( 'unsubscribe-button-label' )-text() ); - $userSubscriptionsForm-show(); + if ( $pager-getNumRows() 0 ) { + $out-addHTML( + $pager-getNavigationBar() . + $pager-getBody() . + $pager-getNavigationBar() + ); + } } +} - /** -* Function to get user entries from HTML form for subscribing to a newsletter -* -* @return array -*/ - protected function getSubscribeFormFields() { - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr-select( - 'nl_newsletters', - array( 'nl_name'), - '', - __METHOD__ - ); - $newsletterNames = array(); - $defaultOption = array( '' = null ); - foreach( $res as $row ) { - $newsletterNames[$row-nl_name] = $row-nl_name; +class NewsletterTablePager extends TablePager { + + function getFieldNames() { + static
[MediaWiki-commits] [Gerrit] Remove unnecessary parameter passed to requireLogin() - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/221441 Change subject: Remove unnecessary parameter passed to requireLogin() .. Remove unnecessary parameter passed to requireLogin() Somehow the require-login text passed to requireLogin() restrict from displaying the text. Hence removing the parameter and switching to default text. Bug: T104128 Change-Id: Ic1e15a6d282a4acacf568a5797ab0c9e920696b5 --- M i18n/en.json M i18n/qqq.json M includes/SpecialNewsletterCreate.php M includes/SpecialNewsletterManage.php 4 files changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/41/221441/1 diff --git a/i18n/en.json b/i18n/en.json index 4922835..74c99e8 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -11,7 +11,6 @@ createnewsletter-section: Create newsletter, newsletter-create-confirmation: Good job! You just created a new newsletter., issue-announce-confirmation: Good job! You just announced a new issue of your newsletter., - requiredlogintext: Please login to access this page, newsletters: Subscribe or unsubscribe newsletters, newsletter-subscribe-section: Subscribe newsletters, newsletter-unsubscribe-section: Unsubscribe newsletters, diff --git a/i18n/qqq.json b/i18n/qqq.json index 4cdfad7..b69c281 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -11,7 +11,6 @@ createnewsletter-section: Section header of [[Special:NewsletterCreate]], newsletter-create-confirmation: Confirmation message displayed after creation of a newsletter, issue-announce-confirmation: Confirmation message displayed after announcing a new issue, - requiredlogintext: Error message to be shown when the user is not logged in, newsletters: Name of special page for user to subscribe to or unsubscribe from newsletters, newsletter-subscribe-section: Section header of HTML form in [[Special:Newsletters]] which allows users to subscribe., newsletter-unsubscribe-section: Section header of HTML form in [[Special:Newsletters]] which allows users to un-subscribe., diff --git a/includes/SpecialNewsletterCreate.php b/includes/SpecialNewsletterCreate.php index 00e9784..3863df2 100644 --- a/includes/SpecialNewsletterCreate.php +++ b/includes/SpecialNewsletterCreate.php @@ -11,7 +11,7 @@ public function execute( $par ) { $this-setHeaders(); $output = $this-getOutput(); - $this-requireLogin( 'requiredlogintext' ); + $this-requireLogin(); $createNewsletterArray = $this-getCreateFormFields(); # Create HTML forms diff --git a/includes/SpecialNewsletterManage.php b/includes/SpecialNewsletterManage.php index 543c7f7..1351fcd 100644 --- a/includes/SpecialNewsletterManage.php +++ b/includes/SpecialNewsletterManage.php @@ -11,7 +11,7 @@ public function execute( $par ) { $this-setHeaders(); $output = $this-getOutput(); - $this-requireLogin( 'requiredlogintext' ); + $this-requireLogin(); $announceIssueArray = $this-getAnnounceFormFields(); # Create HTML forms -- To view, visit https://gerrit.wikimedia.org/r/221441 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1e15a6d282a4acacf568a5797ab0c9e920696b5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove 'Other' option from drop down menu - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/221118 Change subject: Remove 'Other' option from drop down menu .. Remove 'Other' option from drop down menu Removed 'Other' option from drop down menu as it does not really serve any purpose. Code courtesy: Tony Thomas 01tonytho...@gmail.com Bug: T103813 Change-Id: I5fb1c83889bb99f9e4fa41bbe1da52c37d367fd2 --- M includes/SpecialNewsletters.php 1 file changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/18/221118/1 diff --git a/includes/SpecialNewsletters.php b/includes/SpecialNewsletters.php index be4375a..7b979d7 100644 --- a/includes/SpecialNewsletters.php +++ b/includes/SpecialNewsletters.php @@ -42,6 +42,7 @@ __METHOD__ ); $newsletterNames = array(); + $defaultOption = array( '' = null ); foreach( $res as $row ) { $newsletterNames[$row-nl_name] = $row-nl_name; } @@ -49,9 +50,9 @@ return array( 'available-newsletters' = array( 'required' = true, - 'type' = 'selectorother', + 'type' = 'select', 'label' = $this-msg( 'available-newsletters-field-label' )-text(), - 'options' = $newsletterNames, + 'options' = array_merge( $defaultOption, $newsletterNames ), ), 'subscriber' = array( 'type' = 'hidden', @@ -123,6 +124,7 @@ } $newsletterNames = array(); + $defaultOption = array( '' = null ); //get newsletter names foreach ( $newsletterIds as $value ) { $result = $dbr-select( @@ -138,9 +140,9 @@ return array( 'subscribed-newsletters' = array( 'required' = true, - 'type' = 'selectorother', + 'type' = 'select', 'label' = $this-msg( 'subscribed-newsletters-field-label' )-text(), - 'options' = $newsletterNames + 'options' = array_merge( $defaultOption, $newsletterNames ) ), 'un-subscriber' = array( 'type' = 'hidden', -- To view, visit https://gerrit.wikimedia.org/r/221118 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fb1c83889bb99f9e4fa41bbe1da52c37d367fd2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove deprecated $wgOut from Special:NewsletterCreate and S... - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/220758 Change subject: Remove deprecated $wgOut from Special:NewsletterCreate and Special:NewsletterManage .. Remove deprecated $wgOut from Special:NewsletterCreate and Special:NewsletterManage Removed $wgOut to avoid use of depecated globals. Change-Id: I5f305a59363a88e813e9880f06b3b31527a3d767 --- M includes/SpecialNewsletterCreate.php M includes/SpecialNewsletterManage.php 2 files changed, 2 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/58/220758/1 diff --git a/includes/SpecialNewsletterCreate.php b/includes/SpecialNewsletterCreate.php index 931070d..00e9784 100644 --- a/includes/SpecialNewsletterCreate.php +++ b/includes/SpecialNewsletterCreate.php @@ -75,8 +75,6 @@ * @return bool */ static function onSubmitNewsletter( array $formData ) { - global $wgOut; - if ( isset( $formData['mainpage'] ) ) { $page = Title::newFromText( $formData['mainpage'] ); $pageId = $page-getArticleId(); @@ -99,7 +97,7 @@ } catch ( DBQueryError $e ) { return 'A newsletter with the same name already exists. Try again with another name'; } - $wgOut-addWikiMsg( 'newsletter-create-confirmation' ); + RequestContext::getMain()-getOutput()-addWikiMsg( 'newsletter-create-confirmation' ); return true; } diff --git a/includes/SpecialNewsletterManage.php b/includes/SpecialNewsletterManage.php index 0853076..7f92955 100644 --- a/includes/SpecialNewsletterManage.php +++ b/includes/SpecialNewsletterManage.php @@ -70,8 +70,6 @@ * @return bool */ static function onSubmitIssue( $formData ) { - global $wgOut; - if ( isset( $formData['issue-page'] ) isset( $formData['issue-newsletter'] ) ) { $issuePage = Title::newFromText( $formData['issue-page'] ); $pageId = $issuePage-getArticleId(); @@ -99,7 +97,7 @@ 'issue_publisher_id' = $formData['publisher'] ); $dbw-insert( 'nl_issues', $rowData, __METHOD__ ); - $wgOut-addWikiMsg( 'issue-announce-confirmation' ); + RequestContext::getMain()-getOutput()-addWikiMsg( 'issue-announce-confirmation' ); return true; } -- To view, visit https://gerrit.wikimedia.org/r/220758 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f305a59363a88e813e9880f06b3b31527a3d767 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement 'Receiving notifications from subscribed newslette... - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/221041 Change subject: Implement 'Receiving notifications from subscribed newsletters' feature for Newsletter extension .. Implement 'Receiving notifications from subscribed newsletters' feature for Newsletter extension Creates Echo notifications for subscribers of a newsletter whenever it announces a new issue. Also adds a 'Newsletter' entry under 'echosubsciptions' section in Notificatons tab of Special:Preferences. Bug: T101546 Change-Id: Ie8d84c20c7b8cd8b2ba22c471044dc49fc500fb2 --- M Newsletter.hooks.php M Newsletter.php M i18n/en.json A includes/EchoNewsletterFormatter.php M includes/SpecialNewsletterManage.php 5 files changed, 98 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/41/221041/1 diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php index 7ea0d25..64891eb 100755 --- a/Newsletter.hooks.php +++ b/Newsletter.hooks.php @@ -4,6 +4,59 @@ */ class NewsletterHooks { /** +*Function to be called before EchoEvent +* +* @param array $notifications Echo notifications +* @param array $notificationCategories Echo notification categories +* @return bool +*/ + public static function onBeforeCreateEchoEvent( $notifications, $notificationCategories ) { + $notificationCategories['newsletter'] = array( + 'priority' = 3, + 'tooltip' = 'echo-pref-tooltip-newsletter', + ); + $notifications['subscribe-newsletter'] = array( + 'formatter-class' = 'EchoNewsletterFormatter', + 'title-message' = 'notification-newsletter-title', + 'title-params' = array( 'newsletter' ), + 'flyout-message' = 'notification-newsletter-flyout', + 'flyout-params' = array( 'newsletter' ), + + ); + return true; + } + + /** +* Add user to be notified on echo event +* +* @param EchoEvent $event +* @param User[] $users +* @return bool +*/ + public static function onEchoGetDefaultNotifiedUsers( $event, $users ) { + $extra = $event-getExtra(); + $eventType = $event-getType(); + if ( $eventType === 'subscribe-newsletter' ) { + $dbr = wfGetDB( DB_SLAVE ); + $res = $dbr-select( + 'nl_subscriptions', + array( 'subscriber_id' ), + array( 'newsletter_id' = $extra['newsletterId'] ), + __METHOD__, + array() + ); + foreach( $res as $row ) { + $recipient = User::newFromId( $row-subscriber_id ); + $id = $row-subscriber_id; + $users[$id] = $recipient; + } + + } + + return true; + } + + /** * Add tables to Database * * @param DatabaseUpdater $updater diff --git a/Newsletter.php b/Newsletter.php index a3afa1b..87b260b 100755 --- a/Newsletter.php +++ b/Newsletter.php @@ -29,6 +29,7 @@ $wgAutoloadClasses['SpecialNewsletterCreate'] = __DIR__ . '/includes/SpecialNewsletterCreate.php'; $wgAutoloadClasses['SpecialNewsletterManage'] = __DIR__ . '/includes/SpecialNewsletterManage.php'; $wgAutoloadClasses['SpecialNewsletters'] = __DIR__ . '/includes/SpecialNewsletters.php'; +$wgAutoloadClasses['EchoNewsletterFormatter'] = __DIR__ . '/includes/EchoNewsletterFormatter.php'; $wgSpecialPages['NewsletterCreate'] = 'SpecialNewsletterCreate'; $wgSpecialPages['NewsletterManage'] = 'SpecialNewsletterManage'; @@ -36,3 +37,5 @@ //Register Hooks $wgHooks['LoadExtensionSchemaUpdates'][] = 'NewsletterHooks::onLoadExtensionSchemaUpdates'; +$wgHooks['BeforeCreateEchoEvent'][] = 'NewsletterHooks::onBeforeCreateEchoEvent'; +$wgHooks['EchoGetDefaultNotifiedUsers'][] = 'NewsletterHooks::onEchoGetDefaultNotifiedUsers'; diff --git a/i18n/en.json b/i18n/en.json index 6d8d73c..3476cd0 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -20,5 +20,9 @@ subscribe-button-label: Subscribe, unsubscribe-button-label: Unsubscribe, available-newsletters-field-label: Available newsletters, - subscribed-newsletters-field-label: Subscribed newsletters + subscribed-newsletters-field-label: Subscribed newsletters, + echo-category-title-newsletter: Newsletters, + echo-pref-tooltip-newsletter: Notify me when any of the newsletters to which I have subscribed to announces a new issue., +
[MediaWiki-commits] [Gerrit] Fix internal error in user Preferences in Newsletter's Labs ... - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/220313 Change subject: Fix internal error in user Preferences in Newsletter's Labs instance .. Fix internal error in user Preferences in Newsletter's Labs instance Removed a unnecessary line from Newsletter.php to remove the error. Bug: T103588 Change-Id: Ifd54713c60fb76ef83402ad7ab944cf933b23a41 --- M Newsletter.php 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/13/220313/1 diff --git a/Newsletter.php b/Newsletter.php index 03debc2..a3afa1b 100755 --- a/Newsletter.php +++ b/Newsletter.php @@ -35,5 +35,4 @@ $wgSpecialPages['Newsletters'] = 'SpecialNewsletters'; //Register Hooks -$wgHooks['GetPreferences'][] = 'NewsletterHooks::onGetPreferences'; $wgHooks['LoadExtensionSchemaUpdates'][] = 'NewsletterHooks::onLoadExtensionSchemaUpdates'; -- To view, visit https://gerrit.wikimedia.org/r/220313 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd54713c60fb76ef83402ad7ab944cf933b23a41 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement 'Subscribing and unsubscribing' feature for Newsle... - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/219823 Change subject: Implement 'Subscribing and unsubscribing' feature for Newsletter extension .. Implement 'Subscribing and unsubscribing' feature for Newsletter extension What the patch does: 1. Interface for users to subscribe to newsletters 2. Interface for users to unsubscribe from newsletters 3. Adds 'subscriptions' table to database. To be done in future: 1. Show description of newsletter when user selects a newsletter to subscribe. 2. Clean up and improve documentation. Bug: T100492 Change-Id: I0d4a9a450a8e3595f780ed7ab29a3cf551116700 --- M Newsletter.php M i18n/en.json M i18n/qqq.json A includes/SpecialNewsletters.php M sql/newsletter.sql 5 files changed, 203 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/23/219823/1 diff --git a/Newsletter.php b/Newsletter.php index 29e3189..03debc2 100755 --- a/Newsletter.php +++ b/Newsletter.php @@ -28,9 +28,11 @@ $wgAutoloadClasses['NewsletterHooks'] = __DIR__ . '/Newsletter.hooks.php'; $wgAutoloadClasses['SpecialNewsletterCreate'] = __DIR__ . '/includes/SpecialNewsletterCreate.php'; $wgAutoloadClasses['SpecialNewsletterManage'] = __DIR__ . '/includes/SpecialNewsletterManage.php'; +$wgAutoloadClasses['SpecialNewsletters'] = __DIR__ . '/includes/SpecialNewsletters.php'; $wgSpecialPages['NewsletterCreate'] = 'SpecialNewsletterCreate'; $wgSpecialPages['NewsletterManage'] = 'SpecialNewsletterManage'; +$wgSpecialPages['Newsletters'] = 'SpecialNewsletters'; //Register Hooks $wgHooks['GetPreferences'][] = 'NewsletterHooks::onGetPreferences'; diff --git a/i18n/en.json b/i18n/en.json index 852a2e3..5068597 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -11,5 +11,11 @@ createnewsletter-section: Create newsletter, newsletter-create-confirmation: Good job! You just created a new newsletter., issue-announce-confirmation: Good job! You just announced a new issue of your newsletter., - requiredlogintext: Please login to access this page + requiredlogintext: Please login to access this page, + newsletters: Subscribe or Unsubscribe newsletters, + newsletter-subscribe-section: Subscribe newsletters, + newsletter-unsubscribe-section: Unsubscribe newsletters, + newsletter-subscribe-confirmation: You have successfully subscribed to the newsletter., + newsletter-unsubscribe-confirmation: You have successfully unsubscribed from the newsletter. + } diff --git a/i18n/qqq.json b/i18n/qqq.json index 689b14a..3165052 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -11,5 +11,10 @@ createnewsletter-section: Section header of [[Special:NewsletterCreate]], newsletter-create-confirmation: Confirmation message displayed after creation of a newsletter, issue-announce-confirmation: Confirmation message displayed after announcing a new issue, - requiredlogintext: Error message to be shown when the user is not logged in + requiredlogintext: Error message to be shown when the user is not logged in, + newsletters: Name of special page for user to subscribe to or unsubscribe from newsletters, + newsletter-subscribe-section: Section header of HTML form in [[Special:Newsletters]] which allows users to subscribe., + newsletter-unsubscribe-section: Section header of HTML form in [[Special:Newsletters]] which allows users to un-subscribe., + newsletter-subscribe-confirmation: Confirmation message displayed after subscribing to a newsletter, + newsletter-unsubscribe-confirmation: Confirmation message displayed after un-subscribing from a newsletter } \ No newline at end of file diff --git a/includes/SpecialNewsletters.php b/includes/SpecialNewsletters.php new file mode 100644 index 000..a882247 --- /dev/null +++ b/includes/SpecialNewsletters.php @@ -0,0 +1,180 @@ +?php +/** + * Special page for subscribing/un-subscribing a newsletter + * + */ +class SpecialNewsletters extends SpecialPage { + public function __construct() { + parent::__construct('Newsletters'); + } + public function execute( $par ) { + $this-setHeaders(); + $this-requireLogin(); + $subscribeNewsletterArray = $this-getSubscribeFormFields(); + + # Create HTML form + $subscribeNewsletterForm = new HTMLForm( $subscribeNewsletterArray, $this-getContext(), 'subscribenewsletterform' ); + $subscribeNewsletterForm-setSubmitCallback( array( 'SpecialNewsletters', 'onSubscribe' ) ); + $subscribeNewsletterForm-setWrapperLegendMsg( 'newsletter-subscribe-section' ); + $subscribeNewsletterForm-setSubmitText( 'Subscribe' ); + $subscribeNewsletterForm-show(); + + $userSubscriptionsArray =
[MediaWiki-commits] [Gerrit] Add confirmation message for creation of a newsletter - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/219608 Change subject: Add confirmation message for creation of a newsletter .. Add confirmation message for creation of a newsletter Confirmation message to be displayed after creation of a newsletter added Bug: T100125 Change-Id: I0a34a654f3ec2d4a45b9524d279124ba26e27ac1 --- M .gitignore M .gitreview M i18n/en.json M i18n/qqq.json M includes/SpecialNewsletterCreate.php M includes/SpecialNewsletterManage.php M sql/newsletter.sql 7 files changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/08/219608/1 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.gitreview b/.gitreview old mode 100644 new mode 100755 diff --git a/i18n/en.json b/i18n/en.json index c0eaba5..b2d2a9c 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -8,5 +8,6 @@ newslettercreate: Create newsletters, newslettermanage: Manage newsletters, announceissue-section: Announce new issue, - createnewsletter-section: Create newsletter + createnewsletter-section: Create newsletter, + newsletter-create-confirmation: Good job! You just created a new newsletter. } diff --git a/i18n/qqq.json b/i18n/qqq.json old mode 100644 new mode 100755 index 99e6bc5..fa7a0b9 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -8,5 +8,6 @@ newslettercreate: Name of special page which creates newsletters as seen in URLs and links, newslettermanage: Name of special page which announces issues as seen in URLs and links, announceissue-section: Section header of [[Special:NewsletterManage]], - createnewsletter-section: Section header of [[Special:NewsletterCreate]] + createnewsletter-section: Section header of [[Special:NewsletterCreate]], + newsletter-create-confirmation: Confirmation message shown after creation of a new newsletter. } \ No newline at end of file diff --git a/includes/SpecialNewsletterCreate.php b/includes/SpecialNewsletterCreate.php old mode 100644 new mode 100755 index 84f6ebb..18db1e7 --- a/includes/SpecialNewsletterCreate.php +++ b/includes/SpecialNewsletterCreate.php @@ -10,6 +10,9 @@ public function execute( $par ) { $this-setHeaders(); + $output = $this-getOutput(); + + $this-requireLogin(); $createNewsletterArray = $this-getCreateFormFields(); # Create HTML forms @@ -19,6 +22,7 @@ $createNewsletterForm-setWrapperLegendMsg( 'createnewsletter-section' ); # Show HTML forms $createNewsletterForm-show(); + $output-returnToMain(); } /** @@ -70,12 +74,14 @@ * @param array $formData The data entered by user in the form * @return bool */ - public function onSubmitNewsletter( array $formData ) { + static function onSubmitNewsletter( array $formData ) { + global $wgOut; + if ( isset( $formData['mainpage'] ) ) { $page = Title::newFromText( $formData['mainpage'] ); $pageId = $page-getArticleId(); } else { - return 'Unknown Newsletter main page entered. Please try again'; + return 'Unknown newsletter main page entered. Please try again'; } if ( isset( $formData['name'] ) isset( $formData['description'] ) ( $pageId !== 0 ) isset( $formData['mainpage'] ) isset( $formData['frequency'] ) isset( $formData['publisher'] ) ) { @@ -89,10 +95,11 @@ 'nl_publisher_id' = $formData['publisher'] ); $dbw-insert( 'nl_newsletters', $rowData, __METHOD__ ); + $wgOut-addWikiMsg( 'newsletter-create-confirmation' ); return true; } - return 'The Newsletter main page cannot be found. Please try again'; + return 'The newsletter main page cannot be found. Please try again'; } } \ No newline at end of file diff --git a/includes/SpecialNewsletterManage.php b/includes/SpecialNewsletterManage.php old mode 100644 new mode 100755 diff --git a/sql/newsletter.sql b/sql/newsletter.sql old mode 100644 new mode 100755 -- To view, visit https://gerrit.wikimedia.org/r/219608 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a34a654f3ec2d4a45b9524d279124ba26e27ac1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list
[MediaWiki-commits] [Gerrit] Add confirmation message for creation of newsletters and ann... - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/219609 Change subject: Add confirmation message for creation of newsletters and announcing of issues .. Add confirmation message for creation of newsletters and announcing of issues Confirmation message to be displayed after creation of a newsletter and announcing of issues added. Bug: T100125 Change-Id: I8a5dcd57516cce6ec56f8d947424f9640c9614d5 --- M i18n/en.json M i18n/qqq.json M includes/SpecialNewsletterCreate.php M includes/SpecialNewsletterManage.php 4 files changed, 19 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/09/219609/1 diff --git a/i18n/en.json b/i18n/en.json index c0eaba5..a46e1bf 100755 --- a/i18n/en.json +++ b/i18n/en.json @@ -8,5 +8,7 @@ newslettercreate: Create newsletters, newslettermanage: Manage newsletters, announceissue-section: Announce new issue, - createnewsletter-section: Create newsletter + createnewsletter-section: Create newsletter, + issue-announce-confirmation: Good job! You just announced a new issue of your newsletter., + requiredlogintext: Please login to access this page } diff --git a/i18n/qqq.json b/i18n/qqq.json index 99e6bc5..ba35563 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -8,5 +8,7 @@ newslettercreate: Name of special page which creates newsletters as seen in URLs and links, newslettermanage: Name of special page which announces issues as seen in URLs and links, announceissue-section: Section header of [[Special:NewsletterManage]], - createnewsletter-section: Section header of [[Special:NewsletterCreate]] + createnewsletter-section: Section header of [[Special:NewsletterCreate]], + issue-announce-confirmation: Confirmation message displayed after announcing a new issue, + requiredlogintext: Error message to be shown when the user is not logged in } \ No newline at end of file diff --git a/includes/SpecialNewsletterCreate.php b/includes/SpecialNewsletterCreate.php index 84f6ebb..5d9e081 100644 --- a/includes/SpecialNewsletterCreate.php +++ b/includes/SpecialNewsletterCreate.php @@ -10,6 +10,8 @@ public function execute( $par ) { $this-setHeaders(); + $output = $this-getOutput('requiredlogintext'); + $this-requireLogin(); $createNewsletterArray = $this-getCreateFormFields(); # Create HTML forms @@ -19,6 +21,7 @@ $createNewsletterForm-setWrapperLegendMsg( 'createnewsletter-section' ); # Show HTML forms $createNewsletterForm-show(); + $output-returnToMain(); } /** @@ -70,7 +73,9 @@ * @param array $formData The data entered by user in the form * @return bool */ - public function onSubmitNewsletter( array $formData ) { + static function onSubmitNewsletter( array $formData ) { + global $wgOut; + if ( isset( $formData['mainpage'] ) ) { $page = Title::newFromText( $formData['mainpage'] ); $pageId = $page-getArticleId(); @@ -89,6 +94,7 @@ 'nl_publisher_id' = $formData['publisher'] ); $dbw-insert( 'nl_newsletters', $rowData, __METHOD__ ); + $wgOut-addWikiMsg( 'newsletter-create-confirmation' ); return true; } diff --git a/includes/SpecialNewsletterManage.php b/includes/SpecialNewsletterManage.php index f583bba..a980338 100644 --- a/includes/SpecialNewsletterManage.php +++ b/includes/SpecialNewsletterManage.php @@ -10,6 +10,8 @@ public function execute( $par ) { $this-setHeaders(); + $output = $this-getOutput(); + $this-requireLogin('requiredlogintext'); $announceIssueArray = $this-getAnnounceFormFields(); # Create HTML forms @@ -20,6 +22,7 @@ # Show HTML forms $announceIssueForm-show(); + $output-returnToMain(); } /** @@ -67,6 +70,8 @@ * @return bool */ static function onSubmitIssue( $formData ) { + global $wgOut; + if ( isset( $formData['issue-page'] ) isset( $formData['issue-newsletter'] ) ) { $issuePage = Title::newFromText( $formData['issue-page'] ); $pageId = $issuePage-getArticleId(); @@ -94,6 +99,7 @@ 'issue_publisher_id' = $formData['publisher'] ); $dbw-insert( 'nl_issues', $rowData, __METHOD__ ); + $wgOut-addWikiMsg(
[MediaWiki-commits] [Gerrit] Add error message for duplicate newsletters - change (mediawiki...Newsletter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/219611 Change subject: Add error message for duplicate newsletters .. Add error message for duplicate newsletters Added error messages to be displayed when a duplicate newsletter is created. Also, added a new option for frequency field in NewsletterCreate page and extended the word limit of 'other' option. Bug: T100125 Change-Id: Ia159aa7b18905bde6ebb992daca7f8836372f780 --- M includes/SpecialNewsletterCreate.php M sql/newsletter.sql 2 files changed, 9 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/11/219611/1 diff --git a/includes/SpecialNewsletterCreate.php b/includes/SpecialNewsletterCreate.php index 1cb1aae..931070d 100644 --- a/includes/SpecialNewsletterCreate.php +++ b/includes/SpecialNewsletterCreate.php @@ -55,9 +55,10 @@ 'options' = array( 'weekly' = 'weekly', 'monthly' = 'monthly', + 'quarterly' = 'quarterly' ), 'size' = 18, # size of 'other' field - 'maxlength' = 10 + 'maxlength' = 50 ), 'publisher' = array( 'type' = 'hidden', @@ -93,7 +94,11 @@ 'nl_frequency' = $formData['frequency'], 'nl_publisher_id' = $formData['publisher'] ); - $dbw-insert( 'nl_newsletters', $rowData, __METHOD__ ); + try { + $dbw-insert( 'nl_newsletters', $rowData, __METHOD__ ); + } catch ( DBQueryError $e ) { + return 'A newsletter with the same name already exists. Try again with another name'; + } $wgOut-addWikiMsg( 'newsletter-create-confirmation' ); return true; diff --git a/sql/newsletter.sql b/sql/newsletter.sql index 19b5809..09572e0 100644 --- a/sql/newsletter.sql +++ b/sql/newsletter.sql @@ -3,10 +3,10 @@ CREATE TABLE /*_*/nl_newsletters( --Primary key nl_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, - nl_name VARCHAR (50) NOT NULL, + nl_name VARCHAR (50) NOT NULL UNIQUE, nl_desc VARCHAR (256), nl_main_page_id int NOT NULL, - nl_frequency VARCHAR (10) NOT NULL, + nl_frequency VARCHAR (50) NOT NULL, nl_publisher_id int NOT NULL )/*$wgDBTableOptions*/; -- To view, visit https://gerrit.wikimedia.org/r/219611 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia159aa7b18905bde6ebb992daca7f8836372f780 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Trigger Echo notification when registered email address beco... - change (mediawiki...BounceHandler)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/202735 Change subject: Trigger Echo notification when registered email address becomes unverified .. Trigger Echo notification when registered email address becomes unverified User is alerted using a Echo notification when his/her registered email address becomes unverified. As of now a user finds out about the unverified email address only when he navigates to Special:Preferences page. Bug: T94436 Change-Id: I43de1775fb2199c2d96c1bbe2cabd3fccecd7498 --- M BounceHandler.php M BounceHandlerHooks.php M i18n/en.json M i18n/qqq.json M includes/BounceHandlerActions.php 5 files changed, 51 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BounceHandler refs/changes/35/202735/1 diff --git a/BounceHandler.php b/BounceHandler.php index e7b9d39..b8d1544 100644 --- a/BounceHandler.php +++ b/BounceHandler.php @@ -46,6 +46,8 @@ //Register Hooks $wgHooks['UserMailerChangeReturnPath'][] = 'BounceHandlerHooks::onVERPAddressGenerate'; $wgHooks['UnitTestsList'][] = 'BounceHandlerHooks::registerUnitTests'; +$wgHooks['BeforeCreateEchoEvent'][] = 'BounceHandlerHooks::onBeforeCreateEchoEvent'; +$wgHooks['EchoGetDefaultNotifiedUsers'][] = 'BounceHandlerHooks::onEchoGetDefaultNotifiedUsers'; /*Messages Files */ $wgMessagesDirs['BounceHandler'] = $dir. '/i18n'; diff --git a/BounceHandlerHooks.php b/BounceHandlerHooks.php index b1f88c8..fa406e0 100644 --- a/BounceHandlerHooks.php +++ b/BounceHandlerHooks.php @@ -94,4 +94,40 @@ return true; } + + /** +* Add BounceHandler events to Echo +* @param $notifications array of Echo notifications +* @return bool +*/ + public static function onBeforeCreateEchoEvent( $notifications ) { + $notifications['unsubscribe-bouncehandler'] = array( + 'category' = 'system', + 'title-message' = 'notification-bouncehandler', + 'flyout-message' = 'notification-bouncehandler-flyout' + ); + + return true; + } + + /** +* Add user to be notified on echo event +* @param $event EchoEvent +* @param $users array +* @return bool +*/ + public static function onEchoGetDefaultNotifiedUsers( $event, $users ) { + switch ( $event-getType() ) { + case 'unsubscribe-bouncehandler': + $extra = $event-getExtra(); + if ( !$extra || !isset( $extra['failed-user-id'] ) ) { + break; + } + $recipientId = $extra['failed-user-id']; + $recipient = User::newFromId( $recipientId ); + $users[$recipientId] = $recipient; + break; + } + return true; + } } diff --git a/i18n/en.json b/i18n/en.json index 2c3c0d2..97d43ac 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -8,5 +8,7 @@ bouncehandler-notify_subject: Returning temporary bounce, apihelp-bouncehandler-example-1: Receive a bounce email for processing with the content \This is a test email\., apihelp-bouncehandler-description: Receive a bounce email and process it to handle the failing recipient., - apihelp-bouncehandler-param-email: The bounced email. + apihelp-bouncehandler-param-email: The bounced email., + notification-bouncehandler: Your registered email address is no longer valid., + notification-bouncehandler-flyout: Your registered email address is no longer valid. Go to [[Special:Preferences]] to set another email address. } \ No newline at end of file diff --git a/i18n/qqq.json b/i18n/qqq.json index 3e79b9e..a89e5fc 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -8,5 +8,7 @@ bouncehandler-notify_subject: Subject of notification email sent to wiki administrators on a failed to parse bounce, apihelp-bouncehandler-example-1: {{doc-apihelp-example|bouncehandler}}, apihelp-bouncehandler-description: {{doc-apihelp-description|bouncehandler}}, - apihelp-bouncehandler-param-email: {{doc-apihelp-param|bouncehandler|email}} + apihelp-bouncehandler-param-email: {{doc-apihelp-param|bouncehandler|email}}, + notification-bouncehandler: {{Title message of Echo notification to notify the user of his invalid email address}}, + notification-bouncehandler-flyout: {{Flyout message of Echo notification to notify the user of his invalid email address}} } diff --git a/includes/BounceHandlerActions.php b/includes/BounceHandlerActions.php index cab659c..92fa202 100644 --- a/includes/BounceHandlerActions.php +++
[MediaWiki-commits] [Gerrit] Change labels of paging links in Category page - change (mediawiki/core)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/199967 Change subject: Change labels of paging links in Category page .. Change labels of paging links in Category page Links 'next 200' and 'previous 200' don't always list 200 items. Hence changed the labels to 'previous page' and 'next page'. Bug: T59414 Change-Id: Id5c30e92227e863acdeb3cadc132200ef2bc48c8 --- M includes/CategoryViewer.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/67/199967/1 diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 48436c5..87a7399 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -603,7 +603,7 @@ * @return string HTML */ private function pagingLinks( $first, $last, $type = '' ) { - $prevLink = $this-msg( 'prevn' )-numParams( $this-limit )-escaped(); + $prevLink = $this-msg( 'imgmultipageprev' )-text(); if ( $first != '' ) { $prevQuery = $this-query; @@ -617,7 +617,7 @@ ); } - $nextLink = $this-msg( 'nextn' )-numParams( $this-limit )-escaped(); + $nextLink = $this-msg( 'imgmultipagenext' )-text(); if ( $last != '' ) { $lastQuery = $this-query; -- To view, visit https://gerrit.wikimedia.org/r/199967 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5c30e92227e863acdeb3cadc132200ef2bc48c8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Display warning message when invalid username entered - change (mediawiki/core)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/197923 Change subject: Display warning message when invalid username entered .. Display warning message when invalid username entered A warning message is to be displayed when an invalid username is entered in Special:ListFiles. This patch does the same. To do: After you enter a valid username, if some string is appended to make the username invalid and then submitted, the warning message fails to display. Bug: T72784 Change-Id: I35fef559db812d347af7a313778e25f775e1bfb6 --- M includes/specials/SpecialListfiles.php M languages/i18n/en.json 2 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/23/197923/1 diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index d4b45fb..b2e7674 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -92,6 +92,15 @@ if ( !is_null( $nt ) ) { $this-mUserName = $nt-getText(); } + if ( !User::isValidUserName( $userName ) ) { + $this-getOutput()-wrapWikiMsg( + div class=\mw-userpage-userdoesnotexist error\\n\$1\n/div, + array( + 'listfiles-userdoesnotexist', + wfEscapeWikiText( $userName ), + ) + ); + } } if ( $search !== '' !$this-getConfig()-get( 'MiserMode' ) ) { diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 56bfbbc..fa4de57 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1447,6 +1447,7 @@ listfiles-delete: delete, listfiles-summary: This special page shows all uploaded files., listfiles_search_for: Search for media name:, + listfiles-userdoesnotexist: User account \$1\ is not registered., imgfile: file, listfiles: File list, listfiles_thumb: Thumbnail, -- To view, visit https://gerrit.wikimedia.org/r/197923 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I35fef559db812d347af7a313778e25f775e1bfb6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove table header from Special:Tags when there are no tags - change (mediawiki/core)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/197119 Change subject: Remove table header from Special:Tags when there are no tags .. Remove table header from Special:Tags when there are no tags The table header shows up even when there are no tags to be listed in the table. This patch fixes the same. Bug: T92728 Change-Id: I22d2c0435bc365f65354cea604b1c87905c769f8 --- M includes/specials/SpecialTags.php 1 file changed, 31 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/19/197119/1 diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index ff263b6..4fc1b06 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -114,35 +114,40 @@ $showActions = $user-isAllowed( 'managechangetags' ); // Write the headers - $html = Xml::tags( 'tr', null, Xml::tags( 'th', null, $this-msg( 'tags-tag' )-parse() ) . - Xml::tags( 'th', null, $this-msg( 'tags-display-header' )-parse() ) . - Xml::tags( 'th', null, $this-msg( 'tags-description-header' )-parse() ) . - Xml::tags( 'th', null, $this-msg( 'tags-source-header' )-parse() ) . - Xml::tags( 'th', null, $this-msg( 'tags-active-header' )-parse() ) . - Xml::tags( 'th', null, $this-msg( 'tags-hitcount-header' )-parse() ) . - ( $showActions ? - Xml::tags( 'th', array( 'class' = 'unsortable' ), - $this-msg( 'tags-actions-header' )-parse() ) : - '' ) - ); + $tagCount = array_fill_keys( ChangeTags::listExplicitlyDefinedTags(), true ); - // Used in #doTagRow() - $this-explicitlyDefinedTags = array_fill_keys( - ChangeTags::listExplicitlyDefinedTags(), true ); - $this-extensionDefinedTags = array_fill_keys( - ChangeTags::listExtensionDefinedTags(), true ); - $this-extensionActivatedTags = array_fill_keys( - ChangeTags::listExtensionActivatedTags(), true ); + //Show header only if there exists atleast one tag + if ( $tagCount ) { + $html = Xml::tags( 'tr', null, Xml::tags( 'th', null, $this-msg( 'tags-tag' )-parse() ) . + Xml::tags( 'th', null, $this-msg( 'tags-display-header' )-parse() ) . + Xml::tags( 'th', null, $this-msg( 'tags-description-header' )-parse() ) . + Xml::tags( 'th', null, $this-msg( 'tags-source-header' )-parse() ) . + Xml::tags( 'th', null, $this-msg( 'tags-active-header' )-parse() ) . + Xml::tags( 'th', null, $this-msg( 'tags-hitcount-header' )-parse() ) . + ( $showActions ? + Xml::tags( 'th', array( 'class' = 'unsortable' ), + $this-msg( 'tags-actions-header' )-parse() ) : + '' ) + ); - foreach ( ChangeTags::tagUsageStatistics() as $tag = $hitcount ) { - $html .= $this-doTagRow( $tag, $hitcount, $showActions ); + // Used in #doTagRow() + $this-explicitlyDefinedTags = array_fill_keys( + ChangeTags::listExplicitlyDefinedTags(), true ); + $this-extensionDefinedTags = array_fill_keys( + ChangeTags::listExtensionDefinedTags(), true ); + $this-extensionActivatedTags = array_fill_keys( + ChangeTags::listExtensionActivatedTags(), true ); + + foreach ( ChangeTags::tagUsageStatistics() as $tag = $hitcount ) { + $html .= $this-doTagRow( $tag, $hitcount, $showActions ); + } + + $out-addHTML( Xml::tags( + 'table', + array( 'class' = 'mw-datatable sortable mw-tags-table' ), + $html + ) ); } - - $out-addHTML( Xml::tags( - 'table', - array( 'class' = 'mw-datatable sortable mw-tags-table' ), - $html - ) ); } function doTagRow( $tag, $hitcount, $showActions ) { -- To view, visit https://gerrit.wikimedia.org/r/197119 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType:
[MediaWiki-commits] [Gerrit] Use blue links on Echo's notification footer - change (mediawiki...Echo)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/196593 Change subject: Use blue links on Echo's notification footer .. Use blue links on Echo's notification footer Links on the notification footer, View edit / View changes, needs to be blue instead of grey to be consistent with Mediawiki interface. The link turns blue upon hovering, just the way it is currently set for other links on notifications like the page title. Bug: T57367 Change-Id: Ibaaff52b9d4bdfc5beca442e10734dd5cf8886d7 --- M modules/overlay/ext.echo.overlay.js 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/93/196593/1 diff --git a/modules/overlay/ext.echo.overlay.js b/modules/overlay/ext.echo.overlay.js index dfc14d2..a285870 100644 --- a/modules/overlay/ext.echo.overlay.js +++ b/modules/overlay/ext.echo.overlay.js @@ -142,6 +142,14 @@ $( this ).find( '.mw-echo-title a' ).addClass( 'mw-echo-grey-link' ); } ); + $li.hover( + function() { + $( this ).find( '.mw-echo-title a, .mw-echo-notification-footer a' ).removeClass( 'mw-echo-grey-link' ); + }, + function() { + $( this ).find( '.mw-echo-title a, .mw-echo-notification-footer a' ).addClass( 'mw-echo-grey-link' ); + } + ); // If there is a primary link, make the entire notification clickable. // Yes, it is possible to nest a tags via DOM manipulation, // and it works like one would expect. -- To view, visit https://gerrit.wikimedia.org/r/196593 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibaaff52b9d4bdfc5beca442e10734dd5cf8886d7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use mediawiki.ui button styles for submission buttons - change (mediawiki...MassMessage)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/196218 Change subject: Use mediawiki.ui button styles for submission buttons .. Use mediawiki.ui button styles for submission buttons mediawiki.ui button styles were used to get better looking buttons Bug: T62725 Change-Id: I12a121f46c7d46fc6854c13ecb4defeed8373865 --- M includes/SpecialMassMessage.php M modules/ext.MassMessage.special.css 2 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage refs/changes/18/196218/1 diff --git a/includes/SpecialMassMessage.php b/includes/SpecialMassMessage.php index 08d084e..4a6560d 100644 --- a/includes/SpecialMassMessage.php +++ b/includes/SpecialMassMessage.php @@ -145,6 +145,7 @@ $m['message']['help'] = EditPage::getCopyrightWarning( $this-getPageTitle( false ), 'parse' ); $m['submit-button'] = array( 'id' = 'mw-massmessage-form-submit-button', +'cssclass' = 'mw-ui-button mw-ui-constructive', 'name' = 'submit-button', 'type' = 'submit', 'tabindex' = '4', @@ -154,6 +155,7 @@ $m['preview-button'] = array( 'id' = 'mw-massmessage-form-preview-button', +'cssclass' = 'mw-ui-button mw-ui-progressive', 'name' = 'preview-button', 'type' = 'submit', 'tabindex' = '5', diff --git a/modules/ext.MassMessage.special.css b/modules/ext.MassMessage.special.css index 0a7dc2b..e7f084d 100644 --- a/modules/ext.MassMessage.special.css +++ b/modules/ext.MassMessage.special.css @@ -4,5 +4,7 @@ #mw-massmessage-form .mw-htmlform-field-HTMLSubmitField, #mw-massmessage-form .mw-htmlform-field-HTMLSubmitField .mw-label, #mw-massmessage-form .mw-htmlform-field-HTMLSubmitField .mw-input { -display: inline; +display: inline-table !important; +margin-right: 10px; +padding: 0px; } -- To view, visit https://gerrit.wikimedia.org/r/196218 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I12a121f46c7d46fc6854c13ecb4defeed8373865 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MassMessage Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Moved 'Edit review' user preferences into the 'Recent change... - change (mediawiki...FlaggedRevs)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/125996 Change subject: Moved 'Edit review' user preferences into the 'Recent changes' tab .. Moved 'Edit review' user preferences into the 'Recent changes' tab As 'Edit review' preferences control how latest revisions are shown, 'Recent changes' tab seems to be the right one to move it to. Bug: 63576 Change-Id: I2c2b08646da6bde2c7b62a9fc4d42cc610d3e690 --- M frontend/FlaggedRevsUI.hooks.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FlaggedRevs refs/changes/96/125996/1 diff --git a/frontend/FlaggedRevsUI.hooks.php b/frontend/FlaggedRevsUI.hooks.php index e940502..d8be90b 100644 --- a/frontend/FlaggedRevsUI.hooks.php +++ b/frontend/FlaggedRevsUI.hooks.php @@ -95,7 +95,7 @@ $preferences['flaggedrevssimpleui'] = array( 'type' = 'radio', - 'section' = 'flaggedrevs/flaggedrevs-ui', + 'section' = 'rc/flaggedrevs-ui', 'label-message' = 'flaggedrevs-pref-UI', 'options' = array( wfMessage( 'flaggedrevs-pref-UI-0' )-text() = 0, @@ -106,7 +106,7 @@ $preferences['flaggedrevsstable'] = array( 'type' = 'radio', - 'section' = 'flaggedrevs/flaggedrevs-ui', + 'section' = 'rc/flaggedrevs-ui', 'label-message' = 'flaggedrevs-prefs-stable', 'options' = array( wfMessage( 'flaggedrevs-pref-stable-0' )-text() = FR_SHOW_STABLE_DEFAULT, @@ -134,7 +134,7 @@ $preferences['flaggedrevsviewdiffs'] = array( 'type' = 'toggle', - 'section' = 'flaggedrevs/flaggedrevs-ui', + 'section' = 'rc/flaggedrevs-ui', 'label-message' = 'flaggedrevs-prefs-viewdiffs', ); } -- To view, visit https://gerrit.wikimedia.org/r/125996 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2c2b08646da6bde2c7b62a9fc4d42cc610d3e690 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/FlaggedRevs Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added keyboard shortcut (ESC key) to close notifications flyout - change (mediawiki...Echo)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/123638 Change subject: Added keyboard shortcut (ESC key) to close notifications flyout .. Added keyboard shortcut (ESC key) to close notifications flyout Notification flyout is closed when ESC key is pressed Bug: 53588 Change-Id: I220affcc383c943ca9d977bc4014d45904ce06c2 --- M modules/overlay/ext.echo.overlay.js 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/38/123638/1 diff --git a/modules/overlay/ext.echo.overlay.js b/modules/overlay/ext.echo.overlay.js index d29ca32..07a2bb5 100644 --- a/modules/overlay/ext.echo.overlay.js +++ b/modules/overlay/ext.echo.overlay.js @@ -337,5 +337,13 @@ mw.echo.overlay.removeOverlay(); } } ); + + // Closes the notifications overlay when ESC key pressed + $( document ).bind( 'keydown', function ( e ) { + if ( e.which == 27 ) { + mw.echo.overlay.removeOverlay(); + } + } ); + } ); } )( jQuery, mediaWiki ); -- To view, visit https://gerrit.wikimedia.org/r/123638 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I220affcc383c943ca9d977bc4014d45904ce06c2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added hook for adding AbuseFilter log link - change (mediawiki...AbuseFilter)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/120809 Change subject: Added hook for adding AbuseFilter log link .. Added hook for adding AbuseFilter log link When hook is called in Revision history page, a AbuseFilter log link is added to subtitle of the page. Bug: 26934 Change-Id: Ib89c48f2b8f3121ead184844844acee436e2fdd6 --- M AbuseFilter.hooks.php M AbuseFilter.php 2 files changed, 19 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter refs/changes/09/120809/1 diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php index fc17d4d..d9305a4 100644 --- a/AbuseFilter.hooks.php +++ b/AbuseFilter.hooks.php @@ -563,7 +563,24 @@ } return true; } - + + /** +* @param $links +* @return bool +*/ + public static function onHistoryPageLinks( $links ) { + global $wgUser; + if ( $wgUser-isAllowed( 'abusefilter-log' ) ) { + $links = Linker::link( + SpecialPage::getTitleFor( 'AbuseLog' ), + wfMessage( 'abusefilter-log-linkoncontribs' )-text(), + array( 'title' = wfMessage( 'abusefilter-log-linkoncontribs-text' )-parse() ), + array( 'wpSearchUser' = $wgUser-getName() ) + ); + } + return true; + } + /** * Handler for the UploadVerifyFile hook * diff --git a/AbuseFilter.php b/AbuseFilter.php index d517e26..eb3d0ce 100644 --- a/AbuseFilter.php +++ b/AbuseFilter.php @@ -89,6 +89,7 @@ $wgHooks['ArticleSaveComplete'][] = 'AbuseFilterHooks::onArticleSaveComplete'; $wgHooks['APIEditBeforeSave'][] = 'AbuseFilterHooks::onAPIEditBeforeSave'; $wgHooks['UnitTestsList'][] = 'AbuseFilterHooks::onUnitTestsList'; +$wgHooks['HistoryPageAddLink'][] = 'AbuseFilterHooks::onHistoryPageLinks'; $wgAvailableRights[] = 'abusefilter-modify'; $wgAvailableRights[] = 'abusefilter-log-detail'; -- To view, visit https://gerrit.wikimedia.org/r/120809 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib89c48f2b8f3121ead184844844acee436e2fdd6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AbuseFilter Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added a AbuseFilter log link using a hook to Revision histor... - change (mediawiki/core)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/120811 Change subject: Added a AbuseFilter log link using a hook to Revision history page .. Added a AbuseFilter log link using a hook to Revision history page AbuseFilter log link was added to subtitle of Revision history page Works after adding the AbuseFilter hook on the change: https://gerrit.wikimedia.org/r/120809 Bug: 26934 Change-Id: I2e0e9e92d3fc303135b0eb9acf06b5fd120178a5 --- M docs/hooks.txt M includes/actions/HistoryAction.php 2 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/11/120811/1 diff --git a/docs/hooks.txt b/docs/hooks.txt index e4037e6..78dd2cf 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1325,6 +1325,9 @@ $rev: Revision object $links: Array of HTML links +'HistoryPageAddLink': Called to add a link to Revision history page subtitle. +$links: Array to which link will be stored + 'ImageBeforeProduceHTML': Called before producing the HTML created by a wiki image insertion. You can skip the default logic entirely by returning false, or just modify a few things using call-by-reference. diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 8e800f9..27e5220 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -58,12 +58,17 @@ protected function getDescription() { // Creation of a subtitle link pointing to [[Special:Log]] - return Linker::linkKnown( + $links = Linker::link( SpecialPage::getTitleFor( 'Log' ), $this-msg( 'viewpagelogs' )-escaped(), array(), array( 'page' = $this-getTitle()-getPrefixedText() ) ); + //Adding AbuseFilter link + $currlink = $links; + $links = null; + wfRunHooks( 'HistoryPageAddLink', array( $links ) ); + return $currlink. .$links; } /** -- To view, visit https://gerrit.wikimedia.org/r/120811 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e0e9e92d3fc303135b0eb9acf06b5fd120178a5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added tabindex to MassMessage form elements - change (mediawiki...MassMessage)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/119929 Change subject: Added tabindex to MassMessage form elements .. Added tabindex to MassMessage form elements When tabbing through the form, the Copyright text comes between the subject box and buttons. Hence tabindex is set to solve the same. Bug: 60726 Change-Id: I73bbe799f61497c0c6bf4dd9d4798ed07ab39e85 --- M SpecialMassMessage.php 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage refs/changes/29/119929/1 diff --git a/SpecialMassMessage.php b/SpecialMassMessage.php index 63b1c3d..80081e0 100644 --- a/SpecialMassMessage.php +++ b/SpecialMassMessage.php @@ -115,6 +115,7 @@ 'id' = 'mw-massmessage-form-spamlist', 'name' = 'spamlist', 'type' = 'text', + 'tabindex' = '1', 'label-message' = 'massmessage-form-spamlist', 'default' = $request-getText( 'spamlist' ) ); @@ -123,6 +124,7 @@ 'id' = 'mw-massmessage-form-subject', 'name' = 'subject', 'type' = 'text', + 'tabindex' = '2', 'label-message' = 'massmessage-form-subject', 'default' = $request-getText( 'subject' ), 'maxlength' = 240 @@ -133,6 +135,7 @@ 'id' = 'mw-massmessage-form-message', 'name' = 'message', 'type' = 'textarea', + 'tabindex' = '3', 'label-message' = 'massmessage-form-message', 'default' = $request-getText( 'message' ) ); @@ -144,6 +147,7 @@ 'id' = 'mw-massmessage-form-submit-button', 'name' = 'submit-button', 'type' = 'submit', + 'tabindex' = '4', 'default' = $this-msg( 'massmessage-form-submit' )-text() ); } @@ -152,6 +156,7 @@ 'id' = 'mw-massmessage-form-preview-button', 'name' = 'preview-button', 'type' = 'submit', + 'tabindex' = '5', 'default' = $this-msg( 'massmessage-form-preview' )-text() ); -- To view, visit https://gerrit.wikimedia.org/r/119929 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73bbe799f61497c0c6bf4dd9d4798ed07ab39e85 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MassMessage Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added a space between information and discussion links - change (mediawiki...BetaFeatures)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/115911 Change subject: Added a space between information and discussion links .. Added a space between information and discussion links Information and discussion links have no space between them when js disabled on browsers. Hence added a space. Bug: 61471 Change-Id: I439360bb990b7b97b01420475c7632ac20f4fffd --- M includes/HTMLFeatureField.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BetaFeatures refs/changes/11/115911/1 diff --git a/includes/HTMLFeatureField.php b/includes/HTMLFeatureField.php index b1e0008..54b2d6a 100644 --- a/includes/HTMLFeatureField.php +++ b/includes/HTMLFeatureField.php @@ -82,6 +82,7 @@ 'href' = $infoLink, 'class' = 'mw-ui-feature-info-link', ), $this-mParent-msg( 'mw-ui-feature-info' )-escaped() ); + $html .=' '; } if ( isset( $discussionLink ) ) { -- To view, visit https://gerrit.wikimedia.org/r/115911 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I439360bb990b7b97b01420475c7632ac20f4fffd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BetaFeatures Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Removed deprecated $wgDisabledActions - change (mediawiki/core)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/109891 Change subject: Removed deprecated $wgDisabledActions .. Removed deprecated $wgDisabledActions $wgDisabledActions is deprecated since 1.18 and is hardly used anywhere. It occurs once in includes/DefaultSettings.php where it is initialized to an empty array. And in Setup.php, for every action in $wgDisabledActions $wgActions is set to false. Bug: 60460 Change-Id: I5fab95c76b2742b12c1f397d27898148625a9959 --- M includes/DefaultSettings.php M includes/Setup.php 2 files changed, 0 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/91/109891/1 diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 9264947..c45e4dd 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -6471,14 +6471,6 @@ 'watch' = true, ); -/** - * Array of disabled article actions, e.g. view, edit, delete, etc. - * @deprecated since 1.18; just set $wgActions['action'] = false instead - */ -$wgDisabledActions = array(); - -/** @} */ # end actions } - /*//** * @name Robot (search engine crawler) policy * See also $wgNoFollowLinks. diff --git a/includes/Setup.php b/includes/Setup.php index d1269ad..150f4aa 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -341,11 +341,6 @@ $wgHiddenPrefs[] = 'enotifminoredits'; } -# $wgDisabledActions is deprecated as of 1.18 -foreach ( $wgDisabledActions as $action ) { - $wgActions[$action] = false; -} - # We always output HTML5 since 1.22, overriding these is no longer supported # we set them here for extensions that depend on its value. $wgHtml5 = true; -- To view, visit https://gerrit.wikimedia.org/r/109891 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fab95c76b2742b12c1f397d27898148625a9959 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added missing message to OpenStackManager.i18n - change (mediawiki...OpenStackManager)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/108513 Change subject: Added missing message to OpenStackManager.i18n .. Added missing message to OpenStackManager.i18n 'right-listall' message added to OpenStackManager.i18n file. Bug: 54157 Change-Id: I61bbf94202342746996d82cfb7158d0b08876ede --- M OpenStackManager.i18n.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenStackManager refs/changes/13/108513/1 diff --git a/OpenStackManager.i18n.php b/OpenStackManager.i18n.php index b6c9206..6c841a5 100644 --- a/OpenStackManager.i18n.php +++ b/OpenStackManager.i18n.php @@ -26,6 +26,7 @@ Resource names start with a-z, and can only contain a-z, 0-9, and - characters.', 'action-listall' = 'display all resource information', + 'right-listall' = 'Display all resource information', 'action-managednsdomain' = 'manage DNS domains', 'action-manageglobalpuppet' = 'manage global Puppet information', @@ -504,6 +505,7 @@ Resource name(s) in this message probably refers the above-mentioned *name elements.', 'action-listall' = '{{doc-action|listall}}', + 'right-listall' = '{{doc-right|listall}}' 'action-managednsdomain' = '{{doc-action|managednsdomain}}', 'action-manageglobalpuppet' = '{{doc-action|manageglobalpuppet}}', 'specialpages-group-nova' = '{{doc-special-group|that=are related to OpenStack Nova|like=[[Special:NovaInstance]], [[Special:NovaKey]], [[Special:NovaProject]], [[Special:NovaDomain]], [[Special:NovaAddress]], [[Special:NovaSecurityGroup]], [[Special:NovaServiceGroup]],[[Special:NovaRole]], [[Special:NovaVolume]], [[Special:NovaSudoer]], [[Special:NovaPuppetGroup]]}} -- To view, visit https://gerrit.wikimedia.org/r/108513 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61bbf94202342746996d82cfb7158d0b08876ede Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/OpenStackManager Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added CSS to preserve whitespace - change (mediawiki...Translate)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/108330 Change subject: Added CSS to preserve whitespace .. Added CSS to preserve whitespace In Review mode, whitespace is not preserved and so newlines are being displayed as single spaces which can mess up messages. Hence CSS added. Code courtesy: Jesús Martínez Novo Bug: 60198 Change-Id: I11190fd1b0970277fc57ff95a43efaf3ece585a9 --- M resources/css/ext.translate.proofread.css 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/30/108330/1 diff --git a/resources/css/ext.translate.proofread.css b/resources/css/ext.translate.proofread.css index 72b4c34..a678f8e 100644 --- a/resources/css/ext.translate.proofread.css +++ b/resources/css/ext.translate.proofread.css @@ -67,6 +67,11 @@ right: -5px; } +.tux-proofread-translation, +.tux-proofread-source { +white-space: pre-wrap; +} + .ext-translate-container .tux-messagelist .tux-message-proofread.own-translation, .ext-translate-container .tux-messagelist .tux-message-proofread.own-translation:hover { background: #FBFBFB; -- To view, visit https://gerrit.wikimedia.org/r/108330 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I11190fd1b0970277fc57ff95a43efaf3ece585a9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Removing page_restrictions from page table - change (mediawiki/core)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/108219 Change subject: Removing page_restrictions from page table .. Removing page_restrictions from page table Experimental patch-Do not merge. Removing page_restrictions from page table as it is superseded by the page_restriction table. Bug: 4 Change-Id: I1509ad3cc9a99eeff7df4cfc548dd1640053ccc7 --- M includes/WikiPage.php M includes/api/ApiQueryInfo.php M includes/installer/MysqlUpdater.php M includes/installer/SqliteUpdater.php A maintenance/archives/patch-drop-page_restrictions.sql A maintenance/sqlite/archives/patch-drop-page_restrictions.sql M maintenance/tables.sql 7 files changed, 51 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/19/108219/1 diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 8c035aa..d8988af 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -278,7 +278,6 @@ 'page_id', 'page_namespace', 'page_title', - 'page_restrictions', 'page_counter', 'page_is_redirect', 'page_is_new', @@ -407,7 +406,6 @@ $this-mTitle-loadFromRow( $data ); // Old-fashioned restrictions - $this-mTitle-loadRestrictions( $data-page_restrictions ); $this-mId = intval( $data-page_id ); $this-mCounter = intval( $data-page_counter ); @@ -1253,7 +1251,6 @@ 'page_namespace'= $this-mTitle-getNamespace(), 'page_title'= $this-mTitle-getDBkey(), 'page_counter' = 0, - 'page_restrictions' = '', 'page_is_redirect' = 0, // Will set this shortly... 'page_is_new' = 1, 'page_random' = wfRandom(), @@ -2405,7 +2402,6 @@ // Clear out legacy restriction fields $dbw-update( 'page', - array( 'page_restrictions' = '' ), array( 'page_id' = $id ), __METHOD__ ); @@ -2594,20 +2590,20 @@ * @throws MWException * @return String */ - protected static function flattenRestrictions( $limit ) { - if ( !is_array( $limit ) ) { - throw new MWException( 'WikiPage::flattenRestrictions given non-array restriction set' ); - } - - $bits = array(); - ksort( $limit ); - - foreach ( array_filter( $limit ) as $action = $restrictions ) { - $bits[] = $action=$restrictions; - } - - return implode( ':', $bits ); - } +// protected static function flattenRestrictions( $limit ) { +// if ( !is_array( $limit ) ) { +// throw new MWException( 'WikiPage::flattenRestrictions given non-array restriction set' ); +// } +// +// $bits = array(); +// ksort( $limit ); +// +// foreach ( array_filter( $limit ) as $action = $restrictions ) { +// $bits[] = $action=$restrictions; +// } +// +// return implode( ':', $bits ); +// } /** * Same as doDeleteArticleReal(), but returns a simple boolean. This is kept around for diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 43b8c0c..bc12675 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -59,7 +59,6 @@ public function requestExtraData( $pageSet ) { global $wgDisableCounters, $wgContentHandlerUseDB; - $pageSet-requestField( 'page_restrictions' ); // when resolving redirects, no page will have this field if ( !$pageSet-isResolvingRedirects() ) { $pageSet-requestField( 'page_is_redirect' ); @@ -288,7 +287,6 @@ } } - $this-pageRestrictions = $pageSet-getCustomField( 'page_restrictions' ); // when resolving redirects, no page will have this field $this-pageIsRedir = !$pageSet-isResolvingRedirects() ? $pageSet-getCustomField( 'page_is_redirect' ) diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 9dfbff8..96eb3bb 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -249,6 +249,8 @@ array( 'addIndex', 'logging',
[MediaWiki-commits] [Gerrit] Removed SiteConfiguration::getAll() - change (mediawiki/core)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/107034 Change subject: Removed SiteConfiguration::getAll() .. Removed SiteConfiguration::getAll() SiteConfiguration::extractGlobalSetting() and SiteConfiguration::getAll() have duplicate codes.Since SiteConfiguration::getAll() can be replaced by existing functions, it is removed. Bug: 37238 Change-Id: I0fd68fdf307b5bcafdd7ddfb86d9c149998ba6d5 --- M includes/SiteConfiguration.php 1 file changed, 1 insertion(+), 32 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/34/107034/1 diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index fa871fe..f1e0b41 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -104,8 +104,7 @@ * @code * # Name / identifier of the wiki as set in $conf-wikis * $wikiID = 'beta'; - * $globals = $conf-getAll( $wikiID ); - * extract( $globals ); + * $conf-extractAllGlobals( 'enwiki' ); * @endcode * * TODO: give examples for, @@ -276,36 +275,6 @@ } else { return $in; } - } - - /** -* Gets all settings for a wiki -* @param string $wiki Wiki ID of the wiki in question. -* @param string $suffix The suffix of the wiki in question. -* @param array $params List of parameters. $.'key' is replaced by $value in all returned data. -* @param array $wikiTags The tags assigned to the wiki. -* @return Array Array of settings requested. -*/ - public function getAll( $wiki, $suffix = null, $params = array(), $wikiTags = array() ) { - $params = $this-mergeParams( $wiki, $suffix, $params, $wikiTags ); - $localSettings = array(); - foreach ( $this-settings as $varname = $stuff ) { - $append = false; - $var = $varname; - if ( substr( $varname, 0, 1 ) == '+' ) { - $append = true; - $var = substr( $varname, 1 ); - } - - $value = $this-getSetting( $varname, $wiki, $params ); - if ( $append is_array( $value ) is_array( $GLOBALS[$var] ) ) { - $value = self::arrayMerge( $value, $GLOBALS[$var] ); - } - if ( !is_null( $value ) ) { - $localSettings[$var] = $value; - } - } - return $localSettings; } /** -- To view, visit https://gerrit.wikimedia.org/r/107034 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0fd68fdf307b5bcafdd7ddfb86d9c149998ba6d5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Error message for invalid login changed. - change (wikimedia...modifications)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/106883 Change subject: Error message for invalid login changed. .. Error message for invalid login changed. Error message, The username or password you entered is not valid. changed to The email address or password you entered is not valid.. Bug: 50376 Change-Id: Ib364cef6793497bccfa3f8ff76ee36cb073bade4 --- M template/en/custom/global/user-error.html.tmpl 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/bugzilla/modifications refs/changes/83/106883/1 diff --git a/template/en/custom/global/user-error.html.tmpl b/template/en/custom/global/user-error.html.tmpl index 5d8800d..c4cb367 100644 --- a/template/en/custom/global/user-error.html.tmpl +++ b/template/en/custom/global/user-error.html.tmpl @@ -1005,7 +1005,7 @@ [% ELSIF error == invalid_username_or_password %] [% title = Invalid Username Or Password %] -The username or password you entered is not valid. +The email address or password you entered is not valid. [%# People get two login attempts before being warned about # being locked out. #%] -- To view, visit https://gerrit.wikimedia.org/r/106883 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib364cef6793497bccfa3f8ff76ee36cb073bade4 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/bugzilla/modifications Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Changed date format in l10nupdate-1 - change (operations/puppet)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/106892 Change subject: Changed date format in l10nupdate-1 .. Changed date format in l10nupdate-1 Changed date format in script file as year comes after both the time and the time zone. The script runs LocalisationUpdate's update.php script and then logs to the server admin log. Bug: 52986 Change-Id: I7ec72331bfd3b23515fd9a2f788f485f92ddcfad --- M files/misc/l10nupdate/l10nupdate-1 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/92/106892/1 diff --git a/files/misc/l10nupdate/l10nupdate-1 b/files/misc/l10nupdate/l10nupdate-1 index f953728..5ba96bc 100755 --- a/files/misc/l10nupdate/l10nupdate-1 +++ b/files/misc/l10nupdate/l10nupdate-1 @@ -10,7 +10,7 @@ GITREPOS=core extensions umask 0002 -echo Starting l10nupdate at `date`. +echo Starting l10nupdate at `date --rfc-3339=seconds`. # Update i18n messages from git to the HEAD of master, or create the clone if it doesn't exist yet echo Updating git clone ... @@ -71,24 +71,24 @@ --all \ --quiet then - echo Rebuilding localization cache at `date` + echo Rebuilding localization cache at `date --rfc-3339=seconds` /usr/local/bin/mwscript rebuildLocalisationCache.php --wiki=$mwDbName \ --quiet --outdir=/var/lib/l10nupdate/cache-$mwVerNum # Copy the LC files - echo Completed at `date`. Copying LC files to $MW_COMMON_SOURCE + echo Completed at `date --rfc-3339=seconds`. Copying LC files to $MW_COMMON_SOURCE cp --preserve=timestamps --force /var/lib/l10nupdate/cache-$mwVerNum/l10n_cache-* $MW_COMMON_SOURCE/php-$mwVerNum/cache/l10n # Include JSON versions of the CDB files and add MD5 files /usr/local/bin/refreshCdbJsonFiles --directory=$MW_COMMON_SOURCE/php-$mwVerNum/cache/l10n - echo Syncing to Apaches at `date` + echo Syncing to Apaches at `date --rfc-3339=seconds` SYNC_START=$(date +%s) $BINDIR/sync-l10nupdate-1 $mwVerNum SYNC_END=$(date +%s) - $BINDIR/dologmsg !log LocalisationUpdate completed ($mwVerNum) at `date` - echo All done at `date` + $BINDIR/dologmsg !log LocalisationUpdate completed ($mwVerNum) at `date --rfc-3339=seconds` + echo All done at `date --rfc-3339=seconds` $BINDIR/deploy2graphite l10nupdate-sync $((SYNC_END-SYNC_START)) else - $BINDIR/dologmsg !log LocalisationUpdate failed ($mwVerNum) at `date` + $BINDIR/dologmsg !log LocalisationUpdate failed ($mwVerNum) at `date --rfc-3339=seconds` echo FAILED fi done @@ -100,4 +100,4 @@ /usr/local/bin/mwscript extensions/WikimediaMaintenance/refreshMessageBlobs.php --wiki=$wiki done echo All done -$BINDIR/dologmsg !log LocalisationUpdate ResourceLoader cache refresh completed at `date` +$BINDIR/dologmsg !log LocalisationUpdate ResourceLoader cache refresh completed at `date --rfc-3339=seconds` -- To view, visit https://gerrit.wikimedia.org/r/106892 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ec72331bfd3b23515fd9a2f788f485f92ddcfad Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Removed indentation button from WikiEditor extension - change (mediawiki...WikiEditor)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/102101 Change subject: Removed indentation button from WikiEditor extension .. Removed indentation button from WikiEditor extension The button and its remnants are removed. Bug: 24489 Change-Id: I1445fa188770e0c73369f9d1c5fc557326383017 --- M WikiEditor.i18n.php M WikiEditor.php M modules/jquery.wikiEditor.toolbar.config.js 3 files changed, 0 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/01/102101/1 diff --git a/WikiEditor.i18n.php b/WikiEditor.i18n.php index 0392b3f..83364bb 100644 --- a/WikiEditor.i18n.php +++ b/WikiEditor.i18n.php @@ -120,8 +120,6 @@ 'wikieditor-toolbar-tool-ulist-example' = 'Bulleted list item', 'wikieditor-toolbar-tool-olist' = 'Numbered list', 'wikieditor-toolbar-tool-olist-example' = 'Numbered list item', - 'wikieditor-toolbar-tool-indent' = 'Indentation', - 'wikieditor-toolbar-tool-indent-example' = 'Indented line', 'wikieditor-toolbar-tool-nowiki' = 'No wiki formatting', 'wikieditor-toolbar-tool-nowiki-example' = 'Insert non-formatted text here', 'wikieditor-toolbar-tool-redirect' = 'Redirect', diff --git a/WikiEditor.php b/WikiEditor.php index 103c9eb..838e984 100644 --- a/WikiEditor.php +++ b/WikiEditor.php @@ -269,8 +269,6 @@ 'wikieditor-toolbar-tool-ulist-example', 'wikieditor-toolbar-tool-olist', 'wikieditor-toolbar-tool-olist-example', - 'wikieditor-toolbar-tool-indent', - 'wikieditor-toolbar-tool-indent-example', 'wikieditor-toolbar-tool-nowiki', 'wikieditor-toolbar-tool-nowiki-example', 'wikieditor-toolbar-tool-redirect', diff --git a/modules/jquery.wikiEditor.toolbar.config.js b/modules/jquery.wikiEditor.toolbar.config.js index 780eb2c..0068290 100644 --- a/modules/jquery.wikiEditor.toolbar.config.js +++ b/modules/jquery.wikiEditor.toolbar.config.js @@ -314,28 +314,6 @@ } } }, - 'indent': { - 'labelMsg': 'wikieditor-toolbar-tool-indent', - 'type': 'button', - 'icon': { - 'default': 'format-indent.png', - 'default-rtl': 'format-indent-rtl.png' - }, - 'offset': { - 'default': [2, -646], - 'default-rtl': [-70, -430] - }, - 'action': { - 'type': 'encapsulate', - 'options': { - 'pre': :, - 'periMsg': 'wikieditor-toolbar-tool-indent-example', - 'post': , - 'ownline': true, - 'splitlines': true - } - } - }, 'nowiki': { 'labelMsg': 'wikieditor-toolbar-tool-nowiki', 'type': 'button', -- To view, visit https://gerrit.wikimedia.org/r/102101 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1445fa188770e0c73369f9d1c5fc557326383017 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Corrected memcached.txt in MediaWiki 1.22 - change (mediawiki/core)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/102163 Change subject: Corrected memcached.txt in MediaWiki 1.22 .. Corrected memcached.txt in MediaWiki 1.22 The sentence, The newer PECL module is not yet supported. is wrong. It is changed to The newer PECL module is supported.. Bug: 47486 Change-Id: I3111f82843360c3fa57394a980272b62cea8148e --- M docs/memcached.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/63/102163/1 diff --git a/docs/memcached.txt b/docs/memcached.txt index f54a4e7..a2b4a94 100644 --- a/docs/memcached.txt +++ b/docs/memcached.txt @@ -78,7 +78,7 @@ == PHP client for memcached == MediaWiki uses a fork of Ryan T. Dean's pure-PHP memcached client. -The newer PECL module is not yet supported. +The newer PECL module is supported. MediaWiki uses three object for object caching: * $wgMemc, controlled by $wgMainCacheType -- To view, visit https://gerrit.wikimedia.org/r/102163 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3111f82843360c3fa57394a980272b62cea8148e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: REL1_22 Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Removed indentation button from WikiEditor toolbar. - change (mediawiki...WikiEditor)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/94500 Change subject: Removed indentation button from WikiEditor toolbar. .. Removed indentation button from WikiEditor toolbar. Removed the button,image and label messages. Bug: 24489 Change-Id: Iab7eeb3c780f9436cc8cd99b6ad21ebac8a450e2 --- M WikiEditor.i18n.php M WikiEditor.php D modules/images/toolbar/format-indent-rtl.png D modules/images/toolbar/format-indent.png M modules/jquery.wikiEditor.toolbar.config.js 5 files changed, 0 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/00/94500/1 diff --git a/WikiEditor.i18n.php b/WikiEditor.i18n.php index d63aea3..0516863 100644 --- a/WikiEditor.i18n.php +++ b/WikiEditor.i18n.php @@ -120,8 +120,6 @@ 'wikieditor-toolbar-tool-ulist-example' = 'Bulleted list item', 'wikieditor-toolbar-tool-olist' = 'Numbered list', 'wikieditor-toolbar-tool-olist-example' = 'Numbered list item', - 'wikieditor-toolbar-tool-indent' = 'Indentation', - 'wikieditor-toolbar-tool-indent-example' = 'Indented line', 'wikieditor-toolbar-tool-nowiki' = 'No wiki formatting', 'wikieditor-toolbar-tool-nowiki-example' = 'Insert non-formatted text here', 'wikieditor-toolbar-tool-redirect' = 'Redirect', diff --git a/WikiEditor.php b/WikiEditor.php index 103c9eb..838e984 100644 --- a/WikiEditor.php +++ b/WikiEditor.php @@ -269,8 +269,6 @@ 'wikieditor-toolbar-tool-ulist-example', 'wikieditor-toolbar-tool-olist', 'wikieditor-toolbar-tool-olist-example', - 'wikieditor-toolbar-tool-indent', - 'wikieditor-toolbar-tool-indent-example', 'wikieditor-toolbar-tool-nowiki', 'wikieditor-toolbar-tool-nowiki-example', 'wikieditor-toolbar-tool-redirect', diff --git a/modules/images/toolbar/format-indent-rtl.png b/modules/images/toolbar/format-indent-rtl.png deleted file mode 100644 index 6dbad6d..000 --- a/modules/images/toolbar/format-indent-rtl.png +++ /dev/null Binary files differ diff --git a/modules/images/toolbar/format-indent.png b/modules/images/toolbar/format-indent.png deleted file mode 100644 index ec1ba45..000 --- a/modules/images/toolbar/format-indent.png +++ /dev/null Binary files differ diff --git a/modules/jquery.wikiEditor.toolbar.config.js b/modules/jquery.wikiEditor.toolbar.config.js index 15914f4..907180c 100644 --- a/modules/jquery.wikiEditor.toolbar.config.js +++ b/modules/jquery.wikiEditor.toolbar.config.js @@ -313,28 +313,6 @@ } } }, - 'indent': { - 'labelMsg': 'wikieditor-toolbar-tool-indent', - 'type': 'button', - 'icon': { - 'default': 'format-indent.png', - 'default-rtl': 'format-indent-rtl.png' - }, - 'offset': { - 'default': [2, -646], - 'default-rtl': [-70, -430] - }, - 'action': { - 'type': 'encapsulate', - 'options': { - 'pre': :, - 'periMsg': 'wikieditor-toolbar-tool-indent-example', - 'post': , - 'ownline': true, - 'splitlines': true - } - } - }, 'nowiki': { 'labelMsg': 'wikieditor-toolbar-tool-nowiki', 'type': 'button', -- To view, visit https://gerrit.wikimedia.org/r/94500 To
[MediaWiki-commits] [Gerrit] Removed the indentation button from the WikiEditor toolbar. - change (mediawiki...WikiEditor)
Tinaj1234 has uploaded a new change for review. https://gerrit.wikimedia.org/r/93665 Change subject: Removed the indentation button from the WikiEditor toolbar. .. Removed the indentation button from the WikiEditor toolbar. Bug:24489 The indentation button of WikiEditor toolbar is to removed as dd of dl are inserted to html code every time you indent. Hence the button's code is removed from modules/jquery.wikiEditor.toolbar.config.js Change-Id: If0020ea576777d3bf825314ca492e38507c8de1d --- M modules/jquery.wikiEditor.toolbar.config.js 1 file changed, 1 insertion(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/65/93665/1 diff --git a/modules/jquery.wikiEditor.toolbar.config.js b/modules/jquery.wikiEditor.toolbar.config.js index d3f7a9d..d678085 100644 --- a/modules/jquery.wikiEditor.toolbar.config.js +++ b/modules/jquery.wikiEditor.toolbar.config.js @@ -313,28 +313,7 @@ } } }, - 'indent': { - 'labelMsg': 'wikieditor-toolbar-tool-indent', - 'type': 'button', - 'icon': { - 'default': 'format-indent.png', - 'default-rtl': 'format-indent-rtl.png' - }, - 'offset': { - 'default': [2, -646], - 'default-rtl': [-70, -430] - }, - 'action': { - 'type': 'encapsulate', - 'options': { - 'pre': :, - 'periMsg': 'wikieditor-toolbar-tool-indent-example', - 'post': , - 'ownline': true, - 'splitlines': true - } - } - }, + 'nowiki': { 'labelMsg': 'wikieditor-toolbar-tool-nowiki', 'type': 'button', -- To view, visit https://gerrit.wikimedia.org/r/93665 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0020ea576777d3bf825314ca492e38507c8de1d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: Tinaj1234 tinajohnson.1...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits