public function getUserAssignedRows(WAPUser &$u, $offset, $rows = NUM_ROWS)
 {
     global $wgUser;
     $vars['u'] = $u;
     $vars['articles'] = $u->getAssignedArticles($offset, $rows);
     $vars['numrows'] = $rows;
     $vars['tag'] = $rawTag;
     $config = WAPDB::getInstance($this->dbType)->getWAPConfig();
     $userClass = $config->getUserClassName();
     $vars['currentUser'] = $userClass::newFromUserObject($wgUser, $this->dbType);
     $linkerClass = $config->getLinkerClassName();
     $vars['linker'] = new $linkerClass($this->dbType);
     $tmpl = new WAPTemplate($this->dbType);
     return $tmpl->getHtml('user_assigned_pager_rows.tmpl.php', $vars);
 }
Example #2
0
 public function releaseArticles(&$aids, $langCode, WAPUser &$wu)
 {
     if (!empty($aids) && !empty($langCode)) {
         $aids = array_unique($aids);
         $ids = "(" . implode(",", $aids) . ")";
         $conds = array("ct_page_id IN {$ids}", "ct_lang_code" => $langCode);
         // If not a staff user, only allow updates to rows which user is assigned to
         if (!$wu->inGroup('staff')) {
             $conds["ct_user_id"] = $wu->getId();
         }
         $dbw = wfGetDB(DB_MASTER);
         $articleTable = $this->getWAPConfig()->getArticleTableName();
         $articleTagTable = $this->getWAPConfig()->getArticleTagTableName();
         $dbw->update($articleTable, array('ct_completed' => 0, 'ct_reserved_timestamp' => '', 'ct_user_id' => 0, 'ct_user_text' => ''), $conds, __METHOD__);
         $dbw->update($articleTagTable, array('ca_reserved' => 0), array("ca_page_id IN {$ids}", "ca_lang_code" => $langCode), __METHOD__);
     }
 }
 public function getViewableTags(WAPUser &$user)
 {
     if ($user->inGroup(WAPDB::getInstance($this->dbType)->getWAPConfig()->getWikiHowAdminGroupName())) {
         return $this->getTags();
     } else {
         $tags = array();
         foreach ($this->getTags() as $aTag) {
             foreach ($user->getTags() as $uTag) {
                 if ($aTag['raw_tag'] == $uTag['raw_tag']) {
                     $tags[] = $aTag;
                 }
             }
         }
         return $tags;
     }
 }