Differential D20304 Diff 48502 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 617 Lines • ▼ Show 20 Lines | foreach ($visible_columns as $column_phid => $column) { | ||||
| } | } | ||||
| $panel->setCards($cards); | $panel->setCards($cards); | ||||
| $board->addPanel($panel); | $board->addPanel($panel); | ||||
| $drop_effects = $column->getDropEffects(); | $drop_effects = $column->getDropEffects(); | ||||
| $drop_effects = mpull($drop_effects, 'toDictionary'); | $drop_effects = mpull($drop_effects, 'toDictionary'); | ||||
| $preview_effect = null; | |||||
| if ($column->canHaveTrigger()) { | |||||
| $trigger = $column->getTrigger(); | |||||
| if ($trigger) { | |||||
| $preview_effect = $trigger->getPreviewEffect() | |||||
| ->toDictionary(); | |||||
| } | |||||
| } | |||||
| $column_templates[] = array( | $column_templates[] = array( | ||||
| 'columnPHID' => $column_phid, | 'columnPHID' => $column_phid, | ||||
| 'effects' => $drop_effects, | 'effects' => $drop_effects, | ||||
| 'cardPHIDs' => $card_phids, | 'cardPHIDs' => $card_phids, | ||||
| 'triggerPreviewEffect' => $preview_effect, | |||||
| ); | ); | ||||
| } | } | ||||
| $order_key = $this->sortKey; | $order_key = $this->sortKey; | ||||
| $ordering_map = PhabricatorProjectColumnOrder::getEnabledOrders(); | $ordering_map = PhabricatorProjectColumnOrder::getEnabledOrders(); | ||||
| $ordering = id(clone $ordering_map[$order_key]) | $ordering = id(clone $ordering_map[$order_key]) | ||||
| ->setViewer($viewer); | ->setViewer($viewer); | ||||
| Show All 9 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| $header_keys = $ordering->getHeaderKeysForObjects($all_tasks); | $header_keys = $ordering->getHeaderKeysForObjects($all_tasks); | ||||
| $order_maps = array(); | $order_maps = array(); | ||||
| $order_maps[] = $ordering->toDictionary(); | $order_maps[] = $ordering->toDictionary(); | ||||
| $properties = array(); | $properties = array(); | ||||
| foreach ($all_tasks as $task) { | foreach ($all_tasks as $task) { | ||||
| $properties[$task->getPHID()] = array( | $properties[$task->getPHID()] = | ||||
| 'points' => (double)$task->getPoints(), | PhabricatorBoardResponseEngine::newTaskProperties($task); | ||||
| 'status' => $task->getStatus(), | |||||
| 'priority' => (int)$task->getPriority(), | |||||
| 'owner' => $task->getOwnerPHID(), | |||||
| ); | |||||
| } | } | ||||
| $behavior_config = array( | $behavior_config = array( | ||||
| 'moveURI' => $this->getApplicationURI('move/'.$project->getID().'/'), | 'moveURI' => $this->getApplicationURI('move/'.$project->getID().'/'), | ||||
| '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(), | ||||
| ▲ Show 20 Lines • Show All 589 Lines • ▼ Show 20 Lines | private function buildTriggerMenu(PhabricatorProjectColumn $column) { | ||||
| } | } | ||||
| if ($trigger) { | if ($trigger) { | ||||
| $trigger_icon = 'fa-cogs'; | $trigger_icon = 'fa-cogs'; | ||||
| } else { | } else { | ||||
| $trigger_icon = 'fa-cogs grey'; | $trigger_icon = 'fa-cogs grey'; | ||||
| } | } | ||||
| if ($trigger) { | |||||
| $trigger_tip = array( | |||||
| pht('%s: %s', $trigger->getObjectName(), $trigger->getDisplayName()), | |||||
| $trigger->getRulesDescription(), | |||||
| ); | |||||
| $trigger_tip = implode("\n", $trigger_tip); | |||||
| } else { | |||||
| $trigger_tip = pht('No column trigger.'); | |||||
| } | |||||
| $trigger_button = id(new PHUIIconView()) | $trigger_button = id(new PHUIIconView()) | ||||
| ->setIcon($trigger_icon) | ->setIcon($trigger_icon) | ||||
| ->setHref('#') | ->setHref('#') | ||||
| ->addSigil('boards-dropdown-menu') | ->addSigil('boards-dropdown-menu') | ||||
| ->addSigil('has-tooltip') | ->addSigil('trigger-preview') | ||||
| ->setMetadata( | ->setMetadata( | ||||
| array( | array( | ||||
| 'items' => hsprintf('%s', $trigger_menu), | 'items' => hsprintf('%s', $trigger_menu), | ||||
| 'tip' => $trigger_tip, | 'columnPHID' => $column->getPHID(), | ||||
| 'size' => 300, | |||||
| )); | )); | ||||
| return $trigger_button; | return $trigger_button; | ||||
| } | } | ||||
| /** | /** | ||||
| * Add current state parameters (like order and the visibility of hidden | * Add current state parameters (like order and the visibility of hidden | ||||
| * columns) to a URI. | * columns) to a URI. | ||||
| ▲ Show 20 Lines • Show All 213 Lines • Show Last 20 Lines | |||||