소스 검색

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.

jangliss 22 년 전
부모
커밋
e03ab2b9b8
4개의 변경된 파일22개의 추가작업 그리고 7개의 파일을 삭제
  1. 7 5
      ChangeLog
  2. 4 2
      functions/date.php
  3. 4 0
      include/load_prefs.php
  4. 7 0
      include/options/display.php

+ 7 - 5
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 ***

+ 4 - 2
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");

+ 4 - 0
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');
 
 ?>

+ 7 - 0
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();