From 7151188fcea72103109660b013f63304f9e75c46 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Tue, 11 Apr 2000 02:05:25 +0000 Subject: [PATCH] added advanced flags to the message list git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@406 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- TODO | 16 +++++------ functions/mailbox_display.php | 52 +++++++++++++++-------------------- functions/url_parser.php | 3 +- 3 files changed, 32 insertions(+), 39 deletions(-) diff --git a/TODO b/TODO index 705ad7e6..a9ea4176 100644 --- a/TODO +++ b/TODO @@ -8,7 +8,6 @@ initials = taken by that person - Make it possible to save preferences in MySQL DB or on Filesystem - Navigation between messages without going to folder list (next, prev) - Configurable headers shown on the message listing, like: cc, to, etc - - Advanced statuses on messages (Seen, Answered, etc) - Filters - Better inline HTML support including graphics (content-disposition) - Maybe a rewrite of mime.php (see Gustav before any work is done) @@ -27,10 +26,11 @@ initials = taken by that person Finished: ------------------------------------------------------ -(lme) (24.3.00) Saving sent messages -(lme) (24.3.00) Fix "Seen" bug with UW IMAP server -(lme) (24.3.00) Add "subscribe" to folders section -(pl) (25.3.00) LDAP support for address books -(pl) (2.4.00) Personal address book management -(nre) (2.4.00) Better handling emptying Trash folder. Some servers don't allow deleting it (Courier) -(lme) (9.4.00 Better email message body parsing +(lme) (24.3.00) Saving sent messages +(lme) (24.3.00) Fix "Seen" bug with UW IMAP server +(lme) (24.3.00) Add "subscribe" to folders section +(pl) (25.3.00) LDAP support for address books +(pl) (2.4.00) Personal address book management +(nre) (2.4.00) Better handling emptying Trash folder. Some servers don't allow deleting it (Courier) +(lme) (9.4.00 Better email message body parsing +(lme) (10.4.00) Advanced statuses on messages (Seen, Answered, etc) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index e39f6ec0..1041accf 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -10,26 +10,25 @@ $mailbox_info = true; - function printMessageInfo($imapConnection, $t, $i, $from, $subject, $dateString, $answered, $seen, $mailbox, $sort, $startMessage) { - require ("../config/config.php"); - global $PHPSESSID; + function printMessageInfo($imapConnection, $t, $msg, $mailbox, $sort, $startMessage) { + //require ("../config/config.php"); + global $color, $PHPSESSID; - $senderName = $from; + $senderName = $msg["FROM"]; $urlMailbox = urlencode($mailbox); - $subject = trim(stripslashes($subject)); + $subject = trim(stripslashes($msg["SUBJECT"])); echo "\n"; - if ($seen == false) { - echo " \n"; - echo " $senderName\n"; - echo "
$dateString
\n"; - echo " $subject\n"; - } else { - echo " \n"; - echo " $senderName\n"; - echo "
$dateString
\n"; - echo " $subject\n"; - } - echo "\n"; + + if ($msg["FLAG_FLAGGED"] == true) { $flag = ""; $flag_end = ""; } + if ($msg["FLAG_SEEN"] == false) { $bold = ""; $bold_end = ""; } + if ($msg["FLAG_ANSWERED"] == true) { $ans = " [A]"; } + + echo " \n"; + echo " $bold$flag$senderName$flag_end$bold_end\n"; + echo "
$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end
\n"; + echo " $bold$flag$subject$flag_end$ans$bold_end\n"; + + echo "\n"; } /** @@ -59,9 +58,6 @@ $messages[$j]["ID"] = $j+1; $messages[$j]["FROM"] = decodeHeader($from[$j]); $messages[$j]["SUBJECT"] = decodeHeader($subject[$j]); - $messages[$j]["FLAG_DELETED"] = false; - $messages[$j]["FLAG_ANSWERED"] = false; - $messages[$j]["FLAG_SEEN"] = false; $num = 0; while ($num < count($flags[$j])) { @@ -74,6 +70,9 @@ else if ($flags[$j][$num] == "Seen") { $messages[$j]["FLAG_SEEN"] = true; } + else if ($flags[$j][$num] == "Flagged") { + $messages[$j]["FLAG_FLAGGED"] = true; + } $num++; } $j++; @@ -87,14 +86,7 @@ $j++; continue; } - $msgs[$i]["TIME_STAMP"] = $messages[$j]["TIME_STAMP"]; - $msgs[$i]["DATE_STRING"] = $messages[$j]["DATE_STRING"]; - $msgs[$i]["ID"] = $messages[$j]["ID"]; - $msgs[$i]["FROM"] = $messages[$j]["FROM"]; - $msgs[$i]["SUBJECT"] = $messages[$j]["SUBJECT"]; - $msgs[$i]["FLAG_DELETED"] = $messages[$j]["FLAG_DELETED"]; - $msgs[$i]["FLAG_ANSWERED"] = $messages[$j]["FLAG_ANSWERED"]; - $msgs[$i]["FLAG_SEEN"] = $messages[$j]["FLAG_SEEN"]; + $msgs[$i] = $messages[$j]; $i++; $j++; @@ -269,10 +261,10 @@ echo "

". _("THIS FOLDER IS EMPTY") ."
 
"; } else if ($startMessage == $endMessage) { // if there's only one message in the box, handle it different. $i = $startMessage - 1; - printMessageInfo($imapConnection, $t, $msgs[$i]["ID"], $msgs[$i]["FROM"], $msgs[$i]["SUBJECT"], $msgs[$i]["DATE_STRING"], $msgs[$i]["FLAG_ANSWERED"], $msgs[$i]["FLAG_SEEN"], $mailbox, $sort, $startMessage); + printMessageInfo($imapConnection, $t, $msgs[$i], $mailbox, $sort, $startMessage); } else { for ($i = $startMessage - 1;$i <= $endMessage - 1; $i++) { - printMessageInfo($imapConnection, $t, $msgs[$i]["ID"], $msgs[$i]["FROM"], $msgs[$i]["SUBJECT"], $msgs[$i]["DATE_STRING"], $msgs[$i]["FLAG_ANSWERED"], $msgs[$i]["FLAG_SEEN"], $mailbox, $sort, $startMessage); + printMessageInfo($imapConnection, $t, $msgs[$i], $mailbox, $sort, $startMessage); $t++; } } diff --git a/functions/url_parser.php b/functions/url_parser.php index ff1df525..4049bc16 100644 --- a/functions/url_parser.php +++ b/functions/url_parser.php @@ -11,7 +11,8 @@ } function parseEmail ($body) { - $body = eregi_replace ("([a-z]|[0-9]|_|\.|-)+\@([a-z]|[0-9]|_)+(\.([a-z]|[0-9]|_)+)*", "\\0", $body); + global $PHPSESSID; + $body = eregi_replace ("([a-z]|[0-9]|_|\.|-)+\@([a-z]|[0-9]|_)+(\.([a-z]|[0-9]|_)+)*", "\\0", $body); return $body; } -- 2.25.1