From 3e3b60e3e412b565121878ad868d902840213df5 Mon Sep 17 00:00:00 2001 From: jangliss Date: Mon, 14 Jul 2003 05:58:54 +0000 Subject: [PATCH] Provide user with ability to change date/time display in mailboxes. This was 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 | 12 +++++++----- functions/date.php | 6 ++++-- include/load_prefs.php | 4 ++++ include/options/display.php | 7 +++++++ 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 52705298..afb3bcf1 100644 --- 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 *** diff --git a/functions/date.php b/functions/date.php index 85a4cd69..757f34ff 100644 --- a/functions/date.php +++ b/functions/date.php @@ -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"); diff --git a/include/load_prefs.php b/include/load_prefs.php index a94c0f57..1fd5fd20 100644 --- a/include/load_prefs.php +++ b/include/load_prefs.php @@ -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'); ?> diff --git a/include/options/display.php b/include/options/display.php index 2907cf3a..f452009a 100644 --- a/include/options/display.php +++ b/include/options/display.php @@ -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(); -- 2.25.1