当前位置: 首页>>代码示例>>PHP>>正文


PHP ManiphestTaskPriority::getColorMap方法代码示例

本文整理汇总了PHP中ManiphestTaskPriority::getColorMap方法的典型用法代码示例。如果您正苦于以下问题:PHP ManiphestTaskPriority::getColorMap方法的具体用法?PHP ManiphestTaskPriority::getColorMap怎么用?PHP ManiphestTaskPriority::getColorMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ManiphestTaskPriority的用法示例。


在下文中一共展示了ManiphestTaskPriority::getColorMap方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getItem

 public function getItem()
 {
     $task = $this->getTask();
     $owner = $this->getOwner();
     $can_edit = $this->getCanEdit();
     $viewer = $this->getViewer();
     $color_map = ManiphestTaskPriority::getColorMap();
     $bar_color = idx($color_map, $task->getPriority(), 'grey');
     $card = id(new PHUIObjectItemView())->setObject($task)->setUser($viewer)->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setGrippable($can_edit)->setHref('/T' . $task->getID())->addSigil('project-card')->setDisabled($task->isClosed())->setMetadata(array('objectPHID' => $task->getPHID()))->addAction(id(new PHUIListItemView())->setName(pht('Edit'))->setIcon('fa-pencil')->addSigil('edit-project-card')->setHref('/maniphest/task/edit/' . $task->getID() . '/'))->setBarColor($bar_color);
     if ($owner) {
         $card->addHandleIcon($owner, $owner->getName());
     }
     $cover_file = $this->getCoverImageFile();
     if ($cover_file) {
         $card->setCoverImage($cover_file->getBestURI());
     }
     if ($task->isClosed()) {
         $icon = ManiphestTaskStatus::getStatusIcon($task->getStatus());
         $icon = id(new PHUIIconView())->setIcon($icon . ' grey');
         $card->addAttribute($icon);
         $card->setBarColor('grey');
     }
     $project_handles = $this->getProjectHandles();
     if ($project_handles) {
         $tag_list = id(new PHUIHandleTagListView())->setSlim(true)->setHandles($project_handles);
         $card->addAttribute($tag_list);
     }
     return $card;
 }
开发者ID:truSense,项目名称:phabricator,代码行数:29,代码来源:ProjectBoardTaskCard.php

示例2: render

 public function render()
 {
     $handles = $this->handles;
     require_celerity_resource('maniphest-task-summary-css');
     $list = new PHUIObjectItemListView();
     if ($this->noDataString) {
         $list->setNoDataString($this->noDataString);
     } else {
         $list->setNoDataString(pht('No tasks.'));
     }
     $status_map = ManiphestTaskStatus::getTaskStatusMap();
     $color_map = ManiphestTaskPriority::getColorMap();
     $priority_map = ManiphestTaskPriority::getTaskPriorityMap();
     if ($this->showBatchControls) {
         Javelin::initBehavior('maniphest-list-editor');
     }
     foreach ($this->tasks as $task) {
         $item = id(new PHUIObjectItemView())->setUser($this->getUser())->setObject($task)->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setHref('/T' . $task->getID());
         if ($task->getOwnerPHID()) {
             $owner = $handles[$task->getOwnerPHID()];
             $item->addByline(pht('Assigned: %s', $owner->renderLink()));
         }
         $status = $task->getStatus();
         $pri = idx($priority_map, $task->getPriority());
         $status_name = idx($status_map, $task->getStatus());
         $tooltip = pht('%s, %s', $status_name, $pri);
         $icon = ManiphestTaskStatus::getStatusIcon($task->getStatus());
         $color = idx($color_map, $task->getPriority(), 'grey');
         if ($task->isClosed()) {
             $item->setDisabled(true);
             $color = 'grey';
         }
         $item->setStatusIcon($icon . ' ' . $color, $tooltip);
         $item->addIcon('none', phabricator_datetime($task->getDateModified(), $this->getUser()));
         if ($this->showSubpriorityControls) {
             $item->setGrippable(true);
         }
         if ($this->showSubpriorityControls || $this->showBatchControls) {
             $item->addSigil('maniphest-task');
         }
         $project_handles = array_select_keys($handles, array_reverse($task->getProjectPHIDs()));
         $item->addAttribute(id(new PHUIHandleTagListView())->setLimit(4)->setNoDataString(pht('No Projects'))->setSlim(true)->setHandles($project_handles));
         $item->setMetadata(array('taskID' => $task->getID()));
         if ($this->showBatchControls) {
             $href = new PhutilURI('/maniphest/task/edit/' . $task->getID() . '/');
             if (!$this->showSubpriorityControls) {
                 $href->setQueryParam('ungrippable', 'true');
             }
             $item->addAction(id(new PHUIListItemView())->setIcon('fa-pencil')->addSigil('maniphest-edit-task')->setHref($href));
         }
         $list->addItem($item);
     }
     return $list;
 }
开发者ID:endlessm,项目名称:phabricator,代码行数:54,代码来源:ManiphestTaskListView.php

示例3: getItem

 public function getItem()
 {
     $task = $this->getTask();
     $owner = $this->getOwner();
     $can_edit = $this->getCanEdit();
     $color_map = ManiphestTaskPriority::getColorMap();
     $bar_color = idx($color_map, $task->getPriority(), 'grey');
     $card = id(new PHUIObjectItemView())->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setGrippable($can_edit)->setHref('/T' . $task->getID())->addSigil('project-card')->setDisabled($task->isClosed())->setMetadata(array('objectPHID' => $task->getPHID()))->addAction(id(new PHUIListItemView())->setName(pht('Edit'))->setIcon('fa-pencil')->addSigil('edit-project-card')->setHref('/maniphest/task/edit/' . $task->getID() . '/'))->setBarColor($bar_color);
     if ($owner) {
         $card->addAttribute($owner->renderLink());
     }
     return $card;
 }
开发者ID:denghp,项目名称:phabricator,代码行数:13,代码来源:ProjectBoardTaskCard.php

示例4: getItem

 public function getItem()
 {
     $task = $this->getTask();
     $owner = $this->getOwner();
     $can_edit = $this->getCanEdit();
     $viewer = $this->getViewer();
     $color_map = ManiphestTaskPriority::getColorMap();
     $bar_color = idx($color_map, $task->getPriority(), 'grey');
     $card = id(new PHUIObjectItemView())->setObject($task)->setUser($viewer)->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setGrippable($can_edit)->setHref('/T' . $task->getID())->addSigil('project-card')->setDisabled($task->isClosed())->addAction(id(new PHUIListItemView())->setName(pht('Edit'))->setIcon('fa-pencil')->addSigil('edit-project-card')->setHref('/maniphest/task/edit/' . $task->getID() . '/'))->setBarColor($bar_color);
     if ($owner) {
         $card->addHandleIcon($owner, $owner->getName());
     }
     $cover_file = $this->getCoverImageFile();
     if ($cover_file) {
         $card->setCoverImage($cover_file->getBestURI());
     }
     if (ManiphestTaskPoints::getIsEnabled()) {
         $points = $task->getPoints();
         if ($points !== null) {
             $points_tag = id(new PHUITagView())->setType(PHUITagView::TYPE_SHADE)->setShade(PHUITagView::COLOR_GREY)->setSlimShady(true)->setName($points)->addClass('phui-workcard-points');
             $card->addAttribute($points_tag);
         }
     }
     if ($task->isClosed()) {
         $icon = ManiphestTaskStatus::getStatusIcon($task->getStatus());
         $icon = id(new PHUIIconView())->setIcon($icon . ' grey');
         $card->addAttribute($icon);
         $card->setBarColor('grey');
     }
     $project_handles = $this->getProjectHandles();
     // Remove any archived projects from the list.
     if ($project_handles) {
         foreach ($project_handles as $key => $handle) {
             if ($handle->getStatus() == PhabricatorObjectHandle::STATUS_CLOSED) {
                 unset($project_handles[$key]);
             }
         }
     }
     if ($project_handles) {
         $project_handles = array_reverse($project_handles);
         $tag_list = id(new PHUIHandleTagListView())->setSlim(true)->setHandles($project_handles);
         $card->addAttribute($tag_list);
     }
     $card->addClass('phui-workcard');
     return $card;
 }
开发者ID:endlessm,项目名称:phabricator,代码行数:46,代码来源:ProjectBoardTaskCard.php

示例5: getItem

 public function getItem()
 {
     require_celerity_resource('phui-workboard-view-css', 'sprint');
     $query = id(new SprintQuery())->setProject($this->project)->setViewer($this->viewer);
     $task = $this->getTask();
     $task_phid = $task->getPHID();
     $can_edit = $this->getCanEdit();
     $this->points = $query->getStoryPointsForTask($task_phid);
     $color_map = ManiphestTaskPriority::getColorMap();
     $bar_color = idx($color_map, $task->getPriority(), 'grey');
     if (!is_null($this->owner)) {
         $ownerimage = $this->renderHandleIcon($this->owner);
     } else {
         $ownerimage = null;
     }
     $card = id(new PHUIObjectItemView())->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setGrippable($can_edit)->setHref('/T' . $task->getID())->addSigil('project-card')->setDisabled($task->isClosed())->setImageIcon($ownerimage)->setMetadata(array('objectPHID' => $task_phid, 'taskNodeID' => $this->task_node_id, 'points' => $this->points))->addAction(id(new PHUIListItemView())->setName(pht('Edit'))->setIcon('fa-pencil')->addSigil('edit-project-card')->setHref('/project/sprint/board/task/edit/' . $task->getID() . '/'))->setBarColor($bar_color)->addAttribute($this->getCardAttributes());
     return $card;
 }
开发者ID:yangming85,项目名称:phabricator-extensions-Sprint,代码行数:18,代码来源:SprintBoardTaskCard.php

示例6: getItem

 public function getItem()
 {
     require_celerity_resource('phui-workboard-view-css', 'sprint');
     $query = id(new SprintQuery())->setProject($this->project)->setViewer($this->viewer);
     $task = $this->getTask();
     $task_phid = $task->getPHID();
     $can_edit = $this->getCanEdit();
     $this->points = $query->getStoryPointsForTask($task_phid);
     $color_map = ManiphestTaskPriority::getColorMap();
     $bar_color = idx($color_map, $task->getPriority(), 'grey');
     if (!is_null($this->owner)) {
         $ownerimage = $this->renderHandleIcon($this->owner);
     } else {
         $ownerimage = null;
     }
     $card = id(new PHUIObjectItemView())->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setGrippable($can_edit)->setHref('/T' . $task->getID())->addSigil('project-card')->setDisabled($task->isClosed())->setImageIcon($ownerimage)->setMetadata(array('objectPHID' => $task_phid, 'taskNodeID' => $this->task_node_id, 'points' => $this->points))->addAction(id(new PHUIListItemView())->setName(pht('Edit'))->setIcon('fa-pencil')->addSigil('edit-project-card')->setHref('/project/sprint/board/task/edit/' . $task->getID() . '/'))->setBarColor($bar_color)->addAttribute($this->getCardAttributes());
     $continue_title = "";
     $continue_icon = "";
     switch ($task->getStatus()) {
         case "open":
             $continue_title = "Start";
             $continue_icon = "fa-play";
             break;
         case "inprogress":
             $continue_title = "Finish";
             $continue_icon = "fa-flag-checkered";
             break;
         case "finished":
             $continue_title = "Deliver";
             $continue_icon = "fa-truck";
             break;
         case "delivered":
             $continue_title = "Accept";
             $continue_icon = "fa-thumbs-up";
             break;
     }
     if ($continue_title != "") {
         $card->addAction(id(new PHUIListItemView())->setName(pht($continue_title))->setIcon($continue_icon)->addSigil('continue-project-card')->setHref('/project/sprint/board/task/continue/' . $task->getID() . '/'));
     }
     if ($task->getStatus() == 'delivered') {
         $card->addAction(id(new PHUIListItemView())->setName(pht("Reject"))->setIcon('fa-thumbs-down')->addSigil('reject-project-card')->setHref('/project/sprint/board/task/continue/' . $task->getID() . '/'));
     }
     return $card;
 }
开发者ID:puls,项目名称:phabricator-extensions-Sprint,代码行数:44,代码来源:SprintBoardTaskCard.php

示例7: getItem

 public function getItem()
 {
     $task = $this->getTask();
     $owner = $this->getOwner();
     $can_edit = $this->getCanEdit();
     $viewer = $this->getViewer();
     $color_map = ManiphestTaskPriority::getColorMap();
     $bar_color = idx($color_map, $task->getPriority(), 'grey');
     $card = id(new PHUIObjectItemView())->setObject($task)->setUser($viewer)->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setGrippable($can_edit)->setHref('/T' . $task->getID())->addSigil('project-card')->setDisabled($task->isClosed())->setMetadata(array('objectPHID' => $task->getPHID()))->addAction(id(new PHUIListItemView())->setName(pht('Edit'))->setIcon('fa-pencil')->addSigil('edit-project-card')->setHref('/maniphest/task/edit/' . $task->getID() . '/'))->setBarColor($bar_color);
     if ($owner) {
         $card->addAttribute($owner->renderLink());
     }
     $project_phids = array_fuse($task->getProjectPHIDs());
     unset($project_phids[$this->project->getPHID()]);
     if ($project_phids) {
         $handle_list = $viewer->loadHandles($project_phids);
         $tag_list = id(new PHUIHandleTagListView())->setSlim(true)->setHandles($handle_list);
         $card->addAttribute($tag_list);
     }
     return $card;
 }
开发者ID:fairyeye,项目名称:phabricator,代码行数:21,代码来源:ProjectBoardTaskCard.php

示例8: getItem

 public function getItem()
 {
     $query = id(new SprintQuery())->setProject($this->project)->setViewer($this->viewer);
     $task = $this->getTask();
     $owner = $this->getOwner();
     $task_phid = $task->getPHID();
     $can_edit = $this->getCanEdit();
     $viewer = $this->getViewer();
     $this->points = $query->getStoryPointsForTask($task_phid);
     $color_map = ManiphestTaskPriority::getColorMap();
     $bar_color = idx($color_map, $task->getPriority(), 'grey');
     $card = id(new PHUIObjectItemView())->setObject($task)->setUser($viewer)->setObjectName('T' . $task->getID())->setHeader($task->getTitle())->setGrippable($can_edit)->setHref('/T' . $task->getID())->addSigil('project-card')->setDisabled($task->isClosed())->setMetadata(array('objectPHID' => $task_phid, 'taskNodeID' => $this->task_node_id, 'points' => $this->points))->addAction(id(new PHUIListItemView())->setName(pht('Edit'))->setIcon('fa-pencil')->addSigil('edit-project-card')->setHref('/project/sprint/board/task/edit/' . $task->getID() . '/'))->setBarColor($bar_color);
     if ($owner) {
         $card->addHandleIcon($owner, $owner->getName());
     }
     $card->addAttribute($this->getCardAttributes());
     $project_handles = $this->getProjectHandles();
     if ($project_handles) {
         $tag_list = id(new PHUIHandleTagListView())->setSlim(true)->setHandles($project_handles);
         $card->addAttribute($tag_list);
     }
     return $card;
 }
开发者ID:kanarip,项目名称:phabricator-extensions-Sprint,代码行数:23,代码来源:SprintBoardTaskCard.php


注:本文中的ManiphestTaskPriority::getColorMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。