本文整理汇总了PHP中Ubirimi\Util::transformTimeToString方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::transformTimeToString方法的具体用法?PHP Util::transformTimeToString怎么用?PHP Util::transformTimeToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ubirimi\Util
的用法示例。
在下文中一共展示了Util::transformTimeToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
?>
<?php
$editedHTML = '';
if ($workLog['edited_flag'] == 1) {
$editedHTML = ' - edited';
}
?>
<tr>
<td>
<div>
<?php
echo $workLog['first_name'] . ' ' . $workLog['last_name'] . ' logged work - ' . $workLog['date_started'] . $editedHTML;
?>
</div>
<div>Time Spent: <?php
echo Util::transformTimeToString(Util::transformLogTimeToMinutes($workLog['time_spent'], $hoursPerDay, $daysPerWeek), $hoursPerDay, $daysPerWeek);
?>
</div>
<?php
if ($workLog['comment']) {
?>
<div><?php
echo $workLog['comment'];
?>
</div>
<?php
}
?>
</td>
<td width="20px" align="right">
<?php
示例2: adjustRemainingEstimate
public function adjustRemainingEstimate($issueData, $timeSpent, $remainingTime, $hoursPerDay, $daysPerWeek, $loggedInUserId)
{
$issueRemainingTime = $issueData['remaining_estimate'];
$issueRemainingMinutes = Util::transformLogTimeToMinutes($issueRemainingTime, $hoursPerDay, $daysPerWeek);
if ($remainingTime == 'automatic') {
$timeSpentMinutes = Util::transformLogTimeToMinutes($timeSpent, $hoursPerDay, $daysPerWeek);
$difference = $issueRemainingMinutes - $timeSpentMinutes;
if ($difference < 0) {
$difference = 0;
}
$remainingTime = Util::transformTimeToString($difference, $hoursPerDay, $daysPerWeek);
if ('' == $remainingTime) {
$remainingTime = 0;
}
} else {
if ($remainingTime == 'existing') {
$timeSpentMinutes = 0;
$difference = $issueRemainingMinutes - $timeSpentMinutes;
if ($difference < 0) {
$difference = 0;
}
$remainingTime = Util::transformTimeToString($difference, $hoursPerDay, $daysPerWeek);
} else {
if ($remainingTime == 'estimate_unset') {
$remainingTime = null;
} else {
if ($remainingTime[0] == '=') {
$remainingTime = str_replace("=", '', $remainingTime);
$remainingTimeMinutes = Util::transformLogTimeToMinutes($remainingTime, $hoursPerDay, $daysPerWeek);
$difference = $remainingTimeMinutes;
if ($difference < 0) {
$difference = 0;
}
$remainingTime = Util::transformTimeToString($difference, $hoursPerDay, $daysPerWeek);
} else {
if ($remainingTime[0] == "-") {
$remainingTime = str_replace("-", '', $remainingTime);
$remainingTimeMinutes = Util::transformLogTimeToMinutes($remainingTime, $hoursPerDay, $daysPerWeek);
$difference = $issueRemainingMinutes - $remainingTimeMinutes;
if ($difference < 0) {
$difference = 0;
}
$remainingTime = Util::transformTimeToString($difference, $hoursPerDay, $daysPerWeek);
} else {
if ($remainingTime[0] == "+") {
$remainingTime = str_replace("+", '', $remainingTime);
$remainingTimeMinutes = Util::transformLogTimeToMinutes($remainingTime, $hoursPerDay, $daysPerWeek);
$sum = $issueRemainingMinutes + $remainingTimeMinutes;
$remainingTime = Util::transformTimeToString($sum, $hoursPerDay, $daysPerWeek);
}
}
}
}
}
}
// transform it to string
if ($remainingTime !== null) {
$remainingTime = str_replace(array(" ", ','), '', $remainingTime);
$remainingTime = str_replace(array('weeks', 'week'), 'w', $remainingTime);
$remainingTime = str_replace(array('days', 'day'), 'd', $remainingTime);
$remainingTime = str_replace(array('hours', 'hour'), 'h', $remainingTime);
$remainingTime = str_replace(array('minutes', 'minutes'), 'm', $remainingTime);
if ($remainingTime == "") {
$remainingTime = 0;
}
WorkLog::updateRemainingEstimate($issueData['id'], $remainingTime);
} else {
WorkLog::clearRemainingEstimate($issueData['id']);
}
return $remainingTime;
}
示例3:
</td>
<td valign="middle">
<div style="background-color: #d3d3d3; width: 100%; height: 14px; margin-top: 2px">
<div style=" float:right; background-color: #ec9a1f; height: 14px; width: <?php
echo $percRemainingEstimate;
?>
%"></div>
</div>
</td>
</tr>
<tr>
<td><div class="textLabel">Logged:</div></td>
<td align="right">
<?php
if ($worklogs) {
echo Util::transformTimeToString($minutesLogged, $hoursPerDay, $daysPerWeek, 'short');
} else {
echo 'Not Specified';
}
?>
</td>
<td valign="middle">
<div style="background-color: #d3d3d3; width: 100%; height: 14px; margin-top: 2px">
<div style="float:left; background-color: #77ce5c; height: 14px; width: <?php
echo $percMinuteskLogged;
?>
%"></div>
</div>
</td>
</tr>
</table>
示例4:
" id="view_issue_workflow_menu_enabled"/>
<input type="hidden" value="<?php
if ($linkIssueTypes) {
echo "1";
} else {
echo "0";
}
?>
" id="link_possible"/>
<?php
if (isset($issue['remaining_estimate'])) {
?>
<input type="hidden"
value="<?php
echo str_replace(" ", '', Util::transformTimeToString(Util::transformLogTimeToMinutes($issue['remaining_estimate'], $hoursPerDay, $daysPerWeek), $hoursPerDay, $daysPerWeek, 'short'));
?>
"
id="issue_remaining_estimate" />
<?php
} else {
?>
<input type="hidden"
value="-1"
id="issue_remaining_estimate" />
<?php
}
?>
<input type="hidden" value="<?php
echo $workflowUsed['id'];
?>
示例5:
<?php
} else {
?>
<?php
echo $row['old_value'] != 'NULL' ? $row['old_value'] : 'None';
?>
<?php
}
?>
</td>
<td valign="top" width="45%">
<?php
if ($row['field'] == 'time_spent' || $row['field'] == 'remaining_estimate' || $row['field'] == 'worklog_time_spent') {
?>
<?php
echo $row['new_value'] != 'NULL' ? Util::transformTimeToString(Util::transformLogTimeToMinutes($row['new_value'], $hoursPerDay, $daysPerWeek), $hoursPerDay, $daysPerWeek) : 'None';
?>
<?php
} else {
?>
<?php
echo $row['new_value'] != 'NULL' ? $row['new_value'] : 'None';
?>
<?php
}
?>
</td>
</tr>
</table>
<?php
}