Changeset 623 for trunk/mobile


Ignore:
Timestamp:
01/26/09 14:47:04 (15 years ago)
Author:
niltonneto
Message:

Resolve #399.

Location:
trunk/mobile
Files:
3 added
8 edited

Legend:

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

    r588 r623  
    44                var $bo; 
    55                var $cat; 
    6                 var $link_tpl; 
     6                var $link_tpl;           
    77                 
    88                var $public_functions = array( 
     
    1818                 
    1919                function ui_mobilecalendar() { 
    20                         $this->bo = CreateObject('calendar.bocalendar',1); 
     20                        $this->bo = CreateObject('calendar.bocalendar',1);                       
    2121                        $this->cat = &$this->bo->cat; 
    2222                        $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs'); 
     
    3737                 
    3838                function index() { 
    39                         $GLOBALS['phpgw']->redirect_link('calendar.php'); 
     39                        $accountId = $GLOBALS['phpgw_info']['user']['account_id']; 
     40                        $uicalendar = CreateObject("calendar.uicalendar"); 
     41                        $daysofWeek = array(lang('Sunday'), lang('Monday'),lang('Tuesday'),lang('Wednesday'),lang('Thursday'),lang('Friday'),lang('Saturday')); 
     42                        $year = $uicalendar->bo->year; 
     43                        $month = $uicalendar->bo->month; 
     44                        $day = $uicalendar->bo->day; 
     45                        $start = $GLOBALS['phpgw']->datetime->get_weekday_start($year, $month, $day) + $GLOBALS['phpgw']->datetime->tz_offset; 
     46                        $tstart = $start - $GLOBALS['phpgw']->datetime->tz_offset; 
     47                        $tstop = $tstart + 604800; 
     48                        $uicalendar->bo->so->owner = $accountId; 
     49                        $uicalendar->bo->so->open_box($accountId); 
     50                        $uicalendar->bo->store_to_cache( 
     51                                Array( 
     52                                        'syear'  => date('Y',$tstart), 
     53                                        'owner' => $accountId, 
     54                                        'smonth' => date('m',$tstart), 
     55                                        'sday'   => date('d',$tstart), 
     56                                        'eyear'  => date('Y',$tstop), 
     57                                        'emonth' => date('m',$tstop), 
     58                                        'eday'   => date('d',$tstop) 
     59                                ) 
     60                        ); 
     61                        $daily = $uicalendar->bo->cached_events; 
     62                        $p = CreateObject('phpgwapi.Template', "../mobile/templates/".$GLOBALS['phpgw_info']['server']['template_set']); 
     63                        $p->set_file(Array('view' => 'calendar.tpl')); 
     64                        $data[] = array(); 
     65                        @ksort($daily); 
     66                        $p->set_block("view","body"); 
     67                        if($daily){ 
     68                                $p->set_block('view','view_event'); 
     69                                foreach($daily as $date => $day_params) { 
     70                                        $year  = (int)substr($date,0,4); 
     71                                        $month = (int)substr($date,4,2); 
     72                                        $day   = (int)substr($date,6,2); 
     73                                        $day_of_week = $daysofWeek[$GLOBALS['phpgw']->datetime->day_of_week($year,$month,$day)]; 
     74                                        $p->set_var("header_date",$day_of_week." - ".$day."/".$month."/".$year); 
     75                                        for($i = 0; $i < count($day_params);$i++) 
     76                                        { 
     77                 
     78                                                //Verifica se o usuario conectado é o dono do agendamento, se for não serão exibidos os links 
     79                                                //Aceitar e Rejeitar 
     80                                                $display = ""; 
     81                                                if($accountId == $day_params[$i]['owner']) 
     82                                                { 
     83                                                        $display = "none"; 
     84                                                } 
     85                 
     86                                                $vars = $uicalendar->bo->event2array($day_params[$i]); 
     87                                                $data  = array ( 
     88                                                                        "title_field"           => $vars['title']['field'], 
     89                                                                        "title_data"            => $vars['title']['data'], 
     90                                                                        "location_field"        => $vars['location']['field'], 
     91                                                                        "location_data"         => $vars['location']['data'] ? $vars['location']['data'] : "&nbsp;", 
     92                                                                        "startdate_field"       => $vars['startdate']['field'], 
     93                                                                        "startdate_data"        => substr($vars['startdate']['data'],13, 17), 
     94                                                                        "enddate_field"         => $vars['enddate']['field'], 
     95                                                                        "enddate_data"          => substr($vars['enddate']['data'],13, 17), 
     96                                                                        "description_field"     => $vars['description']['field'], 
     97                                                                        "description_data"      => $vars['description']['data'] ? $vars['description']['data'] : "&nbsp;", 
     98                                                                        //Links Aceitar e Rejeitar o compromisso 
     99                                                                        "accept_title"          => lang("Accept"), 
     100                                                                        "accept_data"           => "index.php?menuaction=mobile.ui_mobilemail.set_action&cal_id=" . $day_params[$i]['id'] . "&action=3", 
     101                                                                        "reject_title"          => lang("Reject"), 
     102                                                                        "reject_data"           => "index.php?menuaction=mobile.ui_mobilemail.set_action&cal_id=" . $day_params[$i]['id'] . "&action=0", 
     103                                                                        "display"               => $display 
     104                                                                        ); 
     105                 
     106                        //                      print_r($vars); 
     107                                                $p->set_var($data); 
     108                                                $p->parse('views','view_event',True); 
     109                                        } 
     110                                } 
     111                                $p->parse('events','views'); 
     112                                //$p->pfp('out','views'); 
     113                        } 
     114                        else { 
     115                                $p->set_block('view','no_event'); 
     116                                $syear  = date('Y',$tstart); 
     117                                $smonth = date('m',$tstart); 
     118                                $sday   = date('d',$tstart); 
     119                                $eyear  = date('Y',$tstop); 
     120                                $emonth = date('m',$tstop); 
     121                                $eday   = date('d',$tstop); 
     122                                $p->set_var("start_date",$sday."/".$smonth."/".$syear); 
     123                                $p->set_var("end_date", $eday."/".$emonth."/".$eyear); 
     124                                $p->parse('events','no_event'); 
     125                //              $p->pfp('out','no_event'); 
     126                        } 
     127                        $p->set_var("lang_schedule",lang("schedule")); 
     128                        //$p->pfp('out','body'); 
     129                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out','body')); 
    40130                } 
    41131                 
     
    105195                        $p->set_var('lang_add_participants',lang('keep add participants')); 
    106196                        $p->set_var('lang_continue',lang('continue scheduling')); 
    107                         $p->pfp('out','body'); 
     197                        //$p->pfp('out','body'); 
     198                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out','body')); 
    108199                } 
    109200                 
     
    484575                                $p->set_var($var); 
    485576                                $delete_button = $p->fp('out','form_button'); 
     577                                 
    486578                        } 
    487579                        $p->set_var('delete_button',$delete_button); 
  • trunk/mobile/inc/class.ui_mobilecc.inc.php

    r588 r623  
    33                 
    44                var $nextmatchs; 
    5                 var $bo; 
     5                var $bo;                 
    66                var $page_info = array ( 
    77                                'actual_catalog' => false, 
     
    115115                        $ids = $this->bo->find($what,$rules); 
    116116 
    117                         foreach($ids as $id_r) { //Quero apenas os ids, como valores nas posições do array 
     117                        if(is_array($ids)) foreach($ids as $id_r) { //Quero apenas os ids, como valores nas posições do array 
    118118                                $retorno[] = $id_r[substr($id,strpos($id,".")+1)]; 
    119119                        } 
     
    262262                        if(!$from_calendar) { 
    263263                                $branchs = $bo_ldap_manager->get_external_ldap_sources(); 
    264                                  
    265                                 foreach($branchs as $id=>$branch) { //Ldaps externos 
     264                                if(is_array($branchs)) foreach($branchs as $id=>$branch) { //Ldaps externos 
    266265                                        $p->set_var(array('option_value'=>"bo_global_ldap_catalog#". 
    267266                                                        $id."#". 
     
    334333                                                        $var['row_telefone'] = $conn1['connection_value']; 
    335334                                                } 
    336                                                 $var['form_action'] = "index.php?menuaction=mobile.mobilemail.new_msg"; 
     335                                                $var['form_action'] = "index.php?menuaction=mobile.ui_mobilemail.new_msg"; 
    337336                                                $p->set_var($var); 
    338337                                                $p->parse('rows','row',True); 
     
    367366                                                } 
    368367                                                if(!$from_calendar) 
    369                                                         $var['form_action'] = "index.php?menuaction=mobile.mobilemail.new_msg"; 
     368                                                        $var['form_action'] = "index.php?menuaction=mobile.ui_mobilemail.new_msg"; 
    370369                                                else { 
    371370                                                        $var['id_contact'] = $entry['uidnumber'][0].'U'; 
     
    382381                                $p->set_var('lang_choose_the_participants',lang("choose the participants")); 
    383382                                $participants = $_SESSION['mobile_calendar']; 
    384                                 reset($participants); 
    385                                 while (($participant = current($participants))!==false) { 
     383                                @reset($participants); 
     384                                if(count($participants)) while (($participant = current($participants))!==false) { 
    386385                                        $p->set_var('row_contact_name',$participant); 
    387386                                        if(next($participants)!==false) 
     
    423422                        }                        
    424423                         
    425                         $p->pfp('out','body'); 
     424                        //$p->pfp('out','body'); 
     425                        $GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out','body')); 
    426426                } 
    427427                 
  • trunk/mobile/index.php

    r517 r623  
    44        $phpgw_info = array(); 
    55        $GLOBALS['sessionid'] = isset($_GET['sessionid']) ? $_GET['sessionid'] : @$_COOKIE['sessionid']; 
     6         
    67        if(!$GLOBALS['sessionid']) 
    7         { 
    8                 /*if (($GLOBALS['phpgw_info']['server']['use_https'] == 2) && ($_SERVER['HTTPS'] != 'on')) 
    9                 { 
    10  
    11                         Header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
    12                         exit; 
    13                 } 
    14                 else 
    15                 {*/ 
    16                 $location = 'Location: ' . $_SERVER['SCRIPT_URL'].'login.php'; 
    17                 Header('Location: ' . $_SERVER['SCRIPT_URL'].'login.php'); 
    18                 //Header('Location: ' . $_SERVER['SCRIPT_URL'].'login.php' . 
    19                 //      (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ? 
    20                 //      '?phpgw_forward='.urlencode('/index.php?'.$_SERVER['QUERY_STRING']):'')); 
     8        {                
     9                $location = 'Location: login.php'; 
     10                Header($location); 
    2111                exit; 
    22                 //      Header('Location: login.php'. 
    23                 //      (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ? 
    24                 //      '?phpgw_forward='.urlencode('/mobile/index.php?'.$_SERVER['QUERY_STRING']):'')); 
    25                 //      exit; 
    26                 //} 
    2712        } 
    2813 
     
    3722                This is the menuaction driver for the multi-layered design 
    3823        */ 
     24 
    3925        if(isset($_GET['menuaction'])) 
    4026        { 
     
    4733        else 
    4834        { 
    49         //$phpgw->log->message('W-BadmenuactionVariable, menuaction missing or corrupt: %1',$menuaction); 
    50         //$phpgw->log->commit(); 
    5135                $mobileapp = 'home'; 
    5236                $invalid_data = True; 
    5337        } 
    5438 
     39         
    5540        $GLOBALS['phpgw_info']['flags'] = array( 
    5641                'noheader'   => True, 
     
    6247        include('../header.inc.php'); 
    6348        include('./mobile_header.inc.php'); 
    64  
     49         
    6550        if($mobileapp == 'home') 
    6651        { 
    67                 Header('Location: ' . $GLOBALS['phpgw']->link('/mobile/home.php')); 
     52                start_prefered_app(); 
    6853        } 
    69  
     54         
    7055        $GLOBALS[$class] = CreateObject(sprintf('%s.%s','mobile',$class)); 
    7156        $public_functions = $GLOBALS[$class]->public_functions; 
    7257        if((is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) && ! $invalid_data) 
    73         //if((is_array($public_functions) && $public_functions[$method]) && ! $invalid_data) 
    74         { 
    75                 execmethod($_GET['menuaction']); 
    76                 print_header(); 
    77                 print_footer(); 
     58        {                                                
     59                $GLOBALS['phpgw_info']['mobiletemplate'] = CreateObject("mobile.mobiletemplate");                                        
     60                $GLOBALS['phpgw_info']['mobiletemplate'] -> print_page($class,$method);          
    7861                unset($mobileapp); 
    7962                unset($class); 
    8063                unset($method); 
    8164                unset($invalid_data); 
     65 
    8266        } 
    8367        else 
     
    11195                { 
    11296                        $GLOBALS['phpgw']->log->commit(); 
    113                 } 
    114                 $GLOBALS['phpgw']->redirect_link('/mobile/home.php'); 
     97                }                
     98                start_prefered_app(); 
    11599        } 
    116100 
  • trunk/mobile/login.php

    r588 r623  
    1111                'noheader'               => True 
    1212        ); 
    13  
    14         include('../header.inc.php'); 
     13         
     14        include('../header.inc.php');    
     15        include('./mobile_header.inc.php');      
    1516        $GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] : @$_COOKIE['sessionid']; 
     17         
    1618        if(isset($GLOBALS['sessionid']) && $_GET['cd'] != 10 && $_GET['cd'] != 1) 
    17                 //$GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw_info']['flags']['currentdir'].'/calendar.php'); 
    18                 //session_start(); 
    19                 $GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw_info']['flags']['currentdir'].'/home.php'); 
    20         if ($GLOBALS['phpgw_info']['server']['use_https'] > 0)  { 
     19                start_prefered_app();            
     20                if ($GLOBALS['phpgw_info']['server']['use_https'] > 0)  { 
    2121                if ($_SERVER['HTTPS'] != 'on') { 
    2222                        Header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
     
    2424                } 
    2525        } 
    26  
    27         $GLOBALS['phpgw']->session = CreateObject('phpgwapi.sessions'); 
    28         //$GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT.$GLOBALS['phpgw_info']['flags']['currentdir'].'/templates/'.$GLOBALS['phpgw_info']['login_template_set']; 
    29         $GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT.$GLOBALS['phpgw_info']['flags']['currentdir'].'/templates/'; 
     26         
     27        $GLOBALS['phpgw']->session = CreateObject('phpgwapi.sessions');  
     28        $GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT.$GLOBALS['phpgw_info']['flags']['currentdir'].'/templates/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'];        
    3029        $tmpl = CreateObject('phpgwapi.Template', $GLOBALS['phpgw_info']['server']['template_dir']); 
    3130        $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = $GLOBALS['phpgw_info']['login_template_set']; 
    3231        $tmpl->set_file(array('login_form' => 'login.tpl')); 
    3332        $tmpl->set_var('cd',check_logoutcode($_GET['cd'])); 
    34  
     33         
    3534        function check_logoutcode($code) { 
    3635                switch($code) { 
     
    9695                        $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] .$GLOBALS['phpgw_info']['flags']['currentdir'].'/login.php?cd=' . $GLOBALS['phpgw']->session->cd_reason); 
    9796                } 
    98                 else{ 
    99                         //$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] .$GLOBALS['phpgw_info']['flags']['currentdir'].'/calendar.php'); 
    100                         $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] .$GLOBALS['phpgw_info']['flags']['currentdir'].'/home.php'); 
     97                else{            
     98                        start_prefered_app(); 
    10199                } 
    102100        } 
     
    117115        $tmpl->set_var('lang_username',"Usuário"); 
    118116        $tmpl->set_var('lang_password',"Senha"); 
    119         $tmpl->set_var('lang_login',"Login"); 
    120          
     117        $tmpl->set_var('lang_login',"Login");    
    121118        $tmpl->set_var('website_title', $GLOBALS['phpgw_info']['server']['site_title']); 
    122119        $tmpl->set_var('template_set',$GLOBALS['phpgw_info']['login_template_set']); 
     
    126123        $tmpl->pfp('loginout','login_form'); 
    127124 
    128         function logout(){ 
     125        function logout(){               
    129126                $verified = $GLOBALS['phpgw']->session->verify(); 
    130127                if ($verified) 
  • trunk/mobile/mobile_header.inc.php

    r517 r623  
    1616        //TODO: Ler do banco do expresso as preferências do usuário e definir a aplicação móvel padrão 
    1717        // por enquanto isto será hardcoded para mobilemail. 
    18         $GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app'] = 'mobilemail'; 
    19         //TODO: Fazer mais genérico... Parecido com o home.php do expresso. 
     18        $GLOBALS['phpgw_info']['flags']['currentapp'] = 'mobile'; 
     19        $GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app'] = 'mobilemail'; // mobilecalendar, mobilecc ou mobilemail 
    2020 
    2121        /* 
     
    2525         */ 
    2626        function start_prefered_app(){ 
    27  
    28                 //TODO: Determinar qual a aplicação móvel preferida e iniciá-la. 
    29                 //TODO: Costruir agenda como uma classe. 
    30  
    31                 if ($GLOBALS['phpgw_info']['flags']['currentapp'] === 'mobile'){ 
    32                         $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/' 
    33                                 . $GLOBALS['phpgw_info']['flags']['currentapp'] . '/' 
    34                                 . $GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app'] . '_' 
    35                                 . 'index.php')); 
    36                 } 
    37  
    38         } 
    39  
    40         // Não será necessário implementar nada aqui 
    41         function print_navbar(){ 
    42  
    43         } 
    44  
    45         /* 
    46          * @function print_header 
    47          * @abstract Imprime o início da tela do Expresso Mini, headers html e a barra de navegação 
    48          * @author Mário César Kolling <mario.kolling@serpro.gov.br> 
    49          */ 
    50         function print_header(){ 
    51  
    52                 $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    53                 $p->set_file( 
    54                                 Array( 
    55                                         'home_t' => 'home.tpl' 
    56                                 ) 
    57                 ); 
    58  
    59                 $p->set_block('home_t', 'mobile_header'); 
    60                 $p->set_block('home_t', 'mobile_navbar'); 
    61                 $GLOBALS['phpgw']->accounts->read_repository(); 
    62  
    63                 $var  = Array( 
    64                         'fullname'      => $GLOBALS['phpgw']->accounts->data['fullname'],   //$GLOBALS['phpgw_info']['user']['firstname'], 
    65                         //'last_name'           => $GLOBALS['phpgw']->accounts->data['last_name'], //$GLOBALS['phpgw_info']['user']['lastname'], 
    66                         'account_lid'   => $GLOBALS['phpgw_info']['user']['account_lid'], 
    67                         'lang_logout'   => lang('Logout'), 
    68                         'template_set'  => $GLOBALS['phpgw_info']['server']['template_set'] 
    69                 ); 
    70  
    71                 $p->set_var($var); 
    72                 $p->parse('home_t', 'mobile_header'); 
    73  
    74                 /********************************\ 
    75                  * Cria o link para o new_mail  * 
    76                 \********************************/ 
    77                 $q = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    78                 $q->set_file( 
    79                                 Array( 
    80                                         'new_mail_t' => 'home.tpl' 
    81                                 ) 
    82                 ); 
    83  
    84                 $q->set_block('new_mail_t', 'new_mail'); 
    85                 $q->set_block('new_mail_t', 'begin_anchor'); 
    86                 $q->set_block('new_mail_t', 'end_anchor'); 
    87  
    88                 $q->set_var('href', 'index.php?menuaction=mobile.mobilemail.new_msg&clk=01'); 
    89                 $q->set_var('lang_newmail', lang('Create mail')); 
    90                 $q->fp('new_mail_t', 'begin_anchor'); 
    91                 $q->fp('new_mail_t', 'end_anchor'); 
    92  
    93                 $p->set_var('newmail', trim($q->fp('new_mail_t', 'new_mail'))); 
    94  
    95                 /********************************\ 
    96                  * Cria o link para o mobilemail * 
    97                 \********************************/ 
    98                 $q = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    99                 $q->set_file( 
    100                                 Array( 
    101                                         'mobilemail_t' => 'home.tpl' 
    102                                 ) 
    103                 ); 
    104  
    105                 $q->set_block('mobilemail_t', 'mobilemail'); 
    106                 $q->set_block('mobilemail_t', 'begin_anchor'); 
    107                 $q->set_block('mobilemail_t', 'end_anchor'); 
    108  
    109                 $q->set_var('href', 'mobilemail_index.php'); 
    110                 $q->set_var('lang_email', lang('E-mail')); 
    111                 $q->fp('mobilemail_t', 'begin_anchor'); 
    112                 $q->fp('mobilemail_t', 'end_anchor'); 
    113  
    114                 $p->set_var('mobilemail', trim($q->fp('mobilemail_t', 'mobilemail'))); 
    115  
    116                 /*****************************\ 
    117                  * Cria o link para a agenda * 
    118                 \*****************************/ 
    119                 //TODO: Passar estes passos para um laço quando tivermos um modo de registrar aplicações mobile 
    120                 $q = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    121                 $q->set_file( 
    122                                 Array( 
    123                                         'agenda_t' => 'home.tpl' 
    124                                 ) 
    125                 ); 
    126  
    127                 $q->set_block('agenda_t', 'agenda'); 
    128                 $q->set_block('agenda_t', 'begin_anchor'); 
    129                 $q->set_block('agenda_t', 'end_anchor'); 
    130  
    131                 $q->set_var('href', 'calendar.php'); 
    132                 $q->set_var('lang_agenda', lang('Calendar')); 
    133                 $q->fp('agenda_t', 'begin_anchor'); 
    134                 $q->fp('agenda_t', 'end_anchor'); 
    135  
    136                 $p->set_var('agenda', trim($q->fp('agenda_t', 'agenda'))); 
    137  
    138                 /********************************\ 
    139                  * Cria o link para o mobilemail * 
    140                 \********************************/ 
    141 /*              $q = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    142                 $q->set_file( 
    143                                 Array( 
    144                                         'mobilemail_t' => 'home.tpl' 
    145                                 ) 
    146                 ); 
    147  
    148                 $q->set_block('mobilemail_t', 'mobilemail'); 
    149                 $q->set_block('mobilemail_t', 'begin_anchor'); 
    150                 $q->set_block('mobilemail_t', 'end_anchor'); 
    151  
    152                 $q->set_var('href', 'mobilemail_index.php'); 
    153                 $q->set_var('lang_email', lang('E-mail')); 
    154                 $q->fp('mobilemail_t', 'begin_anchor'); 
    155                 $q->fp('mobilemail_t', 'end_anchor'); 
    156  
    157                 $p->set_var('mobilemail', trim($q->fp('mobilemail_t', 'mobilemail'))); 
    158 */ 
    159  
    160                 /********************************\ 
    161                  * Cria o link para o cc         * 
    162                 \********************************/ 
    163                 $q = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    164                 $q->set_file( 
    165                         Array( 
    166                                 'cc_t' => 'home.tpl' 
    167                         ) 
    168                 ); 
    169  
    170                 $q->set_block('cc_t', 'mobilecc'); 
    171                 $q->set_block('cc_t', 'begin_anchor'); 
    172                 $q->set_block('cc_t', 'end_anchor'); 
    173                  
    174                 $q->set_var('href', 'index.php?menuaction=mobile.ui_mobilecc.contacts_list'); 
    175                 $q->set_var('lang_cc', lang('Contact Center')); 
    176                 $q->fp('cc_t', 'begin_anchor'); 
    177                 $q->fp('cc_t', 'end_anchor'); 
    178                  
    179                 $p->set_var('contactcenter', trim($q->fp('cc_t', 'mobilecc'))); 
    180  
    181                 /**************************************\ 
    182                  * Termina de formar o menu e imprime * 
    183                 \**************************************/ 
    184                 $p->parse('home_t', 'mobile_navbar', true); 
    185                 $p->pfp('out', 'home_t'); 
    186  
    187         } 
    188  
    189         /* 
    190          * @function print_footer 
    191          * @abstract Imprime o fim da tela do Expresso Mini, ou seja, fecha as tags <body> e <html> 
    192          * @author Mário César Kolling <mario.kolling@serpro.gov.br> 
    193          */ 
    194         function print_footer(){ 
    195  
    196                 $p = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
    197                 $p->set_file( 
    198                                 Array( 
    199                                         'home_t' => 'home.tpl' 
    200                                 ) 
    201                 ); 
    202  
    203                 $p->set_block('home_t', 'mobile_footer'); 
    204                 $p->pfp('out', 'mobile_footer'); 
    205  
     27                //TODO: Determinar qual a aplicação móvel preferida e iniciá-la.                         
     28                switch($GLOBALS['phpgw_info']['user']['preferences']['common']['default_mobile_app']){ 
     29                        case mobilemail: 
     30                                $link = "ui_mobilemail.mail_list";               
     31                                break; 
     32                        case mobilecalendar: 
     33                                $link = "ui_mobilecalendar.index"; 
     34                                break; 
     35                        case mobilecc: 
     36                                $link = "ui_mobilecc.contacts_list"; 
     37                                break;           
     38                        default: 
     39                                break;           
     40                }                
     41                $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link("index.php?menuaction=mobile.".$link)); 
    20642        } 
    20743?> 
  • trunk/mobile/templates/css/mobile.css

    r612 r623  
    4747        font-family: Arial, Helvetica, sans-serif !important; 
    4848        border: 1px #000066 solid !important; 
    49 } 
    50 input:focus, textarea:focus 
    51 { 
    52         background-color: #F1F8FF; 
    5349} 
    5450 
  • trunk/mobile/templates/default/home.tpl

    r524 r623  
    1 <!-- BEGIN mobile_header --> 
     1<!-- BEGIN mobile_home --> 
    22<html> 
    33<head> 
    4 <meta http-equiv="Content-Language" content="en" /> 
     4<meta http-equiv="Content-Language" content="pt-BR" /> 
    55<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
    6 <!-- <LINK href="../phpgwapi/templates/{template_set}/css/{template_set}.css" type=text/css rel=StyleSheet> --> 
    76<LINK href="./templates/css/mobile.css" type=text/css rel=StyleSheet> 
    87<title>Expresso Mobile {lang_home}</title> 
    98</head> 
    109<body style="background-color:white !important"> 
     10<!-- BEGIN mobile_home_content --> 
     11{content}<br>{footer} 
     12<!-- END mobile_home_content --> 
    1113<p>&nbsp;&nbsp;<strong>{fullname}: [{account_lid}]</strong></p> 
    1214<hr /> 
    13 <!-- END mobile_header --> 
    14  
    15 <!-- BEGIN mobile_navbar --> 
    1615<!-- TODO: Yep! Deveria ser flexível, não hardcoded do jeito que tá --> 
    1716<!--<p>&nbsp;&nbsp;<strong>:: Expresso Mini</strong> </p>--> 
    1817<p> 
    19 :: {newmail} <br> 
    20 :: {mobilemail} <br> 
    21 :: {agenda} <br> 
    22 :: {contactcenter} <br> 
     18:: <a href="{href_newmail}">{lang_newmail}</a> <br> 
     19:: <a href="{href_email}">{lang_email}</a> <br> 
     20:: <a href="{href_calendar}">{lang_calendar}</a> <br> 
     21:: <a href="{href_cc}">{lang_cc}</a> <br> 
    2322:: <a href="./login.php?cd=1">{lang_logout}</a> 
    2423</p> 
    2524<hr /> 
    26 <!-- END mobile_navbar --> 
    27  
    28 <!-- BEGIN new_mail --> 
    29 {begin_anchor}{lang_newmail}{end_anchor} 
    30 <!-- END new_mail --> 
    31  
    32 <!-- BEGIN agenda --> 
    33 {begin_anchor}{lang_agenda}{end_anchor} 
    34 <!-- END agenda --> 
    35  
    36 <!-- BEGIN mobilemail --> 
    37 {begin_anchor}{lang_email}{end_anchor} 
    38 <!-- END mobilemail --> 
    39  
    40 <!-- BEGIN mobilecc --> 
    41 {begin_anchor}{lang_cc}{end_anchor} 
    42 <!-- END mobilecc --> 
    43  
    44 <!-- BEGIN begin_anchor --> 
    45 <a href="{href}"> 
    46 <!-- END begin_anchor --> 
    47  
    48 <!-- BEGIN end_anchor --> 
    49 </a> 
    50 <!-- END end_anchor --> 
    51  
    52 <!-- BEGIN mobile_footer --> 
    5325</body> 
    5426</html> 
    55 <!-- END mobile_footer --> 
     27<!-- END mobile_home --> 
  • trunk/mobile/templates/default/mobilemail.tpl

    r534 r623  
    2424 
    2525<!-- BEGIN mail_row --> 
    26 <p style="background-color: {unseen_bkg}">&nbsp;&nbsp;<strong>{from_label}</strong>:  {strong_unseen_begin}<a href="index.php?menuaction=mobile.mobilemail.show_msg&msg_number={msg_number}&msg_folder={msg_folder}">{from}<br> 
     26<p style="background-color: {unseen_bkg}">&nbsp;&nbsp;<strong>{from_label}</strong>:  {strong_unseen_begin}<a href="index.php?menuaction=mobile.ui_mobilemail.show_msg&msg_number={msg_number}&msg_folder={msg_folder}">{from}<br> 
    2727&nbsp;&nbsp;&nbsp;&nbsp;{subject} - {date}</a>{strong_unseen_end}</p> 
    2828<!-- END mail_row --> 
Note: See TracChangeset for help on using the changeset viewer.