Changeset 431


Ignore:
Timestamp:
09/16/08 15:20:30 (16 years ago)
Author:
rafaelraymundo
Message:

Novas implementacoes do modulo Mobile.

  • Possibilidade de ler emails com paginacao da caixa de entrada
  • Aumento da Fonte
  • Negritos para facilitar a visualizacao
  • Na leitura, link para retorno a caixa de entrada
Location:
trunk/mobile
Files:
10 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/mobile/calendar.php

    r286 r431  
    77        } 
    88 
     9        // Flag currentapp modificada para mobile 
     10        // Inserida flag mobileapp e definida como calendar 
    911        $GLOBALS['phpgw_info']['flags'] = array( 
    1012                'noheader'                => True, 
    1113                'nonavbar'                => True, 
    12                 'currentapp'              => 'calendar', 
     14                'currentapp'              => 'mobile', 
     15                'mobileapp'                               => 'calendar', 
    1316                'enable_network_class'    => True, 
    1417                'enable_contacts_class'   => True, 
    1518                'enable_nextmatchs_class' => True 
    16         );       
     19        ); 
    1720        include('../header.inc.php'); 
     21        include('mobile_header.inc.php'); 
     22 
     23        // Utiliza o novo header para a página principal. 
     24        print_header(); 
     25 
    1826        $accountId = $GLOBALS['phpgw_info']['user']['account_id']; 
    19 ?>       
    20 <html> 
    21 <head> 
    22 <meta http-equiv="Content-Language" content="en" /> 
    23 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
    24 <LINK href="../phpgwapi/templates/<?=$GLOBALS['phpgw_info']['server']['template_set']?>/css/<?=$GLOBALS['phpgw_info']['server']['template_set']?>.css" type=text/css rel=StyleSheet> 
    25 <title>Minha Agenda Semanal</title> 
    26 </head> 
    27 <body style="background-color:white !important"> 
    28 <?echo lang("User").": ".$GLOBALS['phpgw_info']['user']['firstname']?> <?=$GLOBALS['phpgw_info']['user']['lastname'];?> [<?=$GLOBALS['phpgw_info']['user']['account_lid']?>]<br> 
    29 Expresso Livre :: Agenda :: <a href="./login.php?cd=1"><?=lang("Logout")?></a> 
    30 <?       
     27 
    3128        $uicalendar = CreateObject("calendar.uicalendar"); 
    3229        $daysofWeek = array(lang('Sunday'), lang('Monday'),lang('Tuesday'),lang('Wednesday'),lang('Thursday'),lang('Friday'),lang('Saturday')); 
     
    5249        $daily = $uicalendar->bo->cached_events; 
    5350        $p = CreateObject('phpgwapi.Template', "../mobile/templates/".$GLOBALS['phpgw_info']['server']['template_set']); 
    54         $p->set_file(Array('view' => 'calendar.tpl'));   
     51        $p->set_file(Array('view' => 'calendar.tpl')); 
    5552        $data[] = array(); 
    5653        @ksort($daily); 
    57          
     54 
    5855        if($daily){ 
    59                 $p->set_block('view','view_event');      
     56                $p->set_block('view','view_event'); 
    6057                foreach($daily as $date => $day_params) { 
    6158                        $year  = (int)substr($date,0,4); 
     
    6461                        $day_of_week = $daysofWeek[$GLOBALS['phpgw']->datetime->day_of_week($year,$month,$day)]; 
    6562                        $p->set_var("header_date",$day_of_week." - ".$day."/".$month."/".$year); 
    66                         for($i = 0; $i < count($day_params);$i++)       {                                                                
     63                        for($i = 0; $i < count($day_params);$i++)       { 
    6764                                $vars = $uicalendar->bo->event2array($day_params[$i]); 
    6865                                $data  = array ( 
     
    7875                                                        "description_data"      => $vars['description']['data'] ? $vars['description']['data'] : "&nbsp;" 
    7976                                                        ); 
    80          
     77 
    8178                        $p->set_var($data); 
    8279                        $p->parse('views','view_event',True); 
    83                         }                        
     80                        } 
    8481                } 
    8582                $p->pfp('out','views'); 
    8683        } 
    8784        else { 
    88                 $p->set_block('view','no_event');        
     85                $p->set_block('view','no_event'); 
    8986                $syear  = date('Y',$tstart); 
    9087                $smonth = date('m',$tstart); 
     
    9592                $p->set_var("start_date",$sday."/".$smonth."/".$syear); 
    9693                $p->set_var("end_date", $eday."/".$emonth."/".$eyear); 
    97                 $p->pfp('out','no_event');               
    98         }        
     94                $p->pfp('out','no_event'); 
     95        } 
     96 
     97        // Utiliza o novo footer. 
     98        print_footer(); 
    9999?> 
    100 </body> 
    101 </html>   
  • trunk/mobile/index.php

    r273 r431  
    11<?php 
     2        //TODO: Aplicar o conceito de subapp (mobileapp) 
     3 
    24        $phpgw_info = array(); 
     5        $GLOBALS['sessionid'] = isset($_GET['sessionid']) ? $_GET['sessionid'] : @$_COOKIE['sessionid']; 
     6        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']):'')); 
     21                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                //} 
     27        } 
     28 
     29        if ($GLOBALS['phpgw_info']['server']['use_https'] > 0)  { 
     30                if ($_SERVER['HTTPS'] != 'on') { 
     31                        Header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
     32                        exit; 
     33                } 
     34        } 
     35 
     36        /* 
     37                This is the menuaction driver for the multi-layered design 
     38        */ 
     39        if(isset($_GET['menuaction'])) 
     40        { 
     41                list($mobileapp,$class,$method) = explode('.',@$_GET['menuaction']); 
     42                if(! $mobileapp || ! $class || ! $method) 
     43                { 
     44                        $invalid_data = True; 
     45                } 
     46        } 
     47        else 
     48        { 
     49        //$phpgw->log->message('W-BadmenuactionVariable, menuaction missing or corrupt: %1',$menuaction); 
     50        //$phpgw->log->commit(); 
     51                $mobileapp = 'home'; 
     52                $invalid_data = True; 
     53        } 
     54 
    355        $GLOBALS['phpgw_info']['flags'] = array( 
    4                 'disable_Template_class' => True, 
    5                 'login'                  => True, 
    6                 'currentapp'             => 'login', 
    7                 'noheader'               => True 
     56                'noheader'  => True, 
     57                'nonavbar'   => True, 
     58                'currentapp' => 'mobile', 
     59                'mobileapp'  => $mobileapp, 
    860        ); 
    961 
    10         include('../header.inc.php');    
    11         Header('Location: https://' . $_SERVER['HTTP_HOST'] .$_SERVER['SCRIPT_URL'].'login.php'); 
     62        include('../header.inc.php'); 
     63        include('./mobile_header.inc.php'); 
     64 
     65        if($mobileapp == 'home') 
     66        { 
     67                Header('Location: ' . $GLOBALS['phpgw']->link('/mobile/home.php')); 
     68        } 
     69 
     70        $GLOBALS[$class] = CreateObject(sprintf('%s.%s','mobile',$class)); 
     71        $public_functions = $GLOBALS[$class]->public_functions; 
     72        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                print_header(); 
     76                execmethod($_GET['menuaction']); 
     77                print_footer(); 
     78                unset($mobileapp); 
     79                unset($class); 
     80                unset($method); 
     81                unset($invalid_data); 
     82        } 
     83        else 
     84        { 
     85                if(!$mobileapp || !$class || !$method) 
     86                { 
     87                        if(@is_object($GLOBALS['phpgw']->log)) 
     88                        { 
     89                                $GLOBALS['phpgw']->log->message(array( 
     90                                        'text' => 'W-BadmenuactionVariable, menuaction missing or corrupt: %1', 
     91                                        'p1'   => $menuaction, 
     92                                        'line' => __LINE__, 
     93                                        'file' => __FILE__ 
     94                                )); 
     95                        } 
     96                } 
     97 
     98                if(!is_array($GLOBALS[$class]->public_functions) || ! $GLOBALS[$class]->public_functions[$method] && $method) 
     99                { 
     100                        if(@is_object($GLOBALS['phpgw']->log)) 
     101                        { 
     102                                $GLOBALS['phpgw']->log->message(array( 
     103                                        'text' => 'W-BadmenuactionVariable, attempted to access private method: %1', 
     104                                        'p1'   => $method, 
     105                                        'line' => __LINE__, 
     106                                        'file' => __FILE__ 
     107                                )); 
     108                        } 
     109                } 
     110                if(@is_object($GLOBALS['phpgw']->log)) 
     111                { 
     112                        $GLOBALS['phpgw']->log->commit(); 
     113                } 
     114                $GLOBALS['phpgw']->redirect_link('/mobile/home.php'); 
     115        } 
     116 
    12117?> 
  • trunk/mobile/login.php

    r273 r431  
    11<?php 
     2        //TODO: Trocar name="login" para name="user" no campo username 
    23        $phpgw_info = array(); 
    34        $submit = False; 
     
    1415        $GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] : @$_COOKIE['sessionid']; 
    1516        if(isset($GLOBALS['sessionid']) && $_GET['cd'] != 10 && $_GET['cd'] != 1) 
    16                 $GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw_info']['flags']['currentdir'].'/calendar.php'); 
     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'); 
    1720        if ($GLOBALS['phpgw_info']['server']['use_https'] > 0)  { 
    1821                if ($_SERVER['HTTPS'] != 'on') { 
     
    2326 
    2427        $GLOBALS['phpgw']->session = CreateObject('phpgwapi.sessions'); 
    25         $GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT.$GLOBALS['phpgw_info']['flags']['currentdir'].'/templates/'.$GLOBALS['phpgw_info']['login_template_set']; 
     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/'; 
    2630        $tmpl = CreateObject('phpgwapi.Template', $GLOBALS['phpgw_info']['server']['template_dir']); 
    2731        $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = $GLOBALS['phpgw_info']['login_template_set']; 
    2832        $tmpl->set_file(array('login_form' => 'login.tpl')); 
    2933        $tmpl->set_var('cd',check_logoutcode($_GET['cd'])); 
    30          
     34 
    3135        function check_logoutcode($code) { 
    3236                switch($code) { 
    3337                        case 1: 
    34                                 logout();                        
     38                                logout(); 
    3539                                return lang('You have been successfully logged out'); 
    36                                  
     40 
    3741                        case 2: 
    3842                                return lang('Sorry, your login has expired'); 
    39                                  
     43 
    4044                        case 4: 
    4145                                return lang('Cookies are required to login to this site.'); 
    42                                  
     46 
    4347                        case 5: 
    4448                                return '<font color="FF0000">' . lang('Bad login or password') . '</font>'; 
     
    4650                        case 6: 
    4751                                return '<font color="FF0000">' . lang('Your password has expired, and you do not have access to change it') . '</font>'; 
    48                                  
     52 
    4953                        case 98: 
    5054                                return '<font color="FF0000">' . lang('Account is expired') . '</font>'; 
    51                                  
     55 
    5256                        case 99: 
    5357                                return '<font color="FF0000">' . lang('Blocked, too many attempts') . '</font>'; 
    54                                  
     58 
    5559                        case 10: 
    5660                                $GLOBALS['phpgw']->session->phpgw_setcookie('sessionid'); 
     
    6165                                } 
    6266                                return '<font color="#FF0000">' . lang('Your session could not be verified.') . '</font>'; 
    63                                  
     67 
    6468                        default: 
    6569                                return '&nbsp;'; 
    6670                } 
    67         }        
     71        } 
    6872 
    6973        if($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER'])) { 
     
    8387                        $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link($GLOBALS['phpgw_info']['flags']['currentdir'].'/login.php','cd=5')); 
    8488                } 
    85                  
     89 
    8690                if(!$submit) 
    8791                        $login = $_POST['login']; 
    88          
     92 
    8993                $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create(strtolower($login),$passwd,$passwd_type,'u'); 
    9094 
     
    9397                } 
    9498                else{ 
    95                         $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] .$GLOBALS['phpgw_info']['flags']['currentdir'].'/calendar.php'); 
     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'); 
    96101                } 
    97102        } 
     
    103108                $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $lang; 
    104109        } 
    105          
    106         $tmpl->set_var('charset',$GLOBALS['phpgw']->translation->charset());     
     110 
     111        $tmpl->set_var('charset',$GLOBALS['phpgw']->translation->charset()); 
    107112        $tmpl->set_var('cookie',$last_loginid); 
    108113        $tmpl->set_var('lang_username',lang('username')); 
     
    113118        $tmpl->set_var('language_select',''); 
    114119        $tmpl->set_var($var); 
    115         $tmpl->set_block('login_form','language_select');        
     120        $tmpl->set_block('login_form','language_select'); 
    116121        $tmpl->pfp('loginout','login_form'); 
    117122 
     
    135140                        $GLOBALS['phpgw']->session->destroy($GLOBALS['sessionid'],$GLOBALS['kp3']); 
    136141                } 
    137         }        
     142        } 
    138143?> 
Note: See TracChangeset for help on using the changeset viewer.