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


PHP ManiphestTaskStatus::getStatusIcon方法代码示例

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


在下文中一共展示了ManiphestTaskStatus::getStatusIcon方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: newTableRow

 protected function newTableRow($phid, $object, $trace)
 {
     $viewer = $this->getViewer();
     if ($object) {
         $status = $object->getStatus();
         $priority = $object->getPriority();
         $status_icon = ManiphestTaskStatus::getStatusIcon($status);
         $status_name = ManiphestTaskStatus::getTaskStatusName($status);
         $priority_color = ManiphestTaskPriority::getTaskPriorityColor($priority);
         if ($object->isClosed()) {
             $priority_color = 'grey';
         }
         $status = array(id(new PHUIIconView())->setIcon($status_icon, $priority_color), ' ', $status_name);
         $owner_phid = $object->getOwnerPHID();
         if ($owner_phid) {
             $assigned = $viewer->renderHandle($owner_phid);
         } else {
             $assigned = phutil_tag('em', array(), pht('None'));
         }
         $link = phutil_tag('a', array('href' => $object->getURI()), $object->getTitle());
         $link = array($object->getMonogram(), ' ', $link);
     } else {
         $status = null;
         $assigned = null;
         $link = $viewer->renderHandle($phid);
     }
     return array($trace, $status, $assigned, $link);
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:28,代码来源:ManiphestTaskGraph.php

示例3: buildResults

 private function buildResults()
 {
     $results = array();
     $status_map = ManiphestTaskStatus::getTaskStatusMap();
     foreach ($status_map as $value => $name) {
         $results[$value] = id(new PhabricatorTypeaheadResult())->setIcon(ManiphestTaskStatus::getStatusIcon($value))->setPHID($value)->setName($name);
     }
     return $results;
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:9,代码来源:ManiphestTaskStatusDatasource.php

示例4: 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

示例5: buildResults

 private function buildResults()
 {
     $results = array();
     $status_map = ManiphestTaskStatus::getTaskStatusMap();
     foreach ($status_map as $value => $name) {
         $result = id(new PhabricatorTypeaheadResult())->setIcon(ManiphestTaskStatus::getStatusIcon($value))->setPHID($value)->setName($name);
         if (ManiphestTaskStatus::isDisabledStatus($value)) {
             $result->setClosed(pht('Disabled'));
         }
         $results[$value] = $result;
     }
     return $results;
 }
开发者ID:pugong,项目名称:phabricator,代码行数:13,代码来源:ManiphestTaskStatusDatasource.php

示例6: newTableRow

 protected function newTableRow($phid, $object, $trace)
 {
     $viewer = $this->getViewer();
     if ($object) {
         $status = $object->getStatus();
         $priority = $object->getPriority();
         $status_icon = ManiphestTaskStatus::getStatusIcon($status);
         $status_name = ManiphestTaskStatus::getTaskStatusName($status);
         $priority_color = ManiphestTaskPriority::getTaskPriorityColor($priority);
         if ($object->isClosed()) {
             $priority_color = 'grey';
         }
         $status = array(id(new PHUIIconView())->setIcon($status_icon, $priority_color), ' ', $status_name);
         $owner_phid = $object->getOwnerPHID();
         if ($owner_phid) {
             $assigned = $viewer->renderHandle($owner_phid);
         } else {
             $assigned = phutil_tag('em', array(), pht('None'));
         }
         $full_title = $object->getTitle();
         $title = id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(80)->truncateString($full_title);
         $link = phutil_tag('a', array('href' => $object->getURI(), 'title' => $full_title), $title);
         $link = array(phutil_tag('span', array('class' => 'object-name'), $object->getMonogram()), ' ', $link);
     } else {
         $status = null;
         $assigned = null;
         $link = $viewer->renderHandle($phid);
     }
     if ($this->isParentTask($phid)) {
         $marker = 'fa-chevron-circle-up bluegrey';
         $marker_tip = pht('Direct Parent');
     } else {
         if ($this->isChildTask($phid)) {
             $marker = 'fa-chevron-circle-down bluegrey';
             $marker_tip = pht('Direct Subtask');
         } else {
             $marker = null;
         }
     }
     if ($marker) {
         $marker = id(new PHUIIconView())->setIcon($marker)->addSigil('has-tooltip')->setMetadata(array('tip' => $marker_tip, 'align' => 'E'));
     }
     return array($marker, $trace, $status, $assigned, $link);
 }
开发者ID:endlessm,项目名称:phabricator,代码行数:44,代码来源:ManiphestTaskGraph.php

示例7: buildHeaderView

 private function buildHeaderView(ManiphestTask $task)
 {
     $view = id(new PHUIHeaderView())->setHeader($task->getTitle())->setUser($this->getRequest()->getUser())->setPolicyObject($task);
     $priority_name = ManiphestTaskPriority::getTaskPriorityName($task->getPriority());
     $priority_color = ManiphestTaskPriority::getTaskPriorityColor($task->getPriority());
     $status = $task->getStatus();
     $status_name = ManiphestTaskStatus::renderFullDescription($status, $priority_name, $priority_color);
     $view->addProperty(PHUIHeaderView::PROPERTY_STATUS, $status_name);
     $view->setHeaderIcon(ManiphestTaskStatus::getStatusIcon($task->getStatus()) . ' ' . $priority_color);
     if (ManiphestTaskPoints::getIsEnabled()) {
         $points = $task->getPoints();
         if ($points !== null) {
             $points_name = pht('%s %s', $task->getPoints(), ManiphestTaskPoints::getPointsLabel());
             $tag = id(new PHUITagView())->setName($points_name)->setShade('blue')->setType(PHUITagView::TYPE_SHADE);
             $view->addTag($tag);
         }
     }
     return $view;
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:19,代码来源:ManiphestTaskDetailController.php

示例8: 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) {
         $tag_list = id(new PHUIHandleTagListView())->setSlim(true)->setHandles($project_handles);
         $card->addAttribute($tag_list);
     }
     $card->addClass('phui-workcard');
     return $card;
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:45,代码来源:ProjectBoardTaskCard.php

示例9: getIcon

 public function getIcon()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_OWNER:
             return 'fa-user';
         case self::TYPE_CCS:
             return 'fa-envelope';
         case self::TYPE_TITLE:
             if ($old === null) {
                 return 'fa-pencil';
             }
             return 'fa-pencil';
         case self::TYPE_STATUS:
             $action = ManiphestTaskStatus::getStatusIcon($new);
             if ($action !== null) {
                 return $action;
             }
             if (ManiphestTaskStatus::isClosedStatus($new)) {
                 return 'fa-check';
             } else {
                 return 'fa-pencil';
             }
         case self::TYPE_DESCRIPTION:
             return 'fa-pencil';
         case self::TYPE_PROJECTS:
             return 'fa-briefcase';
         case self::TYPE_PROJECT_COLUMN:
             return 'fa-columns';
         case self::TYPE_MERGED_INTO:
         case self::TYPE_MERGED_FROM:
             return 'fa-compress';
         case self::TYPE_PRIORITY:
             if ($old == ManiphestTaskPriority::getDefaultPriority()) {
                 return 'fa-arrow-right';
             } else {
                 if ($old > $new) {
                     return 'fa-arrow-down';
                 } else {
                     return 'fa-arrow-up';
                 }
             }
         case self::TYPE_EDGE:
         case self::TYPE_ATTACH:
             return 'fa-thumb-tack';
         case self::TYPE_UNBLOCK:
             return 'fa-shield';
     }
     return parent::getIcon();
 }
开发者ID:denghp,项目名称:phabricator,代码行数:51,代码来源:ManiphestTransaction.php


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