http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100313
Revision: 100313
Author: reedy
Date: 2011-10-20 01:03:40 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
1.18wmf1 MFT r100295, r100302, r100307, r100308, r100309, r100311
Modified Paths:
--------------
branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php
branches/wmf/1.18wmf1/extensions/Contest/Contest.php
branches/wmf/1.18wmf1/extensions/Contest/RELEASE-NOTES
branches/wmf/1.18wmf1/extensions/Contest/api/ApiMailContestants.php
branches/wmf/1.18wmf1/extensions/Contest/includes/ContestReminderJob.php
branches/wmf/1.18wmf1/extensions/Contest/resources/contest.special.contest.js
branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContest.php
Property Changed:
----------------
branches/wmf/1.18wmf1/extensions/Contest/
Property changes on: branches/wmf/1.18wmf1/extensions/Contest
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/REL1_15/phase3/extensions/Contest:51646
/branches/REL1_17/phase3/extensions/Contest:81445,81448
/branches/new-installer/phase3/extensions/Contest:43664-66004
/branches/sqlite/extensions/Contest:58211-58321
/trunk/extensions/Contest:99592,99653,100190-100191,100193,100198,100200,100240,100245,100251-100252,100255,100258-100259,100261,100274,100276,100278,100287,100292,100295
/trunk/phase3/extensions/Contest:92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93520,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812,98578,98598,98656
+ /branches/REL1_15/phase3/extensions/Contest:51646
/branches/REL1_17/phase3/extensions/Contest:81445,81448
/branches/new-installer/phase3/extensions/Contest:43664-66004
/branches/sqlite/extensions/Contest:58211-58321
/trunk/extensions/Contest:99592,99653,100190-100191,100193,100198,100200,100240,100245,100251-100252,100255,100258-100259,100261,100274,100276,100278,100287,100292,100295,100302,100307-100309,100311
/trunk/phase3/extensions/Contest:92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93520,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812,98578,98598,98656
Modified: branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php 2011-10-20
01:01:20 UTC (rev 100312)
+++ branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php 2011-10-20
01:03:40 UTC (rev 100313)
@@ -161,10 +161,11 @@
'contest-contest-reminder-cancel' => 'Cancel',
'contest-contest-reminder-sending' => 'Sending...',
// We really want // {{PLURAL:$1|contestant|contestants}} here, but the
JS i18n shizzle does not support it yet :/
- 'contest-contest-reminder-success' => 'Successfully send the reminder
email to $1 contestants',
+ 'contest-contest-reminder-success' => 'Successfully sent the reminder
email to $1 contestants',
'contest-contest-reminder-close' => 'Close',
'contest-contest-reminder-retry' => 'Retry sending',
- 'contest-contest-reminder-failed' => 'Could not send the reminder
emails.',
+ 'contest-contest-reminder-failed' => 'Could not sent the reminder
emails.',
+ 'contest-contest-reminder-subject' => 'Subject:',
// Contestant pager
'contest-contestant-id' => 'ID',
@@ -310,6 +311,7 @@
'contest-contest-reminder-close' => 'Close button text',
'contest-contest-reminder-retry' => 'Retry button text',
'contest-contest-reminder-failed' => 'Failiure message, displayed in an
alert box',
+ 'contest-contest-reminder-subject' => 'Email subject indicator',
// Special:MyContests
'contest-mycontests-toplink' => 'Text for link in the user menu (i.e.
where watchlist and preferences are linked)',
Modified: branches/wmf/1.18wmf1/extensions/Contest/Contest.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/Contest.php 2011-10-20
01:01:20 UTC (rev 100312)
+++ branches/wmf/1.18wmf1/extensions/Contest/Contest.php 2011-10-20
01:03:40 UTC (rev 100313)
@@ -170,6 +170,7 @@
'contest-contest-reminder-close',
'contest-contest-reminder-retry',
'contest-contest-reminder-failed',
+ 'contest-contest-reminder-subject',
),
'dependencies' => array(
'jquery.ui.button', 'jquery.ui.dialog',
Modified: branches/wmf/1.18wmf1/extensions/Contest/RELEASE-NOTES
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/RELEASE-NOTES 2011-10-20
01:01:20 UTC (rev 100312)
+++ branches/wmf/1.18wmf1/extensions/Contest/RELEASE-NOTES 2011-10-20
01:03:40 UTC (rev 100313)
@@ -5,7 +5,7 @@
=== Version 0.1 ===
-2011-10-xx
+2011-10-20
Initial release with these features:
Modified: branches/wmf/1.18wmf1/extensions/Contest/api/ApiMailContestants.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/api/ApiMailContestants.php
2011-10-20 01:01:20 UTC (rev 100312)
+++ branches/wmf/1.18wmf1/extensions/Contest/api/ApiMailContestants.php
2011-10-20 01:03:40 UTC (rev 100313)
@@ -70,9 +70,10 @@
$conditions['id'] = $params['ids'];
}
- $contestants = ContestContestant::s()->select( array(
'contest_id', 'email' ), $conditions );
+ $contestants = ContestContestant::s()->select( array( 'id',
'user_id', 'contest_id', 'email' ), $conditions );
- if ( $contestants !== false && count( $contestants ) > 0 ) {
+ $contestantCount = count( $contestants );
+ if ( $contestants !== false && $contestantCount > 0 ) {
$setSize = ContestSettings::get( 'reminderJobSize' );
$limit = count( $contestants );
@@ -94,7 +95,7 @@
$this->getResult()->addValue(
null,
'contestantcount',
- count( $contestants )
+ $contestantCount
);
}
}
@@ -169,7 +170,7 @@
public function getDescription() {
return array(
'API module for mailing contestants. Selection criteria
will be joined with AND,
- except for the challange ids/titles and contest
ids/names pairs, which will be joined wit OR.'
+ except for the challange ids/titles and contest
ids/names pairs, which will be joined with OR.'
);
}
@@ -184,7 +185,7 @@
'api.php?action=mailcontestants&ids=42',
'api.php?action=mailcontestants&ids=4|2',
'api.php?action=mailcontestants&contestids=42',
- 'api.php?action=mailcontestants&contestnames=Weekend of
Code',
+
'api.php?action=mailcontestants&contestnames=Weekend_of_Code',
'api.php?action=mailcontestants&challengetitles=foo|bar|baz',
);
}
Modified:
branches/wmf/1.18wmf1/extensions/Contest/includes/ContestReminderJob.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/includes/ContestReminderJob.php
2011-10-20 01:01:20 UTC (rev 100312)
+++ branches/wmf/1.18wmf1/extensions/Contest/includes/ContestReminderJob.php
2011-10-20 01:03:40 UTC (rev 100313)
@@ -33,6 +33,9 @@
* @return bool
*/
public function run() {
+ /**
+ * @var $contestant ContestContestant
+ */
foreach ( $this->params['contestants'] as /* ContestContestant
*/ $contestant ) {
$contestant->sendReminderEmail(
$this->params['emailText'], array(
'daysLeft' => $this->params['daysLeft'],
Modified:
branches/wmf/1.18wmf1/extensions/Contest/resources/contest.special.contest.js
===================================================================
---
branches/wmf/1.18wmf1/extensions/Contest/resources/contest.special.contest.js
2011-10-20 01:01:20 UTC (rev 100312)
+++
branches/wmf/1.18wmf1/extensions/Contest/resources/contest.special.contest.js
2011-10-20 01:03:40 UTC (rev 100313)
@@ -1,15 +1,15 @@
/**
* JavasSript for the Contest MediaWiki extension.
* @see https://www.mediawiki.org/wiki/Extension:Contest
- *
+ *
* @licence GNU GPL v3 or later
* @author Jeroen De Dauw <jeroendedauw at gmail dot com>
*/
(function( $, mw ) { $( document ).ready( function() {
-
+
var _this = this;
-
+
this.sendReminder = function( callback ) {
var requestArgs = {
'action': 'mailcontestants',
@@ -17,7 +17,7 @@
'token': $( '#send-reminder' ).attr( 'data-token' ),
'contestids': $( '#send-reminder' ).attr(
'data-contest-id' )
};
-
+
$.post(
wgScriptPath + '/api.php',
requestArgs,
@@ -26,12 +26,13 @@
}
);
};
-
+
this.showReminderDialog = function() {
var $dialog = null;
-
+
$dialog = $( '<div />' ).html( '' ).dialog( {
'title': mw.msg( 'contest-contest-reminder-title' ),
+ 'minWidth': 550,
'buttons': [
{
'text': mw.msg(
'contest-contest-reminder-send' ),
@@ -39,10 +40,10 @@
'click': function() {
var $send = $(
'#reminder-send-button' );
var $cancel = $(
'#reminder-cancel-button' );
-
+
$send.button( 'option',
'disabled', true );
$send.button( 'option',
'label', mw.msg( 'contest-contest-reminder-sending' ) );
-
+
_this.sendReminder( function(
data ) {
if ( data.success ) {
$dialog.text(
mw.msg( 'contest-contest-reminder-success', data.contestantcount ) );
@@ -52,7 +53,7 @@
else {
$send.button(
'option', 'label', mw.msg( 'contest-contest-reminder-retry' ) );
$send.button(
'option', 'disabled', false );
-
+
alert( mw.msg(
'contest-contest-reminder-failed' ) );
}
} );
@@ -67,12 +68,18 @@
}
]
} );
-
+
$dialog.append( $( '<p />' ).text( mw.msg(
'contest-contest-reminder-preview' ) ) ).append( '<hr />' );
-
- $dialog.append( $( '#reminder-content' ).html() );
+
+ $dialog.append( $( '<p />' )
+ .html( $( '<b />' )
+ .text( mw.msg(
'contest-contest-reminder-subject' ) ) )
+ .append( ' ' + $( '#send-reminder' ).attr(
'data-reminder-subject' ) ) )
+ .append( '<hr />' );
+
+ $dialog.append( $( '#reminder-content' ).html() );
};
-
+
$( '#send-reminder' ).button().click( this.showReminderDialog );
-
-} ); })( window.jQuery, window.mediaWiki );
\ No newline at end of file
+
+} ); })( window.jQuery, window.mediaWiki );
Modified: branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContest.php
===================================================================
--- branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContest.php
2011-10-20 01:01:20 UTC (rev 100312)
+++ branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContest.php
2011-10-20 01:03:40 UTC (rev 100313)
@@ -141,7 +141,11 @@
array(
'id' => 'send-reminder',
'data-token' => $this->getUser()->editToken(),
- 'data-contest-id' => $contest->getId()
+ 'data-contest-id' => $contest->getId(),
+
+ // Note: this is a copy of the message in
ContestContestant::sendReminderEmail.
+ // If it's changed or modified by a hook, this
message might not be accurate.
+ 'data-reminder-subject' => wfMsgExt(
'contest-email-reminder-title', 'parsemag', $contest->getDaysLeft() )
),
wfMsg( 'contest-contest-send-reminder' )
) );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs