Differential D17446 Diff 41943 src/applications/project/controller/PhabricatorProjectBoardViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectBoardViewController.php
Show First 20 Lines • Show All 366 Lines • ▼ Show 20 Lines | foreach ($visible_columns as $column_phid => $column) { | ||||
} | } | ||||
$panel->setCards($cards); | $panel->setCards($cards); | ||||
$board->addPanel($panel); | $board->addPanel($panel); | ||||
} | } | ||||
$behavior_config = array( | $behavior_config = array( | ||||
'moveURI' => $this->getApplicationURI('move/'.$project->getID().'/'), | 'moveURI' => $this->getApplicationURI('move/'.$project->getID().'/'), | ||||
'createURI' => $this->getCreateURI(), | |||||
'uploadURI' => '/file/dropupload/', | 'uploadURI' => '/file/dropupload/', | ||||
'coverURI' => $this->getApplicationURI('cover/'), | 'coverURI' => $this->getApplicationURI('cover/'), | ||||
'chunkThreshold' => PhabricatorFileStorageEngine::getChunkThreshold(), | 'chunkThreshold' => PhabricatorFileStorageEngine::getChunkThreshold(), | ||||
'pointsEnabled' => ManiphestTaskPoints::getIsEnabled(), | 'pointsEnabled' => ManiphestTaskPoints::getIsEnabled(), | ||||
'boardPHID' => $project->getPHID(), | 'boardPHID' => $project->getPHID(), | ||||
'order' => $this->sortKey, | 'order' => $this->sortKey, | ||||
'templateMap' => $templates, | 'templateMap' => $templates, | ||||
▲ Show 20 Lines • Show All 411 Lines • ▼ Show 20 Lines | private function buildColumnMenu( | ||||
$column_items = array(); | $column_items = array(); | ||||
if ($column->getProxyPHID()) { | if ($column->getProxyPHID()) { | ||||
$default_phid = $column->getProxyPHID(); | $default_phid = $column->getProxyPHID(); | ||||
} else { | } else { | ||||
$default_phid = $column->getProjectPHID(); | $default_phid = $column->getProjectPHID(); | ||||
} | } | ||||
$specs = id(new ManiphestEditEngine()) | |||||
->setViewer($viewer) | |||||
->newCreateActionSpecifications(array()); | |||||
foreach ($specs as $spec) { | |||||
$column_items[] = id(new PhabricatorActionView()) | $column_items[] = id(new PhabricatorActionView()) | ||||
->setIcon('fa-plus') | ->setIcon($spec['icon']) | ||||
->setName(pht('Create Task...')) | ->setName($spec['name']) | ||||
->setHref($this->getCreateURI()) | ->setHref($spec['uri']) | ||||
->setDisabled($spec['disabled']) | |||||
->addSigil('column-add-task') | ->addSigil('column-add-task') | ||||
->setMetadata( | ->setMetadata( | ||||
array( | array( | ||||
'createURI' => $spec['uri'], | |||||
'columnPHID' => $column->getPHID(), | 'columnPHID' => $column->getPHID(), | ||||
'boardPHID' => $project->getPHID(), | 'boardPHID' => $project->getPHID(), | ||||
'projectPHID' => $default_phid, | 'projectPHID' => $default_phid, | ||||
)); | )); | ||||
} | |||||
if (count($specs) > 1) { | |||||
$column_items[] = id(new PhabricatorActionView()) | |||||
->setType(PhabricatorActionView::TYPE_DIVIDER); | |||||
} | |||||
$batch_edit_uri = $request->getRequestURI(); | $batch_edit_uri = $request->getRequestURI(); | ||||
$batch_edit_uri->setQueryParam('batch', $column->getID()); | $batch_edit_uri->setQueryParam('batch', $column->getID()); | ||||
$can_batch_edit = PhabricatorPolicyFilter::hasCapability( | $can_batch_edit = PhabricatorPolicyFilter::hasCapability( | ||||
$viewer, | $viewer, | ||||
PhabricatorApplication::getByClass('PhabricatorManiphestApplication'), | PhabricatorApplication::getByClass('PhabricatorManiphestApplication'), | ||||
ManiphestBulkEditCapability::CAPABILITY); | ManiphestBulkEditCapability::CAPABILITY); | ||||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | if ($force || ($this->queryKey != $this->getDefaultFilter($project))) { | ||||
$base->setQueryParam('filter', null); | $base->setQueryParam('filter', null); | ||||
} | } | ||||
$base->setQueryParam('hidden', $this->showHidden ? 'true' : null); | $base->setQueryParam('hidden', $this->showHidden ? 'true' : null); | ||||
return $base; | return $base; | ||||
} | } | ||||
private function getCreateURI() { | |||||
$viewer = $this->getViewer(); | |||||
// TODO: This should be cleaned up, but maybe we're going to make options | |||||
// for each column or board? | |||||
$edit_config = id(new ManiphestEditEngine()) | |||||
->setViewer($viewer) | |||||
->loadDefaultEditConfiguration(new ManiphestTask()); | |||||
if ($edit_config) { | |||||
$form_key = $edit_config->getIdentifier(); | |||||
$create_uri = "/maniphest/task/edit/form/{$form_key}/"; | |||||
} else { | |||||
$create_uri = '/maniphest/task/edit/'; | |||||
} | |||||
return $create_uri; | |||||
} | |||||
private function buildInitializeContent(PhabricatorProject $project) { | private function buildInitializeContent(PhabricatorProject $project) { | ||||
$request = $this->getRequest(); | $request = $this->getRequest(); | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$type = $request->getStr('initialize-type'); | $type = $request->getStr('initialize-type'); | ||||
$id = $project->getID(); | $id = $project->getID(); | ||||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |