mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 02:02:41 +01:00
82 lines
2 KiB
PHP
82 lines
2 KiB
PHP
|
<?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();
|
||
|
|
||
|
$nav = $this->buildSideNavView();
|
||
|
|
||
|
$issues = PhabricatorSetupCheck::runAllChecks();
|
||
|
PhabricatorSetupCheck::setOpenSetupIssueCount(count($issues));
|
||
|
|
||
|
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(
|
||
|
phutil_render_tag(
|
||
|
'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();
|
||
|
}
|
||
|
|
||
|
$nav->appendChild($content);
|
||
|
|
||
|
$crumbs = $this
|
||
|
->buildApplicationCrumbs($nav)
|
||
|
->addCrumb(
|
||
|
id(new PhabricatorCrumbView())
|
||
|
->setName(pht('Setup Issues'))
|
||
|
->setHref($this->getApplicationURI('issue/')))
|
||
|
->addCrumb(
|
||
|
id(new PhabricatorCrumbView())
|
||
|
->setName($title)
|
||
|
->setHref($request->getRequestURI()));
|
||
|
|
||
|
$nav->setCrumbs($crumbs);
|
||
|
|
||
|
return $this->buildApplicationPage(
|
||
|
$nav,
|
||
|
array(
|
||
|
'title' => $title,
|
||
|
'device' => true,
|
||
|
)
|
||
|
);
|
||
|
}
|
||
|
|
||
|
private function renderIssue(PhabricatorSetupIssue $issue) {
|
||
|
require_celerity_resource('setup-issue-css');
|
||
|
|
||
|
$view = new PhabricatorSetupIssueView();
|
||
|
$view->setIssue($issue);
|
||
|
$view;
|
||
|
|
||
|
$container = phutil_render_tag(
|
||
|
'div',
|
||
|
array(
|
||
|
'class' => 'setup-issue-background',
|
||
|
),
|
||
|
$view->render());
|
||
|
|
||
|
return $container;
|
||
|
}
|
||
|
|
||
|
}
|