Changeset 5029 for branches/2.2


Ignore:
Timestamp:
09/02/11 16:44:30 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #2104 - Corrigido o erro ao encaminhar ou responder mensagem no mobile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/mobile/inc/class.ui_mobilemail.inc.php

    r5023 r5029  
    710710                        $this->template->set_var("show_check_add_history","none"); 
    711711                         
    712                         if(isset($params["error_message"])) { 
     712                        if(isset($params["error_message"])) 
     713                        { 
    713714                                $this->template->set_var('input_to', $_POST['input_to']); 
    714715                                $this->template->set_var('input_cc', $_POST['input_cc']); 
     
    725726                                 
    726727                                $GLOBALS['phpgw_info']['mobiletemplate']->set_error_msg($params["error_message"]); 
    727                         } else { 
    728                                 if (isset($params['msg_number'])) $msg = $this->imap_functions->get_info_msg(array('msg_number' => $params['msg_number'], 'msg_folder' => $params['msg_folder'] ) ); 
    729                                  
     728                        } 
     729                        else 
     730                        { 
     731                                if (isset($params['msg_number']) ) 
     732                                { 
     733                                        $msg = $this->imap_functions->get_info_msg(array('msg_number' => $params['msg_number'], 'msg_folder' => $params['msg_folder'] ) ); 
     734                                } 
    730735                                 
    731736                                if($params['type']=="clk") 
     
    779784                                        $params["type"] = $params['mobile_add_contact']['type']; 
    780785                                } 
    781                                 else if($params['type']=="forward"){ 
     786                                else if($params['type']=="forward") 
     787                                { 
    782788                                        $this->template->set_var('from', $msg['toaddress2']); 
    783          
    784789                                        $this->template->set_var('subject', "Enc:" . $msg['subject']); 
    785                                         $this->template->set_var('body_value', strip_tags($msg['body'])); // Usa a função strip_tags() para filtrar 
     790                                         
     791                                        $_name  = ( isset($msg['from']['name']) ) ? $msg['from']['name'] : ""; 
     792                                        $_email = ( isset($msg['from']['email']) ) ? " ".$msg['from']['email']." " : ""; 
     793                                        $forward_msg = "\n" . lang('At %1, %2 hours, %3 wrote:', $msg['msg_day'], $msg['msg_hour'],"\"".$_name."\"".$_email ); 
     794                                                 
     795                                        // Usa a função strip_tags() para filtrar 
    786796                                        // as tags que estão presentes no corpo do e-mail. 
     797                                        $this->template->set_var('body_value', "\n\n\n" . $forward_msg . "\n" . strip_tags($msg['body']) );  
    787798                                         
    788799                                        $this->template->set_var('msg_number', $_GET['msg_number']); 
     
    792803                                                $this->template->set_var("show_forward_attachment","block"); 
    793804                                                $this->template->set_block("new_msg_t","forward_attach_block"); 
    794                                                 foreach($msg['attachments'] as $forward_attach) { 
     805                                                foreach($msg['attachments'] as $forward_attach) 
     806                                                { 
    795807                                                        $value = rawurlencode(serialize(array(0=>$msg['msg_folder'], 
    796808                                                                                   1=>$msg['msg_number'], 
     
    804816                                        } 
    805817                                } 
    806                                 else if($params['type']=="use_draft"){ 
     818                                else if($params['type']=="use_draft") 
     819                                { 
    807820                                        $this->template->set_var('input_to', $msg['toaddress2']); 
    808821                                        $this->template->set_var('input_cc', $msg['cc']); 
     
    812825                                        $this->template->set_var('msg_folder', $_GET['msg_folder']); 
    813826                                } 
    814                                 else if($params['type']=="reply"){ 
     827                                else if($params['type']=="reply") 
     828                                { 
    815829                                        $this->template->set_var('from', $msg['toaddress2']); 
    816830                                        $this->template->set_var('input_to', $msg['from']['email']); 
    817          
    818831                                        $this->template->set_var('subject', "Re:" . $msg['subject']); 
    819          
    820832                                        $this->template->set_var('msg_number', $_GET['msg_number']); 
    821833                                        $this->template->set_var('msg_folder', $_GET['msg_folder']); 
    822                                 } else { 
     834                                } 
     835                                else  
     836                                { 
    823837                                        $this->template->set_var('input_to', ""); 
    824838                                        $this->template->set_var('input_cc', ""); 
     
    827841                        } 
    828842                         
    829                                 if($params['type']=="reply" || $params['type']=="forward"  || $params['type']=="reply_all" ) 
    830                                         $this->template->set_var("show_check_add_history","block"); 
     843                        if($params['type']=="reply" || $params['type']=="forward"  || $params['type']=="reply_all" ) 
     844                                $this->template->set_var("show_check_add_history","block"); 
    831845                         
    832846                        //tem que ser realizado no final, pois o tipo user_add é modificado para o tipo que o originou 
     
    920934                        if($isImportant) $mail->isImportant(); 
    921935                        //add history 
    922                         if($addHistory && $msgNumber) { 
     936                        if($addHistory && $msgNumber) 
     937                        { 
    923938                                $msg = $this->imap_functions->get_info_msg(array('msg_number' => $msgNumber ) ); 
    924                                 $mail->Body .= "<br />".$msg['body']."<br />"; 
     939                                 
     940                                $_name  = ( isset($msg['from']['name']) ) ? $msg['from']['name'] : ""; 
     941                                $_email = ( isset($msg['from']['email']) ) ? " ".$msg['from']['email']." " : ""; 
     942                                 
     943                                $history_msg  = "<br/><br/><br/>"; 
     944                                $history_msg .= lang('At %1, %2 hours, %3 wrote:', $msg['msg_day'], $msg['msg_hour'],"\"".$_name."\"".$_email ); 
     945                                $history_msg .= "<br/>"; 
     946                                 
     947                                $mail->Body .= "<br/>". $history_msg . $msg['body']."<br/>"; 
    925948                        } 
    926949                        //read confirmation 
     
    9831006                                                'folder' => 'INBOX/Trash' 
    9841007                                        ); 
    985  
     1008                                 
    9861009                                        $this->imap_functions->delete_msgs($params_messages); 
    987  
     1010                                 
    9881011                                        $msg = lang("The messages were deleted"); 
    9891012                                } else { 
     
    9961019 
    9971020                                        $this->imap_functions->move_messages($params_messages); 
    998  
     1021                                 
    9991022                                        $msg = lang("The messages were moved to trash"); 
    10001023                                } 
Note: See TracChangeset for help on using the changeset viewer.