Ignore:
Timestamp:
12/10/10 10:20:48 (13 years ago)
Author:
eduardoalex
Message:

Ticket #1408 - Modificado o layout da tela de enviar email do expresso mini.

Location:
branches/2.2/mobile/inc
Files:
3 edited

Legend:

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

    r3564 r3571  
    1313                        $this->template = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    1414                        $this->template->set_file(Array('home_t' => 'template.tpl'));    
    15                         $this->template->set_block('home_t', 'mobile_home');                     
     15                        $this->template->set_block('home_t', 'mobile_home');     
     16                        $this->template->set_block('home_t','success_message'); 
     17                        $this->template->set_block('home_t','error_message');            
    1618                } 
    1719 
     
    2527                        $this->template->set_var("content", $pre_content.$content); 
    2628                } 
     29                 
     30                /* 
     31                * @function set_msg 
     32                * @abstract Seta a mensagem de sucesso ou error a depender do tipo. 
     33                * @author Thiago Antonius 
     34                */               
     35                public function set_msg($msg, $type){ 
     36                        if(isset($msg) && trim($msg)!="") { 
     37                                $this->template->set_var("message", $msg); 
     38                                $this->template->parse("message_box", $type."_message", true); 
     39                        } 
     40                }                
     41                 
     42                /* 
     43                * @function set_success_msg 
     44                * @abstract Seta a mensagem de sucesso. 
     45                * @author Thiago Antonius 
     46                */               
     47                public function set_success_msg($msg){ 
     48                        $this->set_msg($msg, "success"); 
     49                } 
     50 
     51                        /* 
     52                * @function set_error_msg 
     53                * @abstract Seta a mensagem de erro 
     54                * @author Thiago Antonius 
     55                */               
     56                public function set_error_msg($msg){ 
     57                        $this->set_msg($msg, "error"); 
     58                }                
    2759 
    2860                /* 
     
    3163                * @author Nilton Emilio Buhrer Neto <niltonneto@celepar.pr.gov.br> 
    3264                */ 
    33                 public function print_page($class, $method){             
     65                public function print_page($class, $method){ 
    3466                        $this->print_header(); 
    3567                        $this->print_navbar(); 
    3668                        $filename = 'inc/class.'.$class.'.inc.php'; 
    37                         include_once($filename);         
     69                        include_once($filename); 
    3870                        $obj = new $class();             
    3971                        $obj -> $method($_REQUEST); 
  • branches/2.2/mobile/inc/class.ui_home.inc.php

    r3567 r3571  
    11<?php 
    22    class ui_home { 
    3                 var $imap_functions;     
     3                var $imap_functions; 
    44                var $db; 
    55                var $bocalendar; 
     
    2020                } 
    2121                 
    22                 function index($params) {                        
    23                         $this->template->set_file(Array('home_index' => 'home_index.tpl')); 
     22                function index($params) { 
     23                        $this->template->set_file(array('home_index' => 'home_index.tpl')); 
    2424                        $this->template->set_block('home_index','page');         
    2525                        $this->template->set_block('home_index','folder_block'); 
     
    3434                        $this->template->set_var('lang_my_folders', lang("my folders")); 
    3535                        $this->template->set_var('lang_my_commitments', lang("my commitments")); 
     36      $this->template->set_var('lang_my_contacts', lang("my contacts")); 
    3637                        $this->template->set_var('lang_new_mail', lang("new mail")); 
    3738                        $this->template->set_var('lang_mark_as_read', lang("mark as read")); 
     
    8889                                 
    8990                                $this->template->parse('commitments_box', 'commitment_block' ,True); 
    90                         }                        
     91                        } 
    9192                         
     93                        $GLOBALS['phpgw_info']['mobiletemplate']->set_success_msg($params["success_message"]); 
    9294                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'page')); 
    9395                } 
     
    109111                                $this->template->set_var('folder_total_msg', $this->imap_functions->get_num_msgs(array('folder' => $folder["folder_id"] ) ) ); 
    110112                                 
    111                                 $this->template->parse($box_target, 'folder_block' ,True); 
     113                                $this->template->parse($box_target, 'folder_block' ,true); 
    112114                        } 
    113115                } 
  • branches/2.2/mobile/inc/class.ui_mobilemail.inc.php

    r3501 r3571  
    3030                        'confirm_delete_msg'    => True, 
    3131                        'init_schedule' => true, 
    32                         'redirect' => true, 
    3332                        'add_recipients' => true, 
    3433                        'add_recipient' => true, 
    35                         'list_folders' => true 
     34                        'list_folders' => true, 
     35                        'save_draft' => true 
    3636                ); 
    3737 
     38                var $template; 
    3839                var $folders; // Pastas imap 
    3940                var $current_folder; // Pasta corrente 
     
    5152                function ui_mobilemail() 
    5253                { 
    53  
    5454                        $this-> load_session();                                          
    55  
     55                        $this->template = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
     56                         
    5657                        // Recupera atributos da classe gravados na sessão 
    5758                        $folders = $GLOBALS['phpgw']->session->appsession('mobilemail.folders','mobile'); 
     
    100101                function save_session() 
    101102                { 
    102  
    103103                        $GLOBALS['phpgw']->session->appsession('mobilemail.folders','mobile',$this->folders); 
    104104                        $GLOBALS['phpgw']->session->appsession('mobilemail.current_folder','mobile',$this->current_folder); 
    105105                        $GLOBALS['phpgw']->session->appsession('mobilemail.current_page','mobile',$this->current_page); 
    106  
    107106                } 
    108107 
     
    161160 
    162161                        // Carrega o template 
    163                         $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    164                         $p->set_file( 
    165                                 Array( 
    166                                         'view_msg_t' => 'view_msg.tpl' 
    167                                 ) 
    168                         ); 
    169                         $p->set_block('view_msg_t', 'mail_header'); 
    170                         $p->set_block('view_msg_t', 'mail_body'); 
    171                         $p->set_block('view_msg_t', 'mail_footer'); 
    172                         $p->set_block('view_msg_t', 'reply_msg'); 
    173                         $p->set_block('view_msg_t', 'attachment_list'); 
    174                         $p->set_block('view_msg_t', 'begin_anchor'); 
    175                         $p->set_block('view_msg_t', 'end_anchor'); 
     162                        $this->template->set_file(array('view_msg_t' => 'view_msg.tpl')); 
     163                        $this->template->set_block('view_msg_t', 'mail_header'); 
     164                        $this->template->set_block('view_msg_t', 'mail_body'); 
     165                        $this->template->set_block('view_msg_t', 'mail_footer'); 
     166                        $this->template->set_block('view_msg_t', 'reply_msg'); 
     167                        $this->template->set_block('view_msg_t', 'attachment_list'); 
     168                        $this->template->set_block('view_msg_t', 'begin_anchor'); 
     169                        $this->template->set_block('view_msg_t', 'end_anchor'); 
    176170 
    177171                        // Define o cabeçalho do e-mail 
    178                         $p->set_var('from_label', lang("From")); 
    179                         $p->set_var('from', $msg['from']['full']); 
    180                         $p->set_var('to_label', lang("To")); 
    181  
    182                         $p->set_var('subject_label', lang("Subject")); 
    183                         $p->set_var('subject', $msg['subject']); 
    184                         $p->set_var('date_label', lang("Date")); 
    185                         $p->set_var('date', $msg['fulldate']); 
     172                        $this->template->set_var('from_label', lang("From")); 
     173                        $this->template->set_var('from', $msg['from']['full']); 
     174                        $this->template->set_var('to_label', lang("To")); 
     175 
     176                        $this->template->set_var('subject_label', lang("Subject")); 
     177                        $this->template->set_var('subject', $msg['subject']); 
     178                        $this->template->set_var('date_label', lang("Date")); 
     179                        $this->template->set_var('date', $msg['fulldate']); 
    186180 
    187181 
    188182                        // Mostra o corpo do e-mail 
    189                         $p->set_var('body', strip_tags($msg['body'], $this->allowed_tags)); // Usa a função strip_tags() para filtrar 
     183                        $this->template->set_var('body', strip_tags($msg['body'], $this->allowed_tags)); // Usa a função strip_tags() para filtrar 
    190184                                // as tags que estão presentes no corpo do e-mail. 
    191                         $p->set_var('link_text', lang("Return")); 
    192                         $p->set_var('link', "index.php?menuaction=mobile.ui_mobilemail.mail_list"); 
    193  
    194  
    195                         $p->set_var('reply_all_text', lang("Reply to all")); 
    196                         $p->set_var('forward_text', lang("Forward")); 
    197  
    198                         $p->set_var('reply_text', lang("Reply")); 
    199                         $p->set_var('Delete', lang("Delete")); 
     185                        $this->template->set_var('link_text', lang("Return")); 
     186                        $this->template->set_var('link', "index.php?menuaction=mobile.ui_mobilemail.mail_list"); 
     187 
     188 
     189                        $this->template->set_var('reply_all_text', lang("Reply to all")); 
     190                        $this->template->set_var('forward_text', lang("Forward")); 
     191 
     192                        $this->template->set_var('reply_text', lang("Reply")); 
     193                        $this->template->set_var('Delete', lang("Delete")); 
    200194                        $msg_number = $_GET['msg_number']; 
    201195                        $msg_folder = $_GET['msg_folder']; 
    202                         $p->set_var('reply', "index.php?menuaction=mobile.ui_mobilemail.new_msg&msg_number=$msg_number&msg_folder=$msg_folder"); 
    203                         $p->set_var('delete', "index.php?menuaction=mobile.ui_mobilemail.confirm_delete_msg&msg_number=$msg_number&msg_folder=$msg_folder"); 
    204                         $p->set_var('reply_all', "index.php?menuaction=mobile.ui_mobilemail.new_msg&msg_number=$msg_number&msg_folder=$msg_folder&reply_all=true"); 
    205                         $p->set_var('forward', "index.php?menuaction=mobile.ui_mobilemail.new_msg&msg_number=$msg_number&msg_folder=$msg_folder&forward=true"); 
     196                        $this->template->set_var('reply', "index.php?menuaction=mobile.ui_mobilemail.new_msg&msg_number=$msg_number&msg_folder=$msg_folder"); 
     197                        $this->template->set_var('delete', "index.php?menuaction=mobile.ui_mobilemail.confirm_delete_msg&msg_number=$msg_number&msg_folder=$msg_folder"); 
     198                        $this->template->set_var('reply_all', "index.php?menuaction=mobile.ui_mobilemail.new_msg&msg_number=$msg_number&msg_folder=$msg_folder&type=reply_all"); 
     199                        $this->template->set_var('forward', "index.php?menuaction=mobile.ui_mobilemail.new_msg&msg_number=$msg_number&msg_folder=$msg_folder&type=forward"); 
    206200                        if (!empty($msg['attachments'])) 
    207201                        { 
     
    215209                                                                          lang('Download').":&nbsp;".$attach['name']."</a><br>"; 
    216210                                        } 
    217                                         $p->set_var('attachment_message', $attachs); 
    218                                 } 
    219                                 //$p->set_var('attachment_message', lang('This message have attachment(s)')); 
     211                                        $this->template->set_var('attachment_message', $attachs); 
     212                                } 
     213                                //$this->template->set_var('attachment_message', lang('This message have attachment(s)')); 
    220214                        } 
    221215                        else 
    222216                        { 
    223                                 $p->set_var('attachment_message', lang('This message don\'t have attachment(s)')); 
    224                         } 
    225  
    226                         $p->parse('view_msg_t', 'end_anchor'); 
    227                         $p->parse('view_msg_t', 'begin_anchor'); 
    228                         //$p->pfp('view_msg_t', 'mail_header'); 
    229                         /*$p->pfp('out', 'mail_header'); 
    230                         //$p->pfp('view_msg_t', 'mail_body'); 
    231                         $p->pfp('out', 'mail_body'); 
    232                         //$p->pfp('view_msg_t', 'attachment_list'); 
    233                         $p->pfp('out', 'attachment_list'); 
    234                         //$p->pfp('view_msg_t', 'mail_footer'); 
    235                         $p->pfp('out', 'reply_msg'); 
    236                         //$p->pfp('out', 'mail_footer');*/ 
    237  
    238                         //$p->pfp('view_msg_t', 'mail_header'); 
    239                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out', 'mail_header')); 
    240                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out', 'mail_body')); 
    241                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out', 'attachment_list')); 
    242                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out', 'reply_msg')); 
     217                                $this->template->set_var('attachment_message', lang('This message don\'t have attachment(s)')); 
     218                        } 
     219 
     220                        $this->template->parse('view_msg_t', 'end_anchor'); 
     221                        $this->template->parse('view_msg_t', 'begin_anchor'); 
     222                        //$this->template->pfp('view_msg_t', 'mail_header'); 
     223                        /*$this->template->pfp('out', 'mail_header'); 
     224                        //$this->template->pfp('view_msg_t', 'mail_body'); 
     225                        $this->template->pfp('out', 'mail_body'); 
     226                        //$this->template->pfp('view_msg_t', 'attachment_list'); 
     227                        $this->template->pfp('out', 'attachment_list'); 
     228                        //$this->template->pfp('view_msg_t', 'mail_footer'); 
     229                        $this->template->pfp('out', 'reply_msg'); 
     230                        //$this->template->pfp('out', 'mail_footer');*/ 
     231 
     232                        //$this->template->pfp('view_msg_t', 'mail_header'); 
     233                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'mail_header')); 
     234                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'mail_body')); 
     235                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'attachment_list')); 
     236                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'reply_msg')); 
    243237                } 
    244238 
     
    310304                function print_folder_selection() 
    311305                { 
    312                         $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    313                         $p->set_file( 
    314                                 Array( 
    315                                         'mobilemail_t' => 'mobilemail.tpl' 
    316                                 ) 
    317                         ); 
    318                         $p->set_block('mobilemail_t', 'inbox_folder_list'); 
    319                         $p->set_var('lang_folder', lang('Folder')); 
     306                        $this->template->set_file(array('mobilemail_t' => 'mobilemail.tpl')); 
     307                        $this->template->set_block('mobilemail_t', 'inbox_folder_list'); 
     308                        $this->template->set_var('lang_folder', lang('Folder')); 
    320309                        $folder = str_replace("*","",lang($this->folders[$this->current_folder]['folder_name'])); 
    321310                        if(!$this->current_folder == 0){ 
    322                                 $p->set_var('lang_inbox', $folder.' :: <a title="'.lang('Inbox').'" href="index.php?menuaction=mobile.ui_mobilemail.mail_list&folder=0">'.lang('Inbox').'</a>'); 
     311                                $this->template->set_var('lang_inbox', $folder.' :: <a title="'.lang('Inbox').'" href="index.php?menuaction=mobile.ui_mobilemail.mail_list&folder=0">'.lang('Inbox').'</a>'); 
    323312                        }else{ 
    324                                 $p->set_var('lang_inbox', lang('Inbox')); 
    325                         } 
    326                          
    327                         //$p->set_var('folder_items', $folder_items); 
    328                         $p->parse('mobilemail_t', 'inbox_folder_list');                  
    329                         //$p->fpf('out', 'mobilemail_t'); 
    330                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out', 'mobilemail_t')); 
     313                                $this->template->set_var('lang_inbox', lang('Inbox')); 
     314                        } 
     315                         
     316                        //$this->template->set_var('folder_items', $folder_items); 
     317                        $this->template->parse('mobilemail_t', 'inbox_folder_list');                     
     318                        //$this->template->fpf('out', 'mobilemail_t'); 
     319                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'mobilemail_t')); 
    331320 
    332321                } 
     
    347336 
    348337                                $option_selected = ''; 
    349                                 $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    350                                 $p->set_file( 
    351                                         Array( 
    352                                                 'mobilemail_t' => 'mobilemail.tpl' 
    353                                         ) 
    354                                 ); 
    355                                 $p->set_block('mobilemail_t', 'folder_item'); 
     338                                $this->template->set_file(array('mobilemail_t' => 'mobilemail.tpl')); 
     339                                $this->template->set_block('mobilemail_t', 'folder_item'); 
    356340 
    357341                                if (is_numeric($i)) 
     
    362346                                        } 
    363347 
    364                                         $p->set_var('option_selected', $option_selected); 
    365                                         $p->set_var('folder_id', $j['folder_id']); 
    366                                         $p->set_var('folder_name', $j['folder_id']); // Mudar... provavelmente usar preg_replace 
     348                                        $this->template->set_var('option_selected', $option_selected); 
     349                                        $this->template->set_var('folder_id', $j['folder_id']); 
     350                                        $this->template->set_var('folder_name', $j['folder_id']); // Mudar... provavelmente usar preg_replace 
    367351                                                                                                                                 // para substituir cpf pelo nome do usuário. 
    368352 
    369353                                        if ($j['folder_unseen'] > 0) 
    370354                                        { 
    371                                                 $p->set_var('folder_unseen', ' - ('.$j['folder_unseen'].')'); 
     355                                                $this->template->set_var('folder_unseen', ' - ('.$j['folder_unseen'].')'); 
    372356                                        } 
    373357 
    374                                         $folder_items .= $p->fp('mobile_t', 'folder_item'); 
     358                                        $folder_items .= $this->template->fp('mobile_t', 'folder_item'); 
    375359                                } 
    376360 
     
    378362 
    379363                        // Processa o select 
    380                         $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    381                         $p->set_file( 
    382                                 Array( 
    383                                         'mobilemail_t' => 'mobilemail.tpl' 
    384                                 ) 
    385                         ); 
    386                         $p->set_block('mobilemail_t', 'folder_list'); 
    387                         $p->set_var('folder_items', $folder_items); 
    388                         $p->parse('mobilemail_t', 'folder_list');                        
    389                         //$p->pfp('out', 'mobilemail_t'); 
    390                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out', 'mobilemail_t')); 
     364                        $this->template->set_file(array('mobilemail_t' => 'mobilemail.tpl')); 
     365                        $this->template->set_block('mobilemail_t', 'folder_list'); 
     366                        $this->template->set_var('folder_items', $folder_items); 
     367                        $this->template->parse('mobilemail_t', 'folder_list');                   
     368                        //$this->template->pfp('out', 'mobilemail_t'); 
     369                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'mobilemail_t')); 
    391370 
    392371                } 
     
    409388                                        isset($GLOBALS['phpgw_info']['user']['preferences']['mobile']['max_message_per_page'])? 
    410389                                        $GLOBALS['phpgw_info']['user']['preferences']['mobile']['max_message_per_page']:10;  
    411 //              var $pages; 
    412 //              var $actual_page; 
    413 //              var $number_of_messages; 
    414390 
    415391                        if (!isset($this->number_of_messages)) 
     
    458434                        // Cria a lista de e-mails 
    459435                        $mail_rows = ''; 
    460             $unread_msg_count = 0; 
     436      $unread_msg_count = 0; 
     437       
    461438                        if ($this->number_of_messages != 0) 
    462439                        { 
     
    464441                                foreach ($messages as $index => $msg) 
    465442                                { 
    466                                         $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    467                                         $p->set_file( 
    468                                                 Array( 
    469                                                         'mobilemail_t' => 'mobilemail.tpl' 
    470                                                 ) 
    471                                         ); 
     443                                  $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
     444                                        $p->set_file(array('mobilemail_t' => 'mobilemail.tpl')); 
    472445                                        $p->set_block('mobilemail_t', 'mail_row'); 
    473446                                        $p->set_block('mobilemail_t', 'end_strong'); 
     
    499472                                        } 
    500473                                } 
    501  
     474     
    502475                                // Imprime a lista de e-mails 
    503476                                $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    504                                 $p->set_file( 
    505                                         Array( 
    506                                                 'mobilemail_t' => 'mobilemail.tpl' 
    507                                         ) 
    508                                 ); 
     477                                $p->set_file(array('mobilemail_t' => 'mobilemail.tpl')); 
    509478                                $p->set_block('mobilemail_t', 'mail_list'); 
    510479                                $p->set_var('mail_rows', $mail_rows); 
     
    523492                                // Lista de e-mails vazia 
    524493                                $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    525                                 $p->set_file( 
    526                                         Array( 
    527                                                 'mobilemail_t' => 'mobilemail.tpl' 
    528                                         ) 
    529                                 ); 
     494                                $p->set_file(array('mobilemail_t' => 'mobilemail.tpl')); 
    530495                                $p->set_block('mobilemail_t', 'empty_list'); 
    531496                                $p->set_var('empty_message', lang('Empty folder'));                              
     
    554519                                { 
    555520 
    556                                         $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    557                                         $p->set_file( 
    558                                                 Array( 
    559                                                         'mobilemail_t' => 'mobilemail.tpl' 
    560                                                 ) 
    561                                         ); 
    562  
     521          $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
     522                                        $p->set_file(array('mobilemail_t' => 'mobilemail.tpl')); 
    563523                                        $p->set_block('mobilemail_t', 'space'); 
    564524                                        $p->set_block('mobilemail_t', 'begin_anchor'); 
     
    595555                                // Geração dos links "anterior" e "próximo" 
    596556                                $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    597                                 $p->set_file( 
    598                                         Array( 
    599                                                 'mobilemail_t' => 'mobilemail.tpl' 
    600                                         ) 
    601                                 ); 
     557                                $p->set_file(array('mobilemail_t' => 'mobilemail.tpl')); 
    602558 
    603559                                //$p->set_block('mobilemail_t', 'space'); 
     
    649605                } 
    650606 
    651                 /* 
    652                  * @function new_msg() 
    653                  * @abstract Gera o formulário para criar novo e-mail. 
    654                  * @author Rommel de Brito Cysne <rommel.cysne@serpro.gov.br> 
    655                   
    656                 function new_msg() 
    657                 { 
    658                         $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    659                         $p->set_file( 
    660                                 Array( 
    661                                         'new_msg_t' => 'new_msg.tpl' 
    662                                 ) 
    663                         ); 
    664  
    665                         $p->set_block('new_msg_t', 'msg_header'); 
    666                         $p->set_block('new_msg_t', 'text'); 
    667                         $p->set_block('new_msg_t', 'begin_form'); 
    668                         $p->set_block('new_msg_t', 'end_form'); 
    669                         $p->set_block('new_msg_t', 'hidden_area'); 
    670  
    671                         $p->set_var('to_label', lang("To")); 
    672                         $p->set_var('to', ""); 
    673                         $p->set_var('to_mail', ""); 
    674  
    675                         $p->set_var('subject_label', lang("Subject")); 
    676                         $p->set_var('subject', ""); 
    677  
    678                         $p->set_var('msg_number', $_GET['msg_number']); 
    679                         $p->set_var('msg_folder', $_GET['msg_folder']); 
    680  
    681                         $p->set_var('send_label', lang("Send")); 
    682  
    683                         $p->set_var('form_action', "index.php?menuaction=mobile.ui_mobilemail.send_mail"); 
    684  
    685                         $p->pfp('out', 'begin_form'); 
    686                         $p->pfp('out', 'msg_header'); 
    687                         $p->pfp('out', 'text'); 
    688                         $p->pfp('out', 'hidden_area'); 
    689                         $p->pfp('out', 'end_form'); 
    690  
    691                  
    692                 } 
    693 */ 
     607                function define_action_message($type) { 
     608                        switch($type) { 
     609                                case "clk": 
     610                                case "cc_mob": 
     611                                        $this->template->set_var('action_msg', lang("New message")); 
     612                                        break; 
     613                                case "reply_all": 
     614                                        $this->template->set_var('action_msg', lang("Reply All")); 
     615                                        break; 
     616                                case "user_add": 
     617                                        $this->template->set_var('action_msg', lang("Add Recipient")); 
     618                                        break; 
     619                                case "forward": 
     620                                        $this->template->set_var('action_msg', lang("Forward")); 
     621                                        break;                                           
     622                        } 
     623                } 
     624                 
    694625                /* 
    695626                 * @function new_msg() 
     
    697628                 * @author Rommel de Brito Cysne <rommel.cysne@serpro.gov.br> 
    698629                 */ 
    699                  
    700                 function new_msg() 
    701                 { 
    702                         $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    703                         $p->set_file( 
    704                                 Array( 
    705                                         'new_msg_t' => 'new_msg.tpl' 
    706                                 ) 
    707                         ); 
    708  
    709  
    710                         if (isset($_GET['msg_number'])) 
    711                         { 
    712                                 $params = array( 
    713                                         'msg_number' => $_GET['msg_number'], 
    714                                 ); 
    715  
    716                                 $msg_number = $_GET['msg_number']; 
    717                         } 
    718                  
    719                         if($params) 
    720                         { 
    721                                 $msg = $this->imap_functions->get_info_msg($params); 
    722                         } 
    723  
    724                         $p->set_block('new_msg_t', 'msg_header'); 
    725                         $p->set_block('new_msg_t', 'text'); 
    726                         $p->set_block('new_msg_t', 'begin_form'); 
    727                         $p->set_block('new_msg_t', 'end_form'); 
    728                         $p->set_block('new_msg_t', 'hidden_area'); 
    729  
    730                         if($_GET['clk']) 
    731                         { 
    732                                 $p->set_var('field_add_user', '<p>&nbsp;&nbsp;<input type="submit" name="action" value="'.lang("Add Recipient").'"></p>'); 
    733                                 $p->set_var('to_label', lang("To")); 
    734                                 $p->set_var('to', ""); 
    735                                 $p->set_var('to_mail', ""); 
    736                                 $p->set_var('subject_label', lang("Subject")); 
    737                                 $p->set_var('subject', ""); 
    738  
    739                         } 
    740                         else if($_GET['cc_mob']) 
    741                         { 
    742  
    743                                 $p->set_var('to_label', lang("To")); 
    744                                 $p->set_var('to', $_GET['input_to']); 
    745                                 $p->set_var('to_mail', $_GET['input_to_mail']); 
    746  
    747                                 $p->set_var('subject_label', lang("Subject")); 
    748                                 $p->set_var('subject', ""); 
    749  
    750                                 $p->set_var('msg_number', $_GET['msg_number']); 
    751                                 $p->set_var('msg_folder', $_GET['msg_folder']); 
    752  
    753                                 $p->set_var('read_only', 'readonly'); 
    754                         } 
    755                         else if($_GET['reply_all']){ 
    756                                 $reply_to_all = $msg['from']['full']; 
    757                                 $reply_to_all = $msg['toaddress2'] ? $reply_to_all.','.$msg['toaddress2']:$reply_to_all; 
    758                                 $reply_to_all = $msg['cc'] ? $reply_to_all.','.$msg['cc']:$reply_to_all; 
    759                                 $reply_to_all = $msg['bcc'] ? $reply_to_all.','.$msg['bcc']:$reply_to_all; 
    760                                 $names = implode(',<br/>',explode(',',$reply_to_all)); 
     630                function new_msg($params) 
     631                { 
     632                        $this->template->set_file(array('new_msg_t' => 'new_msg.tpl')); 
     633                        $this->template->set_block('new_msg_t', 'page'); 
     634                        $this->template->set_block('new_msg_t', 'add_recipient_block'); 
     635                        $this->template->set_var('lang_back', lang("back")); 
     636                        $this->template->set_var('lang_calendar', strtoupper(lang("Calendar"))); 
     637                        $this->template->set_var('lang_send', strtoupper(lang("Send"))); 
     638                        $this->template->set_var('lang_attachment', strtoupper(lang("attachment"))); 
     639                        $this->template->set_var('lang_cancel', strtoupper(lang("cancel"))); 
     640                        $this->template->set_var('lang_save_draft', strtoupper(lang("save draft"))); 
     641                        $this->template->set_var('type', $_GET['type']); 
     642                        $this->template->set_var('lang_to', lang("To")); 
     643                        $this->template->set_var('lang_cc', lang("cc")); 
     644                        $this->template->set_var('lang_subject', lang("Subject")); 
     645                        $this->template->set_var('lang_mark_as_important', lang("mark as important")); 
     646                        $this->template->set_var('lang_read_confirmation', lang("read confirmation")); 
     647                        $this->template->set_var('lang_add_history', lang("add history")); 
     648                         
     649                         
     650                        $this->template->set_var('type', $_REQUEST['type']); 
     651                        $this->template->parse('add_recipient_box', 'add_recipient_block', true); 
     652 
     653                        $this->define_action_message($_REQUEST['type']); 
     654                         
     655                        if(isset($params["error_message"])) { 
     656                                $this->template->set_var('to', $_POST['input_to']); 
     657                                $this->template->set_var('to_mail', $_POST['input_to_mail']); 
     658                                $this->template->set_var('cc', $_POST['input_cc']); 
     659                                $this->template->set_var('cc_mail', $_POST['input_cc_mail']); 
     660                                $this->template->set_var('subject', $_POST['input_subject']); 
     661                                $this->template->set_var('msg_number', $_POST['msg_number']); 
     662                                $this->template->set_var('msg_folder', $_POST['msg_folder']); 
     663                                $this->template->set_var('body_value', $_POST['body']); 
     664                                $this->template->set_var('msg_folder', $_POST['folder']); 
     665                                $this->template->set_var('msg_number', $_POST['reply_msg_number']); 
     666                                $this->template->set_var('from', $_POST['reply_from']); 
     667                                $this->template->set_var('check_important', ( ( $_POST['check_important'] ) ? "checked" : "" ) ); 
     668                                $this->template->set_var('check_read_confirmation', ( ( $_POST['check_read_confirmation'] )  ? "checked" : "" ) ); 
     669                                $this->template->set_var('check_add_history', ( ( $_POST['check_add_history'] )  ? "checked" : "" ) ); 
    761670                                 
    762                                 $array_emails = explode(',',$reply_to_all); 
    763                                 $reply_to_all =''; 
    764                                 foreach ($array_emails as $index => $email){ 
    765                                         $flag = preg_match('/&lt;(.*?)&gt;/',$email,$reply); 
    766                                         $reply_to_all .= $flag == 0 ? $email.', ':$reply[1].', '; 
    767                                 } 
    768                                                                  
    769                                 $p->set_var('to_label', lang("To")); 
    770                                 $p->set_var('to', $reply_to_all); 
    771  
    772                                 $p->set_var('to_mail', $_GET['input_to_mail']); 
    773  
    774                                 $p->set_var('subject_label', lang("Subject")); 
    775                                 $p->set_var('subject', "Re:" . $msg['subject']); 
    776  
    777                                 $p->set_var('msg_number', $_GET['msg_number']); 
    778                                 $p->set_var('msg_folder', $_GET['msg_folder']); 
    779                         } 
    780                         else if($_GET['user_add']){ 
    781                                 $p->set_var('to_label', lang("To")); 
     671                                $GLOBALS['phpgw_info']['mobiletemplate']->set_error_msg($params["error_message"]); 
     672                        } else { 
     673                                if (isset($_GET['msg_number'])) $msg = $this->imap_functions->get_info_msg(array('msg_number' => $_GET['msg_number'] ) ); 
    782674                                 
    783                                 $listMail = implode(',',$_SESSION['mobile_mail']); 
    784                                  
    785                                 $p->set_var('field_add_user', '<p>&nbsp;&nbsp;<input type="submit" name="action" value="'.lang("Add Recipient").'"></p>'); 
    786                                 $p->set_var('to', $listMail); 
    787                                 $p->set_var('to_mail', $listMail); 
    788                                 $p->set_var('subject_label', lang("Subject")); 
    789                                 $p->set_var('subject', $_SESSION['subject_mail']); 
    790                                 $p->set_var('body_value', $_SESSION['body_mail']);                               
    791  
    792                                 $p->set_var('msg_number', $_GET['msg_number']); 
    793                                 $p->set_var('msg_folder', $_GET['msg_folder']);                  
    794                  
    795                         } 
    796                         else if($_GET['forward']){ 
    797                                 $p->set_var('field_add_user', '<p>&nbsp;&nbsp;<input type="submit" name="action" value="'.lang("Add Recipient").'"></p>'); 
    798                                 $p->set_var('from_label', lang("From")); 
    799                                 $p->set_var('from', $msg['toaddress2']); 
    800  
    801                                 $p->set_var('to_label', lang("To")); 
    802                                 $mail_to = $msg['from']['full']; 
    803  
    804                                 $p->set_var('subject_label', lang("Subject")); 
    805                                 $p->set_var('subject', "Enc:" . $msg['subject']); 
    806                                 $p->set_var('body_value', strip_tags($msg['body'])); // Usa a função strip_tags() para filtrar 
    807                                 // as tags que estão presentes no corpo do e-mail. 
    808                                  
    809                                 $p->set_var('msg_number', $_GET['msg_number']); 
    810                                 $p->set_var('msg_folder', $_GET['msg_folder']);                  
    811                  
    812                         } 
    813                         else{ 
    814                                 $p->set_var('from_label', lang("From")); 
    815                                 $p->set_var('from', $msg['toaddress2']); 
    816  
    817                                 $p->set_var('to_label', lang("To")); 
    818                                 $mail_to = $msg['from']['full']; 
    819                                 $p->set_var('to', $msg['from']['name']); 
    820                                 $p->set_var('to_mail', $msg['from']['email']); 
    821  
    822                                 $p->set_var('subject_label', lang("Subject")); 
    823                                 $p->set_var('subject', "Re:" . $msg['subject']); 
    824  
    825                                 $p->set_var('msg_number', $_GET['msg_number']); 
    826                                 $p->set_var('msg_folder', $_GET['msg_folder']); 
    827  
    828                                 $p->set_var('read_only', "readonly"); 
    829                         } 
    830                         $_SESSION['mobile_mail'] = Array();      
    831                         $p->set_var('send_label', lang("Send")); 
    832                         $p->set_var('form_action', "index.php?menuaction=mobile.ui_mobilemail.redirect"); 
    833  
    834                         /*$p->pfp('out', 'begin_form'); 
    835                         $p->pfp('out', 'msg_header'); 
    836                         $p->pfp('out', 'text'); 
    837                         $p->pfp('out', 'hidden_area'); 
    838                         $p->pfp('out', 'end_form');*/ 
    839                          
    840                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out', 'begin_form')); 
    841                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out', 'msg_header')); 
    842                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out', 'text')); 
    843                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out', 'hidden_area')); 
    844                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out', 'end_form')); 
    845                 } 
    846  
     675                                if($_REQUEST['type']=="clk") 
     676                                { 
     677                                        $this->template->set_var('to', ""); 
     678                                        $this->template->set_var('to_mail', ""); 
     679                                        $this->template->set_var('cc', ""); 
     680                                        $this->template->set_var('cc_mail', ""); 
     681                                        $this->template->set_var('subject', ""); 
     682                                } 
     683                                else if($_REQUEST['type']=="cc_mob") 
     684                                { 
     685                                        $this->template->set_var('to', $_GET['input_to']); 
     686                                        $this->template->set_var('to_mail', $_GET['input_to_mail']); 
     687                                        $this->template->set_var('cc', $_GET['input_cc']); 
     688                                        $this->template->set_var('cc_mail', $_GET['input_cc_mail']); 
     689                                        $this->template->set_var('subject', ""); 
     690         
     691                                        $this->template->set_var('msg_number', $_GET['msg_number']); 
     692                                        $this->template->set_var('msg_folder', $_GET['msg_folder']); 
     693         
     694                                        $this->template->set_var('read_only', 'readonly'); 
     695                                } 
     696                                else if($_REQUEST['type']=="reply_all"){ 
     697                                        $reply_to_all = $msg['from']['full']; 
     698                                        $reply_to_all = $msg['toaddress2'] ? $reply_to_all.','.$msg['toaddress2']:$reply_to_all; 
     699                                        $reply_to_all = $msg['cc'] ? $reply_to_all.','.$msg['cc']:$reply_to_all; 
     700                                        $reply_to_all = $msg['bcc'] ? $reply_to_all.','.$msg['bcc']:$reply_to_all; 
     701                                        $names = implode(',<br/>',explode(',',$reply_to_all)); 
     702                                         
     703                                        $array_emails = explode(',',$reply_to_all); 
     704                                        $reply_to_all =''; 
     705                                         
     706                                        foreach ($array_emails as $index => $email){ 
     707                                                $flag = preg_match('/&lt;(.*?)&gt;/',$email,$reply); 
     708                                                $reply_to_all .= $flag == 0 ? $email.', ':$reply[1].', '; 
     709                                        } 
     710                                                                         
     711                                        $this->template->set_var('to', $reply_to_all); 
     712                                        $this->template->set_var('to_mail', $_GET['input_to_mail']); 
     713                                        $this->template->set_var('subject', "Re:" . $msg['subject']); 
     714         
     715                                        $this->template->set_var('msg_number', $_GET['msg_number']); 
     716                                        $this->template->set_var('msg_folder', $_GET['msg_folder']); 
     717                                } 
     718                                else if($_REQUEST['type']=="user_add"){ 
     719                                        $listMail = implode(',',$_SESSION['mobile_mail']); 
     720                                         
     721                                        $this->template->set_var('to', $listMail); 
     722                                        $this->template->set_var('to_mail', $listMail); 
     723                                        $this->template->set_var('subject', $_SESSION['subject_mail']); 
     724                                        $this->template->set_var('body_value', $_SESSION['body_mail']); 
     725         
     726                                        $this->template->set_var('msg_number', $_GET['msg_number']); 
     727                                        $this->template->set_var('msg_folder', $_GET['msg_folder']);                     
     728                                } 
     729                                else if($_REQUEST['type']=="forward"){ 
     730                                        $this->template->set_var('from', $msg['toaddress2']); 
     731         
     732                                        $mail_to = $msg['from']['full']; 
     733         
     734                                        $this->template->set_var('subject', "Enc:" . $msg['subject']); 
     735                                        $this->template->set_var('body_value', strip_tags($msg['body'])); // Usa a função strip_tags() para filtrar 
     736                                        // as tags que estão presentes no corpo do e-mail. 
     737                                         
     738                                        $this->template->set_var('msg_number', $_GET['msg_number']); 
     739                                        $this->template->set_var('msg_folder', $_GET['msg_folder']);             
     740                                } 
     741                                else{ 
     742                                        $this->template->set_var('from', $msg['toaddress2']); 
     743         
     744                                        $mail_to = $msg['from']['full']; 
     745                                        $this->template->set_var('to', $msg['from']['name']); 
     746                                        $this->template->set_var('to_mail', $msg['from']['email']); 
     747         
     748                                        $this->template->set_var('subject', "Re:" . $msg['subject']); 
     749         
     750                                        $this->template->set_var('msg_number', $_GET['msg_number']); 
     751                                        $this->template->set_var('msg_folder', $_GET['msg_folder']); 
     752         
     753                                        $this->template->set_var('read_only', "readonly"); 
     754                                }                                
     755                        } 
     756                         
     757                        $_SESSION['mobile_mail'] = array(); 
     758                         
     759                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out', 'page')); 
     760                } 
     761 
     762                                /* 
     763                 * @function save_draft() 
     764                 * @abstract Função que salva o email como rascunho 
     765                 * @author Thiago Antonius 
     766                 */ 
     767                function save_draft($params) 
     768                { 
     769                        $params["folder"] = "INBOX/".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder']; 
     770                        $return = $this->imap_functions->save_msg($params); 
     771                        if($return["has_error"]) { 
     772                                $params["error_message"] = lang("draft not save")."<br>".lang("error") . $return["append"]; 
     773                                $this->new_msg( $params ); 
     774                        }else { 
     775                                $ui_home = CreateObject('mobile.ui_home'); 
     776                                $params["success_message"] = lang("draft saved"); 
     777                                $ui_home->index( $params ); 
     778                        }                                
     779                } 
     780                 
    847781                /* 
    848782                 * @function send_mail() 
     
    858792                        $userName = $_POST['input_to']; //"User Someone"; 
    859793                        $userMail = $_POST['input_to_mail']; //"user.someone@mail.com.br"; 
     794                        $ccUserName = $_POST['input_cc']; 
     795                        $ccUserMail = $_POST['input_cc_mail'];                   
    860796                        $subject = $_POST['input_subject']; //"Mail Subject"; 
    861797                        $body = $_POST['body']; //"Mail body. Any text."; 
    862  
    863                         if($userMail == "") 
    864                         { 
    865                                 $userMail = $userName; 
    866                         } 
     798                        $isImportant = $_POST['check_important']; 
     799                        $addHistory = $_POST['check_add_history']; 
     800                        $readConfirmation = $_POST['check_read_confirmation']; 
     801                        $msgNumber = $_POST['reply_msg_number']; 
     802 
     803                        if($userMail == "") $userMail = $userName; 
     804                        if($ccUserMail == "") $ccUserMail = $ccUserName; 
    867805 
    868806                        //Cria objeto 
     
    873811                                $error_msg = lang("Some addresses in the To field were not recognized. Please make sure that all addresses are properly formed"); 
    874812                        } 
     813                         
     814                        if(!$this->imap_functions->add_recipients("cc", $ccUserMail, &$mail)) 
     815                        { 
     816                                $error_msg = lang("Some addresses in the CC field were not recognized. Please make sure that all addresses are properly formed"); 
     817                        }                        
    875818 
    876819                        $mail->IsSMTP(); 
     
    885828                        //Nome do remetente do email 
    886829                        $mail->SenderName = $mail->FromName = $_SESSION['phpgw_info']['expressomail']['user']['fullname']; 
    887                         //Endereço de destino do email, ou seja, pra onde a mensagem vai 
    888                         //$mail->AddAddress("$userMail"); 
    889830                        //Assunto da mensagem 
    890831                        $mail->Subject = $subject; 
    891832                        //Corpo da mensagem 
    892833                        $mail->Body .= "<br />$body<br />"; 
    893  
    894                         //Cria um objeto template 
    895                         $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    896                         //Define o template para mensagens de retorno da funcao 
    897                         $p->set_file( 
    898                                 Array( 
    899                                         'sent_msg_t' => 'sent_msg.tpl' 
    900                                 ) 
    901                         ); 
    902  
    903                         $p->set_block('sent_msg_t','retorno'); 
    904                         @header('Refresh: 1; url=./'); 
     834                        //Important message 
     835                        if($isImportant) $mail->isImportant(); 
     836                        //add history 
     837                        if($addHistory && $msgNumber) { 
     838                                $msg = $this->imap_functions->get_info_msg(array('msg_number' => $msgNumber ) ); 
     839                                $mail->Body .= "<br />".$msg['body']."<br />";                                           
     840                        } 
     841                        //read confirmation 
     842                        if ($readConfirmation) $mail->ConfirmReadingTo = $_SESSION['phpgw_info']['expressomail']['user']['email']; 
    905843 
    906844                        //Se o e-mail nao for enviado por qualquer motivo... 
    907                         if(!$mail->Send()) 
    908                         { 
    909                                 //... é exibida a mensagem abaixo e o respectivo erro... 
    910                                 $p->set_var('msg', lang("Message not sent")); 
    911                                 $p->set_var('erro', lang("error") . $mail->ErrorInfo); 
    912  
    913                         //... caso contrário... 
     845                        if(!$mail->Send()) { 
     846                                $params["error_message"] = lang("Message not sent")."<br>".lang("error") . $mail->ErrorInfo; 
     847                                $this->new_msg( $params ); 
    914848                        }else { 
    915                                 //... mostra mensagem de sucesso e link de retorno à lista de e-mail 
    916                                 $p->set_var('msg', lang("Message sent successfully")); 
    917                                 //$p->set_var('link_text', lang("Return")); 
    918                                 //$p->set_var('link', "mobilemail_index.php"); 
    919  
    920                         } 
    921  
    922                         //$p->pfp('out','retorno'); 
    923                         $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out','retorno')); 
    924  
     849                                $ui_home = CreateObject('mobile.ui_home'); 
     850                                $params["success_message"] = lang("Message sent successfully"); 
     851                                $ui_home->index($params); 
     852                        } 
    925853                } 
    926854 
     
    928856                {                                        
    929857                        //Cria um objeto template 
    930                         $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    931858                        //Define o template para mensagens de retorno da funcao 
    932                         $p->set_file( 
    933                                 Array( 
    934                                         'delete_msg_t' => 'delete_msg.tpl' 
    935                                 ) 
    936                         ); 
    937                         $p->set_block('delete_msg_t','retorno');                         
    938                         $p->set_var('lang_delete_msg', lang("Do you like to delete this message?"));                             
    939                         $p->set_var('lang_yes', lang("Yes"));    
    940                         $p->set_var('lang_no', lang("No")); 
    941                         $p->set_var('link_yes', 'index.php?menuaction=mobile.ui_mobilemail.delete_msg&msg_number='.$_GET['msg_number'].'&msg_folder='.$_GET['msg_folder']); 
    942                         $p->set_var('link_no', 'index.php?menuaction=mobile.ui_mobilemail.show_msg&amp;msg_number='.$_GET['msg_number'].'&amp;msg_folder='.$_GET['msg_folder']);         
    943                          
    944                         $p->pfp('out','retorno');   
     859                        $this->template->set_file(array('delete_msg_t' => 'delete_msg.tpl')); 
     860                        $this->template->set_block('delete_msg_t','retorno');                    
     861                        $this->template->set_var('lang_delete_msg', lang("Do you like to delete this message?"));                                
     862                        $this->template->set_var('lang_yes', lang("Yes"));       
     863                        $this->template->set_var('lang_no', lang("No")); 
     864                        $this->template->set_var('link_yes', 'index.php?menuaction=mobile.ui_mobilemail.delete_msg&msg_number='.$_GET['msg_number'].'&msg_folder='.$_GET['msg_folder']); 
     865                        $this->template->set_var('link_no', 'index.php?menuaction=mobile.ui_mobilemail.show_msg&amp;msg_number='.$_GET['msg_number'].'&amp;msg_folder='.$_GET['msg_folder']);    
     866                         
     867                        $this->template->pfp('out','retorno');   
    945868                } 
    946869 
     
    959882                        $this->imap_functions->move_messages($params); 
    960883                        //Cria um objeto template 
    961                         $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    962884                        //Define o template para mensagens de retorno da funcao 
    963                         $p->set_file( 
    964                                 Array( 
    965                                         'move_msg_t' => 'sent_msg.tpl' 
    966                                 ) 
    967                         ); 
    968                         $p->set_block('move_msg_t','retorno'); 
     885                        $this->template->set_file(array('move_msg_t' => 'sent_msg.tpl')); 
     886                        $this->template->set_block('move_msg_t','retorno'); 
    969887                        //@header('Refresh: 1; url=./ui_mobilemail.index?folder='.$this->current_folder);                        
    970                         $p->set_var('msg', lang("The message was moved to trash"));                              
    971  
    972                         $p->pfp('out','retorno');                                   
     888                        $this->template->set_var('msg', lang("The message was moved to trash"));                                 
     889 
     890                        $this->template->pfp('out','retorno');                              
    973891                     
    974892                } 
     
    989907                 
    990908                function init_schedule() { 
    991                          
    992909                        if($_POST['input_to'] != '' && !is_null($_POST['input_to'])) 
    993910                                array_push($_SESSION['mobile_mail'],$_POST['input_to']);                         
     911 
    994912                        $_SESSION['subject_mail'] = $_POST['input_subject']; 
    995913                        $_SESSION['body_mail'] = $_POST['body']; 
     
    1017935                } 
    1018936                 
    1019                 function redirect() { 
    1020                                 if($_POST[action] == lang("Send")){ 
    1021                                         $this->send_mail(); 
    1022                                 }else{ 
    1023                                         $this->init_schedule(); 
    1024                                 } 
    1025                 } 
    1026                  
    1027937                function list_folders(){                         
    1028                         $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    1029938                        //Define o template para mensagens de retorno da funcao 
    1030                         $p->set_file( 
    1031                                 Array( 
    1032                                         'folders_t' => 'folders.tpl' 
    1033                                 ) 
    1034                         ); 
    1035                         $p->set_block('folders_t','retorno'); 
     939                        $this->template->set_file(array('folders_t' => 'folders.tpl')); 
     940                        $this->template->set_block('folders_t','retorno'); 
    1036941                         
    1037942                        $folders_list = ''; 
     
    1055960                                } 
    1056961                        } 
    1057                         $p->set_var('folders_list', $folders_list); 
    1058                         $p->pfp('out','retorno');                                   
     962                        $this->template->set_var('folders_list', $folders_list); 
     963                        $this->template->pfp('out','retorno');                              
    1059964 
    1060965                } 
Note: See TracChangeset for help on using the changeset viewer.