static function undoTip($tipId, $qcId, $userId)
 {
     if (!$tipId || !$qcId) {
         return false;
     }
     // tip is is QC, remove it from there
     QCRuleTip::deleteIfNotPatrolled($qcId, $userId);
     // we just need to get the tip page and the tip from here
     $tipData = TipsPatrol::getTipLogRow($tipId);
     // tip data to add back to tipsandwarnings table
     $data = array("tw_page" => $tipData['tw_page'], "tw_tip" => $tipData['tw_tip'], "tw_user" => $userId, "tw_timestamp" => wfTimestampNow());
     // now delete the tips with this id from the log and put it back into the main queue
     $dbw = wfGetDB(DB_MASTER);
     $dbw->insert('tipsandwarnings', $data, __METHOD__, array('IGNORE'));
     $dbw->delete('tipsandwarnings_log', array('tw_id' => $tipId));
     return true;
 }
Example #2
0
 private function addToQG($tipId, $articleId, $tip, &$result)
 {
     $title = Title::newFromID($articleId);
     if ($title) {
         $article = new Article($title);
         if ($article) {
             //Add it to the QG queue
             $l = new QCRuleTip($article, $tipId);
             $l->process();
             //remove it from Tips Patrol queue
             $dbw = wfGetDB(DB_MASTER);
             $dbw->delete('tipsandwarnings', array('tw_id' => $tipId), __METHOD__);
             //log it
             $logPage = new LogPage('newtips', false);
             $logData = array($tipId);
             $logMsg = wfMsg('newtips-sentToQG-logentry', $title->getFullText(), $tip);
             $logS = $logPage->addEntry("Approved", $title, $logMsg, $logData);
             $result['debug'][] = "processed";
         }
     }
     return;
 }