[whups] Timestamps in comments

Jason Dixon jason at dixongroup.net
Thu Nov 3 19:14:39 PST 2005


Actually, I think it's better to make these as separate options  
(IMHO).  Patches against config/prefs.php.dist 1.23 and templates/ 
comment.inc 1.71.


--- config/prefs.php.dist       Fri Feb 11 11:28:18 2005
+++ config/prefs.php.dist    Thu Nov  3 22:08:50 2005
@@ -9,7 +9,7 @@
      'column' => _("Other Options"),
      'label' => _("Display Options"),
      'desc' => _("Change display options such as how search results  
are sorted."),
-    'members' => array('sortby', 'sortdir', 'comment_sort_dir',  
'whups_default_view', 'summary_show_requested',  
'summary_show_ticket_numbers', 'report_time_format', 'show_days_ago',  
'autolink_tickets')
+    'members' => array('sortby', 'sortdir', 'comment_sort_dir',  
'whups_default_view', 'summary_show_requested',  
'summary_show_ticket_numbers', 'report_time_format',  
'detail_time_format', 'show_days_ago', 'autolink_tickets')
);
$prefGroups['notification'] = array(
@@ -89,6 +89,19 @@
                      '%m/%d/%y' => _("MM/DD/YY"),
                      '%m/%d/%y %H:%M:%S' => _("MM/DD/YY HH:MM:SS")),
      'desc' => _("Date/Time format for search results")
+);
+
+// Allow custom time/date formats in ticket detail
+$_prefs['detail_time_format'] = array(
+    'value' => '%m/%d/%y',
+    'locked' => false,
+    'shared' => false,
+    'type' => 'enum',
+    'enum' => array('%a %d %B' => _("Weekday Day Month"),
+                    '%c' => _("Weekday Day Month HH:MM:SS TZ"),
+                    '%m/%d/%y' => _("MM/DD/YY"),
+                    '%m/%d/%y %H:%M:%S' => _("MM/DD/YY HH:MM:SS")),
+    'desc' => _("Date/Time format for detail view")
);
// Show 'X Days Ago' in Timestamps??


--- templates/comment.inc  Thu Nov  3 21:58:55 2005
+++ templates/comment.inc       Thu Nov  3 22:09:09 2005
@@ -127,7 +127,7 @@
<table cellspacing="0" width="100%">
   <tr><td style="font-size:4px;">&nbsp;</td></tr>
   <tr>
-  <td width="20%" class="<?php echo $class ?>_l" nowrap="nowrap"  
valign="top"><?php echo strftime($prefs->getValue('date_format'),  
$vars->get('timestamp')) ?></td>
+  <td width="20%" class="<?php echo $class ?>_l" nowrap="nowrap"  
valign="top"><?php echo strftime($prefs->getValue 
('detail_time_format'), $vars->get('timestamp')) ?></td>
    <td width="20%" class="<?php echo $class ?>_m" valign="top"><?php  
echo $vars->get('user_id') ? Whups::formatUser($vars->get('user_id'),  
false, true, true) : '&nbsp;' ?></td>
    <td width="30%" class="<?php echo $class ?>_m" valign="top"><?php  
echo implode('<br />', $changes) ?></td>
    <td width="30%" class="<?php echo $class ?>_r rightAlign"  
valign="top"><?php echo implode('<br />', $links) ?></td>


--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net





More information about the whups mailing list