Ignore:
Timestamp:
09/05/11 15:33:41 (13 years ago)
Author:
fernando-alberto
Message:

Ticket #1269 - Mergiando revisoes do branch22 de rev4972 ate rev5034

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/expressoMail1_2/MailArchiver/2.2/mobile/inc/class.ui_mobilemail.inc.php

    r4644 r5035  
    487487                function print_mails_list($messages,$print_checkbox=false) 
    488488                { 
    489                         $flagImportant = intval($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_important_flag']); 
    490                      
    491                         $functions = $this->common; 
     489            $functions = $this->common; 
    492490                        $p = $this->template; 
    493491                        $p->set_file( array( 'mobilemail_t' => 'mails_list.tpl' ) ); 
     
    524522                                                $flag="email-lido "; 
    525523                                         
    526                                         if( $message["Flagged"]==="F" && $flagImportant == 1 ) 
     524                                        if( $message["Flagged"]==="F" ) 
    527525                                                $flag.="email-importante"; 
    528526                                         
     
    691689                function new_msg($params) 
    692690                { 
     691                        $flagImportant = intval($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_important_flag']); 
    693692                        $this->template->set_file(array('new_msg_t' => 'new_msg.tpl')); 
    694693                        $this->template->set_block('new_msg_t', 'page'); 
     
    704703                        $this->template->set_var('lang_cc', lang("cc")); 
    705704                        $this->template->set_var('lang_subject', lang("Subject")); 
     705                        $this->template->set_var('visible_important', ( ($flagImportant == 1 ) ? "block" : "none" ) ); 
    706706                        $this->template->set_var('lang_mark_as_important', lang("mark as important")); 
    707707                        $this->template->set_var('lang_read_confirmation', lang("read confirmation")); 
     
    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 
     
    976999                                header("Location: index.php?menuaction=mobile.ui_mobilemail.index&error_message=".lang("please select one e-mail")); 
    9771000                        } else { 
    978                                 $params_messages = array( 
    979                                         'msgs_number' => isset($params['msgs'])?implode(",",$params['msgs']):$params['msg_number'], 
    980                                         'folder' => $this->folders[$this->current_folder]['folder_name'], 
    981                                         'new_folder_name' => 'Trash', 
    982                                         'new_folder' => 'INBOX/Trash' 
    983                                 ); 
     1001                                $msg = ""; 
     1002 
     1003                                if($params["msg_folder"] == "INBOX/Trash") { 
     1004                                        $params_messages = array( 
     1005                                                'msgs_number' => isset($params['msgs'])?implode(",",$params['msgs']):$params['msg_number'], 
     1006                                                'folder' => 'INBOX/Trash' 
     1007                                        ); 
    9841008                                 
    985                                 $this->imap_functions->move_messages($params_messages); 
    986                                 header("Location: index.php?menuaction=mobile.ui_mobilemail.index&success_message=".lang("The messages were moved to trash").'&ignore_trace_url=true');                          
     1009                                        $this->imap_functions->delete_msgs($params_messages); 
     1010                                 
     1011                                        $msg = lang("The messages were deleted"); 
     1012                                } else { 
     1013                                        $params_messages = array( 
     1014                                                'msgs_number' => isset($params['msgs'])?implode(",",$params['msgs']):$params['msg_number'], 
     1015                                                'folder' => $this->folders[$this->current_folder]['folder_name'], 
     1016                                                'new_folder_name' => 'Trash', 
     1017                                                'new_folder' => 'INBOX/Trash' 
     1018                                        ); 
     1019 
     1020                                        $this->imap_functions->move_messages($params_messages); 
     1021                                 
     1022                                        $msg = lang("The messages were moved to trash"); 
     1023                                } 
     1024 
     1025                                header("Location: index.php?menuaction=mobile.ui_mobilemail.index&success_message=".$msg.'&ignore_trace_url=true'); 
    9871026                        } 
    9881027                } 
Note: See TracChangeset for help on using the changeset viewer.