[dev] trivial patch for nag summary date format

Mathieu CLABAUT mathieu.clabaut at free.fr
Fri Feb 21 17:02:54 PST 2003


 Hello...

  here is a trivial patch to add suport for date format preferences in
  task summary (the default was way too long)...

  Say if I must post it to nag dev list (I did not subscribe to it..)

-mat


--
___________________http://www.fsf.org/philosophy/no-word-attachments.html
Mathieu CLABAUT                            mailto:mathieu.clabaut at free.fr
           F2F5 442F F2AC E1D5 9D31  3EFC 842A BC4A 123B 9A65
-------------- next part --------------
Index: config/prefs.php.dist
===================================================================
RCS file: /repository/nag/config/prefs.php.dist,v
retrieving revision 1.22
diff -u -b -B -w -u -b -B -w -r1.22 prefs.php.dist
--- config/prefs.php.dist	27 Dec 2002 18:11:05 -0000	1.22
+++ config/prefs.php.dist	21 Feb 2003 16:00:17 -0000
@@ -23,7 +23,8 @@
     'label' => _("Summary Options"),
     'desc' => _("Change your summary display options."),
     'members' => array('summary_show_priorities', 'summary_show_due',
-                       'summary_show_owner', 'showsummaryselect'));
+                       'summary_show_owner',
+                       'showsummaryselect','summary_due_format'));
 
 $prefGroups['share'] = array(
     'column' => _("Other Options"),
@@ -159,3 +160,16 @@
     'locked' => false,
     'shared' => false,
     'type' => 'implicit');
+
+//summary date format
+$_prefs['summary_due_format'] = array(
+    'value' => '%a %d %b %H:%M',
+    'locked' => false,
+    'shared' => false,
+    'type' => 'enum',
+    'enum' => array('%a %d %b %H:%M' => strftime('%a %d %b %H:%M'),
+                    '%a %d/%m' => strftime('%a %d/%m'),
+                    '%a %d/%m %H:%M' => strftime('%a %d/%m %H:%M'),
+                    '%x %X' => strftime('%x %X'),
+                    '%c' => strftime('%c')),
+    'desc' => _("Select how to display Dates:"));
Index: lib/Block/summary.php
===================================================================
RCS file: /repository/nag/lib/Block/summary.php,v
retrieving revision 1.4
diff -u -b -B -w -u -b -B -w -r1.4 summary.php
--- lib/Block/summary.php	31 Jan 2003 20:34:53 -0000	1.4
+++ lib/Block/summary.php	21 Feb 2003 16:00:17 -0000
@@ -86,7 +86,7 @@
                 $due_end = '</font></b>';
             }
             if (!empty($task['due']) && empty($task['completed']) && $prefs->getValue('summary_show_due')) {
-                $due_begin .= '(' . strftime('%c', $task['due']) . ') ';
+                $due_begin .= '(' .  strftime($prefs->getValue('summary_due_format'), $task['due']) . ') ';
             }
             $html .= $closed_begin . $owner . $due_begin . $row . $due_end . $closed_end;
             $html .= "</td></tr>\n";


More information about the dev mailing list