mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Modernize Maniphest
Summary: Updates (some) of Maniphest for modern methods. Didn't convert Reports (probably need a setNavigation call added). Test Plan: View List, edit task, new task, view reports. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D14597
This commit is contained in:
parent
f6c98a55a4
commit
b9fcaadce8
3 changed files with 32 additions and 31 deletions
|
@ -6,21 +6,17 @@ abstract class ManiphestController extends PhabricatorController {
|
|||
return $this->buildSideNavView(true)->getMenu();
|
||||
}
|
||||
|
||||
public function buildSideNavView($for_app = false) {
|
||||
$user = $this->getRequest()->getUser();
|
||||
public function buildSideNavView() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$nav = new AphrontSideNavFilterView();
|
||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||
|
||||
if ($for_app) {
|
||||
$nav->addFilter('task/create/', pht('Create Task'));
|
||||
}
|
||||
|
||||
id(new ManiphestTaskSearchEngine())
|
||||
->setViewer($user)
|
||||
->setViewer($viewer)
|
||||
->addNavigationItems($nav->getMenu());
|
||||
|
||||
if ($user->isLoggedIn()) {
|
||||
if ($viewer->isLoggedIn()) {
|
||||
// For now, don't give logged-out users access to reports.
|
||||
$nav->addLabel(pht('Reports'));
|
||||
$nav->addFilter('report', pht('Reports'));
|
||||
|
|
|
@ -349,19 +349,23 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
|||
$object_box->addPropertyList($description);
|
||||
}
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$info_view,
|
||||
$object_box,
|
||||
$timeline,
|
||||
$comment_box,
|
||||
$preview_panel,
|
||||
),
|
||||
array(
|
||||
'title' => 'T'.$task->getID().' '.$task->getTitle(),
|
||||
'pageObjects' => array($task->getPHID()),
|
||||
));
|
||||
$title = 'T'.$task->getID().' '.$task->getTitle();
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setPageObjectPHIDs(
|
||||
array(
|
||||
$task->getPHID(),
|
||||
))
|
||||
->appendChild(
|
||||
array(
|
||||
$info_view,
|
||||
$object_box,
|
||||
$timeline,
|
||||
$comment_box,
|
||||
$preview_panel,
|
||||
));
|
||||
}
|
||||
|
||||
private function buildHeaderView(ManiphestTask $task) {
|
||||
|
|
|
@ -741,16 +741,17 @@ final class ManiphestTaskEditController extends ManiphestController {
|
|||
|
||||
$crumbs->addTextCrumb($header_name);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$crumbs,
|
||||
$form_box,
|
||||
$preview,
|
||||
),
|
||||
array(
|
||||
'title' => $header_name,
|
||||
'pageObjects' => $page_objects,
|
||||
));
|
||||
$title = $header_name;
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setPageObjectPHIDs($page_objects)
|
||||
->appendChild(
|
||||
array(
|
||||
$form_box,
|
||||
$preview,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue