summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Pramana <aaron@sociotopia.com>2012-07-03 19:56:35 -0700
committerAaron Pramana <aaron@sociotopia.com>2012-07-03 19:56:35 -0700
commit58eb9ecefed4f16d527a6cd51925909f4035a426 (patch)
tree19e922f6f1341cbeb28c2f476f75d6c7bdd915ef
parent647272f3bb213c15142483e252b32ec09b655e4f (diff)
changes include database patches and localization Change-Id: Icb2cb01ed23ac2022493c9511b9edfb6f59ce38f
-rw-r--r--includes/installer/MysqlUpdater.php2
-rw-r--r--includes/specials/SpecialEditWatchlist.php12
-rw-r--r--includes/specials/SpecialEditWatchlistGroup.php6
-rw-r--r--languages/messages/MessagesEn.php43
-rw-r--r--maintenance/archives/patch-watchlist_groups.sql11
-rw-r--r--maintenance/archives/patch-watchlist_groups_newfield.sql1
-rw-r--r--maintenance/sqlite/archives/patch-watchlist_groups.sql0
7 files changed, 47 insertions, 28 deletions
diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php
index e453b0113a15..aa91804fe716 100644
--- a/includes/installer/MysqlUpdater.php
+++ b/includes/installer/MysqlUpdater.php
@@ -213,6 +213,8 @@ class MysqlUpdater extends DatabaseUpdater {
array( 'addIndex', 'revision', 'page_user_timestamp', 'patch-revision-user-page-index.sql' ),
array( 'addField', 'ipblocks', 'ipb_parent_block_id', 'patch-ipb-parent-block-id.sql' ),
array( 'addIndex', 'ipblocks', 'ipb_parent_block_id', 'patch-ipb-parent-block-id-index.sql' ),
+ array( 'addTable', 'watchlist_groups', 'patch-watchlist_groups.sql' ),
+ array( 'addField', 'watchlist', 'wl_group', 'patch-watchlist_groups_newfield.sql' ),
);
}
diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php
index e7a167b59de2..24505d4966a7 100644
--- a/includes/specials/SpecialEditWatchlist.php
+++ b/includes/specials/SpecialEditWatchlist.php
@@ -283,9 +283,9 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
private function getWatchlistInfo() {
$titles = array();
$where = array( 'wl_user' => $this->getUser()->getId() );
- if( $this->groupname ){
- $where['wl_group'] = $this->groupname;
- }
+// if( WatchlistGroup::isGroup( $this->groupname, $this->getUser()->getId() ){
+// $where['wl_group'] = $this->groupname;
+// }
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select(
@@ -458,7 +458,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
foreach( $data as $titles ) {
WatchlistGroup::regroupTitles( $titles, $group, $this->getContext() );
}
- $this->successMessage = 'Titles were successfully regrouped!';
+ $this->successMessage = $this->msg( 'watchlistedit-normal-donegrouping' )->escaped();
return true;
}
@@ -530,7 +530,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
$groups = WatchlistGroup::getGroups( $this->getContext()->getUser()->getId() );
foreach( $groups as &$g ){
- $g = 'Change group to "' . $g . '"';
+ $g = $this->msg( 'watchlistedit-normal-change' )->rawParams( $g )->escaped();
}
$gsOptions = array_merge( array( $this->msg( 'watchlistedit-normal-remove' )->escaped() => -1,
@@ -586,7 +586,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
wfRunHooks( 'WatchlistEditorBuildRemoveLine', array( &$tools, $title, $title->isRedirect(), $this->getSkin() ) );
- return $link . " (" . $this->getLanguage()->pipeList( $tools ) . ") (Group: " . $wgrouplink . ")";
+ return $link . " (" . $this->getLanguage()->pipeList( $tools ) . ") (" . $wgrouplink . ")";
}
/**
diff --git a/includes/specials/SpecialEditWatchlistGroup.php b/includes/specials/SpecialEditWatchlistGroup.php
index dd66e230de2b..47031397cd29 100644
--- a/includes/specials/SpecialEditWatchlistGroup.php
+++ b/includes/specials/SpecialEditWatchlistGroup.php
@@ -83,13 +83,15 @@ class SpecialEditWatchlistGroup extends UnlistedSpecialPage {
$fields['groupaction_' . $id] = array(
'type' => 'select',
- 'options' => array( 'Take no action' => 0, 'Rename' => 1, 'Delete' => -1 ),
+ 'options' => array( $this->msg('wlgroup-noaction')->parse() => 0,
+ $this->msg('wlgroup-rename')->parse() => 1,
+ $this->msg('wlgroup-delete')->parse() => -1 ),
'label' => $name . ':'
);
$fields['grouprename_' . $id] = array(
'type' => 'text',
- 'label' => 'Rename '.$name.' to:',
+ 'label' => $this->msg( 'wlgroup-renameto' )->rawParams( $name )->parse(),
'size' => '15'
);
}
diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php
index 8f4c1b6bc256..56a980c1d40f 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -4522,30 +4522,32 @@ Try normal preview.',
'lag-warn-high' => 'Due to high database server lag, changes newer than $1 {{PLURAL:$1|second|seconds}} may not be shown in this list.',
# Watchlist editor
-'editwatchlist-summary' => '', # do not translate or duplicate this message to other languages
-'watchlistedit-numitems' => 'Your watchlist contains {{PLURAL:$1|1 title|$1 titles}}, excluding talk pages.',
-'watchlistedit-noitems' => 'Your watchlist contains no titles.',
-'watchlistedit-normal-title' => 'Edit watchlist',
-'watchlistedit-normal-legend' => 'Edit titles in watchlist',
-'watchlistedit-normal-explain' => 'Titles on your watchlist are shown below.
+'editwatchlist-summary' => '', # do not translate or duplicate this message to other languages
+'watchlistedit-numitems' => 'Your watchlist contains {{PLURAL:$1|1 title|$1 titles}}, excluding talk pages.',
+'watchlistedit-noitems' => 'Your watchlist contains no titles.',
+'watchlistedit-normal-title' => 'Edit watchlist',
+'watchlistedit-normal-legend' => 'Edit titles in watchlist',
+'watchlistedit-normal-explain' => 'Titles on your watchlist are shown below.
To edit a title, check the box next to it, select an action to regroup or remove the titles, and click "{{int:Watchlistedit-normal-submit}}".
You can also [[Special:EditWatchlist/raw|edit the raw list]].',
-'watchlistedit-normal-ungroup' => 'Ungroup titles',
-'watchlistedit-normal-remove' => 'Remove titles',
-'watchlistedit-normal-action' => 'Action:',
-'watchlistedit-normal-submit' => 'Update watchlist',
-'watchlistedit-normal-done' => '{{PLURAL:$1|1 title was|$1 titles were}} removed from your watchlist:',
-'watchlistedit-raw-title' => 'Edit raw watchlist',
-'watchlistedit-raw-legend' => 'Edit raw watchlist',
-'watchlistedit-raw-explain' => 'Titles on your watchlist are shown below, and can be edited by adding to and removing from the list;
+'watchlistedit-normal-ungroup' => 'Ungroup titles',
+'watchlistedit-normal-remove' => 'Remove titles',
+'watchlistedit-normal-change' => 'Change group to "$1"',
+'watchlistedit-normal-action' => 'Action:',
+'watchlistedit-normal-submit' => 'Update watchlist',
+'watchlistedit-normal-done' => '{{PLURAL:$1|1 title was|$1 titles were}} removed from your watchlist:',
+'watchlistedit-normal-donegrouping' => 'Titles were successfully regrouped!',
+'watchlistedit-raw-title' => 'Edit raw watchlist',
+'watchlistedit-raw-legend' => 'Edit raw watchlist',
+'watchlistedit-raw-explain' => 'Titles on your watchlist are shown below, and can be edited by adding to and removing from the list;
one title per line.
When finished, click "{{int:Watchlistedit-raw-submit}}".
You can also [[Special:EditWatchlist|use the standard editor]].',
-'watchlistedit-raw-titles' => 'Titles:',
-'watchlistedit-raw-submit' => 'Update watchlist',
-'watchlistedit-raw-done' => 'Your watchlist has been updated.',
-'watchlistedit-raw-added' => '{{PLURAL:$1|1 title was|$1 titles were}} added:',
-'watchlistedit-raw-removed' => '{{PLURAL:$1|1 title was|$1 titles were}} removed:',
+'watchlistedit-raw-titles' => 'Titles:',
+'watchlistedit-raw-submit' => 'Update watchlist',
+'watchlistedit-raw-done' => 'Your watchlist has been updated.',
+'watchlistedit-raw-added' => '{{PLURAL:$1|1 title was|$1 titles were}} added:',
+'watchlistedit-raw-removed' => '{{PLURAL:$1|1 title was|$1 titles were}} removed:',
# Watchlist group editor
'wlgroup-title' => 'Edit watchlist groups',
@@ -4558,10 +4560,11 @@ When finished, click "{{int:Wlgroup-submit}}".',
'wlgroup-noaction' => 'Take no action',
'wlgroup-rename' => 'Rename',
'wlgroup-delete' => 'Delete',
+'wlgroup-renameto' => 'Rename "$1" to:',
'wlgroup-newname' => 'New group name:',
'wlgroup-createnew' => 'Create a new watchlist group:',
'wlgroup-submit' => 'Save groups',
-'wlgroup-success' => 'Your watchlist groups were uploaded successfully',
+'wlgroup-success' => 'Your watchlist groups were updated successfully.',
# Watchlist editing tools
'watchlisttools-view' => 'View relevant changes',
diff --git a/maintenance/archives/patch-watchlist_groups.sql b/maintenance/archives/patch-watchlist_groups.sql
new file mode 100644
index 000000000000..24515ed1d45f
--- /dev/null
+++ b/maintenance/archives/patch-watchlist_groups.sql
@@ -0,0 +1,11 @@
+CREATE TABLE watchlist_groups (
+ wg_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ wg_name varchar(255) binary NOT NULL,
+
+ -- Key to user.user_id for owner of the watchlist
+ wg_user int unsigned NOT NULL,
+
+ -- Permissions bool
+ wg_perm tinyint NOT NULL default 0
+
+) /*$wgDBTableOptions*/; \ No newline at end of file
diff --git a/maintenance/archives/patch-watchlist_groups_newfield.sql b/maintenance/archives/patch-watchlist_groups_newfield.sql
new file mode 100644
index 000000000000..eb2995cb1263
--- /dev/null
+++ b/maintenance/archives/patch-watchlist_groups_newfield.sql
@@ -0,0 +1 @@
+ALTER TABLE /*$wgDBprefix*/watchlist ADD wl_group int unsigned NOT NULL default 0 AFTER wl_user; \ No newline at end of file
diff --git a/maintenance/sqlite/archives/patch-watchlist_groups.sql b/maintenance/sqlite/archives/patch-watchlist_groups.sql
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/maintenance/sqlite/archives/patch-watchlist_groups.sql