X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fimap_search.php;h=993a23aa2d420d56b1a1e40569e5455cc29a145e;hp=b40cb4f7d3bc92e67ef73d6665a5d117c3ae8467;hb=367e4f70490865d893981c68dc3931b379d24f09;hpb=98fe1e9ffb8c254a739f853d3b83c667b9f9f65e diff --git a/functions/imap_search.php b/functions/imap_search.php index b40cb4f7..993a23aa 100644 --- a/functions/imap_search.php +++ b/functions/imap_search.php @@ -1,6 +1,7 @@ -
No Messages Found
"; return; - } else { + } else if (isset($errors)) { echo ""; } # HACKED CODED FROM ANOTHER FUNCTION, Could Probably dump this and mondify # exsitising code with a search true/false varible. + global $sent_folder; for ($q = 0; $q < count($messagelist); $q++) { $messagelist[$q] = trim($messagelist[$q]); @@ -55,11 +70,16 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo $hdr = sqimap_get_small_header ($imapConnection, $messagelist[$q], true); else $hdr = sqimap_get_small_header ($imapConnection, $messagelist[$q], false); + $from[$q] = $hdr->from; $date[$q] = $hdr->date; $subject[$q] = $hdr->subject; + $to[$q] = $hdr->to; + $priority[$q] = $hdr->priority; + $cc[$q] = $hdr->cc; + $size[$q] = $hdr->size; + $type[$q] = $hdr->type0; $id[$q] = $messagelist[$q]; - $flags[$q] = sqimap_get_flags ($imapConnection, $messagelist[$q]); } @@ -70,9 +90,16 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo $messages[$j]["TIME_STAMP"] = getTimeStamp($tmpdate); $messages[$j]["DATE_STRING"] = getDateString($messages[$j]["TIME_STAMP"]); - $messages[$j]["ID"] = $id[$j]; + $messages[$j]["ID"] = $id[$j]; $messages[$j]["FROM"] = decodeHeader($from[$j]); + $messages[$j]["FROM-SORT"] = strtolower(sqimap_find_displayable_name(decodeHeader($from[$j]))); $messages[$j]["SUBJECT"] = decodeHeader($subject[$j]); + $messages[$j]["SUBJECT-SORT"] = strtolower(decodeHeader($subject[$j])); + $messages[$j]["TO"] = decodeHeader($to[$j]); + $messages[$j]["PRIORITY"] = $priority[$j]; + $messages[$j]["CC"] = $cc[$j]; + $messages[$j]["SIZE"] = $size[$j]; + $messages[$j]["TYPE0"] = $type[$j]; $num = 0; while ($num < count($flags[$j])) { @@ -97,7 +124,7 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo $i = 0; $j = 0; while ($j < count($messagelist)) { - if ($messages[$j]["FLAG_DELETED"] == true) { + if (isset($messages[$j]["FLAG_DELETED"]) && $messages[$j]["FLAG_DELETED"] == true) { $j++; continue; } @@ -110,63 +137,17 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo // There's gotta be messages in the array for it to sort them. - # Carn't Use the Display messages function it assumes messages are in order. - # Again More code Hacked from else where - # AT THE MOMENT YOU CARN'T SORT SEARCH RESULTS - # ACTULLY THE CODE IS PROLLY BROKEN ANY HOW! - if (count($messagelist) > 0) { $j=0; - echo "
" . _("Found") . " " . count($messagelist) . " " . _("messages") . "
\n"; - echo "
\n"; - echo ""; - echo ""; - echo "
"; - - echo "\n\n\n
"; - echo "\n"; - echo " \n"; - echo " \n"; - echo " "; - echo " \n"; - - echo "
\n"; - echo " ". _("Move selected to:") .""; - echo " "; - echo " \n"; - - echo " \n"; - echo "  ". _("checked messages") ."\n"; - echo "
\n\n\n"; - echo "
"; - echo ""; - echo ""; - echo " "; - /** FROM HEADER **/ - if ($mailbox == $sent_folder) - echo " "; - else - echo " "; - /** DATE HEADER **/ - echo " "; - echo " \n"; - /** SUBJECT HEADER **/ - echo " \n"; - echo ""; + if (!isset ($msg)) { $msg = ""; } + mail_message_listing_beginning($imapConnection, + "move_messages.php?msg=$msg&mailbox=$urlMailbox&where=".urlencode($search_where)."&what=".urlencode($search_what), + '', -1, '' . _("Found") . ' ' . count($messagelist) . ' ' . _("messages") . '', + ' '); + while ($j < count($msgs)) { printMessageInfo($imapConnection, $msgs[$j]["ID"], 0, $j, $mailbox, "", 0, $search_where, $search_what); - //echo $msgs[$j]["SUBJECT"]."
"; $j++; } echo "
 ". _("To") ."". _("From") ."". _("Date") ." ". _("Subject") ."
";