Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/view/ProjectBoardTaskCard.php
<?php | <?php | ||||
final class ProjectBoardTaskCard extends Phobject { | final class ProjectBoardTaskCard extends Phobject { | ||||
private $viewer; | private $viewer; | ||||
private $projectHandles; | private $projectHandles; | ||||
private $task; | private $task; | ||||
private $owner; | private $owner; | ||||
private $canEdit; | private $canEdit; | ||||
private $coverImageFile; | private $coverImageFile; | ||||
private $hideArchivedProjects; | |||||
public function setViewer(PhabricatorUser $viewer) { | public function setViewer(PhabricatorUser $viewer) { | ||||
$this->viewer = $viewer; | $this->viewer = $viewer; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getViewer() { | public function getViewer() { | ||||
return $this->viewer; | return $this->viewer; | ||||
} | } | ||||
Show All 11 Lines | public function setCoverImageFile(PhabricatorFile $cover_image_file) { | ||||
$this->coverImageFile = $cover_image_file; | $this->coverImageFile = $cover_image_file; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getCoverImageFile() { | public function getCoverImageFile() { | ||||
return $this->coverImageFile; | return $this->coverImageFile; | ||||
} | } | ||||
public function setHideArchivedProjects($hide_archived_projects) { | |||||
$this->hideArchivedProjects = $hide_archived_projects; | |||||
return $this; | |||||
} | |||||
public function getHideArchivedProjects() { | |||||
return $this->hideArchivedProjects; | |||||
} | |||||
public function setTask(ManiphestTask $task) { | public function setTask(ManiphestTask $task) { | ||||
$this->task = $task; | $this->task = $task; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getTask() { | public function getTask() { | ||||
return $this->task; | return $this->task; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | if ($task->isClosed()) { | ||||
->setIcon($icon.' grey'); | ->setIcon($icon.' grey'); | ||||
$card->addAttribute($icon); | $card->addAttribute($icon); | ||||
$card->setBarColor('grey'); | $card->setBarColor('grey'); | ||||
} | } | ||||
$project_handles = $this->getProjectHandles(); | $project_handles = $this->getProjectHandles(); | ||||
// Remove any archived projects from the list. | // Remove any archived projects from the list. | ||||
if ($this->hideArchivedProjects) { | |||||
if ($project_handles) { | if ($project_handles) { | ||||
foreach ($project_handles as $key => $handle) { | foreach ($project_handles as $key => $handle) { | ||||
if ($handle->getStatus() == PhabricatorObjectHandle::STATUS_CLOSED) { | if ($handle->getStatus() == PhabricatorObjectHandle::STATUS_CLOSED) { | ||||
unset($project_handles[$key]); | unset($project_handles[$key]); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | |||||
if ($project_handles) { | if ($project_handles) { | ||||
$project_handles = array_reverse($project_handles); | $project_handles = array_reverse($project_handles); | ||||
$tag_list = id(new PHUIHandleTagListView()) | $tag_list = id(new PHUIHandleTagListView()) | ||||
->setSlim(true) | ->setSlim(true) | ||||
->setHandles($project_handles); | ->setHandles($project_handles); | ||||
$card->addAttribute($tag_list); | $card->addAttribute($tag_list); | ||||
} | } | ||||
$card->addClass('phui-workcard'); | $card->addClass('phui-workcard'); | ||||
return $card; | return $card; | ||||
} | } | ||||
} | } |