Changeset 659
- Timestamp:
- 02/04/09 13:59:41 (15 years ago)
- Location:
- trunk/expressoMail1_2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r650 r659 1577 1577 } 1578 1578 1579 function messages_sort($sort_box_type,$sort_box_reverse, $search_box_type) 1580 { 1581 $sort = array(); 1582 $sort_uid = array(); 1583 1584 $num_msgs = imap_num_msg($this->mbox); 1585 for ($i=1; $i<=$num_msgs; $i++) 1586 { 1587 $header = $this->get_header(imap_uid($this->mbox,$i)); 1588 // List UNSEEN messages. 1589 if($search_box_type == "UNSEEN" && (!trim($header->Recent) && !trim($header->Unseen))){ 1590 continue; 1591 } 1592 // List SEEN messages. 1593 elseif($search_box_type == "SEEN" && (trim($header->Recent) || trim($header->Unseen))){ 1594 continue; 1595 } 1596 // List ANSWERED messages. 1597 elseif($search_box_type == "ANSWERED" && !trim($header->Answered)){ 1598 continue; 1599 } 1600 // List FLAGGED messages. 1601 elseif($search_box_type == "FLAGGED" && !trim($header->Flagged)){ 1602 continue; 1603 } 1604 1605 1606 if($sort_box_type=='SORTFROM') { 1607 if (($header->from[0]->mailbox . "@" . $header->from[0]->host) == $_SESSION['phpgw_info']['expressomail']['user']['email']) 1608 $from = $header->to; 1609 else 1610 $from = $header->from; 1611 1612 $tmp = imap_mime_header_decode($from[0]->personal); 1613 1614 if ($tmp[0]->text != "") 1615 $sort[$i] = $tmp[0]->text; 1616 else 1617 $sort[$i] = $from[0]->mailbox . "@" . $from[0]->host; 1618 } 1619 else if($sort_box_type=='SORTSUBJECT') { 1620 $sort[$i] = $header->subject; 1621 } 1622 else if($sort_box_type=='SORTSIZE') { 1623 $sort[$i] = $header->Size; 1624 } 1625 else { 1626 $sort[$i] = $header->udate; 1627 } 1628 1629 } 1630 1631 natcasesort($sort); 1632 1633 foreach($sort as $index => $header_msg) 1634 { 1635 $sort_uid[] = imap_uid($this->mbox, $index); 1636 } 1637 1638 if ($sort_box_reverse) 1639 $sort_uid = array_reverse($sort_uid); 1640 1641 return $sort_uid; 1642 1643 } 1644 1645 /** 1646 * Deprecated 1647 * 1648 * Replaced for the method messages_sort 1649 */ 1579 1650 function imap_sortfrom($sort_box_reverse, $search_box_type) 1580 1651 { … … 1987 2058 $flag_importance = false; 1988 2059 $msgs_number = explode(",",$msgs_to_set); 2060 $unflagged_msgs = ""; 1989 2061 foreach($msgs_number as $msg_number) { 1990 2062 preg_match('/importance *: *(.*)\r/i', … … 1993 2065 if(strtolower($importance[1])=="high") { 1994 2066 $flag_importance=true; 1995 break; 1996 } 1997 1998 } 1999 2000 if(!$flag_importance) 2001 $return["status"] = imap_clearflag_full($this->mbox, $msgs_to_set, "\\Flagged", ST_UID); 2002 else{ 2067 } 2068 else { 2069 $unflagged_msgs.=$msg_number.","; 2070 } 2071 } 2072 2073 if($unflagged_msgs!="") { 2074 imap_clearflag_full($this->mbox,substr($unflagged_msgs,0,strlen($unflagged_msgs)-1), "\\Flagged", ST_UID); 2075 $return["msgs_unflageds"] = substr($unflagged_msgs,0,strlen($unflagged_msgs)-1); 2076 } 2077 else { 2078 $return["msgs_unflageds"] = false; 2079 } 2080 2081 if($flag_importance) { 2003 2082 $return["status"] = false; 2004 2083 $return["msg"] = $this->functions->getLang("At least one of selected message cant be marked as normal"); 2084 } 2085 else { 2086 $return["status"] = true; 2005 2087 } 2006 2088 } … … 2098 2180 } 2099 2181 2100 switch($sort_box_type){ 2182 return $this->messages_sort($sort_box_type,$sort_box_reverse, $search_box_type); 2183 /*switch($sort_box_type){ 2101 2184 case 'SORTFROM': 2102 2185 return $this->imap_sortfrom($sort_box_reverse, $search_box_type); … … 2107 2190 default: 2108 2191 return imap_sort($this->mbox, SORTARRIVAL, $sort_box_reverse, SE_UID, $search_box_type); 2109 } 2192 }*/ 2110 2193 } 2111 2194 … … 2732 2815 $pdate = date_parse($header->MailDate); 2733 2816 $header->udate += $pdate['zone']*(-60); 2817 2818 if($header->Flagged!="F") { 2819 $flag = preg_match('/importance *: *(.*)\r/i', 2820 imap_fetchheader($this->mbox, imap_msgno($this->mbox, $msg_number)) 2821 ,$importance); 2822 $header->Flagged = $flag==0?false:strtolower($importance[1])=="high"?"F":false; 2823 } 2824 2734 2825 return $header; 2735 2826 } -
trunk/expressoMail1_2/js/draw_api.js
r652 r659 589 589 _img_important.src = "templates/default/images/important.gif"; 590 590 591 if ((headers_msgs.Flagged == 'F') || (headers_msgs.Importance. indexOf("high")!=-1))591 if ((headers_msgs.Flagged == 'F') || (headers_msgs.Importance.toLowerCase().indexOf("high")!=-1)) 592 592 td_element22.innerHTML += "<img src ='templates/default/images/important.gif' title='"+get_lang('Important')+"'>"; 593 593 else -
trunk/expressoMail1_2/js/main.js
r649 r659 1230 1230 remove_className(Element(msgs_to_set[i]), 'selected_msg'); 1231 1231 } 1232 return; 1232 if(!data.msgs_unflageds) 1233 return; 1234 else 1235 msgs_to_set = data.msgs_unflageds.split(","); 1233 1236 } 1234 1237
Note: See TracChangeset
for help on using the changeset viewer.