1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-14 15:58:39 +01:00
phorge-phorge/src/view/phui/PHUIWorkpanelView.php
epriestley 90a0459821 Roughly implement milestone columns on workboards
Summary:
Ref T10010. These aren't perfect but I think (?) they aren't horribly broken.

  - When a project is a parent project, destroy (as far as the user can tell) any custom columns.
  - When a project has milestones, automatically generate columns on the project's workboard (if it has a workboard).
  - When you move tasks between milestones, add the proper milestone tag.
  - When you move tasks out of milestones back into the backlog, add the proper parent project tag.
  - (Plenty of UI / design stuff to adjust.)

Test Plan:
  - Dragged stuff between milestone columns.
  - Used a normal workboard.
  - Wasn't able to find any egregiously bad cases that did anything terrible.

{F1088224}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10010

Differential Revision: https://secure.phabricator.com/D15171
2016-02-03 16:37:59 -08:00

107 lines
2.2 KiB
PHP

<?php
final class PHUIWorkpanelView extends AphrontTagView {
private $cards = array();
private $header;
private $subheader = null;
private $footerAction;
private $headerActions = array();
private $headerTag;
private $headerIcon;
public function setHeaderIcon($icon) {
$this->headerIcon = $icon;
return $this;
}
public function getHeaderIcon() {
return $this->headerIcon;
}
public function setCards(PHUIObjectItemListView $cards) {
$this->cards[] = $cards;
return $this;
}
public function setHeader($header) {
$this->header = $header;
return $this;
}
public function setSubheader($subheader) {
$this->subheader = $subheader;
return $this;
}
public function setFooterAction(PHUIListItemView $footer_action) {
$this->footerAction = $footer_action;
return $this;
}
public function addHeaderAction(PHUIIconView $action) {
$this->headerActions[] = $action;
return $this;
}
public function setHeaderTag(PHUITagView $tag) {
$this->headerTag = $tag;
return $this;
}
protected function getTagAttributes() {
return array(
'class' => 'phui-workpanel-view',
);
}
protected function getTagContent() {
require_celerity_resource('phui-workpanel-view-css');
$footer = '';
if ($this->footerAction) {
$footer_tag = $this->footerAction;
$footer = phutil_tag(
'ul',
array(
'class' => 'phui-workpanel-footer-action mst ps',
),
$footer_tag);
}
$header = id(new PHUIHeaderView())
->setHeader($this->header)
->setSubheader($this->subheader);
if ($this->headerIcon) {
$header->setHeaderIcon($this->headerIcon);
}
if ($this->headerTag) {
$header->addTag($this->headerTag);
}
foreach ($this->headerActions as $action) {
$header->addActionIcon($action);
}
$body = phutil_tag(
'div',
array(
'class' => 'phui-workpanel-body',
),
$this->cards);
$view = id(new PHUIBoxView())
->setColor(PHUIBoxView::GREY)
->addClass('phui-workpanel-view-inner')
->appendChild(
array(
$header,
$body,
$footer,
));
return $view;
}
}