本文整理汇总了PHP中app::dateTimeFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP app::dateTimeFormat方法的具体用法?PHP app::dateTimeFormat怎么用?PHP app::dateTimeFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app
的用法示例。
在下文中一共展示了app::dateTimeFormat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEventsListByDate
public static function getEventsListByDate($timestamp, $users_id = null, $sf_user)
{
$html = '';
foreach (Events::getEventsListByDateQuery($timestamp, $users_id) as $events) {
$edit_action = '';
if ($sf_user->hasCredential('public_scheduler_access_full_access') and $users_id == null or $sf_user->hasCredential('allow_manage_personal_scheduler') and $users_id > 0) {
$edit_action = 'onClick="openModalBox(\'' . url_for('scheduler/edit?id=' . $events->getEventId() . '&users_id=' . $users_id) . '\')"';
}
if ($users_id == null and $events->getPublicStatus() == 1) {
$edit_action = '';
}
$event_name = '<a class="jt" href="#" onClick="return false" title="<b>' . __('Start Date') . ':</b> ' . app::dateTimeFormat($events->getStartDate()) . ' - <b>' . __('End Date') . ':</b> ' . app::dateTimeFormat($events->getEndDate()) . '" rel="' . url_for('scheduler/info?id=' . $events->getEventId()) . '">' . $events->getEventName() . '</a>';
$time = date('H:i', app::getDateTimestamp($events->getStartDate()));
if ($time != '00:00') {
$event_name = $time . ' ' . $event_name;
}
$html .= '<div class="eventItem" ' . $edit_action . '>' . $event_name . '</div>';
}
return $html;
}
示例2: __
echo '<span>' . __('Status') . ':</span> ' . app::getNameByTableId('TasksStatus', $c['tasks_status_id']);
?>
</li>
<?php
}
if ($c['tasks_priority_id'] > 0) {
?>
<li><?php
echo '<span>' . __('Priority') . ':</span> ' . app::getNameByTableId('TasksPriority', $c['tasks_priority_id']);
?>
</li>
<?php
}
if (strlen($c['due_date']) > 0) {
?>
<li><?php
echo '<span>' . __('Due Date') . ':</span> ' . app::dateTimeFormat($c['due_date']);
?>
</li>
<?php
}
if ($c['worked_hours'] > 0) {
?>
<li><?php
echo '<span>' . __('Work Hours') . ':</span> ' . $c['worked_hours'];
?>
</li>
<?php
}
?>
</ul>
示例3: echo
<?php
if (in_array('Progress', $in_listing)) {
?>
<td><?php
echo (int) $tasks['progress'];
?>
%</td>
<?php
}
?>
<?php
if (in_array('CreatedAt', $in_listing)) {
?>
<td><?php
echo app::dateTimeFormat($tasks['created_at'], 0, true);
?>
</td>
<?php
}
?>
<?php
$v = ExtraFieldsList::getValuesList($extra_fields, $tasks['id']);
echo ExtraFieldsList::renderListingTbody($extra_fields, $v, array('est_time' => $tasks['estimated_time']));
$totals = ExtraFieldsList::getListingTotals($totals, $extra_fields, $v, array('est_time' => $tasks['estimated_time']));
?>
<?php
if (!$sf_request->hasParameter('projects_id')) {
?>
示例4: renderFieldValueByType
public static function renderFieldValueByType($f, $values, $extra_values = array(), $is_export = false)
{
$value = isset($values[$f['id']]) ? $values[$f['id']] : '';
switch ($f['type']) {
case 'file':
$html = '';
if ($a = Doctrine_Core::getTable('Attachments')->find($value)) {
if ($is_export) {
return app::public_url('attachments/download?id=' . $a->getId());
} else {
$html = Attachments::getLink($a);
}
}
return $html;
break;
case 'date_dropdown':
return strlen($value) > 2 ? app::dateFormat($value, 0, $is_export ? false : true) : '';
break;
case 'date':
return app::dateFormat($value, 0, $is_export ? false : true);
break;
case 'date_time':
return app::dateTimeFormat($value, 0, $is_export ? false : true);
break;
case 'date_range':
if (strlen($value) > 1) {
$value = explode('|', $value);
return app::dateFormat($value[0], 0, $is_export ? false : true) . ' - ' . app::dateFormat($value[1], 0, $is_export ? false : true);
} else {
return '';
}
break;
case 'formula':
$formula = $f['default_values'];
foreach ($values as $k => $v) {
$formula = str_replace('[' . $k . ']', (double) $v, $formula);
}
foreach ($extra_values as $k => $v) {
$formula = str_replace('[' . $k . ']', (double) $v, $formula);
}
if (!strstr($formula, '[')) {
if (strstr($formula, '{')) {
$eval_str = 'function getFormulaValue()' . $formula . '; $fv=getFormulaValue();';
} else {
$eval_str = '$fv=' . $formula . ';';
}
@($r = eval($eval_str));
if ($r !== null) {
$fv = $formula;
}
return $fv;
} else {
return '';
}
break;
case 'checkbox':
return str_replace("\n", '<br>', $value);
break;
case 'url':
if (strlen($value) > 0) {
if (!strstr($value, '://')) {
$value = 'http://' . $value;
}
if ($is_export) {
return $value;
} else {
return '<a href="' . $value . '" target="blank">' . t::__('view') . '</a>';
}
} else {
return '';
}
break;
case 'textarea':
return nl2br($value);
break;
default:
return $value;
break;
}
}
示例5: replaceTextToLinks
<tr>
<td style="vertical-align: top; font-family: Arial; font-size: 13px; color: black; padding: 2px; border-bottom:1px dashed LightGray">
<?php
echo replaceTextToLinks($c->getDescription());
?>
<div><?php
include_component('attachments', 'attachmentsList', array('bind_type' => 'discussionsComments', 'bind_id' => $c->getId()));
?>
</div>
<div><?php
include_component('discussionsComments', 'info', array('c' => $c));
?>
</div>
</td>
<td style="width:25%; vertical-align: top; font-family: Arial; font-size: 13px; color: black; padding: 2px; border-bottom:1px dashed LightGray"><?php
echo app::dateTimeFormat($c->getCreatedAt()) . '<br>' . $c->getUsers()->getName() . '<br>' . renderUserPhoto($c->getUsers()->getPhoto());
?>
</td>
</tr>
<?php
}
?>
</table>
</td>
<td width="30%" valign="top">
<?php
echo app::setCssForEmailContent('<div>' . get_component('discussions', 'details', array('discussions' => $discussions, 'is_email' => true)) . '</div>');
?>
</td>
</tr>
示例6:
echo ' ' . app::getLastCommentByTable('TicketsComments', 'tickets_id', $tickets['id']);
}
?>
</td>
<td><?php
echo app::getArrayName($tickets, 'Departments');
?>
</td>
<td><?php
echo $tickets['Users']['name'];
?>
</td>
<td><?php
echo app::dateTimeFormat($tickets['created_at'], 0, true);
?>
</td>
<?php
$v = ExtraFieldsList::getValuesList($extra_fields, $tickets['id']);
echo ExtraFieldsList::renderListingTbody($extra_fields, $v);
$totals = ExtraFieldsList::getListingTotals($totals, $extra_fields, $v);
?>
<?php
if (!$sf_request->hasParameter('projects_id')) {
?>
<td><?php
if ($tickets['projects_id'] > 0) {
echo link_to(app::getArrayName($tickets, 'Projects'), 'projectsComments/index?projects_id=' . $tickets['projects_id']);
示例7: replaceTextToLinks
</td>
<td style="white-space:normal">
<?php
echo replaceTextToLinks($c['description']);
?>
<div><?php
include_component('attachments', 'attachmentsList', array('bind_type' => 'ticketsComments', 'bind_id' => $c['id']));
?>
</div>
<div><?php
include_component('ticketsComments', 'info', array('c' => $c));
?>
</div>
</td>
<td><?php
echo app::dateTimeFormat($c['created_at']) . '<br>' . $c['Users']['name'] . '<br>' . renderUserPhoto($c['Users']['photo']);
?>
</td>
</tr>
<?php
}
?>
<?php
if (count($tickets_comments) == 0) {
echo '<tr><td colspan="3">' . __('No Records Found') . '</td></tr>';
}
?>
</tbody>
</table>
<?php
if ($comments_access['insert']) {
示例8: __
?>
<?php
if ($tasks->getProgress() > 0) {
echo '<tr><th>' . __('Progress') . ':</th><td>' . $tasks->getProgress() . '%</td></tr>';
}
?>
<tr><td style="padding-top: 7px;"></td></tr>
<tr>
<th><?php
echo __('Created At');
?>
:</th>
<td><?php
echo app::dateTimeFormat($tasks->getCreatedAt());
?>
</td>
</tr>
</table>
<br>
<h2><?php
echo __('Assigned To');
?>
</h2>
<table class="contentTable" style="margin-bottom: 7px;">
<?php
foreach (explode(',', $tasks->getAssignedTo()) as $users_id) {
if ($user = Doctrine_Core::getTable('Users')->find($users_id)) {
echo '<tr><th><div style="float:left;">' . renderUserPhoto($user->getPhoto()) . '</div> ' . $user->getName() . '<br>' . '</td></tr>';
}
示例9: executeExport
//.........这里部分代码省略.........
$q = app::addListingOrder($q, 'tickets', $this->getUser(), (int) $request->getParameter('projects_id'));
} else {
$q->orderBy('LTRIM(p.name), ts.sort_order, LTRIM(ts.name), LTRIM(t.name)');
}
$tickets = $q->fetchArray();
$totals = array();
$projects_totals = array();
$current_project_id = 0;
foreach ($tickets as $t) {
$ex_values = ExtraFieldsList::getValuesList($extra_fields, $t['id']);
$content = '';
//
if ($current_project_id == 0) {
$current_project_id = $t['projects_id'];
}
if ($current_project_id != $t['projects_id']) {
//adding totals
if (isset($projects_totals[$current_project_id])) {
foreach ($fields as $f) {
$v = '';
if (strstr($f, 'extra_field_')) {
if (isset($projects_totals[$current_project_id][str_replace('extra_field_', '', $f)])) {
$v = $projects_totals[$current_project_id][str_replace('extra_field_', '', $f)];
}
}
$content .= str_replace(array("\n\r", "\r", "\n", $separator), ' ', $v) . $separator;
}
$content .= "\n\n";
}
$current_project_id = $t['projects_id'];
}
foreach ($fields as $f) {
$v = '';
if (in_array($f, array('id', 'name', 'description'))) {
$v = $t[$f];
} elseif (strstr($f, 'extra_field_')) {
if ($ex = Doctrine_Core::getTable('ExtraFields')->find(str_replace('extra_field_', '', $f))) {
$v = ExtraFieldsList::renderFieldValueByType($ex, $ex_values, array(), true);
if (in_array($ex->getType(), array('number', 'formula'))) {
if (!isset($totals[$ex->getId()])) {
$totals[$ex->getId()] = 0;
}
if (!isset($projects_totals[$t['projects_id']][$ex->getId()])) {
$projects_totals[$t['projects_id']][$ex->getId()] = 0;
}
$totals[$ex->getId()] += $v;
$projects_totals[$t['projects_id']][$ex->getId()] += $v;
}
$v = str_replace('<br>', ', ', $v);
}
} elseif ($f == 'created_at') {
if (strlen($t[$f]) > 0) {
$v = app::dateTimeFormat($t[$f]);
}
} elseif ($f == 'url') {
$v = app::public_url('ticketsComments/index?projects_id=' . $t['projects_id'] . '&tickets_id=' . $t['id']);
} else {
$v = app::getArrayName($t, $f);
}
$content .= str_replace(array("\n\r", "\r", "\n", $separator), ' ', $v) . $separator;
}
$content .= "\n";
if ($format == 'csv') {
echo chr(0xff) . chr(0xfe) . mb_convert_encoding($content, 'UTF-16LE', 'UTF-8');
} else {
echo $content;
}
}
$content = '';
//adding totals
if (isset($projects_totals[$current_project_id]) and !$request->hasParameter('projects_id')) {
foreach ($fields as $f) {
$v = '';
if (strstr($f, 'extra_field_')) {
if (isset($projects_totals[$current_project_id][str_replace('extra_field_', '', $f)])) {
$v = $projects_totals[$current_project_id][str_replace('extra_field_', '', $f)];
}
}
$content .= str_replace(array("\n\r", "\r", "\n", $separator), ' ', $v) . $separator;
}
$content .= "\n\n";
}
foreach ($fields as $f) {
$v = '';
if (strstr($f, 'extra_field_')) {
if (isset($totals[str_replace('extra_field_', '', $f)])) {
$v = $totals[str_replace('extra_field_', '', $f)];
}
}
$content .= str_replace(array("\n\r", "\r", "\n", $separator), ' ', $v) . $separator;
}
$content .= "\n";
if ($format == 'csv') {
echo chr(0xff) . chr(0xfe) . mb_convert_encoding($content, 'UTF-16LE', 'UTF-8');
} else {
echo $content;
}
exit;
}
}
示例10: __
}
?>
<?php
echo ExtraFieldsList::renderInfoFileds('tickets', $tickets, $sf_user);
?>
<tr><td style="padding-top: 7px;"></td></tr>
<tr>
<th><?php
echo __('Created At');
?>
:</th>
<td><?php
echo app::dateTimeFormat($tickets->getCreatedAt());
?>
</td>
</tr>
</table>
<br>
<h2><?php
echo __('Department');
?>
: <?php
echo $tickets->getDepartments()->getName();
?>
</h2>
<table class="contentTable" style="margin-bottom: 7px;">
<?php
if ($tickets->getDepartments_id() > 0) {
示例11: foreach
</thead>
<tbody>
<?php
foreach ($backups as $file) {
?>
<tr>
<td><?php
echo $file;
?>
</td>
<td><?php
echo number_format(filesize(sfConfig::get('sf_web_dir') . '/backups/' . $file)) . ' ' . __('bytes');
?>
</td>
<td><?php
echo app::dateTimeFormat('', filemtime(sfConfig::get('sf_web_dir') . '/backups/' . $file));
?>
</td>
<td><?php
echo button_to(__('Restore'), 'tools/doRestore?restore_file=' . $file, array('confirm' => __('Are you sure?'), 'class' => 'btn'));
?>
</td>
<td><?php
echo button_to(__('Download'), 'tools/backup?download_file=' . $file, array('class' => 'btn'));
?>
</td>
<td><?php
echo button_to(__('Delete'), 'tools/backup?delete_file=' . $file, array('confirm' => __('Are you sure?'), 'class' => 'btn'));
?>
</td>
示例12:
if ($is_filter['type']) {
?>
<td><?php
echo app::getArrayName($projects, 'ProjectsTypes');
?>
</td>
<?php
}
?>
<td><?php
echo app::getArrayName($projects, 'Users');
?>
</td>
<td><?php
echo app::dateTimeFormat($projects['created_at'], 0, true);
?>
</td>
<?php
$v = ExtraFieldsList::getValuesList($extra_fields, $projects['id']);
echo ExtraFieldsList::renderListingTbody($extra_fields, $v);
$totals = ExtraFieldsList::getListingTotals($totals, $extra_fields, $v);
?>
</tr>
<?php
}
?>
</tbody>
<?php
示例13: link_to
</td>
<td><?php
echo link_to($comments->getTasks()->getName(), 'tasksComments/index?tasks_id=' . $comments->getTasks()->getId() . '&projects_id=' . $comments->getTasks()->getProjects()->getId(), array('class' => 'jt', 'rel' => url_for('tasks/info?projects_id=' . $comments->getTasks()->getProjects()->getId() . '&id=' . $comments->getTasks()->getId()), 'title' => __('Task Info'), 'target' => 'new'));
?>
</td>
<td><?php
echo $comments->getTasks()->getTasksStatus() ? $comments->getTasks()->getTasksStatus()->getName() : '';
?>
</td>
<td><?php
echo link_to($comments->getTasks()->getProjects()->getName(), 'projectsComments/index?projects_id=' . $comments->getTasks()->getProjects()->getId(), array('class' => 'jt', 'rel' => url_for('projects/info?id=' . $comments->getTasks()->getProjects()->getId()), 'title' => __('Project Info'), 'target' => 'new'));
?>
</td>
</tr>
<?php
$export[] = array(app::dateTimeFormat($comments->getCreatedAt()), $comments->getUsers()->getName(), $comments->getWorkedHours(), $comments->getTasks()->getName(), $comments->getTasks()->getTasksStatus() ? $comments->getTasks()->getTasksStatus()->getName() : '', $comments->getTasks()->getProjects()->getName(), url_for('tasksComments/index?tasks_id=' . $comments->getTasks()->getId() . '&projects_id=' . $comments->getTasks()->getProjects()->getId(), true));
}
echo '
<tr>
<td></td>
<td></td>
<td><b>' . $total_worked_hours_per_day . '</b></td>
<td></td>
<td></td>
<td></td>
</tr>';
$export[] = array('', '', $total_worked_hours_per_day, '', '', '', '');
$export[] = array('', '', '', '', '', '', '');
?>
</table>
示例14: __
}
?>
<?php
echo ExtraFieldsList::renderInfoFileds('projects', $projects, $sf_user);
?>
<tr><td style="padding-top: 7px;"></td></tr>
<tr>
<th><?php
echo __('Created At');
?>
:</th>
<td><?php
echo app::dateTimeFormat($projects->getCreatedAt());
?>
</td>
</tr>
<tr>
<th><?php
echo __('Created By');
?>
:</th>
<td><?php
echo $projects->getUsers()->getName();
?>
</td>
</tr>
</table>
<br>
示例15: executeExport
//.........这里部分代码省略.........
$v = $projects_totals[$current_project_id][str_replace('extra_field_', '', $f)];
}
}
$content .= str_replace(array("\n\r", "\r", "\n", $separator), ' ', $v) . $separator;
}
$content .= "\n\n";
}
$current_project_id = $t['projects_id'];
}
//
$name_adding = '';
$ex_values = ExtraFieldsList::getValuesList($extra_fields, $t['id']);
foreach ($fields as $f) {
$v = '';
if ($f == 'name') {
$v = $name_adding . $t[$f];
} elseif (in_array($f, array('id', 'description', 'estimated_time', 'work_hours'))) {
if ($f == 'work_hours') {
$v = TasksComments::getTotalWorkHours($t['id']);
} else {
$v = $t[$f];
}
if (in_array($f, array('estimated_time', 'work_hours'))) {
if (!isset($totals[$f])) {
$totals[$f] = 0;
}
if (!isset($projects_totals[$t['projects_id']][$f])) {
$projects_totals[$t['projects_id']][$f] = 0;
}
$totals[$f] += $v;
$projects_totals[$t['projects_id']][$f] += $v;
}
} elseif (in_array($f, array('start_date', 'due_date', 'created_at'))) {
$v = app::dateTimeFormat($t[$f]);
} elseif ($f == 'progress') {
$v = (int) $t['progress'] . '%';
} elseif (strstr($f, 'extra_field_')) {
if ($ex = Doctrine_Core::getTable('ExtraFields')->find(str_replace('extra_field_', '', $f))) {
$v = ExtraFieldsList::renderFieldValueByType($ex, $ex_values, array(), true);
if (in_array($ex->getType(), array('number', 'formula'))) {
if (!isset($totals[$ex->getId()])) {
$totals[$ex->getId()] = 0;
}
if (!isset($projects_totals[$t['projects_id']][$ex->getId()])) {
$projects_totals[$t['projects_id']][$ex->getId()] = 0;
}
$totals[$ex->getId()] += $v;
$projects_totals[$t['projects_id']][$ex->getId()] += $v;
}
$v = str_replace('<br>', ', ', $v);
}
} elseif ($f == 'assigned_to') {
$v = Users::getNameById($t[$f], ', ');
} elseif ($f == 'url') {
$v = app::public_url('tasksComments/index?projects_id=' . $t['projects_id'] . '&tasks_id=' . $t['id']);
} elseif ($f == 'actual_time') {
if ($t['work_hours'] > 0 and $t['togo_hours'] == 0) {
$v = $t['work_hours'];
} else {
$v = (double) $t['estimated_time'] - (double) $t['work_hours'] + (double) $t['togo_hours'];
}
if (!isset($totals[$f])) {
$totals[$f] = 0;
}
$totals[$f] += $v;
$projects_totals[$t['projects_id']][$f] += $v;