Ignore:
Timestamp:
09/05/11 17:12:06 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #2260 - Sincronismo do branch2.2(versão 2.2.8) do modulo mobile para 2.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mobile/inc/class.ui_mobilemail.inc.php

    r4354 r5037  
    689689                function new_msg($params) 
    690690                { 
     691                        $flagImportant = intval($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_important_flag']); 
    691692                        $this->template->set_file(array('new_msg_t' => 'new_msg.tpl')); 
    692693                        $this->template->set_block('new_msg_t', 'page'); 
     
    702703                        $this->template->set_var('lang_cc', lang("cc")); 
    703704                        $this->template->set_var('lang_subject', lang("Subject")); 
     705                        $this->template->set_var('visible_important', ( ($flagImportant == 1 ) ? "block" : "none" ) ); 
    704706                        $this->template->set_var('lang_mark_as_important', lang("mark as important")); 
    705707                        $this->template->set_var('lang_read_confirmation', lang("read confirmation")); 
     
    708710                        $this->template->set_var("show_check_add_history","none"); 
    709711                         
    710                         if(isset($params["error_message"])) { 
     712                        if(isset($params["error_message"])) 
     713                        { 
    711714                                $this->template->set_var('input_to', $_POST['input_to']); 
    712715                                $this->template->set_var('input_cc', $_POST['input_cc']); 
     
    723726                                 
    724727                                $GLOBALS['phpgw_info']['mobiletemplate']->set_error_msg($params["error_message"]); 
    725                         } else { 
    726                                 if (isset($params['msg_number'])) $msg = $this->imap_functions->get_info_msg(array('msg_number' => $params['msg_number'], 'msg_folder' => $params['msg_folder'] ) ); 
    727                                  
     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                                } 
    728735                                 
    729736                                if($params['type']=="clk") 
     
    790797                                                $this->template->set_var("show_forward_attachment","block"); 
    791798                                                $this->template->set_block("new_msg_t","forward_attach_block"); 
    792                                                 foreach($msg['attachments'] as $forward_attach) { 
     799                                                foreach($msg['attachments'] as $forward_attach) 
     800                                                { 
    793801                                                        $value = rawurlencode(serialize(array(0=>$msg['msg_folder'], 
    794802                                                                                   1=>$msg['msg_number'], 
     
    802810                                        } 
    803811                                } 
    804                                 else if($params['type']=="use_draft"){ 
     812                                else if($params['type']=="use_draft") 
     813                                { 
    805814                                        $this->template->set_var('input_to', $msg['toaddress2']); 
    806815                                        $this->template->set_var('input_cc', $msg['cc']); 
     
    918927                        if($isImportant) $mail->isImportant(); 
    919928                        //add history 
    920                         if($addHistory && $msgNumber) { 
     929                        if($addHistory && $msgNumber) 
     930                        { 
    921931                                $msg = $this->imap_functions->get_info_msg(array('msg_number' => $msgNumber ) ); 
    922                                 $mail->Body .= "<br />".$msg['body']."<br />"; 
     932                                 
     933                                $_name  = ( isset($msg['from']['name']) ) ? $msg['from']['name'] : ""; 
     934                                $_email = ( isset($msg['from']['email']) ) ? " ".$msg['from']['email']." " : ""; 
     935                                 
     936                                $history_msg  = "<br/><br/><br/>"; 
     937                                $history_msg .= lang('At %1, %2 hours, %3 wrote:', $msg['msg_day'], $msg['msg_hour'],"\"".$_name."\"".$_email ); 
     938                                $history_msg .= "<br/>"; 
     939                                 
     940                                $mail->Body .= "<br/>". $history_msg . $msg['body']."<br/>"; 
    923941                        } 
    924942                        //read confirmation 
     
    974992                                header("Location: index.php?menuaction=mobile.ui_mobilemail.index&error_message=".lang("please select one e-mail")); 
    975993                        } else { 
    976                                 $params_messages = array( 
    977                                         'msgs_number' => isset($params['msgs'])?implode(",",$params['msgs']):$params['msg_number'], 
    978                                         'folder' => $this->folders[$this->current_folder]['folder_name'], 
    979                                         'new_folder_name' => 'Trash', 
    980                                         'new_folder' => 'INBOX/Trash' 
    981                                 ); 
     994                                $msg = ""; 
     995 
     996                                if($params["msg_folder"] == "INBOX/Trash") { 
     997                                        $params_messages = array( 
     998                                                'msgs_number' => isset($params['msgs'])?implode(",",$params['msgs']):$params['msg_number'], 
     999                                                'folder' => 'INBOX/Trash' 
     1000                                        ); 
    9821001                                 
    983                                 $this->imap_functions->move_messages($params_messages); 
    984                                 header("Location: index.php?menuaction=mobile.ui_mobilemail.index&success_message=".lang("The messages were moved to trash").'&ignore_trace_url=true');                          
     1002                                        $this->imap_functions->delete_msgs($params_messages); 
     1003                                 
     1004                                        $msg = lang("The messages were deleted"); 
     1005                                } else { 
     1006                                        $params_messages = array( 
     1007                                                'msgs_number' => isset($params['msgs'])?implode(",",$params['msgs']):$params['msg_number'], 
     1008                                                'folder' => $this->folders[$this->current_folder]['folder_name'], 
     1009                                                'new_folder_name' => 'Trash', 
     1010                                                'new_folder' => 'INBOX/Trash' 
     1011                                        ); 
     1012 
     1013                                        $this->imap_functions->move_messages($params_messages); 
     1014                                 
     1015                                        $msg = lang("The messages were moved to trash"); 
     1016                                } 
     1017 
     1018                                header("Location: index.php?menuaction=mobile.ui_mobilemail.index&success_message=".$msg.'&ignore_trace_url=true'); 
    9851019                        } 
    9861020                } 
Note: See TracChangeset for help on using the changeset viewer.