Index: trunk/extensions/DeleteQueue/DeleteQueue.hooks.php |
— | — | @@ -43,9 +43,9 @@ |
44 | 44 | 'class' => $selected ? 'selected' : false ); |
45 | 45 | } |
46 | 46 | |
47 | | - $actions['delvote'] = array( |
48 | | - 'text' => wfMsg('deletequeue-vote-tab'), |
49 | | - 'href' => $st->mTitle->getLocalUrl( 'action=delvote' ), |
| 47 | + $actions['deletequeue'] = array( |
| 48 | + 'text' => wfMsg('deletequeue-action-queued'), |
| 49 | + 'href' => $st->mTitle->getLocalUrl( 'action=deletequeue' ), |
50 | 50 | 'class' => ($action == 'delvote') ? 'selected' : false ); |
51 | 51 | } |
52 | 52 | |
— | — | @@ -65,7 +65,15 @@ |
66 | 66 | global $wgOut; |
67 | 67 | |
68 | 68 | $wgOut->setPageTitle( wfMsg( 'deletequeue-action-title', $article->mTitle->getPrefixedText() ) ); |
69 | | - $wgOut->addWikitext( wfMsg( 'deletequeue-action-text' ) ); |
| 69 | + |
| 70 | + $dqi = DeleteQueueItem::newFromArticle( $article ); |
| 71 | + |
| 72 | + if ( $dqi->getQueue() == '' ) |
| 73 | + $wgOut->addWikiMsg('deletequeue-action-text' ); |
| 74 | + else { |
| 75 | + self::onArticleViewHeader( $article ); |
| 76 | + $wgOut->addWikiMsg( 'deletequeue-action-text-queued' ); |
| 77 | + } |
70 | 78 | return false; |
71 | 79 | } elseif ( $action == 'delreview' ) { |
72 | 80 | wfLoadExtensionMessages( 'DeleteQueue' ); |
Index: trunk/extensions/DeleteQueue/ReviewForm.php |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | if ($processed) { |
80 | 80 | // Delete from the DB |
81 | 81 | $dqi->deQueue( ); |
82 | | - |
| 82 | + |
83 | 83 | // Redirect to the page |
84 | 84 | $wgOut->redirect( $article->mTitle->getLocalURL() ); |
85 | 85 | |
Index: trunk/extensions/DeleteQueue/DeleteQueueItem.php |
— | — | @@ -300,6 +300,9 @@ |
301 | 301 | * @param User $user The user to assign to that role. Optional. |
302 | 302 | */ |
303 | 303 | public function addRole( $role, $user=null ) { |
| 304 | + if (!$this->getCaseID()) |
| 305 | + return; // Case doesn't exist anymore. |
| 306 | + |
304 | 307 | if ( $user == null ) { |
305 | 308 | global $wgUser; |
306 | 309 | $user = $wgUser; |
— | — | @@ -322,6 +325,9 @@ |
323 | 326 | * @param string $user The user who's voted (Optional) |
324 | 327 | */ |
325 | 328 | public function addVote( $action, $comments, $user = null ) { |
| 329 | + if (!$this->getCaseID()) |
| 330 | + return; // Case doesn't exist anymore. |
| 331 | + |
326 | 332 | if ( $user == null ) { |
327 | 333 | global $wgUser; |
328 | 334 | $user = $wgUser; |
— | — | @@ -355,6 +361,10 @@ |
356 | 362 | * @param string $timestamp Timestamp in database format. Optional. |
357 | 363 | */ |
358 | 364 | public function setQueue( $queue, $reason, $timestamp = null ) { |
| 365 | + |
| 366 | + if (!$this->getCaseID()) |
| 367 | + return; // Case doesn't exist anymore. |
| 368 | + |
359 | 369 | $dbw = wfGetDB( DB_MASTER ); |
360 | 370 | |
361 | 371 | if ($timestamp == null) { |
— | — | @@ -405,15 +415,20 @@ |
406 | 416 | // Reload new data from the master. |
407 | 417 | $this->loadData(true); |
408 | 418 | |
409 | | - $this->getArticle()->mTitle->invalidateCache(); |
410 | | - $this->getArticle()->mTitle->purgeSquid(); |
| 419 | + if ($this->getArticle()->mTitle) { |
| 420 | + $this->getArticle()->mTitle->invalidateCache(); |
| 421 | + $this->getArticle()->mTitle->purgeSquid(); |
| 422 | + } |
411 | 423 | } |
412 | 424 | |
413 | 425 | /** |
414 | 426 | * Remove this page from all queues |
415 | 427 | */ |
416 | | - public function deQueue( $article ) { |
| 428 | + public function deQueue( ) { |
417 | 429 | $dbw = wfGetDB( DB_MASTER ); |
| 430 | + |
| 431 | + if (!$this->getCaseID()) |
| 432 | + return; // Case doesn't exist anymore. |
418 | 433 | |
419 | 434 | $dbw->update( 'delete_queue', array( 'dq_active' => 0 ), array( 'dq_case' => $this->getCaseID() ), __METHOD__ ); |
420 | 435 | |
Index: trunk/extensions/DeleteQueue/DeleteQueue.php |
— | — | @@ -45,14 +45,14 @@ |
46 | 46 | $wgAvailableRights[] = 'deletediscuss-review'; |
47 | 47 | $wgAvailableRights[] = 'deletequeue-vote'; |
48 | 48 | |
49 | | -$wgGroupPermissions['sysop']['prod-admin'] = true; |
50 | 49 | $wgGroupPermissions['sysop']['speedy-review'] = true; |
51 | 50 | $wgGroupPermissions['sysop']['deletediscuss-review'] = true; |
| 51 | +$wgGroupPermissions['sysop']['prod-review'] = true; |
52 | 52 | |
53 | | -$wgGroupPermissions['autoconfirmed']['prod-review'] = true; |
54 | 53 | $wgGroupPermissions['autoconfirmed']['deletequeue-vote'] = true; |
55 | 54 | $wgGroupPermissions['autoconfirmed']['speedy-nominate'] = true; |
56 | 55 | $wgGroupPermissions['autoconfirmed']['prod-nominate'] = true; |
| 56 | +$wgGroupPermissions['autoconfirmed']['deletediscuss-nominate'] = true; |
57 | 57 | |
58 | 58 | $wgLogActions['delete/nominate'] = 'deletequeue-log-nominate'; |
59 | 59 | $wgLogActions['delete/dequeue'] = 'deletequeue-log-dequeue'; |