phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: felamimail/inc class.bocompose.inc.php,1.1.1.1.2


From: Lars Kneschke <address@hidden>
Subject: [Phpgroupware-cvs] CVS: felamimail/inc class.bocompose.inc.php,1.1.1.1.2.2,1.1.1.1.2.3 class.bofelamimail.inc.php,1.2.2.3,1.2.2.4 class.uicompose.inc.php,1.1.1.1.2.2,1.1.1.1.2.3 class.uifelamimail.inc.php,1.2.2.2,1.2.2.3
Date: Sun, 05 May 2002 16:02:51 -0400

Update of /cvsroot/phpgroupware/felamimail/inc
In directory subversions:/tmp/cvs-serv30737/inc

Modified Files:
      Tag: Version-0_9_14-branch
        class.bocompose.inc.php class.bofelamimail.inc.php 
        class.uicompose.inc.php class.uifelamimail.inc.php 
Log Message:
- made the "Answered" flag working again
- fixed a reply to all bug(it did not reply to all)
- made the "Send Email" button on the main view vissible again

some internal code clean up



Index: class.bocompose.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.bocompose.inc.php,v
retrieving revision 1.1.1.1.2.2
retrieving revision 1.1.1.1.2.3
diff -C2 -r1.1.1.1.2.2 -r1.1.1.1.2.3
*** class.bocompose.inc.php     22 Mar 2002 20:07:20 -0000      1.1.1.1.2.2
--- class.bocompose.inc.php     5 May 2002 20:02:49 -0000       1.1.1.1.2.3
***************
*** 118,132 ****
                }
                
!               function getForwardData($_folder, $_replyID)
                {
                        $bofelamimail    = 
CreateObject('felamimail.bofelamimail',$_folder);
                        
                        // get message headers for specified message
!                       $headers        = 
$bofelamimail->getMessageHeaders($_replyID);
                        
                        // check for Re: in subject header
                        $this->sessionData['subject'] = "[FWD: " . 
$bofelamimail->decode_header($headers->Subject)."]";
  
!                       $structure     = 
$bofelamimail->getMessageStructure($_replyID);
                        if(sizeof($structure->parts) > 1)
                        {
--- 118,132 ----
                }
                
!               function getForwardData($_folder, $_uid)
                {
                        $bofelamimail    = 
CreateObject('felamimail.bofelamimail',$_folder);
                        
                        // get message headers for specified message
!                       $headers        = 
$bofelamimail->getMessageHeaders($_uid, ST_UID);
                        
                        // check for Re: in subject header
                        $this->sessionData['subject'] = "[FWD: " . 
$bofelamimail->decode_header($headers->Subject)."]";
  
!                       $structure     = 
$bofelamimail->getMessageStructure($_uid, ST_UID);
                        if(sizeof($structure->parts) > 1)
                        {
***************
*** 149,153 ****
                                                != "attachment")
                                        {
!                                               $bodyPart = 
$bofelamimail->getMessageBody($_replyID, $sections[$x]["pid"]);
                                                $this->sessionData['body'] .= 
quoted_printable_decode($bodyPart);
                                        }
--- 149,153 ----
                                                != "attachment")
                                        {
!                                               $bodyPart = 
$bofelamimail->getMessageBody($_uid, $sections[$x]["pid"], ST_UID);
                                                $this->sessionData['body'] .= 
quoted_printable_decode($bodyPart);
                                        }
***************
*** 156,160 ****
                        else
                        {
!                               $this->sessionData['body']      .= 
$bofelamimail->getMessageBody($_replyID);
                        }
                                                                                
                                                
--- 156,160 ----
                        else
                        {
!                               $this->sessionData['body']      .= 
$bofelamimail->getMessageBody($_uid, '', ST_UID);
                        }
                                                                                
                                                
***************
*** 166,175 ****
                }
  
!               function getReplyData($_folder, $_replyID)
                {
                        $bofelamimail    = 
CreateObject('felamimail.bofelamimail',$_folder);
                        
                        // get message headers for specified message
!                       $headers        = 
$bofelamimail->getMessageHeaders($_replyID);
                        
                        // check for Reply-To: header and use if available
--- 166,181 ----
                }
  
!               // $_mode can be:
!               // single: for a reply to one address
!               // all: for a reply to all
!               function getReplyData($_folder, $_mode, $_uid)
                {
                        $bofelamimail    = 
CreateObject('felamimail.bofelamimail',$_folder);
                        
                        // get message headers for specified message
!                       $headers        = 
$bofelamimail->getMessageHeaders($_uid,ST_UID);
! 
!                       $this->sessionData['uid'] = $_uid;
!                       $this->sessionData['folder'] = $_folder;
                        
                        // check for Reply-To: header and use if available
***************
*** 183,186 ****
--- 189,255 ----
                        }
                        
+                       if($_mode == 'all')
+                       {
+                               #_debug_array($this->preferences);
+                               // reply to any address which is cc, but not to 
my self
+                               $oldCC = 
$bofelamimail->decode_header(trim($headers->ccaddress));
+                               $addressParts = 
imap_rfc822_parse_adrlist($oldCC, '');
+                               if (count($addressParts)>0)
+                               {
+                                       while(list($key,$val) = 
each($addressParts))
+                                       {
+                                               if($val->mailbox.'@'.$val->host 
== $this->preferences['emailAddress'])
+                                               {
+                                                       continue;
+                                               }
+                                               
if(!empty($this->sessionData['cc'])) $this->sessionData['cc'] .= ",";
+                                               if(!empty($val->personal))
+                                               {
+                                                       
$this->sessionData['cc'] .= sprintf("%s <address@hidden>",
+                                                                               
        $val->personal,
+                                                                               
        $val->mailbox,
+                                                                               
        $val->host);
+                                               }
+                                               else
+                                               {
+                                                       
$this->sessionData['cc'] .= sprintf("address@hidden",
+                                                                               
        $val->mailbox,
+                                                                               
        $val->host);
+                                               }
+                                       }
+                               }
+                               
+                               
+                               // reply to any address which is to, but not to 
my self
+                               $oldTo = 
$bofelamimail->decode_header(trim($headers->toaddress));
+                               $addressParts = 
imap_rfc822_parse_adrlist($oldTo, '');
+                               if (count($addressParts)>0)
+                               {
+                                       while(list($key,$val) = 
each($addressParts))
+                                       {
+                                               if($val->mailbox.'@'.$val->host 
== $this->preferences['emailAddress'])
+                                               {
+                                                       continue;
+                                               }
+                                               print 
$val->mailbox.'@'.$val->host."<br>";
+                                               
if(!empty($this->sessionData['to'])) $this->sessionData['to'] .= ", ";
+                                               if(!empty($val->personal))
+                                               {
+                                                       
$this->sessionData['to'] .= sprintf("%s <address@hidden>",
+                                                                               
        $val->personal,
+                                                                               
        $val->mailbox,
+                                                                               
        $val->host);
+                                               }
+                                               else
+                                               {
+                                                       
$this->sessionData['to'] .= sprintf("address@hidden",
+                                                                               
        $val->mailbox,
+                                                                               
        $val->host);
+                                               }
+                                       }
+                               }
+                       }
+                       
+                       
                        // check for Re: in subject header
                        if(strtolower(substr(trim($headers->Subject), 0, 3)) == 
"re:")
***************
*** 193,197 ****
                        }
  
!                       $structure     = 
$bofelamimail->getMessageStructure($_replyID);
                        if(sizeof($structure->parts) > 1)
                        {
--- 262,266 ----
                        }
  
!                       $structure     = 
$bofelamimail->getMessageStructure($_uid,ST_UID);
                        if(sizeof($structure->parts) > 1)
                        {
***************
*** 211,215 ****
                                                != "attachment")
                                        {
!                                               $bodyPart = 
$bofelamimail->getMessageBody($_replyID, $sections[$x]["pid"]);
                                                $bodyPart = 
quoted_printable_decode($bodyPart);
                                                $this->sessionData['body'] .= 
str_replace("\n", "\n>", $bodyPart);
--- 280,284 ----
                                                != "attachment")
                                        {
!                                               $bodyPart = 
$bofelamimail->getMessageBody($_uid, $sections[$x]["pid"], ST_UID);
                                                $bodyPart = 
quoted_printable_decode($bodyPart);
                                                $this->sessionData['body'] .= 
str_replace("\n", "\n>", $bodyPart);
***************
*** 219,223 ****
                        else
                        {
!                               $this->sessionData['body']      .= 
str_replace("\n", "\n>", $bofelamimail->getMessageBody($_replyID));
                        }
                                                                                
                                                
--- 288,292 ----
                        else
                        {
!                               $this->sessionData['body']      .= 
str_replace("\n", "\n>", $bofelamimail->getMessageBody($_uid,'',ST_UID));
                        }
                                                                                
                                                
***************
*** 283,287 ****
  
                        $mail = CreateObject('felamimail.phpmailer');
!                       #_debug_array($this->preferences);
                        
                        #include(PHPGW_APP_ROOT . "/config/config.php");
--- 352,361 ----
  
                        $mail = CreateObject('felamimail.phpmailer');
!                       
!                       #print $this->sessionData['uid']."<bR>";
!                       #print $this->sessionData['folder']."<bR>";
!                       
!                       #_debug_array($_formData);
!                       #exit;
                        
                        #include(PHPGW_APP_ROOT . "/config/config.php");
***************
*** 408,411 ****
--- 482,492 ----
                                }
                                sqimap_logout($imap_stream);
+                       }
+                       if(isset($this->sessionData['uid']))
+                       {
+                               // mark message as answered
+                               $bofelamimail = 
CreateObject('felamimail.bofelamimail',$this->sessionData['folder']);
+                               
$bofelamimail->flagMessages("answered",array('0' => $this->sessionData['uid']));
+                               $bofelamimail->closeConnection();
                        }
                        while(list($key,$value) = 
@each($this->sessionData['attachments']))

Index: class.bofelamimail.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.bofelamimail.inc.php,v
retrieving revision 1.2.2.3
retrieving revision 1.2.2.4
diff -C2 -r1.2.2.3 -r1.2.2.4
*** class.bofelamimail.inc.php  22 Apr 2002 19:08:51 -0000      1.2.2.3
--- class.bofelamimail.inc.php  5 May 2002 20:02:49 -0000       1.2.2.4
***************
*** 120,124 ****
                                $msglist .= $value;
                        }
!                       
                        $prefs  = $this->bopreferences->getPreferences();
  
--- 120,124 ----
                                $msglist .= $value;
                        }
! 
                        $prefs  = $this->bopreferences->getPreferences();
  
***************
*** 176,180 ****
                                $msglist .= $value;
                        }
!                       
                        switch($_flag)
                        {
--- 176,180 ----
                                $msglist .= $value;
                        }
! 
                        switch($_flag)
                        {
***************
*** 185,188 ****
--- 185,191 ----
                                        $result = imap_setflag_full 
($this->mbox, $msglist, "\\Seen", ST_UID);
                                        break;
+                               case "answered":
+                                       $result = imap_setflag_full 
($this->mbox, $msglist, "\\Answered", ST_UID);
+                                       break;
                                case "unflagged":
                                        $result = imap_clearflag_full 
($this->mbox, $msglist, "\\Flagged", ST_UID);
***************
*** 469,493 ****
                }
  
!               function getMessageBody($_replyID, $_partID='')
                {
                        if(!empty($_partID))
                        {
!                               return trim(imap_fetchbody($this->mbox, 
$_replyID, $_partID));
                        }
                        else
                        {
!                               return trim(imap_body($this->mbox,$_replyID));
                        }
                }
  
!               function getMessageHeaders($_replyID)
                {
                        return imap_header($this->mbox, $_replyID);
                }
  
!               function getMessageStructure($_replyID)
                {
!                       #return imap_fetchstructure($this->mbox, $_replyID, 
FT_UID);
!                       return imap_fetchstructure($this->mbox, $_replyID);
                }
  
--- 472,520 ----
                }
  
!               function getMessageBody($_replyID, $_partID='',$_options=0)
                {
                        if(!empty($_partID))
                        {
!                               if($_options == ST_UID)
!                               {
!                                       return trim(imap_fetchbody($this->mbox, 
$_replyID, $_partID, FT_UID));
!                               }
!                               else
!                               {
!                                       return trim(imap_fetchbody($this->mbox, 
$_replyID, $_partID));
!                               }
                        }
                        else
                        {
!                               if($_options == ST_UID)
!                               {                               
!                                       return 
trim(imap_body($this->mbox,$_replyID, FT_UID));
!                               }
!                               else
!                               {
!                                       return 
trim(imap_body($this->mbox,$_replyID));
!                               }
                        }
                }
  
!               function getMessageHeaders($_replyID, $_options=0)
                {
+                       if($_options == ST_UID)
+                       {
+                               $_replyID = imap_msgno($this->mbox, $_replyID);
+                       }
                        return imap_header($this->mbox, $_replyID);
                }
  
!               function getMessageStructure($_replyID,$_options=0)
                {
!                       if($_options == ST_UID)
!                       {
!                               return imap_fetchstructure($this->mbox, 
$_replyID, FT_UID);
!                       }
!                       else
!                       {
!                               return imap_fetchstructure($this->mbox, 
$_replyID);
!                       }
                }
  

Index: class.uicompose.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.uicompose.inc.php,v
retrieving revision 1.1.1.1.2.2
retrieving revision 1.1.1.1.2.3
diff -C2 -r1.1.1.1.2.2 -r1.1.1.1.2.3
*** class.uicompose.inc.php     22 Mar 2002 20:07:20 -0000      1.1.1.1.2.2
--- class.uicompose.inc.php     5 May 2002 20:02:49 -0000       1.1.1.1.2.3
***************
*** 64,67 ****
--- 64,68 ----
                        $formData['priority']   = 
$this->bocompose->stripSlashes($GLOBALS['HTTP_POST_VARS']['priority']);
                        $formData['signature']  = 
$this->bocompose->stripSlashes($GLOBALS['HTTP_POST_VARS']['signature']);
+                       $formData['mailbox']    = 
$GLOBALS['HTTP_GET_VARS']['mailbox'];
  
                        if (isset($GLOBALS['HTTP_POST_VARS']['send'])) 
***************
*** 218,222 ****
                        {
                                // this fill the session data with the values 
from the original email
!                               $this->bocompose->getReplyData($folder, 
$replyID);
                        }
                        $this->compose();
--- 219,223 ----
                        {
                                // this fill the session data with the values 
from the original email
!                               $this->bocompose->getReplyData($folder, 
'single', $replyID);
                        }
                        $this->compose();
***************
*** 230,234 ****
                        {
                                // this fill the session data with the values 
from the original email
!                               $this->bocompose->getReplyData($folder, 
$replyID);
                        }
                        $this->compose();
--- 231,235 ----
                        {
                                // this fill the session data with the values 
from the original email
!                               $this->bocompose->getReplyData($folder, 'all', 
$replyID);
                        }
                        $this->compose();

Index: class.uifelamimail.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/felamimail/inc/class.uifelamimail.inc.php,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -C2 -r1.2.2.2 -r1.2.2.3
*** class.uifelamimail.inc.php  22 Apr 2002 13:20:20 -0000      1.2.2.2
--- class.uifelamimail.inc.php  5 May 2002 20:02:49 -0000       1.2.2.3
***************
*** 614,617 ****
--- 614,618 ----
                        $this->t->set_var('lang_recent',lang("recent"));
                        $this->t->set_var('lang_flagged',lang("flagged"));
+                       $this->t->set_var('lang_unflagged',lang("unflagged"));
                        $this->t->set_var('lang_subject',lang("subject"));
                        $this->t->set_var('lang_add_to_addressbook',lang("add 
to addressbook"));




reply via email to

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