Provide user with ability to change date/time display in mailboxes. This was
authorjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 14 Jul 2003 05:58:54 +0000 (05:58 +0000)
committerjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 14 Jul 2003 05:58:54 +0000 (05:58 +0000)
requested on IRC, and I think it should have always been optional.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5317 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/date.php
include/load_prefs.php
include/options/display.php

index 5270529838f47143c083c55e85c21a7bd1975d4b..afb3bcf1df93b4fa848eb303263c3d9fa8dda960 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,16 +40,18 @@ Version 1.5.0 -- CVS
   - Rewrite of email address parser and solve the infinite loops issues due to
     bad formatted addresses.
   - Modified conf.pl: default to force usernames lowercase for servers which
-    are case-insensitive
+    are case-insensitive.
   - Applied bugfixes from stable to htmlfilter code.
-  - Fix bug #722933 where resuming a draft message would lose the reference headers
+  - Fix bug #722933 where resuming a draft message would lose the reference headers.
   - Removed hard coded colors from login.php and made it use the default theme and css file
   - Fix that sending of read receipts failed when JavaScript on and comp in new off (#738130).
   - Replaced search with new version by Alex Lemaresquier. (Originally
-    "asearch" plugin)
-  - New debugging function: sm_print_r() in strings.php
+    "asearch" plugin).
+  - New debugging function: sm_print_r() in strings.php.
   - Use SM_PATH in config_default. Change default server type to 'other' in stead
-    of cyrus. (#766577)
+    of cyrus. (#766577).
+  - Added feature to allow user to switch on full date display in mailboxes instead
+    of just partial date/time based on time of email, and current date.
 
 **************************************
 *** SquirrelMail Stable Series 1.4 ***
index 85a4cd6922fc4714c457fa88f4ffc11e842b7c56..757f34ff354560f51601c96033e268d36b13ccbd 100644 (file)
@@ -281,7 +281,7 @@ function getLongDateString( $stamp ) {
 
 function getDateString( $stamp ) {
 
-    global $invert_time, $hour_format;
+    global $invert_time, $hour_format, $show_full_date;
 
     if ( $stamp == -1 ) {
        return '';
@@ -295,7 +295,9 @@ function getDateString( $stamp ) {
     }
     $midnight = $now - ($now % 86400) - $dateZ;
     
-    if ($midnight < $stamp) {
+    if ($show_full_date == 1) {
+        $date_format = _("M j, Y");
+    } else if ($midnight < $stamp) {
         /* Today */
         if ( $hour_format == SMPREF_TIME_12HR ) {
             $date_format = _("g:i a");
index a94c0f57be0968d8d6010eb7caf5013a7738e9fd..1fd5fd20896959efc85220cf579a77415900f5e6 100644 (file)
@@ -258,6 +258,10 @@ $forward_cc = getPref($data_dir, $username, 'forward_cc', 0);
 
 $mailbox_select_style = getPref($data_dir, $username, 'mailbox_select_style', 0);
 
+/* Allow user to customize, and display the full date, instead of day, or time based
+   on time distance from date of message */
+$show_full_date = getPref($data_dir, $username, 'show_full_date', 0);
+
 do_hook('loading_prefs');
 
 ?>
index 2907cf3a96520b56d23966259ac4ab982b1266a5..f452009a1005d47ab28591890224fbb41694036d 100644 (file)
@@ -147,6 +147,13 @@ function load_optpage_data_display() {
         'size'    => SMOPT_SIZE_TINY
     );
 
+    $optvals[SMOPT_GRP_MAILBOX][] = array(
+        'name'    => 'show_full_date',
+        'caption' => _("Always Show Full Date"),
+        'type'    => SMOPT_TYPE_BOOLEAN,
+        'refresh' => SMOPT_REFRESH_NONE
+    );
+
     /*** Load the General Options into the array ***/
     $optgrps[SMOPT_GRP_MESSAGE] = _("Message Display and Composition");
     $optvals[SMOPT_GRP_MESSAGE] = array();