本文整理汇总了PHP中Issue::getDriftColor方法的典型用法代码示例。如果您正苦于以下问题:PHP Issue::getDriftColor方法的具体用法?PHP Issue::getDriftColor怎么用?PHP Issue::getDriftColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Issue
的用法示例。
在下文中一共展示了Issue::getDriftColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIssueGeneralInfo
/**
* Get general info of an issue
* @param Issue $issue The issue
* @param bool $isManager if true: show MgrEffortEstim column
* @param bool $displaySupport If true, display support
* @return mixed[]
*/
public static function getIssueGeneralInfo(Issue $issue, $isManager = false, $displaySupport = false)
{
$withSupport = true;
// include support in elapsed & Drift
$drift = $issue->getDrift($withSupport);
$issueGeneralInfo = array("issueId" => $issue->getId(), "issueSummary" => htmlspecialchars(preg_replace('![\\t\\r\\n]+!', ' ', $issue->getSummary())), "issueType" => $issue->getType(), "issueDescription" => htmlspecialchars($issue->getDescription()), "projectName" => $issue->getProjectName(), "categoryName" => $issue->getCategoryName(), "issueExtRef" => $issue->getTcId(), 'mantisURL' => Tools::mantisIssueURL($issue->getId(), NULL, true), 'issueURL' => Tools::mantisIssueURL($issue->getId()), 'statusName' => $issue->getCurrentStatusName(), 'priorityName' => $issue->getPriorityName(), 'severityName' => $issue->getSeverityName(), 'handlerName' => UserCache::getInstance()->getUser($issue->getHandlerId())->getName(), "issueEffortTitle" => $issue->getEffortEstim() . ' + ' . $issue->getEffortAdd(), "issueEffort" => $issue->getEffortEstim() + $issue->getEffortAdd(), "issueReestimated" => $issue->getReestimated(), "issueBacklog" => $issue->getBacklog(), "issueDriftColor" => $issue->getDriftColor($drift), "issueDrift" => round($drift, 2), "progress" => round(100 * $issue->getProgress()), 'relationships' => self::getFormattedRelationshipsInfo($issue));
if ($isManager) {
$issueGeneralInfo['issueMgrEffortEstim'] = $issue->getMgrEffortEstim();
$driftMgr = $issue->getDriftMgr($withSupport);
$issueGeneralInfo['issueDriftMgrColor'] = $issue->getDriftColor($driftMgr);
$issueGeneralInfo['issueDriftMgr'] = round($driftMgr, 2);
}
if ($withSupport) {
$issueGeneralInfo['issueElapsed'] = $issue->getElapsed();
} else {
$issueGeneralInfo['issueElapsed'] = $issue->getElapsed() - $issue->getElapsed(Jobs::JOB_SUPPORT);
}
if ($displaySupport) {
if ($isManager) {
$driftMgr = $issue->getDriftMgr(!$withSupport);
$issueGeneralInfo['issueDriftMgrSupportColor'] = $issue->getDriftColor($driftMgr);
$issueGeneralInfo['issueDriftMgrSupport'] = round($driftMgr, 2);
}
$drift = $issue->getDrift(!$withSupport);
$issueGeneralInfo['issueDriftSupportColor'] = $issue->getDriftColor($drift);
$issueGeneralInfo['issueDriftSupport'] = round($drift, 2);
}
return $issueGeneralInfo;
}
示例2: getTimeDrift
/**
* Get time drift of an issue
* @param Issue $issue The issue
* @return mixed[]
*/
private function getTimeDrift(Issue $issue)
{
$timeDriftSmarty = array();
$deadline = $issue->getDeadLine();
if (!is_null($deadline) && 0 != $deadline) {
$timeDriftSmarty["deadLine"] = Tools::formatDate("%d %b %Y", $deadline);
}
$tooltipAttr = array();
if (NULL != $issue->getDeliveryDate()) {
//$timeDriftSmarty["deliveryDate"] = Tools::formatDate("%d %b %Y", $issue->getDeliveryDate());
$tooltipAttr[T_('DeliveryDate')] = Tools::formatDate("%d %b %Y", $issue->getDeliveryDate());
$btImage = 'images/b_markAsRead.png';
}
$timeDrift = $issue->getTimeDrift();
if (!is_string($timeDrift)) {
$tooltipAttr[T_('DriftColor')] = $issue->getDriftColor($timeDrift);
$tooltipAttr[T_('Drift')] = round($timeDrift);
if (round($timeDrift) > 0) {
$btImage = 'images/b_error.png';
}
}
if (0 !== count($tooltipAttr)) {
$tooltip = Tools::imgWithTooltip($btImage, $tooltipAttr);
$timeDriftSmarty["tooltip"] = $tooltip;
}
return $timeDriftSmarty;
}
示例3: getTimeDrift
/**
* Get time drift of an issue
* @param Issue $issue The issue
* @return mixed[]
*/
private function getTimeDrift(Issue $issue)
{
$timeDriftSmarty = array();
$deadline = $issue->getDeadLine();
if (!is_null($deadline) && 0 != $deadline) {
$timeDriftSmarty["deadLine"] = Tools::formatDate("%d %b %Y", $deadline);
}
if (NULL != $issue->getDeliveryDate()) {
$timeDriftSmarty["deliveryDate"] = Tools::formatDate("%d %b %Y", $issue->getDeliveryDate());
}
$timeDrift = $issue->getTimeDrift();
if (!is_string($timeDrift)) {
$timeDriftSmarty["driftColor"] = $issue->getDriftColor($timeDrift);
$timeDriftSmarty["drift"] = round($timeDrift);
}
return $timeDriftSmarty;
}