Inheritance: extends Horde_Form_Type
Esempio n. 1
0
 function getFormattedTime($timestamp, $format = null, $showago = true)
 {
     if (empty($format)) {
         $format = $this->_format;
     }
     if (!empty($timestamp)) {
         return strftime($format, $timestamp) . ($showago ? Horde_Form_Type_date::getAgo($timestamp) : '');
     } else {
         return '';
     }
 }
Esempio n. 2
0
 protected function _renderVarDisplay_datetime($form, &$var, &$vars)
 {
     $value = $var->getValue($vars);
     $html = htmlspecialchars($var->type->formatDate($value));
     if (!$var->type->emptyDateArray($value)) {
         $html .= Horde_Form_Type_date::getAgo($value);
     }
     return $html;
 }
Esempio n. 3
0
 /**
  * Formats a ticket property for a tabular ticket listing.
  *
  * @param array $info    A ticket information hash.
  * @param string $value  The column/property to format.
  *
  * @return string  The formatted property.
  */
 public static function formatColumn($info, $value)
 {
     $url = self::urlFor('ticket', $info['id']);
     $thevalue = isset($info[$value]) ? $info[$value] : '';
     if ($value == 'timestamp' || $value == 'due' || substr($value, 0, 5) == 'date_') {
         require_once 'Horde/Form/Type.php';
         $thevalue = Horde_Form_Type_date::getFormattedTime($thevalue, $GLOBALS['prefs']->getValue('report_time_format'), false);
     } elseif ($value == 'user_id_requester') {
         $thevalue = $info['requester_formatted'];
     } elseif ($value == 'id' || $value == 'summary') {
         $thevalue = Horde::link($url) . '<strong>' . htmlspecialchars($thevalue) . '</strong></a>';
     } elseif ($value == 'owners') {
         if (!empty($info['owners_formatted'])) {
             $thevalue = implode(', ', $info['owners_formatted']);
         }
     }
     return $thevalue;
 }
Esempio n. 4
0

<?php 
    echo _("Ticket #");
    echo $ticket['id'];
    ?>
: <?php 
    echo $ticket['summary'];
    ?>

<?php 
    echo _("Opened:");
    ?>
 <?php 
    echo strftime('%a %d %B', $ticket['timestamp']);
    echo Horde_Form_Type_date::getAgo($ticket['timestamp']);
    ?>

<?php 
    echo _("State:");
    ?>
 <?php 
    echo $ticket['state_name'];
    ?>

<?php 
    echo _("Link:");
    ?>
 <?php 
    echo $ticket['link'];
}