예제 #1
0
 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;
 }