本文整理汇总了PHP中tbg_formatTime函数的典型用法代码示例。如果您正苦于以下问题:PHP tbg_formatTime函数的具体用法?PHP tbg_formatTime怎么用?PHP tbg_formatTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tbg_formatTime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<?php
if (count($comments)) {
?>
<table cellpadding=0 cellspacing=0 style="margin: 5px;">
<?php
$prev_date = null;
?>
<?php
foreach ($comments as $comment) {
?>
<?php
$date = tbg_formatTime($comment->getPosted(), 5);
?>
<?php
if ($date != $prev_date) {
?>
<tr>
<td class="latest_action_dates" colspan="2"><?php
echo $date;
?>
</td>
</tr>
<?php
}
?>
<?php
include_component('main/commentitem', array('comment' => $comment, 'include_project' => true));
?>
<?php
$prev_date = $date;
示例2: foreach
?>
<ul class="article_list">
<?php
foreach ($latest_articles as $article) {
?>
<li>
<div>
<?php
echo image_tag('news_item_medium.png', array('style' => 'float: left;'), false, 'publish');
?>
<?php
echo link_tag(make_url('publish_article', array('article_name' => $article->getName())), get_spaced_name($article->getTitle()));
?>
<br>
<span><?php
echo __('%time, by %user', array('%time' => tbg_formatTime($article->getPostedDate(), 3), '%user' => '<b>' . ($article->getAuthor() instanceof TBGIdentifiable ? '<a href="javascript:void(0);" onclick="TBG.Main.Helpers.Backdrop.show(\'' . make_url('get_partial_for_backdrop', array('key' => 'usercard', 'user_id' => $article->getAuthor()->getID())) . '\');">' . $article->getAuthor()->getName() . '</a>' : __('System')) . '</b>'));
?>
</span>
</div>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<div class="no_items"><?php
echo __('There are no recent pages here');
?>
</div>
示例3: __
?>
</option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td class="config_explanation" colspan="2">
<?php
echo __('This setting is used to display issues, comments and more in your local timezone.');
?>
<br>
<?php
echo __('The time is now: %time%', array('%time%' => tbg_formatTime(time(), 1)));
?>
</td>
</tr>
<tr>
<td style="width: 200px; padding: 5px;"><label for="profile_timezone"><?php
echo __('Language');
?>
</label></td>
<td>
<select name="profile_language" id="profile_language" style="width: 300px;">
<option value="sys"<?php
if ($tbg_user->getLanguage() == 'sys') {
?>
selected<?php
}
示例4: tbg_formatTime
- <?php
echo tbg_formatTime($milestone->getScheduledDate(), 22, true, true);
?>
)
<?php
} elseif ($milestone->getStartingDate() && !$milestone->isScheduled()) {
?>
(<?php
echo __('Starting %start_date', array('%start_date' => tbg_formatTime($milestone->getStartingDate(), 22, true, true)));
?>
)
<?php
} elseif (!$milestone->getStartingDate() && $milestone->isScheduled()) {
?>
(<?php
echo __('Ends %end_date', array('%end_date' => tbg_formatTime($milestone->getScheduledDate(), 22, true, true)));
?>
)
<?php
}
?>
</span>
<div id="selected_burndown_image" class="graph_view" style="margin: 15px; width: 750px; height: 360px;"></div>
<?php
//echo image_tag(make_url('project_scrum_sprint_burndown_image', array('project_key' => $selected_project->getKey(), 'sprint_id' => $milestone->getID())), array('style' => 'margin: 15px 0 15px 0;', 'id' => 'selected_burndown_image'), true);
?>
<table id="milestone_details_issue_list" cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th> </td>
<th><?php
示例5: link_tag
?>
</td>
<td>
<span class="faded_out smaller"><?php
echo link_tag(make_url('project_dashboard', array('project_key' => $theIssue->getProject()->getKey())), '[' . $theIssue->getProject()->getKey() . ']');
?>
</span>
<?php
echo link_tag(make_url('viewissue', array('project_key' => $theIssue->getProject()->getKey(), 'issue_no' => $theIssue->getFormattedIssueNo())), $theIssue->getFormattedTitle(true));
?>
</td>
</tr>
<tr>
<td colspan="2" class="faded_out" style="padding-bottom: 15px;">
<?php
echo __('<strong>%status%</strong>, updated %updated_at%', array('%status%' => $theIssue->getStatus() instanceof TBGDatatype ? $theIssue->getStatus()->getName() : __('Status not determined'), '%updated_at%' => tbg_formatTime($theIssue->getLastUpdatedTime(), 12)));
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
} else {
?>
<div class="faded_out" style="padding: 5px 5px 15px 5px;"><?php
echo __($default_message);
?>
</div>
<?php
示例6: do_execute
public function do_execute()
{
$this->cliEcho('Showing detailed information about ');
$this->cliEcho($this->getProvidedArgument('project_key'), 'green');
$this->cliEcho(' issue ');
$print_issue_number = $this->getProvidedArgument('issue_number');
if (is_numeric($print_issue_number)) {
$print_issue_number = '#' . $print_issue_number;
}
$this->cliEcho($print_issue_number, 'yellow');
$this->cliEcho(' on ');
$this->cliEcho($this->_getCurrentRemoteServer(), 'white', 'bold');
$this->cliEcho("\n");
$url_options = array('project_key' => $this->project_key, 'issue_no' => $this->issue_number, 'format' => 'json');
$this->cliEcho("\n");
$issue = $this->getRemoteResponse($this->getRemoteURL('api_viewissue', $url_options));
\thebuggenie\core\framework\Context::loadLibrary('common');
$this->cliEcho($print_issue_number, 'green', 'bold');
$this->cliEcho(" - ");
$state = $issue->state == \thebuggenie\core\entities\Issue::STATE_OPEN ? 'OPEN' : 'CLOSED';
$this->cliEcho("[{$state}] ", 'cyan');
$this->cliEcho(html_entity_decode($issue->title), 'white', 'bold');
$this->cliEcho("\n");
$this->cliEcho("State: ", 'white', 'bold');
$this->cliEcho($state);
$this->cliEcho("\n");
$this->cliEcho("Posted: ", 'white', 'bold');
$this->cliEcho(tbg_formatTime($issue->created_at, 21, true, true) . ' (' . $issue->created_at . ')');
$this->cliEcho("\n");
$this->cliEcho("Posted by: ", 'white', 'bold');
if ($issue->posted_by) {
$this->cliEcho($issue->posted_by->name);
} else {
$this->cliEcho('-');
}
$this->cliEcho("\n");
$this->cliEcho("Updated: ", 'white', 'bold');
$this->cliEcho(tbg_formatTime($issue->updated_at, 21, true, true) . ' (' . $issue->updated_at . ')');
$this->cliEcho("\n");
$this->cliEcho("Assigned to: ", 'white', 'bold');
if ($issue->assignee) {
$this->cliEcho($issue->assignee->name);
} else {
$this->cliEcho('-');
}
$this->cliEcho("\n");
$this->cliEcho("Status: ", 'white', 'bold');
if ($issue->status) {
$this->cliEcho($issue->status->name);
} else {
$this->cliEcho('-');
}
$this->cliEcho("\n");
foreach ($issue->visible_fields as $field => $details) {
$name = ucfirst(str_replace('_', ' ', $field));
$this->cliEcho("{$name}: ", 'white', 'bold');
if (isset($issue->{$field})) {
if ($field == 'estimated_time' || $field == 'spent_time') {
if (isset($issue->{$field}->points)) {
$this->cliEcho($issue->{$field}->points . 'p, ' . $issue->{$field}->hours . 'h, ' . $issue->{$field}->days . 'd, ' . $issue->{$field}->weeks . 'w, ' . $issue->{$field}->months . 'mo');
} else {
$this->cliEcho('-');
}
} else {
if (is_object($issue->{$field})) {
$this->cliEcho($issue->{$field}->name);
} else {
$this->cliEcho($issue->{$field});
}
}
} else {
$this->cliEcho('-');
}
$this->cliEcho("\n");
}
if ($this->getProvidedArgument('include_comments', 'no') == 'yes') {
$this->cliEcho("\n");
$this->cliEcho("Comments: \n", 'white', 'bold');
if (count($issue->comments) > 0) {
foreach ($issue->comments as $comment) {
if ($comment->system_comment && $this->getProvidedArgument('include_system_comments', 'no') != 'yes') {
continue;
}
$this->cliEcho('Comment #' . $comment->comment_number, 'yellow', 'bold');
$this->cliEcho("\n");
$this->cliEcho('Posted by: ', 'white', 'bold');
if ($comment->posted_by) {
$this->cliEcho($comment->posted_by->name);
} else {
$this->cliEcho("Unknown user");
}
$this->cliEcho("\n");
$this->cliEcho('Posted: ', 'white', 'bold');
$this->cliEcho(tbg_formatTime($comment->created_at, 21, true, true) . ' (' . $comment->created_at . ')');
$this->cliEcho("\n");
$this->cliEcho('Comment: ', 'white', 'bold');
$this->cliEcho($comment->content);
$this->cliEcho("\n");
$this->cliEcho('----------', 'white', 'bold');
$this->cliEcho("\n\n");
//.........这里部分代码省略.........
示例7: image_tag
?>
"><?php
echo image_tag($issue->getIssueType()->getIcon() . '_tiny.png', array('class' => 'informal'));
?>
<div><?php
echo __('Issue %issue_no - %title', array('%issue_no' => $issue->getFormattedIssueNo(true), '%title' => mb_strlen($issue->getTitle()) <= 32 ? $issue->getTitle() : str_pad(mb_substr($issue->getTitle(), 0, 32), 35, '...')));
?>
</div><span class="informal"><?php
if ($issue->isClosed()) {
?>
[<?php
echo mb_strtoupper(__('Closed'));
?>
] <?php
}
echo __('Last updated %updated_at', array('%updated_at' => tbg_formatTime($issue->getLastUpdatedTime(), 6)));
?>
</span><span class="informal url"><?php
echo make_url('viewissue', array('project_key' => $issue->getProject()->getKey(), 'issue_no' => $issue->getFormattedIssueNo()));
?>
</span><div class="informal extra"><?php
echo __('Status: %status', array('%status' => '<span>' . $issue->getStatus()->getName() . '</span>'));
?>
</div><?php
if ($issue->isResolutionVisible()) {
?>
<div class="informal extra"><?php
echo __('Resolution: %resolution', array('%resolution' => '<span>' . ($issue->getResolution() instanceof \thebuggenie\core\entities\Resolution ? $issue->getResolution()->getName() : '<span class="faded_out">' . __('Not determined') . '</span>') . '</span>'));
?>
</div><?php
}
示例8: getDateString
public function getDateString()
{
framework\Context::loadLibrary('common');
$i18n = framework\Context::getI18n();
if ($this->hasStartingDate() && $this->hasScheduledDate()) {
if ($this->getStartingDate() < NOW && $this->getScheduledDate() < NOW) {
return $i18n->__('%milestone_name (started %start_date - ended %end_date)', array('%milestone_name' => '', '%start_date' => tbg_formatTime($this->getStartingDate(), 23, true, true), '%end_date' => tbg_formatTime($this->getScheduledDate(), 23, true, true)));
} elseif ($this->getStartingDate() < NOW && $this->getScheduledDate() > NOW) {
return $i18n->__('%milestone_name (started %start_date - ends %end_date)', array('%milestone_name' => '', '%start_date' => tbg_formatTime($this->getStartingDate(), 23, true, true), '%end_date' => tbg_formatTime($this->getScheduledDate(), 23, true, true)));
} elseif ($this->getStartingDate() > NOW) {
return $i18n->__('%milestone_name (starts %start_date - ended %end_date)', array('%milestone_name' => '', '%start_date' => tbg_formatTime($this->getStartingDate(), 23, true, true), '%end_date' => tbg_formatTime($this->getScheduledDate(), 23, true, true)));
}
} elseif ($this->hasStartingDate()) {
if ($this->getStartingDate() < NOW) {
return $i18n->__('%milestone_name (started %start_date)', array('%milestone_name' => '', '%start_date' => tbg_formatTime($this->getStartingDate(), 23, true, true)));
} else {
return $i18n->__('%milestone_name (starts %start_date)', array('%milestone_name' => '', '%start_date' => tbg_formatTime($this->getStartingDate(), 23, true, true)));
}
} elseif ($this->hasScheduledDate()) {
if ($this->getScheduledDate() < NOW) {
return $i18n->__('%milestone_name (released: %date)', array('%milestone_name' => '', '%date' => tbg_formatTime($this->getScheduledDate(), 23, true, true)));
} else {
return $i18n->__('%milestone_name (will be released: %date)', array('%milestone_name' => '', '%date' => tbg_formatTime($this->getScheduledDate(), 23, true, true)));
}
} elseif ($this->hasReachedDate()) {
return $i18n->__('%milestone_name (reached: %date)', array('%milestone_name' => '', '%date' => tbg_formatTime($this->getReachedDate(), 23, true, true)));
}
return $i18n->__('Not scheduled');
}
示例9: tbg_formatTime
$sheet->setCellValueByColumnAndRow(12, $cc, $severity);
$sheet->setCellValueByColumnAndRow(13, $cc, $resolution);
$sheet->setCellValueByColumnAndRow(14, $cc, $milestone);
$sheet->setCellValueByColumnAndRow(15, $cc, tbg_formatTime($issue->getPosted(), 21));
$sheet->setCellValueByColumnAndRow(16, $cc, tbg_formatTime($issue->getLastUpdatedTime(), 21));
$sheet->setCellValueByColumnAndRow(17, $cc, $issue->getPercentCompleted() . '%');
$sheet->setCellValueByColumnAndRow(18, $cc, !$issue->hasEstimatedTime() ? '-' : \thebuggenie\core\entities\Issue::getFormattedTime($issue->getEstimatedTime(true, true)));
$sheet->setCellValueByColumnAndRow(19, $cc, !$issue->hasSpentTime() ? '-' : \thebuggenie\core\entities\Issue::getFormattedTime($issue->getSpentTime(true, true)));
$sheet->setCellValueByColumnAndRow(20, $cc, $issue->getUserpain());
$sheet->setCellValueByColumnAndRow(21, $cc, $issue->getVotes());
$start_column = 22;
foreach ($custom_columns as $column) {
$value = $issue->getCustomField($column->getKey());
switch ($column->getType()) {
case \thebuggenie\core\entities\CustomDatatype::DATE_PICKER:
$value = strtotime($value) !== false ? tbg_formatTime($value, 20) : '';
break;
case \thebuggenie\core\entities\CustomDatatype::DROPDOWN_CHOICE_TEXT:
case \thebuggenie\core\entities\CustomDatatype::RADIO_CHOICE:
$value = $value instanceof \thebuggenie\core\entities\CustomDatatypeOption ? $value->getValue() : '';
break;
case \thebuggenie\core\entities\CustomDatatype::CLIENT_CHOICE:
case \thebuggenie\core\entities\CustomDatatype::COMPONENTS_CHOICE:
case \thebuggenie\core\entities\CustomDatatype::EDITIONS_CHOICE:
case \thebuggenie\core\entities\CustomDatatype::MILESTONE_CHOICE:
case \thebuggenie\core\entities\CustomDatatype::RELEASES_CHOICE:
case \thebuggenie\core\entities\CustomDatatype::STATUS_CHOICE:
case \thebuggenie\core\entities\CustomDatatype::TEAM_CHOICE:
case \thebuggenie\core\entities\CustomDatatype::USER_CHOICE:
$value = $value instanceof \thebuggenie\core\entities\common\Identifiable ? $value->getName() : '';
break;
示例10: runCheckIncomingAccount
/**
* Check incoming email accounts for incoming emails
*
* @Route(url="/mailing/incoming_account/:account_id/check", name="check_account")
* @param \thebuggenie\core\framework\Request $request
* @return type
* @throws \Exception
*/
public function runCheckIncomingAccount(framework\Request $request)
{
framework\Context::loadLibrary('common');
if ($account_id = $request['account_id']) {
try {
$account = new \thebuggenie\modules\mailing\entities\IncomingEmailAccount($account_id);
try {
if (!function_exists('imap_open')) {
throw new \Exception($this->getI18n()->__('The php imap extension is not installed'));
}
framework\Context::getModule('mailing')->processIncomingEmailAccount($account);
} catch (\Exception $e) {
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array('error' => $e->getMessage()));
}
return $this->renderJSON(array('account_id' => $account->getID(), 'time' => tbg_formatTime($account->getTimeLastFetched(), 6), 'count' => $account->getNumberOfEmailsLastFetched()));
} catch (\Exception $e) {
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array('error' => $this->getI18n()->__('This is not a valid mailing account')));
}
} else {
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array('error' => $this->getI18n()->__('This is not a valid mailing account')));
}
}
示例11: isset
</td>
<td style="clear: both;<?php
if (!isset($include_issue_title) || $include_issue_title) {
?>
padding-bottom: <?php
echo isset($extra_padding) && $extra_padding ? 15 : 10;
?>
px;<?php
}
?>
">
<?php
if ((!isset($include_issue_title) || $include_issue_title) && (isset($include_time) && $include_time == true)) {
?>
<span class="time "><?php
echo tbg_formatTime($log_action['timestamp'], 19);
?>
</span> <?php
}
?>
<?php
if (!isset($include_issue_title) || $include_issue_title) {
?>
<?php
if (isset($include_project) && $include_project == true) {
?>
<span class="faded_out smaller"><?php
echo image_tag($issue->getProject()->getSmallIconName(), array('class' => 'issuelog-project-logo'), $issue->getProject()->hasSmallIcon());
?>
</span><?php
}
示例12: date
<?php
if ($item instanceof \thebuggenie\core\entities\LogItem) {
?>
<li>
<span class="date"><?php
echo date('YmdHis', $previous_time) != date('YmdHis', $item->getTime()) ? tbg_formatTime($item->getTime(), 6) : '';
?>
</span>
<?php
$previous_value = null;
$new_value = null;
try {
switch ($item->getChangeType()) {
case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_CREATED:
echo image_tag('icon_open_new.png');
echo __('The issue was created');
break;
case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_CLOSE:
echo image_tag('icon_close.png');
echo __('The issue was closed');
break;
case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_REOPEN:
echo image_tag('icon_open_new.png');
echo __('The issue was reopened');
break;
case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_DEPENDS:
echo image_tag('icon_new_related_issue.png');
echo __('The issues dependency changed: %change', array('%change' => '<strong>' . $item->getText() . '</strong>'));
break;
case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_UPDATE:
示例13: runTransitionIssues
public function runTransitionIssues(TBGRequest $request)
{
try {
try {
$transition = TBGContext::factory()->TBGWorkflowTransition($request['transition_id']);
} catch (Exception $e) {
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array('error' => $this->getI18n()->__('This is not a valid transition')));
}
$issue_ids = $request['issue_ids'];
$status = null;
$closed = false;
foreach ($issue_ids as $issue_id) {
$issue = TBGContext::factory()->TBGIssue($issue_id);
if (!$issue->isWorkflowTransitionsAvailable() || !$transition->validateFromRequest($request)) {
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array('error' => TBGContext::getI18n()->__('The transition could not be applied to issue %issue_number because of %errors', array('%issue_number' => $issue->getFormattedIssueNo(), '%errors' => join(', ', $transition->getValidationErrors())))));
}
try {
$transition->transitionIssueToOutgoingStepFromRequest($issue, $request);
} catch (Exception $e) {
$this->getResponse()->setHttpStatus(400);
TBGLogging::log(TBGLogging::LEVEL_WARNING, 'Transition ' . $transition->getID() . ' failed for issue ' . $issue_id);
TBGLogging::log(TBGLogging::LEVEL_WARNING, $e->getMessage());
return $this->renderJSON(array('error' => $this->getI18n()->__('The transition failed because of an error in the workflow. Check your workflow configuration.')));
}
if ($status === null) {
$status = $issue->getStatus();
}
$closed = $issue->isClosed();
}
TBGContext::loadLibrary('common');
$options = array('issue_ids' => array_keys($issue_ids), 'last_updated' => tbg_formatTime(time(), 20), 'closed' => $closed);
$options['status'] = array('color' => $status->getColor(), 'name' => $status->getName(), 'id' => $status->getID());
if ($request->hasParameter('milestone_id')) {
$milestone = new TBGMilestone($request['milestone_id']);
$options['milestone_id'] = $milestone->getID();
$options['milestone_name'] = $milestone->getName();
}
foreach (array('resolution', 'priority', 'category', 'severity') as $item) {
$class = "TBG" . ucfirst($item);
if ($request->hasParameter($item . '_id')) {
if ($item_id = $request[$item . '_id']) {
$itemobject = new $class($item_id);
$itemname = $itemobject->getName();
} else {
$item_id = 0;
$itemname = '-';
}
$options[$item] = array('name' => $itemname, 'id' => $item_id);
} else {
$method = 'get' . ucfirst($item);
$itemname = $issue->{$method}() instanceof $class ? $issue->{$method}()->getName() : '-';
$item_id = $issue->{$method}() instanceof $class ? $issue->{$method}()->getID() : 0;
$options[$item] = array('name' => $itemname, 'id' => $item_id);
}
}
return $this->renderJSON($options);
} catch (Exception $e) {
$this->getResponse()->setHttpStatus(400);
TBGLogging::log(TBGLogging::LEVEL_WARNING, 'Transition ' . $transition->getID() . ' failed for issue ' . $issue_id);
TBGLogging::log(TBGLogging::LEVEL_WARNING, $e->getMessage());
return $this->renderJSON(array('error' => $this->getI18n()->__('An error occured when trying to apply the transition')));
}
}
示例14: tbg_formatTime
if ($milestone->getStartingDate()) {
?>
<?php
echo tbg_formatTime($milestone->getStartingDate(), 20, true, true) . ' - ';
if ($milestone->getScheduledDate() > 0) {
echo tbg_formatTime($milestone->getScheduledDate(), 20, true, true);
} else {
echo __('No scheduled date specified');
}
?>
<?php
} else {
?>
<?php
if ($milestone->getScheduledDate() > 0) {
echo __('Scheduled for %scheduled_date', array('%scheduled_date' => tbg_formatTime($milestone->getScheduledDate(), 20, true, true)));
} else {
echo __('No scheduled date specified');
}
?>
<?php
}
?>
</div>
<div class="percentage">
<div class="numbers">
<?php
if ($milestone->isSprint()) {
?>
<?php
if ($milestone->countClosedIssues() == 1) {
示例15: __
if ($issue->getUserWorkingOnIssue()->getID() == $tbg_user->getID()) {
?>
<?php
echo __('You have been working on this issue since %time', array('%time' => tbg_formatTime($issue->getWorkedOnSince(), 6)));
?>
<?php
} elseif ($issue->getAssignee() instanceof \thebuggenie\core\entities\Team) {
?>
<?php
echo __('%teamname has been working on this issue since %time', array('%teamname' => $issue->getAssignee()->getName(), '%time' => tbg_formatTime($issue->getWorkedOnSince(), 6)));
?>
<?php
} else {
?>
<?php
echo __('%user has been working on this issue since %time', array('%user' => $issue->getUserWorkingOnIssue()->getNameWithUsername(), '%time' => tbg_formatTime($issue->getWorkedOnSince(), 6)));
?>
<?php
}
?>
<div class="buttons">
<button class="button button-silver" onclick="$('viewissue_being_worked_on').hide();"><?php
echo __('OK');
?>
</button>
</div>
</div>
<?php
}
?>
<div class="issue_info error" id="blocking_div"<?php