phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: email/inc class.bofilters.inc.php,1.10,1.11 clas


From: Angelo Tony Puglisi <address@hidden>
Subject: [Phpgroupware-cvs] CVS: email/inc class.bofilters.inc.php,1.10,1.11 class.mail_dcom_imap.inc.php,1.18,1.19 class.mail_msg_base.inc.php,1.70,1.71 class.mail_msg_wrappers.inc.php,1.31,1.32 class.uifilters.inc.php,1.8,1.9
Date: Thu, 31 Jan 2002 19:10:02 -0500

Update of /cvsroot/phpgroupware//email/inc
In directory subversions:/tmp/cvs-serv12792/email/inc

Modified Files:
        class.bofilters.inc.php class.mail_dcom_imap.inc.php 
        class.mail_msg_base.inc.php class.mail_msg_wrappers.inc.php 
        class.uifilters.inc.php 
Log Message:
improve speed of filters

Index: class.bofilters.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.bofilters.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.bofilters.inc.php     26 Jan 2002 22:47:03 -0000      1.10
--- class.bofilters.inc.php     1 Feb 2002 00:09:59 -0000       1.11
***************
*** 34,37 ****
--- 34,38 ----
                var $debug_set_prefs = 0;
                var $examine_imap_search_keys_map=array();
+               var $match_keeper_row_values=array();
                var $result_set = Array();
                var $result_set_mlist = Array();
***************
*** 40,49 ****
                var $do_filter_apply_all = True;
                var $inbox_full_msgball_list = array();
[...1049 lines suppressed...]
!                       $this_filter_matching_msgballs = array();
                        
                        if ($this->debug > 0) { echo 
'bofilters.run_single_filter: LEAVING, return True because we made it to the 
end of the function<br><br><br>'; }
***************
*** 938,944 ****
                        
                }
                
!               
!               
                function make_imap_search_str($feed_filter)
                {
--- 1325,1331 ----
                        
                }
+               */
                
!               // DEPRECIATED
                function make_imap_search_str($feed_filter)
                {

Index: class.mail_dcom_imap.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_dcom_imap.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** class.mail_dcom_imap.inc.php        19 Dec 2001 16:17:50 -0000      1.18
--- class.mail_dcom_imap.inc.php        1 Feb 2002 00:09:59 -0000       1.19
***************
*** 104,107 ****
--- 104,112 ----
                        }
                        return 
imap_header($stream,$msg_nr,$fromlength,$tolength,$defaulthost);
+               }
+               
+               function headers($stream)
+               {
+                       return imap_headers($stream);
                } 
  

Index: class.mail_msg_base.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_base.inc.php,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -r1.70 -r1.71
*** class.mail_msg_base.inc.php 24 Jan 2002 22:58:07 -0000      1.70
--- class.mail_msg_base.inc.php 1 Feb 2002 00:09:59 -0000       1.71
***************
*** 2922,2930 ****
        }
        
!       /*
        // ----  RFC Header Decoding  -----
!       function qprint_rfc_header($data)
        {
!               // SAME FUNCTIONALITY as decode_header_string()  in 
/inc/functions, (but Faster, hopefully)
                // non-us-ascii chars in email headers MUST be encoded using 
the special format:  
                //  =?charset?Q?word?=
--- 2922,2930 ----
        }
        
!       
        // ----  RFC Header Decoding  -----
!       function decode_rfc_header($data)
        {
!               // SAME FUNCTIONALITY as decode_header_string()  (but Faster, 
hopefully)
                // non-us-ascii chars in email headers MUST be encoded using 
the special format:  
                //  =?charset?Q?word?=
***************
*** 2934,2945 ****
                        $data = ereg_replace("=\?.*\?(Q|q)\?", '', $data);
                        $data = ereg_replace("\?=", '', $data);
!                       $data = $this->qprint($data);
                }
                return $data;
        }
!       */
  
        // non-us-ascii chars in email headers MUST be encoded using the 
special format:  
        //  =?charset?Q?word?=
        // currently only qprint and base64 encoding is specified by RFCs
        function decode_header_string($string)
--- 2934,2953 ----
                        $data = ereg_replace("=\?.*\?(Q|q)\?", '', $data);
                        $data = ereg_replace("\?=", '', $data);
!                       $data = $this->qprint(str_replace("_"," ",$data));
!               }
!               if (ereg("=\?.*\?(B|b)\?.*\?=", $data))
!               {
!                       $data = ereg_replace("=\?.*\?(B|b)\?", '', $data);
!                       $data = ereg_replace("\?=", '', $data);
!                       $data = urldecode(base64_decode($data));
                }
                return $data;
        }
!       
  
        // non-us-ascii chars in email headers MUST be encoded using the 
special format:  
        //  =?charset?Q?word?=
+       // commonly:
+       // =?iso-8859-1?Q?encoded_word?=
        // currently only qprint and base64 encoding is specified by RFCs
        function decode_header_string($string)
***************
*** 2980,2984 ****
                        if(strtoupper($encoding) == "Q")
                        {
!                               $decoded = 
$GLOBALS['phpgw']->msg->qprint(str_replace("_"," ",$encoded_text));
                        }
                        if (strtoupper($encoding) == "B")
--- 2988,2992 ----
                        if(strtoupper($encoding) == "Q")
                        {
!                               $decoded = $this->qprint(str_replace("_"," 
",$encoded_text));
                        }
                        if (strtoupper($encoding) == "B")

Index: class.mail_msg_wrappers.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.mail_msg_wrappers.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** class.mail_msg_wrappers.inc.php     26 Jan 2002 12:45:51 -0000      1.31
--- class.mail_msg_wrappers.inc.php     1 Feb 2002 00:09:59 -0000       1.32
***************
*** 116,126 ****
                
                        // Message Information: THE MESSAGE'S HEADERS RETURNED 
RAW (no processing)
!                       //$tmp_a = $this->a[$this->acctnum];
!                       //$retval = 
$tmp_a['dcom']->fetchheader($mailsvr_stream, $msgball['msgnum']);
!                       $retval = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->fetchheader($mailsvr_stream, 
$msgball['msgnum']);
!                       //$this->a[$this->acctnum] = $tmp_a;
!                       return $retval;
                }
        
                function phpgw_get_flag($flag='')
                {
--- 116,153 ----
                
                        // Message Information: THE MESSAGE'S HEADERS RETURNED 
RAW (no processing)
!                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->fetchheader($mailsvr_stream, 
$msgball['msgnum']);
                }
        
+               /*!
+               @function all_headers_in_folder
+               @abstract wrapper for IMAP_HEADERS, phpgw supplies the 
nedessary stream arg and mail_dcom reference
+               @param $fldball : array[folder] : string ; array[acctnum] : int
+               @result returns the php IMAP_HEADERS data, php manual says:
+               function.imap-headers.php
+               Returns headers for all messages in a mailbox 
+               Returns an array of string formatted with header info. One 
element per mail message
+               @discussion = = = = USELESS FUNCTION = = = = 
+               returns array of strings, each string is extremely truncated
+               partial contents of date, from, and subject, also includes the 
msg size in chars
+               */
+               function all_headers_in_folder($fldball='')
+               {
+                       if (!(isset($fldball))
+                       || ((string)$fldball == ''))
+                       {
+                               $msgball = $this->get_arg_value('fldball');
+                       }
+                       $acctnum = $fldball['acctnum'];
+                       if (!(isset($acctnum))
+                       || ((string)$acctnum == ''))
+                       {
+                               $acctnum = $this->get_acctnum();
+                       }
+                       $this->ensure_stream_and_folder($fldball, 
'all_headers_in_folder');
+                       $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
+                       
+                       return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->headers($mailsvr_stream);
+               }
+               
                function phpgw_get_flag($flag='')
                {
***************
*** 132,140 ****
                        else
                        {
!                               //$tmp_a = $this->a[$this->acctnum];
!                               //$retval = 
$tmp_a['dcom']->get_flag($this->get_arg_value('mailsvr_stream'),$this->get_arg_value('["msgball"]["msgnum"]'),$flag);
!                               $retval = 
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->get_flag($this->get_arg_value('mailsvr_stream'),$this->get_arg_value('["msgball"]["msgnum"]'),$flag);
!                               //$this->a[$this->acctnum] = $tmp_a;
!                               return $retval;
                        }
                }
--- 159,163 ----
                        else
                        {
!                               return 
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->get_flag($this->get_arg_value('mailsvr_stream'),$this->get_arg_value('["msgball"]["msgnum"]'),$flag);
                        }
                }
***************
*** 158,166 ****
                }
                
-               //FIXME: msgball
-               //function phpgw_fetchbody($part_num_mime='', $flags='')
-               //{
-               //      return 
$this->a[$this->acctnum]['dcom']->fetchbody($this->get_arg_value('mailsvr_stream'),
 $this->get_arg_value('msgnum'), $part_num_mime, $flags);
-               //}
                function phpgw_fetchbody($msgball='', $flags='')
                {
--- 181,184 ----

Index: class.uifilters.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware//email/inc/class.uifilters.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.uifilters.inc.php     26 Jan 2002 22:47:03 -0000      1.8
--- class.uifilters.inc.php     1 Feb 2002 00:09:59 -0000       1.9
***************
*** 65,71 ****
                        $GLOBALS['phpgw']->template->set_var('lang_cc',lang('CC 
Address'));
                        
$GLOBALS['phpgw']->template->set_var('lang_bcc',lang('Bcc Address'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_recipient',lang('Recipient').$not_available_yet);
                        
$GLOBALS['phpgw']->template->set_var('lang_sender',lang('Sender').$not_available_yet);
                        
$GLOBALS['phpgw']->template->set_var('lang_subject',lang('Subject'));
                        
$GLOBALS['phpgw']->template->set_var('lang_header',lang('Header 
Field').$not_available_yet);
                        
$GLOBALS['phpgw']->template->set_var('lang_size_larger',lang('Size Larger 
Than'.$not_available_yet));
--- 65,72 ----
                        $GLOBALS['phpgw']->template->set_var('lang_cc',lang('CC 
Address'));
                        
$GLOBALS['phpgw']->template->set_var('lang_bcc',lang('Bcc Address'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_recipient',lang('Recipient').' 
&#040;to,cc,bcc&#041;');
                        
$GLOBALS['phpgw']->template->set_var('lang_sender',lang('Sender').$not_available_yet);
                        
$GLOBALS['phpgw']->template->set_var('lang_subject',lang('Subject'));
+                       
$GLOBALS['phpgw']->template->set_var('lang_received_headers',lang('Received 
Headers'));
                        
$GLOBALS['phpgw']->template->set_var('lang_header',lang('Header 
Field').$not_available_yet);
                        
$GLOBALS['phpgw']->template->set_var('lang_size_larger',lang('Size Larger 
Than'.$not_available_yet));
***************
*** 186,191 ****
                        // ---  for now we will offer 2 rows ---
                        // because the IMAP search string for 2 items is not as 
comlicated as for 3 or 4
!                       $num_matchrow_pairs = 2;
!                       for ($i=0; $i < $num_matchrow_pairs; $i++)
                        {
                                if ($i == 0)
--- 187,192 ----
                        // ---  for now we will offer 2 rows ---
                        // because the IMAP search string for 2 items is not as 
comlicated as for 3 or 4
!                       $num_match_criteria_rows = 3;
!                       for ($i=0; $i < $num_match_criteria_rows; $i++)
                        {
                                if ($i == 0)
***************
*** 251,256 ****
--- 252,260 ----
                                $to_selected = '';
                                $cc_selected = '';
+                               $bcc_selected = '';
+                               $recipient_selected = '';
                                $sender_selected = '';
                                $subject_selected = '';
+                               $received_selected = '';
                                // as our numbers of rows go beyond what the 
user previously set, there will bo no data
                                if 
((!isset($this->bo->all_filters[$filter_num]['matches'][$i]['examine']))
***************
*** 267,270 ****
--- 271,282 ----
                                        $cc_selected = ' selected';
                                }
+                               elseif 
($this->bo->all_filters[$filter_num]['matches'][$i]['examine'] == 'bcc')
+                               {
+                                       $bcc_selected = ' selected';
+                               }
+                               elseif 
($this->bo->all_filters[$filter_num]['matches'][$i]['examine'] == 'recipient')
+                               {
+                                       $recipient_selected = ' selected';
+                               }
                                elseif 
($this->bo->all_filters[$filter_num]['matches'][$i]['examine'] == 'sender')
                                {
***************
*** 275,278 ****
--- 287,294 ----
                                        $subject_selected = ' selected';
                                }
+                               elseif 
($this->bo->all_filters[$filter_num]['matches'][$i]['examine'] == 'received')
+                               {
+                                       $received_selected = ' selected';
+                               }
                                else
                                {
***************
*** 283,288 ****
--- 299,307 ----
                                
$GLOBALS['phpgw']->template->set_var('to_selected',$to_selected);
                                
$GLOBALS['phpgw']->template->set_var('cc_selected',$cc_selected);
+                               
$GLOBALS['phpgw']->template->set_var('bcc_selected',$bcc_selected);
+                               
$GLOBALS['phpgw']->template->set_var('recipient_selected',$recipient_selected);
                                
$GLOBALS['phpgw']->template->set_var('sender_selected',$sender_selected);
                                
$GLOBALS['phpgw']->template->set_var('subject_selected',$subject_selected);
+                               
$GLOBALS['phpgw']->template->set_var('received_selected',$received_selected);
                                // COMPARATOR
                                $comparator_selectbox_name = 
'match_'.(string)$i.'[comparator]';




reply via email to

[Prev in Thread] Current Thread [Next in Thread]