[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] SF.net SVN: squirrelmail:[13883]
From:       jangliss () users ! sourceforge ! net
Date:       2010-01-12 4:26:58
Message-ID: E1NUYLK-0004Ui-Mh () bj8yhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 13883
          http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=13883&view=rev
Author:   jangliss
Date:     2010-01-12 04:26:58 +0000 (Tue, 12 Jan 2010)

Log Message:
-----------
Fix sort in Sent folder to sort by "To" field instead of "From" field (#2907412).

Modified Paths:
--------------
    branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog
    branches/SM-1_4-STABLE/squirrelmail/functions/imap_messages.php
    branches/SM-1_4-STABLE/squirrelmail/functions/mailbox_display.php
    branches/SM-1_4-STABLE/squirrelmail/src/search.php

Modified: branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog	2010-01-05 08:58:04 UTC (rev \
                13882)
+++ branches/SM-1_4-STABLE/squirrelmail/doc/ChangeLog	2010-01-12 04:26:58 UTC (rev \
13883) @@ -8,6 +8,7 @@
   - Fix issue with returning to search results due to new security token code.
   - Fix issue with multi-part related messages not showing all attachments \
                (#2830140).
   - Fix for security token missing in newmail plugin (#2919418).
+  - Fix sort in Sent folder to sort by "To" field instead of "From" field \
(#2907412).  
 Version 1.4.20 RC2 - 17 Aug 2009
 --------------------------------

Modified: branches/SM-1_4-STABLE/squirrelmail/functions/imap_messages.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/imap_messages.php	2010-01-05 \
                08:58:04 UTC (rev 13882)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/imap_messages.php	2010-01-12 \
04:26:58 UTC (rev 13883) @@ -930,19 +930,27 @@
 
         /* non server sort stuff */
         if (!$allow_server_sort) {
-           $from = parseAddress($from);
-           if ($from[0][1]) {
-              $from = decodeHeader($from[0][1], true, false);
-           } else {
-              $from = $from[0][0];
-           }
-           $messages[$msgi]['FROM-SORT'] = $from;
-           $subject_sort = strtolower(decodeHeader($subject, true, false));
-           if (preg_match("/^(?:(?:vedr|sv|re|aw|fw|fwd|\[\w\]):\s*)*\s*(.*)$/si", \
$subject_sort, $matches)){ +            $from = parseAddress($from);
+            if ($from[0][1]) {
+                $from = decodeHeader($from[0][1], true, false);
+            } else {
+                $from = $from[0][0];
+            }
+            $messages[$msgi]['FROM-SORT'] = $from;
+            $subject_sort = strtolower(decodeHeader($subject, true, false));
+            if (preg_match("/^(?:(?:vedr|sv|re|aw|fw|fwd|\[\w\]):\s*)*\s*(.*)$/si", \
$subject_sort, $matches)){  $messages[$msgi]['SUBJECT-SORT'] = $matches[1];
-           } else {
-               $messages[$msgi]['SUBJECT-SORT'] = $subject_sort;
-           }
+            } else {
+                $messages[$msgi]['SUBJECT-SORT'] = $subject_sort;
+            }
+            
+            $to = parseAddress($to);
+            if ($to[0][1]) {
+           	    $to = decodeHeader($to[0][1], true, false);
+            } else {
+                $to = $to[0][0];
+            }
+            $messages[$msgi]['TO-SORT'] = $to;
         }
         ++$msgi;
     }

Modified: branches/SM-1_4-STABLE/squirrelmail/functions/mailbox_display.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/mailbox_display.php	2010-01-05 \
                08:58:04 UTC (rev 13882)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/mailbox_display.php	2010-01-12 \
04:26:58 UTC (rev 13883) @@ -487,7 +487,7 @@
                 if (!$use_cache) {
                     $msgs = getSelfSortMessages($imapConnection, $start_msg, \
                $show_num,
                                                 $num_msgs, $sort, $mbxresponse);
-                    $msort = calc_msort($msgs, $sort);
+                    $msort = calc_msort($msgs, $sort, $mailbox);
                 } /* !use cache */
                 break;
         } // switch
@@ -545,7 +545,7 @@
     //echo("elapsed time = $t seconds\n");
 }
 
-function calc_msort($msgs, $sort) {
+function calc_msort($msgs, $sort, $mailbox = 'INBOX') {
 
     /*
      * 0 = Date (up)
@@ -565,8 +565,9 @@
             $msort[] = $item['TIME_STAMP'];
         }
     } elseif (($sort == 2) || ($sort == 3)) {
+        $fld_sort = (handleAsSent($mailbox)?'TO-SORT':'FROM-SORT');
         foreach ($msgs as $item) {
-            $msort[] = $item['FROM-SORT'];
+            $msort[] = $item[$fld_sort];
         }
     } elseif (($sort == 4) || ($sort == 5)) {
         foreach ($msgs as $item) {

Modified: branches/SM-1_4-STABLE/squirrelmail/src/search.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/src/search.php	2010-01-05 08:58:04 UTC (rev \
                13882)
+++ branches/SM-1_4-STABLE/squirrelmail/src/search.php	2010-01-12 04:26:58 UTC (rev \
13883) @@ -226,7 +226,7 @@
         if ((!empty($allow_server_sort) && $allow_server_sort) || \
(!empty($allow_server_thread) && $allow_server_thread)) {  $msort = $msgs;
         } else {
-            $msort = calc_msort($msgs, $sort);
+            $msort = calc_msort($msgs, $sort, $mailbox);
         }
 
         if ( $mailbox == 'INBOX' ) {


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
                https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic