1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Fix board links in TaskDetail

Summary: Not sure if this is the correct fix, but I think it's where you intend to go?

Test Plan: Click on link in Task, get the the correct board. Click lots of links of boards and make sure everything still works.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5361

Differential Revision: https://secure.phabricator.com/D9520
This commit is contained in:
Chad Little 2014-06-13 14:09:21 -07:00
parent cc5ba7e801
commit fefe5ae27c
3 changed files with 13 additions and 11 deletions

View file

@ -565,16 +565,10 @@ final class ManiphestTaskDetailController extends ManiphestController {
$column = head(array_intersect_key($columns, $in_column_phids)); $column = head(array_intersect_key($columns, $in_column_phids));
if ($column) { if ($column) {
$column_name = pht('(%s)', $column->getDisplayName()); $column_name = pht('(%s)', $column->getDisplayName());
// TODO: This is really hacky but there's no cleaner way to do it
// right now, T4022 should give us better tools for this.
$column_href = str_replace(
'project/view',
'project/board',
$handle->getURI());
$column_link = phutil_tag( $column_link = phutil_tag(
'a', 'a',
array( array(
'href' => $column_href, 'href' => $handle->getURI().'board/',
'class' => 'maniphest-board-link', 'class' => 'maniphest-board-link',
), ),
$column_name); $column_name);

View file

@ -79,6 +79,7 @@ final class PhabricatorApplicationProject extends PhabricatorApplication {
), ),
'/tag/' => array( '/tag/' => array(
'(?P<slug>[^/]+)/' => 'PhabricatorProjectProfileController', '(?P<slug>[^/]+)/' => 'PhabricatorProjectProfileController',
'(?P<slug>[^/]+)/board/' => 'PhabricatorProjectBoardViewController',
), ),
); );
} }

View file

@ -4,6 +4,7 @@ final class PhabricatorProjectBoardViewController
extends PhabricatorProjectBoardController { extends PhabricatorProjectBoardController {
private $id; private $id;
private $slug;
private $handles; private $handles;
private $queryKey; private $queryKey;
private $filter; private $filter;
@ -13,7 +14,8 @@ final class PhabricatorProjectBoardViewController
} }
public function willProcessRequest(array $data) { public function willProcessRequest(array $data) {
$this->id = $data['id']; $this->id = idx($data, 'id');
$this->slug = idx($data, 'slug');
$this->queryKey = idx($data, 'queryKey'); $this->queryKey = idx($data, 'queryKey');
$this->filter = (bool)idx($data, 'filter'); $this->filter = (bool)idx($data, 'filter');
} }
@ -24,12 +26,17 @@ final class PhabricatorProjectBoardViewController
$project = id(new PhabricatorProjectQuery()) $project = id(new PhabricatorProjectQuery())
->setViewer($viewer) ->setViewer($viewer)
->needImages(true) ->needImages(true);
->withIDs(array($this->id)) if ($this->slug) {
->executeOne(); $project->withSlugs(array($this->slug));
} else {
$project->withIDs(array($this->id));
}
$project = $project->executeOne();
if (!$project) { if (!$project) {
return new Aphront404Response(); return new Aphront404Response();
} }
$this->setProject($project); $this->setProject($project);
$columns = id(new PhabricatorProjectColumnQuery()) $columns = id(new PhabricatorProjectColumnQuery())