• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ManiphestTaskStatus类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

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


示例2: render

 public function render()
 {
     if (!$this->user) {
         throw new Exception("Call setUser() before rendering!");
     }
     $task = $this->task;
     $handles = $this->handles;
     require_celerity_resource('maniphest-task-summary-css');
     $pri_class = self::getPriorityClass($task->getPriority());
     $status_map = ManiphestTaskStatus::getTaskStatusMap();
     $batch = null;
     if ($this->showBatchControls) {
         $batch = '<td class="maniphest-task-batch">' . javelin_render_tag('input', array('type' => 'checkbox', 'name' => 'batch[]', 'value' => $task->getID(), 'sigil' => 'maniphest-batch'), null) . '</td>';
     }
     $projects_view = new ManiphestTaskProjectsView();
     $projects_view->setHandles(array_select_keys($this->handles, $task->getProjectPHIDs()));
     $control_class = null;
     $control_sigil = null;
     if ($this->showSubpriorityControls) {
         $control_class = 'maniphest-active-handle';
         $control_sigil = 'maniphest-task-handle';
     }
     $handle = javelin_render_tag('td', array('class' => 'maniphest-task-handle ' . $pri_class . ' ' . $control_class, 'sigil' => $control_sigil), '');
     return javelin_render_tag('table', array('class' => 'maniphest-task-summary', 'sigil' => 'maniphest-task', 'meta' => array('taskID' => $task->getID())), '<tr>' . $handle . $batch . '<td class="maniphest-task-number">' . 'T' . $task->getID() . '</td>' . '<td class="maniphest-task-status">' . idx($status_map, $task->getStatus(), 'Unknown') . '</td>' . '<td class="maniphest-task-owner">' . ($task->getOwnerPHID() ? $handles[$task->getOwnerPHID()]->renderLink() : '<em>None</em>') . '</td>' . '<td class="maniphest-task-name">' . phutil_render_tag('a', array('href' => '/T' . $task->getID()), phutil_escape_html($task->getTitle())) . '</td>' . '<td class="maniphest-task-projects">' . $projects_view->render() . '</td>' . '<td class="maniphest-task-updated">' . phabricator_date($task->getDateModified(), $this->user) . '</td>' . '</tr>');
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:25,代码来源:ManiphestTaskSummaryView.php


示例3: buildActionView

 private function buildActionView(ManiphestTask $task)
 {
     $viewer = $this->getRequest()->getUser();
     $id = $task->getID();
     $phid = $task->getPHID();
     $can_edit = PhabricatorPolicyFilter::hasCapability($viewer, $task, PhabricatorPolicyCapability::CAN_EDIT);
     $view = id(new PhabricatorActionListView())->setUser($viewer)->setObject($task);
     $view->addAction(id(new PhabricatorActionView())->setName(pht('Edit Task'))->setIcon('fa-pencil')->setHref($this->getApplicationURI("/task/edit/{$id}/"))->setDisabled(!$can_edit)->setWorkflow(!$can_edit));
     $view->addAction(id(new PhabricatorActionView())->setName(pht('Merge Duplicates In'))->setHref("/search/attach/{$phid}/TASK/merge/")->setWorkflow(true)->setIcon('fa-compress')->setDisabled(!$can_edit)->setWorkflow(true));
     $edit_config = id(new ManiphestEditEngine())->setViewer($viewer)->loadDefaultEditConfiguration();
     $can_create = (bool) $edit_config;
     if ($can_create) {
         $form_key = $edit_config->getIdentifier();
         $edit_uri = id(new PhutilURI("/task/edit/form/{$form_key}/"))->setQueryParam('parent', $id)->setQueryParam('template', $id)->setQueryParam('status', ManiphestTaskStatus::getDefaultStatus());
         $edit_uri = $this->getApplicationURI($edit_uri);
     } else {
         // TODO: This will usually give us a somewhat-reasonable error page, but
         // could be a bit cleaner.
         $edit_uri = "/task/edit/{$id}/";
         $edit_uri = $this->getApplicationURI($edit_uri);
     }
     $view->addAction(id(new PhabricatorActionView())->setName(pht('Create Subtask'))->setHref($edit_uri)->setIcon('fa-level-down')->setDisabled(!$can_create)->setWorkflow(!$can_create));
     $view->addAction(id(new PhabricatorActionView())->setName(pht('Edit Blocking Tasks'))->setHref("/search/attach/{$phid}/TASK/blocks/")->setWorkflow(true)->setIcon('fa-link')->setDisabled(!$can_edit)->setWorkflow(true));
     return $view;
 }
开发者ID:barcelonascience,项目名称:phabricator,代码行数:25,代码来源:ManiphestTaskDetailController.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())->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


示例5: renderActionEffectDescription

 protected function renderActionEffectDescription($type, $data)
 {
     switch ($type) {
         case self::DO_STATUS:
             return pht('Changed task status to "%s".', ManiphestTaskStatus::getTaskStatusName($data));
     }
 }
开发者ID:pugong,项目名称:phabricator,代码行数:7,代码来源:ManiphestTaskStatusHeraldAction.php


示例6: buildHeaderView

 private function buildHeaderView(ManiphestTask $task)
 {
     $view = id(new PHUIHeaderView())->setHeader($task->getTitle())->setUser($this->getRequest()->getUser())->setPolicyObject($task);
     $status = $task->getStatus();
     $status_name = ManiphestTaskStatus::renderFullDescription($status);
     $view->addProperty(PHUIHeaderView::PROPERTY_STATUS, $status_name);
     return $view;
 }
开发者ID:fuding,项目名称:phabricator,代码行数:8,代码来源:ManiphestTaskDetailController.php


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


示例8: loadStatus

 public function loadStatus(PhabricatorUser $user)
 {
     $status = array();
     $query = id(new ManiphestTaskQuery())->setViewer($user)->withStatuses(ManiphestTaskStatus::getOpenStatusConstants())->withOwners(array($user->getPHID()));
     $count = count($query->execute());
     $type = PhabricatorApplicationStatusView::TYPE_WARNING;
     $status[] = id(new PhabricatorApplicationStatusView())->setType($type)->setText(pht('%s Assigned Task(s)', new PhutilNumber($count)))->setCount($count);
     return $status;
 }
开发者ID:denghp,项目名称:phabricator,代码行数:9,代码来源:PhabricatorManiphestApplication.php


示例9: getEditorValue

 public function getEditorValue(PhabricatorUser $viewer, $value)
 {
     $status_map = ManiphestTaskStatus::getTaskStatusMap();
     $value_map = array();
     foreach ($value as $status) {
         $value_map[$status] = idx($status_map, $status, $status);
     }
     return $value_map;
 }
开发者ID:ThomasWo,项目名称:phabricator,代码行数:9,代码来源:ManiphestTaskStatusHeraldField.php


示例10: renderUserItems

 private function renderUserItems(PhutilEvent $event)
 {
     if (!$this->canUseApplication($event->getUser())) {
         return null;
     }
     $user = $event->getValue('object');
     $phid = $user->getPHID();
     $view_uri = sprintf('/maniphest/?statuses=%s&assigned=%s#R', implode(',', ManiphestTaskStatus::getOpenStatusConstants()), $phid);
     return id(new PhabricatorActionView())->setIcon('fa-anchor')->setName(pht('View Tasks'))->setHref($view_uri);
 }
开发者ID:denghp,项目名称:phabricator,代码行数:10,代码来源:ManiphestActionMenuEventListener.php


示例11: assertConfigValid

 private function assertConfigValid($expect, $name, array $config)
 {
     $caught = null;
     try {
         ManiphestTaskStatus::validateConfiguration($config);
     } catch (Exception $ex) {
         $caught = $ex;
     }
     $this->assertEqual($expect, !$caught instanceof Exception, pht('Validation of "%s"', $name));
 }
开发者ID:denghp,项目名称:phabricator,代码行数:10,代码来源:ManiphestTaskStatusTestCase.php


示例12: generateTaskStatus

 public function generateTaskStatus()
 {
     $statuses = array_keys(ManiphestTaskStatus::getTaskStatusMap());
     // Make sure 4/5th of all generated Tasks are open
     $random = rand(0, 4);
     if ($random != 0) {
         return ManiphestTaskStatus::getDefaultStatus();
     } else {
         return array_rand($statuses);
     }
 }
开发者ID:truSense,项目名称:phabricator,代码行数:11,代码来源:PhabricatorManiphestTaskTestDataGenerator.php


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


示例14: buildCurtain

 private function buildCurtain(ManiphestTask $task, PhabricatorEditEngine $edit_engine)
 {
     $viewer = $this->getViewer();
     $id = $task->getID();
     $phid = $task->getPHID();
     $can_edit = PhabricatorPolicyFilter::hasCapability($viewer, $task, PhabricatorPolicyCapability::CAN_EDIT);
     $curtain = $this->newCurtainView($task);
     $curtain->addAction(id(new PhabricatorActionView())->setName(pht('Edit Task'))->setIcon('fa-pencil')->setHref($this->getApplicationURI("/task/edit/{$id}/"))->setDisabled(!$can_edit)->setWorkflow(!$can_edit));
     $edit_config = $edit_engine->loadDefaultEditConfiguration();
     $can_create = (bool) $edit_config;
     $can_reassign = $edit_engine->hasEditAccessToTransaction(ManiphestTransaction::TYPE_OWNER);
     if ($can_create) {
         $form_key = $edit_config->getIdentifier();
         $edit_uri = id(new PhutilURI("/task/edit/form/{$form_key}/"))->setQueryParam('parent', $id)->setQueryParam('template', $id)->setQueryParam('status', ManiphestTaskStatus::getDefaultStatus());
         $edit_uri = $this->getApplicationURI($edit_uri);
     } else {
         // TODO: This will usually give us a somewhat-reasonable error page, but
         // could be a bit cleaner.
         $edit_uri = "/task/edit/{$id}/";
         $edit_uri = $this->getApplicationURI($edit_uri);
     }
     $subtask_item = id(new PhabricatorActionView())->setName(pht('Create Subtask'))->setHref($edit_uri)->setIcon('fa-level-down')->setDisabled(!$can_create)->setWorkflow(!$can_create);
     $relationship_list = PhabricatorObjectRelationshipList::newForObject($viewer, $task);
     $submenu_actions = array($subtask_item, ManiphestTaskHasParentRelationship::RELATIONSHIPKEY, ManiphestTaskHasSubtaskRelationship::RELATIONSHIPKEY, ManiphestTaskMergeInRelationship::RELATIONSHIPKEY, ManiphestTaskCloseAsDuplicateRelationship::RELATIONSHIPKEY);
     $task_submenu = $relationship_list->newActionSubmenu($submenu_actions)->setName(pht('Edit Related Tasks...'))->setIcon('fa-anchor');
     $curtain->addAction($task_submenu);
     $relationship_submenu = $relationship_list->newActionMenu();
     if ($relationship_submenu) {
         $curtain->addAction($relationship_submenu);
     }
     $owner_phid = $task->getOwnerPHID();
     $author_phid = $task->getAuthorPHID();
     $handles = $viewer->loadHandles(array($owner_phid, $author_phid));
     if ($owner_phid) {
         $image_uri = $handles[$owner_phid]->getImageURI();
         $image_href = $handles[$owner_phid]->getURI();
         $owner = $viewer->renderHandle($owner_phid)->render();
         $content = phutil_tag('strong', array(), $owner);
         $assigned_to = id(new PHUIHeadThingView())->setImage($image_uri)->setImageHref($image_href)->setContent($content);
     } else {
         $assigned_to = phutil_tag('em', array(), pht('None'));
     }
     $curtain->newPanel()->setHeaderText(pht('Assigned To'))->appendChild($assigned_to);
     $author_uri = $handles[$author_phid]->getImageURI();
     $author_href = $handles[$author_phid]->getURI();
     $author = $viewer->renderHandle($author_phid)->render();
     $content = phutil_tag('strong', array(), $author);
     $date = phabricator_date($task->getDateCreated(), $viewer);
     $content = pht('%s, %s', $content, $date);
     $authored_by = id(new PHUIHeadThingView())->setImage($author_uri)->setImageHref($author_href)->setContent($content);
     $curtain->newPanel()->setHeaderText(pht('Authored By'))->appendChild($authored_by);
     return $curtain;
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:53,代码来源:ManiphestTaskDetailController.php


示例15: processRequest

 public function processRequest()
 {
     $this->requireApplicationCapability(ManiphestBulkEditCapability::CAPABILITY);
     $request = $this->getRequest();
     $user = $request->getUser();
     $task_ids = $request->getArr('batch');
     $tasks = id(new ManiphestTaskQuery())->setViewer($user)->withIDs($task_ids)->requireCapabilities(array(PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT))->execute();
     $actions = $request->getStr('actions');
     if ($actions) {
         $actions = json_decode($actions, true);
     }
     if ($request->isFormPost() && is_array($actions)) {
         foreach ($tasks as $task) {
             $field_list = PhabricatorCustomField::getObjectFields($task, PhabricatorCustomField::ROLE_EDIT);
             $field_list->readFieldsFromStorage($task);
             $xactions = $this->buildTransactions($actions, $task);
             if ($xactions) {
                 // TODO: Set content source to "batch edit".
                 $editor = id(new ManiphestTransactionEditor())->setActor($user)->setContentSourceFromRequest($request)->setContinueOnNoEffect(true)->setContinueOnMissingFields(true)->applyTransactions($task, $xactions);
             }
         }
         $task_ids = implode(',', mpull($tasks, 'getID'));
         return id(new AphrontRedirectResponse())->setURI('/maniphest/?ids=' . $task_ids);
     }
     $handles = ManiphestTaskListView::loadTaskHandles($user, $tasks);
     $list = new ManiphestTaskListView();
     $list->setTasks($tasks);
     $list->setUser($user);
     $list->setHandles($handles);
     $template = new AphrontTokenizerTemplateView();
     $template = $template->render();
     $projects_source = new PhabricatorProjectDatasource();
     $mailable_source = new PhabricatorMetaMTAMailableDatasource();
     $owner_source = new PhabricatorTypeaheadOwnerDatasource();
     require_celerity_resource('maniphest-batch-editor');
     Javelin::initBehavior('maniphest-batch-editor', array('root' => 'maniphest-batch-edit-form', 'tokenizerTemplate' => $template, 'sources' => array('project' => array('src' => $projects_source->getDatasourceURI(), 'placeholder' => $projects_source->getPlaceholderText()), 'owner' => array('src' => $owner_source->getDatasourceURI(), 'placeholder' => $owner_source->getPlaceholderText(), 'limit' => 1), 'cc' => array('src' => $mailable_source->getDatasourceURI(), 'placeholder' => $mailable_source->getPlaceholderText())), 'input' => 'batch-form-actions', 'priorityMap' => ManiphestTaskPriority::getTaskPriorityMap(), 'statusMap' => ManiphestTaskStatus::getTaskStatusMap()));
     $form = new AphrontFormView();
     $form->setUser($user);
     $form->setID('maniphest-batch-edit-form');
     foreach ($tasks as $task) {
         $form->appendChild(phutil_tag('input', array('type' => 'hidden', 'name' => 'batch[]', 'value' => $task->getID())));
     }
     $form->appendChild(phutil_tag('input', array('type' => 'hidden', 'name' => 'actions', 'id' => 'batch-form-actions')));
     $form->appendChild(phutil_tag('p', array(), pht('These tasks will be edited:')));
     $form->appendChild($list);
     $form->appendChild(id(new AphrontFormInsetView())->setTitle('Actions')->setRightButton(javelin_tag('a', array('href' => '#', 'class' => 'button green', 'sigil' => 'add-action', 'mustcapture' => true), pht('Add Another Action')))->setContent(javelin_tag('table', array('sigil' => 'maniphest-batch-actions', 'class' => 'maniphest-batch-actions-table'), '')))->appendChild(id(new AphrontFormSubmitControl())->setValue(pht('Update Tasks'))->addCancelButton('/maniphest/'));
     $title = pht('Batch Editor');
     $crumbs = $this->buildApplicationCrumbs();
     $crumbs->addTextCrumb($title);
     $form_box = id(new PHUIObjectBoxView())->setHeaderText(pht('Batch Edit Tasks'))->setForm($form);
     return $this->buildApplicationPage(array($crumbs, $form_box), array('title' => $title, 'device' => false));
 }
开发者ID:denghp,项目名称:phabricator,代码行数:52,代码来源:ManiphestBatchEditController.php


示例16: render

 public function render()
 {
     if (!$this->user) {
         throw new Exception("Call setUser() before rendering!");
     }
     $task = $this->task;
     $handles = $this->handles;
     require_celerity_resource('maniphest-task-summary-css');
     $classes = array(ManiphestTaskPriority::PRIORITY_UNBREAK_NOW => 'pri-unbreak', ManiphestTaskPriority::PRIORITY_TRIAGE => 'pri-triage', ManiphestTaskPriority::PRIORITY_HIGH => 'pri-high', ManiphestTaskPriority::PRIORITY_NORMAL => 'pri-normal', ManiphestTaskPriority::PRIORITY_LOW => 'pri-low', ManiphestTaskPriority::PRIORITY_WISH => 'pri-wish');
     $pri_class = idx($classes, $task->getPriority());
     $status_map = ManiphestTaskStatus::getTaskStatusMap();
     return '<table class="maniphest-task-summary">' . '<tr>' . '<td class="maniphest-task-number ' . $pri_class . '">' . 'T' . $task->getID() . '</td>' . '<td class="maniphest-task-status">' . idx($status_map, $task->getStatus(), 'Unknown') . '</td>' . '<td class="maniphest-task-owner">' . ($task->getOwnerPHID() ? $handles[$task->getOwnerPHID()]->renderLink() : '<em>None</em>') . '</td>' . '<td class="maniphest-task-name">' . phutil_render_tag('a', array('href' => '/T' . $task->getID()), phutil_escape_html($task->getTitle())) . '</td>' . '<td class="maniphest-task-priority">' . ManiphestTaskPriority::getTaskPriorityName($task->getPriority()) . '</td>' . '<td class="maniphest-task-updated">' . phabricator_datetime($task->getDateModified(), $this->user) . '</td>' . '</tr>' . '</table>';
 }
开发者ID:hwang36,项目名称:phabricator,代码行数:13,代码来源:ManiphestTaskSummaryView.php


示例17: loadStatus

 public function loadStatus(PhabricatorUser $user)
 {
     $status = array();
     if (!$user->isLoggedIn()) {
         return $status;
     }
     $query = id(new ManiphestTaskQuery())->setViewer($user)->withStatuses(ManiphestTaskStatus::getOpenStatusConstants())->withOwners(array($user->getPHID()))->setLimit(self::MAX_STATUS_ITEMS);
     $count = count($query->execute());
     $count_str = self::formatStatusCount($count, '%s Assigned Tasks', '%d Assigned Task(s)');
     $type = PhabricatorApplicationStatusView::TYPE_WARNING;
     $status[] = id(new PhabricatorApplicationStatusView())->setType($type)->setText($count_str)->setCount($count);
     return $status;
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:13,代码来源:PhabricatorManiphestApplication.php


示例18: evaluateFunction

 protected function evaluateFunction($function, array $argv_list)
 {
     $results = array();
     $map = ManiphestTaskStatus::getTaskStatusMap();
     foreach ($argv_list as $argv) {
         foreach ($map as $status => $name) {
             if (ManiphestTaskStatus::isOpenStatus($status)) {
                 $results[] = $status;
             }
         }
     }
     return $results;
 }
开发者ID:pugong,项目名称:phabricator,代码行数:13,代码来源:ManiphestTaskOpenStatusDatasource.php


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


示例20: buildWorkbook

 /**
  * @phutil-external-symbol class PHPExcel
  * @phutil-external-symbol class PHPExcel_IOFactory
  * @phutil-external-symbol class PHPExcel_Style_NumberFormat
  * @phutil-external-symbol class PHPExcel_Cell_DataType
  */
 public function buildWorkbook(PHPExcel $workbook, array $tasks, array $handles, PhabricatorUser $user)
 {
     $sheet = $workbook->setActiveSheetIndex(0);
     $sheet->setTitle(pht('Tasks'));
     $widths = array(null, 15, null, 10, 15, 15, 60, 30, 20, 100);
     foreach ($widths as $col => $width) {
         if ($width !== null) {
             $sheet->getColumnDimension($this->col($col))->setWidth($width);
         }
     }
     $status_map = ManiphestTaskStatus::getTaskStatusMap();
     $pri_map = ManiphestTaskPriority::getTaskPriorityMap();
     $date_format = null;
     $rows = array();
     $rows[] = array(pht('ID'), pht('Owner'), pht('Status'), pht('Priority'), pht('Date Created'), pht('Date Updated'), pht('Deadline'), pht('Title'), pht('Projects'), pht('Description'));
     $is_date = array(false, false, false, false, true, true, true, false, false, false);
     $header_format = array('font' => array('bold' => true));
     foreach ($tasks as $task) {
         $task_owner = null;
         if ($task->getOwnerPHID()) {
             $task_owner = $handles[$task->getOwnerPHID()]->getName();
         }
         $projects = array();
         foreach ($task->getProjectPHIDs() as $phid) {
             $projects[] = $handles[$phid]->getName();
         }
         $projects = implode(', ', $projects);
         $custom_fields = PhabricatorCustomField::getObjectFields($task, PhabricatorCustomField::ROLE_VIEW);
         $custom_fields->setViewer($user)->readFieldsFromStorage($task);
         $fields = $custom_fields->getFields();
         $rows[] = array('T' . $task->getID(), $task_owner, idx($status_map, $task->getStatus(), '?'), idx($pri_map, $task->getPriority(), '?'), $this->computeExcelDate($task->getDateCreated()), $this->computeExcelDate($task->getDateModified()), $this->computeExcelDate($fields['std:maniphest:Deadline']->getValueForStorage()), $task->getTitle(), $projects, id(new PhutilUTF8StringTruncator())->setMaximumBytes(512)->truncateString($task->getDescription()));
     }
     foreach ($rows as $row => $cols) {
         foreach ($cols as $col => $spec) {
             $cell_name = $this->col($col) . ($row + 1);
             $cell = $sheet->setCellValue($cell_name, $spec, $return_cell = true);
             if ($row == 0) {
                 $sheet->getStyle($cell_name)->applyFromArray($header_format);
             }
             if ($is_date[$col]) {
                 $code = PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD2;
                 $sheet->getStyle($cell_name)->getNumberFormat()->setFormatCode($code);
             } else {
                 $cell->setDataType(PHPExcel_Cell_DataType::TYPE_STRING);
             }
         }
     }
 }
开发者ID:nanamiwang,项目名称:phabricator,代码行数:54,代码来源:ManiphestExcelDefaultFormat.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP MantisEnum类代码示例发布时间:2022-05-23
下一篇:
PHP ManiphestTaskPriority类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap