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


PHP Issue::getFirstTimetrack方法代码示例

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


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

示例1: getCalendar

 /**
  * Get the calendar of an issue
  * @param Issue $issue The issue
  * @param TimeTrack[] $trackList
  * @return mixed[]
  */
 private function getCalendar(Issue $issue, array $trackList)
 {
     $months = NULL;
     if (!empty($trackList)) {
         $firstTT = $issue->getFirstTimetrack();
         $startTimestamp = $firstTT->getDate();
         $endTimestamp = $issue->getLatestTimetrack()->getDate();
         for ($y = date('Y', $startTimestamp); $y <= date('Y', $endTimestamp); $y++) {
             for ($m = 1; $m <= 12; $m++) {
                 $monthsValue = $this->getMonth($m, $y, $issue, $trackList);
                 if ($monthsValue != NULL) {
                     $months[] = $monthsValue;
                 }
             }
         }
     }
     return $months;
 }
开发者ID:dfuzeau,项目名称:codev,代码行数:24,代码来源:issue_info.php

示例2: dashboardSettings

 /**
  *
  * @param SmartyHelper $smartyHelper
  * @param Issue $issue
  * @param int $userid
  * @param int $teamid
  */
 public static function dashboardSettings(SmartyHelper $smartyHelper, Issue $issue, $userid, $teamid)
 {
     $isel = new IssueSelection();
     $isel->addIssue($issue->getId());
     $pluginDataProvider = PluginDataProvider::getInstance();
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_ISSUE_SELECTION, $isel);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_TEAM_ID, $teamid);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_SESSION_USER_ID, $userid);
     // start date is min(1st_timetrack, issue_creation_date)
     $startT = $issue->getDateSubmission();
     $firstTT = $issue->getFirstTimetrack();
     if (NULL != $firstTT) {
         $startT = min(array($issue->getDateSubmission(), $firstTT->getDate()));
     }
     // end date is last_timetrack or now if none
     $eTs = NULL == $firstTT ? time() : $issue->getLatestTimetrack()->getDate();
     $endT = mktime(23, 59, 59, date('m', $eTs), date('d', $eTs), date('Y', $eTs));
     //echo "start $startT end $endT<br>";
     // Calculate a nice day interval
     $nbWeeks = ($endT - $startT) / 60 / 60 / 24;
     $interval = ceil($nbWeeks / 20);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_START_TIMESTAMP, $startT);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_END_TIMESTAMP, $endT);
     $pluginDataProvider->setParam(PluginDataProviderInterface::PARAM_INTERVAL, $interval);
     $dashboardName = 'Tasks_prj' . $issue->getProjectId();
     // save the DataProvider for Ajax calls
     $_SESSION[PluginDataProviderInterface::SESSION_ID . $dashboardName] = serialize($pluginDataProvider);
     // create the Dashboard
     $dashboard = new Dashboard($dashboardName);
     // settings are common all tasks of a project
     $dashboard->setDomain(IndicatorPluginInterface::DOMAIN_TASK);
     $dashboard->setCategories(array(IndicatorPluginInterface::CATEGORY_QUALITY, IndicatorPluginInterface::CATEGORY_ACTIVITY, IndicatorPluginInterface::CATEGORY_ROADMAP, IndicatorPluginInterface::CATEGORY_PLANNING, IndicatorPluginInterface::CATEGORY_RISK));
     $dashboard->setTeamid($teamid);
     $dashboard->setUserid($userid);
     $data = $dashboard->getSmartyVariables($smartyHelper);
     foreach ($data as $smartyKey => $smartyVariable) {
         $smartyHelper->assign($smartyKey, $smartyVariable);
     }
 }
开发者ID:dfuzeau,项目名称:codev,代码行数:46,代码来源:issue_info_tools.php

示例3: findStartDate

 /**
  * use min(first timetrack, first status change) as startDate
  *
  * @param Issue $issue
  * @param type $backlogStartDate
  * @return type
  */
 private function findStartDate(Issue $issue, $backlogStartDate)
 {
     // sometimes people add a timetrack but forget to update the status,
     // in this case the date of the first timetrack will be used
     $tt = $issue->getFirstTimetrack();
     $ttDate = NULL;
     if (NULL != $tt) {
         $ttDate = $tt->getDate();
         if (self::$logger->isDebugEnabled()) {
             self::$logger->debug("findStartDate() issue=" . $issue->getId() . ": first timetrack on " . date("Y-m-d", $tt->getDate()));
         }
     }
     // use status to find startDate
     $statusDate = $this->findStartDateFromStatus($issue, $backlogStartDate);
     // startDate is the older one
     if (NULL == $ttDate) {
         // statusDate is never NULL
         $startDate = $statusDate;
     } else {
         $startDate = min($ttDate, $statusDate);
         if (self::$logger->isDebugEnabled()) {
             self::$logger->debug("findStartDate() issue=" . $issue->getId() . ": startDate=" . date("Y-m-d", $startDate) . ' : min(' . date("Y-m-d", $ttDate) . ',' . date("Y-m-d", $statusDate) . ')');
         }
     }
     return $startDate;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:33,代码来源:gantt_manager.class.php


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