2012-12-30 15:37:49 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorConfigIssueViewController
|
|
|
|
extends PhabricatorConfigController {
|
|
|
|
|
|
|
|
private $issueKey;
|
|
|
|
|
|
|
|
public function willProcessRequest(array $data) {
|
|
|
|
$this->issueKey = $data['key'];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$user = $request->getUser();
|
|
|
|
|
|
|
|
$issues = PhabricatorSetupCheck::runAllChecks();
|
2013-02-22 18:21:01 +01:00
|
|
|
PhabricatorSetupCheck::setOpenSetupIssueCount(
|
|
|
|
PhabricatorSetupCheck::countUnignoredIssues($issues));
|
2012-12-30 15:37:49 +01:00
|
|
|
|
|
|
|
if (empty($issues[$this->issueKey])) {
|
|
|
|
$content = id(new AphrontErrorView())
|
|
|
|
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
|
|
|
|
->setTitle(pht('Issue Resolved'))
|
|
|
|
->appendChild(pht('This setup issue has been resolved. '))
|
|
|
|
->appendChild(
|
2013-01-18 04:15:06 +01:00
|
|
|
phutil_tag(
|
2012-12-30 15:37:49 +01:00
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'href' => $this->getApplicationURI('issue/'),
|
|
|
|
),
|
|
|
|
pht('Return to Open Issue List')));
|
|
|
|
$title = pht('Resolved Issue');
|
|
|
|
} else {
|
|
|
|
$issue = $issues[$this->issueKey];
|
|
|
|
$content = $this->renderIssue($issue);
|
|
|
|
$title = $issue->getShortName();
|
|
|
|
}
|
|
|
|
|
|
|
|
$crumbs = $this
|
2013-01-01 23:09:29 +01:00
|
|
|
->buildApplicationCrumbs()
|
2013-12-19 02:47:34 +01:00
|
|
|
->addTextCrumb(pht('Setup Issues'), $this->getApplicationURI('issue/'))
|
|
|
|
->addTextCrumb($title, $request->getRequestURI());
|
2012-12-30 15:37:49 +01:00
|
|
|
|
|
|
|
return $this->buildApplicationPage(
|
2013-01-01 23:09:29 +01:00
|
|
|
array(
|
|
|
|
$crumbs,
|
|
|
|
$content,
|
|
|
|
),
|
2012-12-30 15:37:49 +01:00
|
|
|
array(
|
|
|
|
'title' => $title,
|
2013-02-19 22:33:10 +01:00
|
|
|
));
|
2012-12-30 15:37:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private function renderIssue(PhabricatorSetupIssue $issue) {
|
|
|
|
require_celerity_resource('setup-issue-css');
|
|
|
|
|
|
|
|
$view = new PhabricatorSetupIssueView();
|
|
|
|
$view->setIssue($issue);
|
|
|
|
|
2013-01-30 20:26:03 +01:00
|
|
|
$container = phutil_tag(
|
2012-12-30 15:37:49 +01:00
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'class' => 'setup-issue-background',
|
|
|
|
),
|
|
|
|
$view->render());
|
|
|
|
|
|
|
|
return $container;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|