Changeset 5037 for trunk


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

Location:
trunk/mobile
Files:
7 edited

Legend:

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

    r4277 r5037  
    6565                public function change_max_results($params) { 
    6666                        $this->page_info['actual_max_contacts'] = $params['results']; 
     67                        $this->save_session(); 
    6768                        $this->contacts_list(); 
     69                } 
     70                 
     71                public function change_letter($params) 
     72                { 
     73                        if( $params['letter'] ) 
     74                        { 
     75                                $this->page_info['actual_letter'] = $params['letter']; 
     76                        } 
     77                        $this->page_info['actual_max_contacts'] = 10; 
    6878                        $this->save_session(); 
    69                 } 
    70                  
    71                 public function change_letter($params) { 
    72                         $this->page_info['actual_letter'] = $params['letter']; 
     79                        $this->contacts_list($params); 
     80                } 
     81                 
     82                public function change_catalog($params) 
     83                { 
     84                        $this->page_info['actual_catalog'] = $params['catalog']; 
     85                        $this->page_info['actual_letter'] = 'a'; 
    7386                        $this->page_info['actual_max_contacts'] = 10; 
    74                         $this->contacts_list(); 
    7587                        $this->save_session(); 
    76                 } 
    77                  
    78                 public function change_catalog($params) { 
    79  
    80                         if( $params['catalog'] ) $this->page_info['actual_catalog'] = $params['catalog']; 
    81                         $this->page_info['actual_max_contacts'] = 10; 
    82                         $this->page_info['actual_letter'] = 'a'; 
    83                          
    8488                        $this->contacts_list($params); 
    85                          
    86                         $this->save_session(); 
    8789                } 
    8890                 
     
    9698                        $this->set_page_info_to_default(); 
    9799                        $this->page_info['request_from'] = $params['request_from']; //Para escolher contato vindo de outro modulo, mudo apenas o request_from 
     100                        $this->save_session(); 
    98101                        $this->contacts_list(); 
    99                         $this->save_session(); 
    100102                } 
    101103                 
     
    108110                public function init_cc($params) { 
    109111                        $this->set_page_info_to_default(); 
     112                        $this->save_session(); 
    110113                        $this->contacts_list($params); 
    111                         $this->save_session(); 
    112114                } 
    113115                 
     
    242244                 */ 
    243245                 
    244                 function delete_contacts($params) { 
     246                function delete_contacts($params) 
     247                { 
    245248                        $this->bo->set_catalog($params['catalog']); 
    246249 
     
    369372                 * @return $contact 
    370373                 */ 
    371                 function contact_view($params) { 
    372  
    373                         if ( empty($params['id']) || empty($params['catalog']) ){ 
     374                function contact_view($params) 
     375                { 
     376 
     377                        if ( empty($params['id']) || empty($params['catalog']) ) 
     378                        { 
    374379                                header('Location: ../mobile/index.php?menuaction=mobile.ui_mobilecc.init_cc'); 
    375380                        } 
     
    633638                                $view = true; 
    634639 
    635                                 if ( !isset($params['erro'])){ 
     640                                if ( !isset($params['erro'])) 
     641                                { 
    636642                                        $this->bo->set_catalog($params['catalog']); 
    637643                                        $result = $this->bo->bo->get_single_entry($params['id'], array("given_names"=>true,"names_ordered"=>true,"alias"=>true,"family_names"=>true,"companies"=>true,"relations"=>true,"connections"=>true)); 
     
    727733                                        $data['connections']['default_phone']['connection_value'] = $params['phone']; 
    728734                                } 
    729          
    730735                                $this->bo->set_catalog($params['catalog']); 
    731736                                $contact_id = $this->bo->bo->quick_add($data); 
     
    761766                        else 
    762767                        { 
    763  
    764768                                $this->bo->set_catalog($params['catalog']); 
    765769                                $types = $this->bo->bo->get_all_connections_types(); 
     
    850854                         
    851855                } 
    852  
    853                  
    854856        } 
    855          
    856          
    857857?> 
  • 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                } 
  • trunk/mobile/index.php

    r4277 r5037  
    88        //$fwConstruct = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $proxies[0] : $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 
    99        $fwConstruct = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $proxies[0] : $_SERVER['HTTP_HOST'];   
    10         $REQUEST_URI = substr( $_SERVER['REQUEST_URI'], 0, strpos( $_SERVER['REQUEST_URI'], "/mobile/" ) + 8 ); 
     10        $REQUEST_URI = substr( $_SERVER['REQUEST_URI'], 0, strpos( $_SERVER['REQUEST_URI'], "/mobile/"+1)); 
     11        if( strpos( $_SERVER['REQUEST_URI'], "/mobile/" ) !== false ) 
     12        { 
     13                $REQUEST_URI = substr($_SERVER['REQUEST_URI'], 0, strpos( $_SERVER['REQUEST_URI'], "/mobile/")); 
     14        } 
     15         
    1116        $fwConstruct .= $REQUEST_URI; 
    1217         
     
    2126                $aux = 'https://'; 
    2227            } 
    23                  
    24             Header('Location: ' . $aux . $fwConstruct . "login.php"); 
    25                 exit; 
     28           
     29            Header('Location: ' . $aux . $fwConstruct . "/login.php"); 
     30                exit; 
    2631        } 
    2732 
     
    2934        { 
    3035                if ($_SERVER['HTTPS'] != 'on') { 
    31                         Header('Location: https://' . $fwConstruct . '/' . $_SERVER['REQUEST_URI']); 
     36                        Header('Location: https://' . $fwConstruct . $_SERVER['REQUEST_URI']); 
    3237                        exit; 
    3338                } 
  • trunk/mobile/login.php

    r4277 r5037  
    158158                        $_SESSION['phpgw_info']['user']['preferences']['expressoMail'] = $preferences['expressoMail']; 
    159159                         
    160                         if($_POST['save_login'] == 'yes') 
     160                        if($_POST['save_login'] === 'on') 
    161161                        { 
    162162                                // Time to keep values into cookies 
     
    165165                                $GLOBALS['phpgw']->session->phpgw_setcookie('pem', base64_encode($passwd), $ttl);                       // pem = password 
    166166                        } 
    167                         start_prefered_app(); 
    168                 } 
    169         } 
    170         elseif ($_GET['lang']) 
    171         { 
    172                 $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $_GET['lang']; 
     167                         
     168                        if( isset($GLOBALS['sessionid']) ) 
     169                        { 
     170                                if( $_GET['cd'] != 10 && $_GET['cd'] != 1 && $_GET['cd'] !== 'logout_mobile' && $_GET['cd'] != 66 ) 
     171                                { 
     172                                        start_prefered_app(); 
     173                                } 
     174                        } 
     175                } 
    173176        } 
    174177        elseif(!isset($_COOKIE['last_loginid']) || !$prefs->account_id) 
  • trunk/mobile/setup/phpgw_pt-br.lang

    r4277 r5037  
    11attachment      mobile  pt-br   Anexo 
    22Add Recipient   mobile  pt-br   Adicionar Destinatário 
     3At %1, %2 hours, %3 wrote:      mobile  pt-br   Em %1 às %2 horas, %3 escreveu: 
    34more attachment mobile  pt-br   mais anexo 
    45cancel  mobile  pt-br   Cancelar 
     
    6465This message don't have attachment(s)   mobile  pt-br   Este e-mail não possui anexo(s) 
    6566This message has the follow attachments:        mobile  pt-br   Esta mensagem possui anexo: 
     67Tips    mobile  pt-br   Dicas 
    6668Catalog mobile  pt-br   Catálogo 
    6769Phone   mobile  pt-br   Telefone 
     
    108110No matches found        mobile  pt-br   Contato não localizado 
    109111The message was moved to trash  mobile  pt-br   A mensagem foi movida para a lixeira. 
     112The messages were deleted       mobile  pt-br   As mensagens foram apagadas. 
    110113The messages were moved to trash        mobile  pt-br   As mensagens foram movidas para a lixeira. 
    111114The messages were marked as seen        mobile  pt-br   As mensagens foram marcadas como lidas. 
  • trunk/mobile/templates/default/login.tpl

    r4277 r5037  
    77                <meta content="text/html;width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0; charset=utf-8;" http-equiv="Content-Type" name="viewport" />  
    88                <meta name="format-detection" content="telephone=no" /> 
    9                 <link href="templates/css/mobile.css" type="text/css" rel="StyleSheet" /> 
     9                <!-- link href="templates/css/mobile.css" type="text/css" rel="StyleSheet" /--> 
     10                <link type="text/css" rel="stylesheet" href="templates/css/login.css"> 
    1011                <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/> 
    1112                <link rel="apple-touch-icon" href="./templates/default/images/favicon.png" /> 
  • trunk/mobile/templates/default/new_msg.tpl

    r4277 r5037  
    6161        <div id="corpo_mensagem" class="limpar_div" style="background:#EFF8FB; display:table; width:100%" > 
    6262                <div id="text_area"><textarea id="body" wrap="virtual" name="body" cols="5" rows="5">{body_value}</textarea></div> 
    63                 <div class="limpar_div">&nbsp;<input type="checkbox" name="check_important" {check_important} />{lang_mark_as_important}</div> 
     63                <div class="limpar_div" style="display:{visible_important} !important;">&nbsp;<input type="checkbox" name="check_important" {check_important} />{lang_mark_as_important}</div> 
    6464                <div class="limpar_div">&nbsp;<input type="checkbox" name="check_read_confirmation" {check_read_confirmation} />{lang_read_confirmation}</div> 
    6565                <div class="limpar_div" style="display:{show_check_add_history}">&nbsp;<input type="checkbox" name="check_add_history" {check_add_history} />{lang_add_history}</div> 
Note: See TracChangeset for help on using the changeset viewer.