function execute()
 {
     global $wgOut, $wgLang;
     $stats = RepoStats::newFromRepo($this->mRepo);
     $repoName = $this->mRepo->getName();
     $wgOut->wrapWikiMsg('<h2 id="stats-main">$1</h2>', array('code-stats-header', $repoName));
     $wgOut->addWikiMsg('code-stats-main', $wgLang->timeanddate($stats->time, true), $wgLang->formatNum($stats->revisions), $repoName, $wgLang->formatNum($stats->authors), $wgLang->time($stats->time, true), $wgLang->date($stats->time, true));
     if (!empty($stats->states)) {
         $wgOut->wrapWikiMsg('<h3 id="stats-revisions">$1</h3>', 'code-stats-status-breakdown');
         $wgOut->addHTML('<table class="wikitable">' . '<tr><th>' . wfMsgHtml('code-field-status') . '</th><th>' . wfMsgHtml('code-stats-count') . '</th></tr>');
         foreach (CodeRevision::getPossibleStates() as $state) {
             $count = isset($stats->states[$state]) ? $stats->states[$state] : 0;
             $count = htmlspecialchars($wgLang->formatNum($count));
             $link = Linker::link(SpecialPage::getTitleFor('Code', $repoName . '/status/' . $state), htmlspecialchars($this->statusDesc($state)));
             $wgOut->addHTML("<tr><td>{$link}</td>" . "<td class=\"mw-codereview-status-{$state}\">{$count}</td></tr>");
         }
         $wgOut->addHTML('</table>');
     }
     if (!empty($stats->fixmes)) {
         $this->writeAuthorStatusTable('fixme', $stats->fixmes);
     }
     if (!empty($stats->new)) {
         $this->writeAuthorStatusTable('new', $stats->new);
     }
     if (!empty($stats->fixmesPerPath)) {
         $this->writeStatusPathTable('fixme', $stats->fixmesPerPath);
     }
     if (!empty($stats->newPerPath)) {
         $this->writeStatusPathTable('new', $stats->newPerPath);
     }
 }
 function execute()
 {
     global $wgOut;
     $name = $this->mRepo->getName();
     $states = CodeRevision::getPossibleStates();
     $wgOut->wrapWikiMsg("== \$1 ==", 'code-field-status');
     $table_rows = '';
     foreach ($states as $state) {
         $link = $this->skin->link(SpecialPage::getTitleFor('Code', $name . "/status/{$state}"), wfMsgHtml("code-status-" . $state));
         $table_rows .= "<tr><td class=\"mw-codereview-status-{$state}\">{$link}</td>" . "<td>" . wfMsgHtml("code-status-desc-" . $state) . "</td></tr>\n";
     }
     $wgOut->addHTML('<table class="wikitable">' . '<tr><th>' . wfMsgHtml('code-field-status') . '</th>' . '<th>' . wfMsgHtml('code-field-status-description') . '</th></tr>' . $table_rows . '</table>');
 }
Beispiel #3
0
 /**
  * @static
  * @param string $status
  * @param CodeView $view
  * @return string
  */
 static function buildStatusList($status, $view)
 {
     $states = CodeRevision::getPossibleStates();
     $out = '';
     foreach ($states as $state) {
         $out .= Xml::option($view->statusDesc($state), $state, $status === $state);
     }
     return $out;
 }
Beispiel #4
0
 public function getAllowedParams()
 {
     $flags = CodeRevision::getPossibleFlags();
     return array('repo' => array(ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_REQUIRED => true), 'rev' => array(ApiBase::PARAM_TYPE => 'integer', ApiBase::PARAM_MIN => 1, ApiBase::PARAM_REQUIRED => true), 'comment' => null, 'status' => array(ApiBase::PARAM_TYPE => CodeRevision::getPossibleStates()), 'addtags' => array(ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_ISMULTI => true), 'removetags' => array(ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_ISMULTI => true), 'addflags' => array(ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_TYPE => $flags), 'removeflags' => array(ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_TYPE => $flags), 'addreferences' => array(ApiBase::PARAM_TYPE => 'integer', ApiBase::PARAM_ISMULTI => true), 'removereferences' => array(ApiBase::PARAM_TYPE => 'integer', ApiBase::PARAM_ISMULTI => true), 'addreferenced' => array(ApiBase::PARAM_TYPE => 'integer', ApiBase::PARAM_ISMULTI => true), 'removereferenced' => array(ApiBase::PARAM_TYPE => 'integer', ApiBase::PARAM_ISMULTI => true), 'token' => null);
 }
 /**
  * @param $pager SvnTablePager
  *
  * @return string
  */
 function showForm($pager)
 {
     global $wgScript, $wgRequest;
     $states = CodeRevision::getPossibleStates();
     $name = $this->mRepo->getName();
     $title = SpecialPage::getTitleFor('Code', $name);
     $options = array(Xml::option('', $title->getPrefixedText(), $this->mStatus == ''));
     foreach ($states as $key => $state) {
         $title = SpecialPage::getTitleFor('Code', $name . "/status/{$state}");
         $options[] = Xml::option(wfMsgHtml("code-status-{$state}"), $title->getPrefixedText(), $this->mStatus == $state);
     }
     $ret = "<fieldset><legend>" . wfMsgHtml('code-pathsearch-legend') . "</legend>" . '<table width="100%"><tr><td>' . Xml::openElement('form', array('action' => $wgScript, 'method' => 'get')) . Xml::inputlabel(wfMsg("code-pathsearch-path"), 'path', 'path', 55, $this->getPathsAsString(), array('dir' => 'ltr')) . '&#160;' . Xml::label(wfMsg('code-pathsearch-filter'), 'code-status-filter') . '&#160;' . Xml::openElement('select', array('id' => 'code-status-filter', 'name' => 'title')) . "\n" . implode("\n", $options) . "\n" . Xml::closeElement('select') . '&#160;' . Xml::submitButton(wfMsg('allpagessubmit')) . $pager->getHiddenFields(array('path', 'title')) . Xml::closeElement('form') . '</td></tr></table></fieldset>';
     return $ret;
 }