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


PHP ManiphestTaskStatus::isOpenStatus方法代码示例

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


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

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

示例2: 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::isOpenStatus($value)) {
             $result->addAttribute(pht('Open Status'));
         } else {
             $result->addAttribute(pht('Closed Status'));
         }
         if (ManiphestTaskStatus::isDisabledStatus($value)) {
             $result->setClosed(pht('Disabled'));
         }
         $results[$value] = $result;
     }
     return $results;
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:18,代码来源:ManiphestTaskStatusDatasource.php

示例3: addTaskStatustoData

 private function addTaskStatustoData($data)
 {
     foreach ($data as $key => $row) {
         // NOTE: Hack to avoid json_decode().
         $oldv = trim($row['oldValue'], '"');
         $newv = trim($row['newValue'], '"');
         if ($oldv == 'null') {
             $old_is_open = false;
         } else {
             $old_is_open = ManiphestTaskStatus::isOpenStatus($oldv);
         }
         $new_is_open = ManiphestTaskStatus::isOpenStatus($newv);
         $is_open = $new_is_open && !$old_is_open;
         $is_close = $old_is_open && !$new_is_open;
         $data[$key]['_is_open'] = $is_open;
         $data[$key]['_is_close'] = $is_close;
         if (!$is_open && !$is_close) {
             // This is either some kind of bogus events, or a resolution change
             // (e.g., resolved -> invalid). Just skip it.
             continue;
         }
     }
     return $data;
 }
开发者ID:yangming85,项目名称:phabricator-extensions-Sprint,代码行数:24,代码来源:SprintReportBurnUpView.php

示例4: renderBurn

 public function renderBurn()
 {
     $request = $this->getRequest();
     $viewer = $request->getUser();
     $handle = null;
     $project_phid = $request->getStr('project');
     if ($project_phid) {
         $phids = array($project_phid);
         $handles = $this->loadViewerHandles($phids);
         $handle = $handles[$project_phid];
     }
     $table = new ManiphestTransaction();
     $conn = $table->establishConnection('r');
     $joins = '';
     if ($project_phid) {
         $joins = qsprintf($conn, 'JOIN %T t ON x.objectPHID = t.phid
       JOIN %T p ON p.src = t.phid AND p.type = %d AND p.dst = %s', id(new ManiphestTask())->getTableName(), PhabricatorEdgeConfig::TABLE_NAME_EDGE, PhabricatorProjectObjectHasProjectEdgeType::EDGECONST, $project_phid);
     }
     $data = queryfx_all($conn, 'SELECT x.oldValue, x.newValue, x.dateCreated FROM %T x %Q
     WHERE transactionType = %s
     ORDER BY x.dateCreated ASC', $table->getTableName(), $joins, ManiphestTransaction::TYPE_STATUS);
     $stats = array();
     $day_buckets = array();
     $open_tasks = array();
     foreach ($data as $key => $row) {
         // NOTE: Hack to avoid json_decode().
         $oldv = trim($row['oldValue'], '"');
         $newv = trim($row['newValue'], '"');
         if ($oldv == 'null') {
             $old_is_open = false;
         } else {
             $old_is_open = ManiphestTaskStatus::isOpenStatus($oldv);
         }
         $new_is_open = ManiphestTaskStatus::isOpenStatus($newv);
         $is_open = $new_is_open && !$old_is_open;
         $is_close = $old_is_open && !$new_is_open;
         $data[$key]['_is_open'] = $is_open;
         $data[$key]['_is_close'] = $is_close;
         if (!$is_open && !$is_close) {
             // This is either some kind of bogus event, or a resolution change
             // (e.g., resolved -> invalid). Just skip it.
             continue;
         }
         $day_bucket = phabricator_format_local_time($row['dateCreated'], $viewer, 'Yz');
         $day_buckets[$day_bucket] = $row['dateCreated'];
         if (empty($stats[$day_bucket])) {
             $stats[$day_bucket] = array('open' => 0, 'close' => 0);
         }
         $stats[$day_bucket][$is_close ? 'close' : 'open']++;
     }
     $template = array('open' => 0, 'close' => 0);
     $rows = array();
     $rowc = array();
     $last_month = null;
     $last_month_epoch = null;
     $last_week = null;
     $last_week_epoch = null;
     $week = null;
     $month = null;
     $last = last_key($stats) - 1;
     $period = $template;
     foreach ($stats as $bucket => $info) {
         $epoch = $day_buckets[$bucket];
         $week_bucket = phabricator_format_local_time($epoch, $viewer, 'YW');
         if ($week_bucket != $last_week) {
             if ($week) {
                 $rows[] = $this->formatBurnRow(pht('Week of %s', phabricator_date($last_week_epoch, $viewer)), $week);
                 $rowc[] = 'week';
             }
             $week = $template;
             $last_week = $week_bucket;
             $last_week_epoch = $epoch;
         }
         $month_bucket = phabricator_format_local_time($epoch, $viewer, 'Ym');
         if ($month_bucket != $last_month) {
             if ($month) {
                 $rows[] = $this->formatBurnRow(phabricator_format_local_time($last_month_epoch, $viewer, 'F, Y'), $month);
                 $rowc[] = 'month';
             }
             $month = $template;
             $last_month = $month_bucket;
             $last_month_epoch = $epoch;
         }
         $rows[] = $this->formatBurnRow(phabricator_date($epoch, $viewer), $info);
         $rowc[] = null;
         $week['open'] += $info['open'];
         $week['close'] += $info['close'];
         $month['open'] += $info['open'];
         $month['close'] += $info['close'];
         $period['open'] += $info['open'];
         $period['close'] += $info['close'];
     }
     if ($week) {
         $rows[] = $this->formatBurnRow(pht('Week To Date'), $week);
         $rowc[] = 'week';
     }
     if ($month) {
         $rows[] = $this->formatBurnRow(pht('Month To Date'), $month);
         $rowc[] = 'month';
     }
//.........这里部分代码省略.........
开发者ID:truSense,项目名称:phabricator,代码行数:101,代码来源:ManiphestReportController.php

示例5: getColor

 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_OWNER:
             if ($this->getAuthorPHID() == $new) {
                 return 'green';
             } else {
                 if (!$new) {
                     return 'black';
                 } else {
                     if (!$old) {
                         return 'green';
                     } else {
                         return 'green';
                     }
                 }
             }
         case self::TYPE_STATUS:
             $color = ManiphestTaskStatus::getStatusColor($new);
             if ($color !== null) {
                 return $color;
             }
             if (ManiphestTaskStatus::isOpenStatus($new)) {
                 return 'green';
             } else {
                 return 'black';
             }
         case self::TYPE_PRIORITY:
             if ($old == ManiphestTaskPriority::getDefaultPriority()) {
                 return 'green';
             } else {
                 if ($old > $new) {
                     return 'grey';
                 } else {
                     return 'yellow';
                 }
             }
     }
     return parent::getColor();
 }
开发者ID:denghp,项目名称:phabricator,代码行数:42,代码来源:ManiphestTransaction.php

示例6: addTaskToTree

 private function addTaskToTree($task)
 {
     $cdate = $this->getTaskCreatedDate($task);
     $date_created = phabricator_date($cdate, $this->viewer);
     $udate = $this->getTaskModifiedDate($task);
     $last_updated = phabricator_date($udate, $this->viewer);
     $status = $task->getStatus();
     $owner_link = $this->setOwnerLink($this->handles, $task);
     $priority = $this->getPriority($task);
     $priority_name = $this->getPriorityName($task);
     $is_open = ManiphestTaskStatus::isOpenStatus($task->getStatus());
     if ($this->blocker === true && $is_open === true) {
         $blockericon = $this->getIconforBlocker();
     } else {
         $blockericon = '';
     }
     if ($this->blocked === true && $is_open === true) {
         $blockedicon = $this->getIconforBlocked();
     } else {
         $blockedicon = '';
     }
     $output = array();
     $output[] = array(phutil_safe_html(phutil_tag('a', array('href' => '/' . $task->getMonogram(), 'class' => $status !== 'open' ? 'phui-tag-core-closed' : ''), array($this->buildTaskLink($task), $blockericon, $blockedicon))), $cdate, $date_created, $udate, $last_updated, $owner_link, $priority, $priority_name, $this->points, $status);
     return $output;
 }
开发者ID:kanarip,项目名称:phabricator-extensions-Sprint,代码行数:25,代码来源:TaskTableDataProvider.php


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