| Index: trunk/phase3/maintenance/language/messages.inc |
| — | — | @@ -783,25 +783,6 @@ |
| 784 | 784 | 'suppressionlog', |
| 785 | 785 | 'suppressionlogtext', |
| 786 | 786 | ), |
| 787 | | - 'revisionmove' => array( |
| 788 | | - 'moverevlogentry', |
| 789 | | - 'revisionmove', |
| 790 | | - 'revisionmove-backlink', |
| 791 | | - 'revmove-explain', |
| 792 | | - 'revmove-legend', |
| 793 | | - 'revmove-submit', |
| 794 | | - 'revisionmoveselectedversions', |
| 795 | | - 'revmove-reasonfield', |
| 796 | | - 'revmove-titlefield', |
| 797 | | - 'revmove-badparam-title' , |
| 798 | | - 'revmove-badparam', |
| 799 | | - 'revmove-norevisions-title', |
| 800 | | - 'revmove-norevisions', |
| 801 | | - 'revmove-nullmove-title', |
| 802 | | - 'revmove-nullmove', |
| 803 | | - 'revmove-success-existing', |
| 804 | | - 'revmove-success-created', |
| 805 | | - ), |
| 806 | 787 | 'mergehistory' => array( |
| 807 | 788 | 'mergehistory', |
| 808 | 789 | 'mergehistory-header', |
| — | — | @@ -1148,7 +1129,6 @@ |
| 1149 | 1130 | 'right-reset-passwords', |
| 1150 | 1131 | 'right-override-export-depth', |
| 1151 | 1132 | 'right-sendemail', |
| 1152 | | - 'right-revisionmove', |
| 1153 | 1133 | ), |
| 1154 | 1134 | 'rightslog' => array( |
| 1155 | 1135 | 'rightslog', |
| — | — | @@ -1191,7 +1171,6 @@ |
| 1192 | 1172 | 'action-userrights', |
| 1193 | 1173 | 'action-userrights-interwiki', |
| 1194 | 1174 | 'action-siteadmin', |
| 1195 | | - 'action-revisionmove', |
| 1196 | 1175 | ), |
| 1197 | 1176 | 'recentchanges' => array( |
| 1198 | 1177 | 'nchanges', |
| — | — | @@ -3341,7 +3320,6 @@ |
| 3342 | 3321 | 'history-feed' => 'Revision feed', |
| 3343 | 3322 | 'revdelete' => 'Revision deletion', |
| 3344 | 3323 | 'suppression' => 'Suppression log', |
| 3345 | | - 'revisionmove' => 'Revision move', |
| 3346 | 3324 | 'mergehistory' => 'History merging', |
| 3347 | 3325 | 'mergelog' => 'Merge log', |
| 3348 | 3326 | 'diffs' => 'Diffs', |
| Index: trunk/phase3/maintenance/language/messageTypes.inc |
| — | — | @@ -388,7 +388,6 @@ |
| 389 | 389 | 'prefs-memberingroups-type', |
| 390 | 390 | 'shared-repo-name-wikimediacommons', |
| 391 | 391 | 'usermessage-template', |
| 392 | | - 'revisionmove-backlink', |
| 393 | 392 | 'filepage.css', |
| 394 | 393 | 'nocookiesforlogin', |
| 395 | 394 | ); |
| Index: trunk/phase3/includes/Article.php |
| — | — | @@ -1762,12 +1762,10 @@ |
| 1763 | 1763 | * on. |
| 1764 | 1764 | * @param $lastRevIsRedirect Boolean: if given, will optimize adding and |
| 1765 | 1765 | * removing rows in redirect table. |
| 1766 | | - * @param $setNewFlag Boolean: Set to true if a page flag should be set |
| 1767 | | - * Needed when $lastRevision has to be set to sth. !=0 |
| 1768 | 1766 | * @return bool true on success, false on failure |
| 1769 | 1767 | * @private |
| 1770 | 1768 | */ |
| 1771 | | - public function updateRevisionOn( &$dbw, $revision, $lastRevision = null, $lastRevIsRedirect = null, $setNewFlag = false ) { |
| | 1769 | + public function updateRevisionOn( &$dbw, $revision, $lastRevision = null, $lastRevIsRedirect = null ) { |
| 1772 | 1770 | wfProfileIn( __METHOD__ ); |
| 1773 | 1771 | |
| 1774 | 1772 | $text = $revision->getText(); |
| — | — | @@ -1780,15 +1778,11 @@ |
| 1781 | 1779 | $conditions['page_latest'] = $lastRevision; |
| 1782 | 1780 | } |
| 1783 | 1781 | |
| 1784 | | - if ( !$setNewFlag ) { |
| 1785 | | - $setNewFlag = ( $lastRevision === 0 ); |
| 1786 | | - } |
| 1787 | | - |
| 1788 | 1782 | $dbw->update( 'page', |
| 1789 | 1783 | array( /* SET */ |
| 1790 | 1784 | 'page_latest' => $revision->getId(), |
| 1791 | 1785 | 'page_touched' => $dbw->timestamp(), |
| 1792 | | - 'page_is_new' => $setNewFlag, |
| | 1786 | + 'page_is_new' => ( $lastRevision === 0 ) ? 1 : 0, |
| 1793 | 1787 | 'page_is_redirect' => $rt !== null ? 1 : 0, |
| 1794 | 1788 | 'page_len' => strlen( $text ), |
| 1795 | 1789 | ), |
| Index: trunk/phase3/includes/HistoryPage.php |
| — | — | @@ -403,9 +403,6 @@ |
| 404 | 404 | if ( $wgUser->isAllowed( 'deleterevision' ) ) { |
| 405 | 405 | $s .= $this->getRevisionButton( 'revisiondelete', 'showhideselectedversions' ); |
| 406 | 406 | } |
| 407 | | - if ( $wgUser->isAllowed( 'revisionmove' ) ) { |
| 408 | | - $s .= $this->getRevisionButton( 'revisionmove', 'revisionmoveselectedversions' ); |
| 409 | | - } |
| 410 | 407 | $this->buttons .= '</div>'; |
| 411 | 408 | $s .= '</div><ul id="pagehistory">' . "\n"; |
| 412 | 409 | return $s; |
| — | — | @@ -510,11 +507,10 @@ |
| 511 | 508 | |
| 512 | 509 | $del = ''; |
| 513 | 510 | // Show checkboxes for each revision |
| 514 | | - if ( $wgUser->isAllowedAny( 'deleterevision', 'revisionmove' ) ) { |
| | 511 | + if ( $wgUser->isAllowed( 'deleterevision' ) ) { |
| 515 | 512 | $this->preventClickjacking(); |
| 516 | 513 | // If revision was hidden from sysops, disable the checkbox |
| 517 | | - // However, if the user has revisionmove rights, we cannot disable the checkbox |
| 518 | | - if ( !$rev->userCan( Revision::DELETED_RESTRICTED ) && !$wgUser->isAllowed( 'revisionmove' ) ) { |
| | 514 | + if ( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
| 519 | 515 | $del = Xml::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) ); |
| 520 | 516 | // Otherwise, enable the checkbox... |
| 521 | 517 | } else { |
| Property changes on: trunk/phase3/includes/HistoryPage.php |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 522 | 518 | Merged /branches/REL1_17/phase3/includes/HistoryPage.php:r81448 |
| Index: trunk/phase3/includes/AutoLoader.php |
| — | — | @@ -673,7 +673,6 @@ |
| 674 | 674 | 'RevDel_ArchivedFileItem' => 'includes/revisiondelete/RevisionDelete.php', |
| 675 | 675 | 'RevDel_LogList' => 'includes/revisiondelete/RevisionDelete.php', |
| 676 | 676 | 'RevDel_LogItem' => 'includes/revisiondelete/RevisionDelete.php', |
| 677 | | - 'SpecialRevisionMove' => 'includes/specials/SpecialRevisionMove.php', |
| 678 | 677 | 'ShortPagesPage' => 'includes/specials/SpecialShortpages.php', |
| 679 | 678 | 'SpecialActiveUsers' => 'includes/specials/SpecialActiveusers.php', |
| 680 | 679 | 'SpecialAllpages' => 'includes/specials/SpecialAllpages.php', |
| Property changes on: trunk/phase3/includes/AutoLoader.php |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 681 | 680 | Merged /branches/REL1_17/phase3/includes/AutoLoader.php:r81448 |
| Index: trunk/phase3/includes/Wiki.php |
| — | — | @@ -556,11 +556,6 @@ |
| 557 | 557 | $special = SpecialPage::getPage( 'Revisiondelete' ); |
| 558 | 558 | $special->execute( '' ); |
| 559 | 559 | break; |
| 560 | | - case 'revisionmove': |
| 561 | | - // For revision move submission from history page |
| 562 | | - $special = SpecialPage::getPage( 'RevisionMove' ); |
| 563 | | - $special->execute( '' ); |
| 564 | | - break; |
| 565 | 560 | default: |
| 566 | 561 | if ( wfRunHooks( 'UnknownAction', array( $act, $article ) ) ) { |
| 567 | 562 | $this->context->output->showErrorPage( 'nosuchaction', 'nosuchactiontext' ); |
| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -4834,7 +4834,6 @@ |
| 4835 | 4835 | 'upload/revert' => 'uploadedimage', |
| 4836 | 4836 | 'move/move' => '1movedto2', |
| 4837 | 4837 | 'move/move_redir' => '1movedto2_redir', |
| 4838 | | - 'move/move_rev' => 'moverevlogentry', |
| 4839 | 4838 | 'import/upload' => 'import-logentry-upload', |
| 4840 | 4839 | 'import/interwiki' => 'import-logentry-interwiki', |
| 4841 | 4840 | 'merge/merge' => 'pagemerge-logentry', |
| Index: trunk/phase3/includes/specials/SpecialRevisionMove.php |
| — | — | @@ -1,400 +0,0 @@ |
| 2 | | -<?php |
| 3 | | -/** |
| 4 | | - * Implements Special:RevisionMove |
| 5 | | - * |
| 6 | | - * This program is free software; you can redistribute it and/or modify |
| 7 | | - * it under the terms of the GNU General Public License as published by |
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
| 9 | | - * (at your option) any later version. |
| 10 | | - * |
| 11 | | - * This program is distributed in the hope that it will be useful, |
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | | - * GNU General Public License for more details. |
| 15 | | - * |
| 16 | | - * You should have received a copy of the GNU General Public License along |
| 17 | | - * with this program; if not, write to the Free Software Foundation, Inc., |
| 18 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | | - * http://www.gnu.org/copyleft/gpl.html |
| 20 | | - * |
| 21 | | - * @file |
| 22 | | - * @ingroup SpecialPage |
| 23 | | - */ |
| 24 | | - |
| 25 | | -/** |
| 26 | | - * Special page allowing users with the appropriate permissions to |
| 27 | | - * move revisions of a page to a new target (either an existing page or not) |
| 28 | | - * |
| 29 | | - * The user selects revisions in the page history (HistoryPage.php), |
| 30 | | - * clicks on the submit button and gets this special page. |
| 31 | | - * A form is shown (showForm()) where the user has to enter a target page |
| 32 | | - * name and confirm the action with a post request & edit token. |
| 33 | | - * Then submit() is called, which does some checks and calls moveRevisions(). |
| 34 | | - * If the target doesn't exist, a new page gets created. rev_page of the |
| 35 | | - * selected revisions is updated, after that it is determined whether page_latest |
| 36 | | - * of the target page and the source page require an update. |
| 37 | | - * |
| 38 | | - * **** NOTE: This feature is EXPERIMENTAL. **** |
| 39 | | - * **** Do not use on any productive system. **** |
| 40 | | - * |
| 41 | | - * @ingroup SpecialPage |
| 42 | | - * @todo In case page_deleted gets introduced some day, use it. |
| 43 | | - * Currently it is possible with RevisionMove to make the latest revision |
| 44 | | - * of a page a RevisionDeleted one. When that happens, the user is presented |
| 45 | | - * an empty page with no error message whatsoever (in case he is not permitted |
| 46 | | - * to view deleted edits). |
| 47 | | -*/ |
| 48 | | -class SpecialRevisionMove extends UnlistedSpecialPage { |
| 49 | | - # common objects |
| 50 | | - var $mOldTitle; # Title object. |
| 51 | | - var $mNewTitle; # Title object. Desired new title |
| 52 | | - var $request; # WebRequest object, $wgRequest by default |
| 53 | | - var $skin; # Skin object |
| 54 | | - var $user; # User object |
| 55 | | - |
| 56 | | - # variables |
| 57 | | - var $mIds; # Array of Ids to look at |
| 58 | | - var $mRevlist; # RevDel_RevisionList object - borrowed from RevisionDelete |
| 59 | | - var $mReason; # User-supplied reason for performing the move operation |
| 60 | | - var $mSubmit; # Boolean: Is this a submitted request? |
| 61 | | - var $mIsAllowedRevisionMove = false; |
| 62 | | - |
| 63 | | - public function __construct( $name = 'RevisionMove' ) { |
| 64 | | - parent::__construct( $name ); |
| 65 | | - } |
| 66 | | - |
| 67 | | - /** |
| 68 | | - * @param $par subpage part, standard special page parameter, is ignored here |
| 69 | | - * |
| 70 | | - * Mostly initializes variables and calls either showForm() or submit() |
| 71 | | - */ |
| 72 | | - public function execute( $par ) { |
| 73 | | - global $wgUser, $wgOut; |
| 74 | | - |
| 75 | | - $this->setHeaders(); |
| 76 | | - $this->outputHeader(); |
| 77 | | - |
| 78 | | - $this->mIsAllowedRevisionMove = $wgUser->isAllowed( 'revisionmove' ); |
| 79 | | - $this->user = $wgUser; |
| 80 | | - $this->skin = $wgUser->getSkin(); |
| 81 | | - |
| 82 | | - if ( !$this->request instanceof WebRequest ) { |
| 83 | | - $this->request = $GLOBALS['wgRequest']; |
| 84 | | - } |
| 85 | | - |
| 86 | | - # Get correct title |
| 87 | | - if ( $this->request->getVal( 'action' ) == 'historysubmit' ) { |
| 88 | | - $this->mOldTitle = Title::newFromText( $this->request->getVal( 'title' ) ); |
| 89 | | - } else { |
| 90 | | - $this->mOldTitle = Title::newFromText( $this->request->getVal( 'oldTitle' ) ); |
| 91 | | - } |
| 92 | | - |
| 93 | | - if ( !$this->mOldTitle instanceof Title ) { |
| 94 | | - $wgOut->showErrorPage( 'revmove-badparam-title', 'revmove-badparam' ); |
| 95 | | - return; |
| 96 | | - } |
| 97 | | - |
| 98 | | - $wgOut->setPagetitle( wfMsg( 'revisionmove', $this->mOldTitle->getPrefixedText() ) ); |
| 99 | | - $oldTitleLink = $this->skin->link( $this->mOldTitle ); |
| 100 | | - $wgOut->setSubtitle( wfMsg( 'revisionmove-backlink', $oldTitleLink ) ); |
| 101 | | - |
| 102 | | - $this->mReason = $this->request->getText( 'wpReason' ); |
| 103 | | - |
| 104 | | - # TODO maybe not needed here? Copied from SpecialRevisiondelete.php. |
| 105 | | - # Keep for now, allow different inputs |
| 106 | | - # Handle our many different possible input types for ids |
| 107 | | - $ids = $this->request->getVal( 'ids' ); |
| 108 | | - if ( !is_null( $ids ) ) { |
| 109 | | - # Allow CSV, for backwards compatibility, or a single ID for show/hide links |
| 110 | | - $this->mIds = explode( ',', $ids ); |
| 111 | | - } else { |
| 112 | | - # Array input |
| 113 | | - $this->mIds = array_keys( $this->request->getArray( 'ids', array() ) ); |
| 114 | | - } |
| 115 | | - $this->mIds = array_unique( array_filter( $this->mIds ) ); |
| 116 | | - |
| 117 | | - if ( is_null ( $this->mIds ) ) { |
| 118 | | - $wgOut->showErrorPage( 'revmove-badparam-title', 'revmove-badparam' ); |
| 119 | | - return; |
| 120 | | - } |
| 121 | | - $this->mRevlist = new RevDel_RevisionList( $this, $this->mOldTitle, $this->mIds ); |
| 122 | | - |
| 123 | | - # Decide what to do: Show the form, or submit the changes |
| 124 | | - if ( $this->request->wasPosted() ) { |
| 125 | | - $this->submit(); |
| 126 | | - } else { |
| 127 | | - $this->showForm(); |
| 128 | | - } |
| 129 | | - } |
| 130 | | - |
| 131 | | - /** |
| 132 | | - * Show a list of items that we will operate on and a field for the target name |
| 133 | | - */ |
| 134 | | - public function showForm() { |
| 135 | | - global $wgOut, $wgUser; |
| 136 | | - |
| 137 | | - if ( !$this->mIsAllowedRevisionMove ) { |
| 138 | | - $permErrors = $this->mOldTitle->getUserPermissionsErrors( 'revisionmove', $this->user ); |
| 139 | | - $wgOut->showPermissionsErrorPage( $permErrors, 'revisionmove' ); |
| 140 | | - return false; |
| 141 | | - } |
| 142 | | - |
| 143 | | - $wgOut->addWikiMsg( 'revmove-explain', $this->mOldTitle->getPrefixedText() ); |
| 144 | | - $listNotEmpty = $this->listItems(); |
| 145 | | - if ( !$listNotEmpty ) { |
| 146 | | - return; # we're done, we already displayed an error earlier |
| 147 | | - } |
| 148 | | - |
| 149 | | - $out = Xml::openElement( 'form', array( 'method' => 'post', |
| 150 | | - 'action' => $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) ), |
| 151 | | - 'id' => 'mw-revmove-form' ) ) . |
| 152 | | - Xml::fieldset( wfMsg( 'revmove-legend' ) ) . |
| 153 | | - Html::hidden( 'wpEditToken', $wgUser->editToken() ) . |
| 154 | | - Html::hidden( 'oldTitle', $this->mOldTitle->getPrefixedText() ) . |
| 155 | | - '<div>' . Xml::inputLabel( wfMsg( 'revmove-reasonfield' ), 'wpReason', |
| 156 | | - 'revmove-reasonfield', 60 ) . '</div>' . |
| 157 | | - Xml::inputLabel( wfMsg( 'revmove-titlefield' ), 'newTitle', 'revmove-titlefield', 20, |
| 158 | | - $this->mOldTitle->getPrefixedText() ) . |
| 159 | | - Html::hidden( 'ids', implode( ',', $this->mIds ) ) . |
| 160 | | - Xml::submitButton( wfMsg( 'revmove-submit' ), |
| 161 | | - array( 'name' => 'wpSubmit' ) ) . |
| 162 | | - Xml::closeElement( 'fieldset' ) . "\n" . |
| 163 | | - Xml::closeElement( 'form' ) . "\n"; |
| 164 | | - $wgOut->addHTML( $out ); |
| 165 | | - } |
| 166 | | - |
| 167 | | - /** |
| 168 | | - * Show a list of selected revisions and check the input |
| 169 | | - */ |
| 170 | | - protected function listItems() { |
| 171 | | - global $wgOut; |
| 172 | | - |
| 173 | | - $wgOut->addHTML( "<ul>" ); |
| 174 | | - |
| 175 | | - $numRevisions = 0; |
| 176 | | - |
| 177 | | - # No revisions specified at all |
| 178 | | - if ( $this->mIds == array() ) { |
| 179 | | - $wgOut->showErrorPage( 'revmove-norevisions-title', 'revmove-norevisions' ); |
| 180 | | - return false; |
| 181 | | - } |
| 182 | | - |
| 183 | | - for ( $this->mRevlist->reset(); $this->mRevlist->current(); $this->mRevlist->next() ) { |
| 184 | | - $item = $this->mRevlist->current(); |
| 185 | | - $numRevisions++; |
| 186 | | - $wgOut->addHTML( $item->getHTML() ); |
| 187 | | - } |
| 188 | | - |
| 189 | | - # No valid revisions specified (e.g. only revs belonging to another page) |
| 190 | | - if ( $numRevisions == 0 ) { |
| 191 | | - $wgOut->showErrorPage( 'revmove-norevisions-title', 'revmove-norevisions' ); |
| 192 | | - return false; |
| 193 | | - } |
| 194 | | - |
| 195 | | - $wgOut->addHTML( "</ul>" ); |
| 196 | | - |
| 197 | | - return true; |
| 198 | | - } |
| 199 | | - |
| 200 | | - /** |
| 201 | | - * Submit the posted changes (in $this->request). |
| 202 | | - * |
| 203 | | - * This function does some checks and then calls moveRevisions(), which does the real work |
| 204 | | - */ |
| 205 | | - public function submit() { |
| 206 | | - global $wgUser, $wgOut; |
| 207 | | - |
| 208 | | - # Confirm permissions |
| 209 | | - if ( !$this->mIsAllowedRevisionMove ) { |
| 210 | | - $permErrors = $this->mOldTitle->getUserPermissionsErrors( 'revisionmove', $this->user ); |
| 211 | | - $wgOut->showPermissionsErrorPage( $permErrors, 'revisionmove' ); |
| 212 | | - return false; |
| 213 | | - } |
| 214 | | - |
| 215 | | - # Confirm Token |
| 216 | | - if ( !$wgUser->matchEditToken( $this->request->getVal( 'wpEditToken' ) ) ) { |
| 217 | | - $wgOut->showErrorPage( 'sessionfailure-title', 'sessionfailure' ); |
| 218 | | - return false; |
| 219 | | - } |
| 220 | | - |
| 221 | | - $this->mNewTitle = Title::newFromText( $this->request->getVal( 'newTitle' ) ); |
| 222 | | - if ( !$this->mNewTitle instanceof Title ) { |
| 223 | | - $wgOut->showErrorPage( 'badtitle', 'badtitletext' ); |
| 224 | | - return false; |
| 225 | | - } |
| 226 | | - |
| 227 | | - if ( $this->mNewTitle->getPrefixedText() == $this->mOldTitle->getPrefixedText() ) { |
| 228 | | - $pagename = array( $this->mOldTitle->getPrefixedText() ); |
| 229 | | - $wgOut->showErrorPage( 'revmove-nullmove-title', 'revmove-nullmove', $pagename ); |
| 230 | | - return; |
| 231 | | - } |
| 232 | | - |
| 233 | | - $this->moveRevisions(); |
| 234 | | - } |
| 235 | | - |
| 236 | | - /** |
| 237 | | - * This function actually move the revision. NEVER call this function, call submit() |
| 238 | | - */ |
| 239 | | - protected function moveRevisions() { |
| 240 | | - $oldArticle = new Article( $this->mOldTitle ); |
| 241 | | - $newArticle = new Article( $this->mNewTitle ); |
| 242 | | - |
| 243 | | - # Get DB connection and begin transaction |
| 244 | | - $dbw = wfGetDB( DB_MASTER ); |
| 245 | | - $dbw->begin(); |
| 246 | | - |
| 247 | | - # Check if the target exists. If not, try creating it |
| 248 | | - if ( !$this->mNewTitle->exists() ) { |
| 249 | | - $newArticle->insertOn( $dbw ); |
| 250 | | - $this->createArticle = true; |
| 251 | | - } else { |
| 252 | | - $this->createArticle = false; |
| 253 | | - } |
| 254 | | - |
| 255 | | - # This is where the magic happens: |
| 256 | | - # Update revision table |
| 257 | | - $dbw->update( 'revision', |
| 258 | | - array( 'rev_page' => $this->mNewTitle->getArticleID() ), |
| 259 | | - array( |
| 260 | | - 'rev_id' => $this->mIds, |
| 261 | | - 'rev_page' => $this->mOldTitle->getArticleID(), |
| 262 | | - ), |
| 263 | | - __METHOD__ |
| 264 | | - ); |
| 265 | | - $modifiedRevsNum = $dbw->affectedRows(); |
| 266 | | - |
| 267 | | - # Check if we need to update page_latest |
| 268 | | - # Get the latest version of the revisions we are moving |
| 269 | | - $timestampNewPage = $this->queryLatestTimestamp( |
| 270 | | - $this->mNewTitle->getArticleID(), |
| 271 | | - array( 'rev_id' => $this->mIds ) |
| 272 | | - ); |
| 273 | | - |
| 274 | | - # Compare the new page's page_latest against db query. |
| 275 | | - # If we create a new page, we have to update anyway |
| 276 | | - |
| 277 | | - $currentNewPageRev = Revision::newFromId( $this->mNewTitle->getLatestRevID() ); |
| 278 | | - if ( $this->createArticle || $timestampNewPage > $currentNewPageRev->getTimestamp() ) { |
| 279 | | - # we have to set page_latest to $timestampNewPage's revid |
| 280 | | - $this->updatePageLatest( |
| 281 | | - $this->mNewTitle, |
| 282 | | - $newArticle, |
| 283 | | - $timestampNewPage, |
| 284 | | - array( 'rev_id' => $this->mIds ) |
| 285 | | - ); |
| 286 | | - } |
| 287 | | - |
| 288 | | - # Update the old page's page_latest field |
| 289 | | - $timestampOldPage = $this->queryLatestTimestamp( |
| 290 | | - $this->mOldTitle->getArticleID() |
| 291 | | - ); |
| 292 | | - |
| 293 | | - # If the timestamp is null that means the page doesn't have |
| 294 | | - # any revisions associated and should be deleted. In other words, |
| 295 | | - # someone misused revisionmove for the normal move function. |
| 296 | | - if ( is_null( $timestampOldPage ) ) { |
| 297 | | - $dbw->delete( |
| 298 | | - 'page', |
| 299 | | - array( 'page_id' => $this->mOldTitle->getArticleID() ), |
| 300 | | - __METHOD__ |
| 301 | | - ); |
| 302 | | - } else { |
| 303 | | - # page_latest has to be updated |
| 304 | | - $currentOldPageRev = Revision::newFromId( $this->mOldTitle->getLatestRevID() ); |
| 305 | | - if ( $timestampOldPage < $currentOldPageRev->getTimestamp() ) { |
| 306 | | - $this->updatePageLatest( |
| 307 | | - $this->mOldTitle, |
| 308 | | - $oldArticle, |
| 309 | | - $timestampOldPage |
| 310 | | - ); |
| 311 | | - } |
| 312 | | - # Purge the old one only if it hasn't been deleted |
| 313 | | - $oldArticle->doPurge(); |
| 314 | | - } |
| 315 | | - |
| 316 | | - # All done, commit |
| 317 | | - $dbw->commit(); |
| 318 | | - |
| 319 | | - $this->logMove( $modifiedRevsNum ); |
| 320 | | - |
| 321 | | - # Purge new article |
| 322 | | - $newArticle->doPurge(); |
| 323 | | - |
| 324 | | - # If noting went wrong (i.e. returned), we are successful |
| 325 | | - $this->showSuccess( $modifiedRevsNum ); |
| 326 | | - } |
| 327 | | - |
| 328 | | - /** |
| 329 | | - * Query for the latest timestamp in order to update page_latest and |
| 330 | | - * page_timestamp. |
| 331 | | - * @param $articleId Integer page_id |
| 332 | | - * @param $conds array database conditions |
| 333 | | - * |
| 334 | | - * @return String timestamp |
| 335 | | - */ |
| 336 | | - protected function queryLatestTimestamp( $articleId, $conds = array() ) { |
| 337 | | - $dbw = wfGetDB( DB_MASTER ); |
| 338 | | - $timestampNewRow = $dbw->selectRow( |
| 339 | | - 'revision', |
| 340 | | - 'max(rev_timestamp) AS maxtime', |
| 341 | | - array_merge( array( 'rev_page' => $articleId ), $conds ), |
| 342 | | - __METHOD__ |
| 343 | | - ); |
| 344 | | - return $timestampNewRow->maxtime; |
| 345 | | - } |
| 346 | | - |
| 347 | | - /** |
| 348 | | - * Updates page_latest and similar database fields (see Article::updateRevisionOn). |
| 349 | | - * Called two times, for the new and the old page |
| 350 | | - * |
| 351 | | - * @param $articleTitle Title object of the page |
| 352 | | - * @param $articleObj Article object of the page |
| 353 | | - * @param $timestamp to search for (use queryLatestTimestamp to get the latest) |
| 354 | | - * @param $conds array database conditions |
| 355 | | - * |
| 356 | | - * @return boolean indicating success |
| 357 | | - */ |
| 358 | | - protected function updatePageLatest( $articleTitle, $articleObj, $timestamp, $conds = array() ) { |
| 359 | | - $dbw = wfGetDB( DB_MASTER ); |
| 360 | | - # Query to find out the rev_id |
| 361 | | - $revisionRow = $dbw->selectRow( |
| 362 | | - 'revision', |
| 363 | | - 'rev_id', |
| 364 | | - array_merge( array( |
| 365 | | - 'rev_timestamp' => $timestamp, |
| 366 | | - 'rev_page' => $articleTitle->getArticleID(), |
| 367 | | - ), $conds ), |
| 368 | | - __METHOD__ |
| 369 | | - ); |
| 370 | | - |
| 371 | | - # Update page_latest |
| 372 | | - $latestRev = Revision::newFromId( $revisionRow->rev_id ); |
| 373 | | - return $articleObj->updateRevisionOn( $dbw, $latestRev, $articleTitle->getLatestRevID(), null, |
| 374 | | - /* set new page flag */ true ); |
| 375 | | - } |
| 376 | | - |
| 377 | | - /** |
| 378 | | - * Add a log entry for the revision move |
| 379 | | - */ |
| 380 | | - protected function logMove( $modifiedRevsNum ) { |
| 381 | | - $paramArray = array( |
| 382 | | - $this->mNewTitle->getPrefixedText(), |
| 383 | | - $modifiedRevsNum |
| 384 | | - ); |
| 385 | | - |
| 386 | | - $log = new LogPage( 'move' ); |
| 387 | | - $log->addEntry( 'move_rev', $this->mOldTitle, $this->mReason, $paramArray, $this->user ); |
| 388 | | - } |
| 389 | | - |
| 390 | | - protected function showSuccess( $modifiedRevsNum ) { |
| 391 | | - global $wgOut; |
| 392 | | - |
| 393 | | - if ( $this->createArticle ) { |
| 394 | | - $wgOut->addWikiMsg( 'revmove-success-created', $modifiedRevsNum, |
| 395 | | - $this->mOldTitle->getPrefixedText(), $this->mNewTitle->getPrefixedText() ); |
| 396 | | - } else { |
| 397 | | - $wgOut->addWikiMsg( 'revmove-success-existing', $modifiedRevsNum, |
| 398 | | - $this->mOldTitle->getPrefixedText(), $this->mNewTitle->getPrefixedText() ); |
| 399 | | - } |
| 400 | | - } |
| 401 | | -} |
| Index: trunk/phase3/includes/SpecialPage.php |
| — | — | @@ -194,7 +194,6 @@ |
| 195 | 195 | 'Myuploads' => 'SpecialMyuploads', |
| 196 | 196 | 'PermanentLink' => 'SpecialPermanentLink', |
| 197 | 197 | 'Revisiondelete' => 'SpecialRevisionDelete', |
| 198 | | - 'RevisionMove' => 'SpecialRevisionMove', |
| 199 | 198 | 'Specialpages' => 'SpecialSpecialpages', |
| 200 | 199 | 'Userlogout' => 'SpecialUserlogout', |
| 201 | 200 | ); |
| Property changes on: trunk/phase3/includes/SpecialPage.php |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 202 | 201 | Merged /branches/REL1_17/phase3/includes/SpecialPage.php:r81448 |
| Index: trunk/phase3/includes/LogPage.php |
| — | — | @@ -259,7 +259,7 @@ |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | // Page moves |
| 263 | | - } elseif ( $type == 'move' && count( $params ) == 3 && $action != 'move_rev' ) { |
| | 263 | + } elseif ( $type == 'move' && count( $params ) == 3 ) { |
| 264 | 264 | if( $params[2] ) { |
| 265 | 265 | if ( $skin ) { |
| 266 | 266 | $details .= ' [' . wfMsg( 'move-redirect-suppressed' ) . ']'; |
| Index: trunk/phase3/languages/messages/MessagesEn.php |
| — | — | @@ -1579,27 +1579,6 @@ |
| 1580 | 1580 | 'suppressionlogtext' => 'Below is a list of deletions and blocks involving content hidden from administrators. |
| 1581 | 1581 | See the [[Special:BlockList|IP block list]] for the list of currently operational bans and blocks.', |
| 1582 | 1582 | |
| 1583 | | -# Revision move |
| 1584 | | -'moverevlogentry' => 'moved {{PLURAL:$3|one revision|$3 revisions}} from $1 to $2', |
| 1585 | | -'revisionmove' => 'Move revisions from "$1"', |
| 1586 | | -'revisionmove-backlink' => '← $1', # only translate this message to other languages if you have to change it |
| 1587 | | -'revmove-explain' => 'The following revisions will be moved from $1 to the specified target page. If the target does not exist, it is created. Otherwise, these revisions will be merged into the page history.', |
| 1588 | | -'revmove-legend' => 'Set target page and summary', |
| 1589 | | -'revmove-submit' => 'Move revisions to selected page', |
| 1590 | | -'revisionmoveselectedversions' => 'Move selected revisions', |
| 1591 | | -'revmove-reasonfield' => 'Reason:', |
| 1592 | | -'revmove-titlefield' => 'Target page:', |
| 1593 | | -'revmove-badparam-title' => 'Bad parameters', |
| 1594 | | -'revmove-badparam' => 'Your request contains illegal or insufficient parameters. |
| 1595 | | -Go back to the previous page and try again.', |
| 1596 | | -'revmove-norevisions-title' => 'Invalid target revision', |
| 1597 | | -'revmove-norevisions' => 'You have not specified one or more target revisions to perform this function or the specified revision does not exist.', |
| 1598 | | -'revmove-nullmove-title' => 'Bad title', |
| 1599 | | -'revmove-nullmove' => 'The target page cannot be the same as the source page. |
| 1600 | | -Go back to the previous page and choose a different name from "$1".', |
| 1601 | | -'revmove-success-existing' => '{{PLURAL:$1|One revision from [[$2]] has|$1 revisions from [[$2]] have}} been moved to the existing page [[$3]].', |
| 1602 | | -'revmove-success-created' => '{{PLURAL:$1|One revision from [[$2]] has|$1 revisions from [[$2]] have}} been moved to the newly created page [[$3]].', |
| 1603 | | - |
| 1604 | 1583 | # History merging |
| 1605 | 1584 | 'mergehistory' => 'Merge page histories', |
| 1606 | 1585 | 'mergehistory-header' => 'This page lets you merge revisions of the history of one source page into a newer page. |
| — | — | @@ -1968,7 +1947,6 @@ |
| 1969 | 1948 | 'right-reset-passwords' => "Reset other users' passwords", |
| 1970 | 1949 | 'right-override-export-depth' => 'Export pages including linked pages up to a depth of 5', |
| 1971 | 1950 | 'right-sendemail' => 'Send e-mail to other users', |
| 1972 | | -'right-revisionmove' => 'Move revisions', |
| 1973 | 1951 | |
| 1974 | 1952 | # User rights log |
| 1975 | 1953 | 'rightslog' => 'User rights log', |
| — | — | @@ -2011,7 +1989,6 @@ |
| 2012 | 1990 | 'action-userrights' => 'edit all user rights', |
| 2013 | 1991 | 'action-userrights-interwiki' => 'edit user rights of users on other wikis', |
| 2014 | 1992 | 'action-siteadmin' => 'lock or unlock the database', |
| 2015 | | -'action-revisionmove' => 'move revisions', |
| 2016 | 1993 | |
| 2017 | 1994 | # Recent changes |
| 2018 | 1995 | 'nchanges' => '$1 {{PLURAL:$1|change|changes}}', |
| Property changes on: trunk/phase3 |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 2019 | 1996 | Merged /branches/REL1_17/phase3:r81448 |