- Timestamp:
- 09/05/11 19:10:51 (13 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/login.php
r5042 r5043 54 54 55 55 //detect if the user has a compatible browser, if don't have send him to expresso mini 56 $ifMobile = false;56 $ifMobile = true; 57 57 $browser = CreateObject('phpgwapi.browser'); 58 58 switch ( $browser->get_platform() ) -
trunk/mobile/inc/class.mobiletemplate.inc.php
r4277 r5043 19 19 if( $template == "mini_desktop" ) 20 20 { 21 $url_expresso = $this->getUrlExpresso() . "index.php"; 22 21 23 $this->template->set_file(array('home_t' => 'pc_template.tpl')); 22 24 $this->template->set_file(array('home_t_search_bar' => 'search_bar.tpl')); 23 25 $this->template->set_block('home_t_search_bar','search_bar'); 24 26 $this->template->set_var('search',$this->template->fp('out','search_bar')); 27 $this->template->set_var('url_expresso',$url_expresso); 25 28 $this->template->set_var('lang_mini_mobile', lang('mini mobile')); 26 29 $this->template->set_var('lang_search_error_message',lang("need choose one option")); … … 133 136 134 137 $this->template->set_var('global_title', lang('expresso mini')); 135 // button logout 136 if( isset($_COOKIE['lem']) && isset($_COOKIE['pem']) ) 137 { 138 $this->template->set_var('style_1','padding-left:65%;'); 139 $this->template->set_var('style_2','position:relative; float: right; display: none'); 140 } 141 else 142 { 143 $this->template->set_var('style_1','position:absolute; float: left;'); 144 $this->template->set_var('style_2','position:relative; float: right; display: block'); 145 } 146 147 if( isset($_SESSION['mobile']['displayIOS']) && $_SESSION['mobile']['displayIOS'] == "true" ) 148 $this->template->set_var('display_IOS', "none"); 149 else 150 $this->template->set_var('display_IOS', "block"); 151 138 $this->template->set_var('style_1','position:absolute; float: left;'); 139 $this->template->set_var('style_2','position:relative; float: right; display: block'); 152 140 $this->template->set_var('lang_tips', lang('Tips')); 153 141 $this->template->set_var('lang_logout', lang('logout')); 154 142 $this->template->set_var('lang_search', lang('search')); 155 143 156 $this->template->set_var('href_logout', 'login.php?cd=1'); 144 if( isset($_SESSION['mobile']['displayIOS']) && $_SESSION['mobile']['displayIOS'] == "true" ) 145 { 146 $this->template->set_var('display_IOS', "none"); 147 } 148 else 149 { 150 $this->template->set_var('display_IOS', "block"); 151 } 152 153 if( isset($_COOKIE['lem']) && isset($_COOKIE['pem']) ) 154 { 155 $this->template->set_var('href_logout', 'login.php?cd=logout_mobile'); 156 } 157 else 158 { 159 $this->template->set_var('href_logout', 'login.php?cd=1'); 160 } 157 161 } 158 162 … … 249 253 return $url; 250 254 } 255 256 private function getUrlExpresso() 257 { 258 $url_expresso = $GLOBALS['phpgw_info']['server']['webserver_url']; 259 $url_expresso = ( !empty($url_expresso) ) ? $url_expresso : '/'; 260 261 if(strrpos($url_expresso,'/') === false || strrpos($url_expresso,'/') != (strlen($url_expresso)-1)) 262 { 263 $url_expresso .= '/'; 264 } 265 266 return $url_expresso; 267 } 251 268 252 269 function get_back_link(){ -
trunk/mobile/inc/class.ui_mobilecc.inc.php
r5037 r5043 22 22 'contact_add_edit' => true, 23 23 'contact_add' => true, 24 'contact_edit' => true 24 'contact_edit' => true, 25 'getPhoto' => true 25 26 ); 26 27 var $template; … … 41 42 $this->set_page_info_to_default(); 42 43 } 43 44 //if()45 46 44 } 47 45 … … 163 161 //Combo de catálogos 164 162 $catalogs = $this->bo->get_all_catalogs(); 165 foreach($catalogs as $catalog) { 163 164 foreach($catalogs as $catalog) 165 { 166 166 $this->template->set_var("catalog_value",$catalog["catalog"]); 167 167 $this->template->set_var("catalog_name",$catalog["label"]); 168 if($this->page_info['actual_catalog']==$catalog['catalog']) 168 169 if( $this->page_info['actual_catalog'] == $catalog['catalog'] ) 169 170 $this->template->set_var("selected","selected"); 170 171 else 171 172 $this->template->set_var("selected"," "); 173 172 174 $this->template->fp("catalogs","catalog_row",true); 173 175 } 174 $this->bo->set_catalog($this->page_info["actual_catalog"]); 175 $contacts = $this->bo->search($this->page_info["actual_letter"]."%", 176 $this->page_info["actual_max_contacts"]); 177 178 176 177 $catalog = ( isset($params['catalog']) ) ? $params['catalog'] : $this->page_info['actual_catalog']; 178 179 if( strpos( $catalog, "bo_global_ldap_catalog") !== false ) 180 { 181 $dn = $GLOBALS['phpgw_info']['user']['account_dn']; 182 $dn = substr( $dn, strpos($dn, "ou=" ) ); 183 $exploded = explode("#", $catalog ); 184 $catalog = 'bo_people_catalog'; 185 186 if( count($exploded) > 2 ) 187 { 188 $exploded[2] = $dn; 189 $actual_catalog = implode("#", $exploded); 190 $catalog = $actual_catalog; 191 } 192 } 193 194 $this->bo->set_catalog($catalog); 195 $contacts = $this->bo->search($this->page_info["actual_letter"]."%", $this->page_info["actual_max_contacts"]); 196 179 197 //Letras da paginação 180 198 $max_letters = 5; … … 402 420 $email_to = ""; 403 421 404 switch ($params['catalog']){ 422 switch ($params['catalog']) 423 { 405 424 406 425 case 'bo_shared_people_manager'; 407 426 case 'bo_people_catalog': 408 427 409 $this->template->set_var('lang_contact_title',lang("context contact")); 410 $this->bo->set_catalog($params['catalog']); 411 412 $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)); 413 414 asort($result['connections']); 415 416 $this->template->set_var('photo', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_photo&id='.$params['id']); 417 $this->template->set_var('id',$params['id']); 418 $this->template->set_var('catalog',$params['catalog']); 419 420 $this->template->set_var('cc_name',$result['names_ordered']); 421 $this->template->set_var('lang_title_alias',lang("Alias")); 422 $this->template->set_var('lang_alias',$result['alias']); 428 $this->template->set_var('lang_contact_title',lang("context contact")); 429 $this->bo->set_catalog($params['catalog']); 430 431 $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)); 432 433 asort($result['connections']); 434 435 $this->template->set_var('photo', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_photo&id='.$params['id']); 436 $this->template->set_var('id',$params['id']); 437 $this->template->set_var('catalog',$params['catalog']); 438 439 $this->template->set_var('cc_name',$result['names_ordered']); 440 $this->template->set_var('lang_title_alias',lang("Alias")); 441 $this->template->set_var('lang_alias',$result['alias']); 442 443 $this->template->set_var('lang_title_name',lang("Name")); 444 $this->template->set_var('lang_name',$result['given_names']); 445 446 $this->template->set_var('lang_title_lastname',lang("Family Names")); 447 $this->template->set_var('lang_lastname',$result['family_names']); 448 449 $var_phone = ""; 450 $var_email = ""; 451 foreach($result['connections'] as $conn): 452 if ( $conn['id_type'] == 1 ){ 453 if ( !empty($var_email) ) 454 $var_email .= ' | '; 455 $var_email .= $conn['connection_value']; 456 457 if ( empty($email_to) ) 458 $email_to = $var_email; 459 460 }else if ($conn['id_type'] == 2){ 461 if ( !empty($var_phone)) 462 $var_phone .= ' | '; 463 $var_phone .= $conn['connection_value']; 464 } 465 466 if (($conn['id_type'] == null) || ($conn['id_type'] == '_NONE_')){ 467 if ( $conn['type'] == 'email' ){ 468 if ( !empty($var_email) ) 469 $var_email .= ' | '; 470 $var_email .= $conn['connection_value']; 423 471 424 $this->template->set_var('lang_title_name',lang("Name"));425 $this->template->set_var('lang_name',$result['given_names']);472 if ( empty($email_to) ) 473 $email_to = $var_email; 426 474 427 $this->template->set_var('lang_title_lastname',lang("Family Names")); 428 $this->template->set_var('lang_lastname',$result['family_names']); 429 430 $var_phone = ""; 431 $var_email = ""; 432 foreach($result['connections'] as $conn): 433 if ( $conn['id_type'] == 1 ){ 434 if ( !empty($var_email) ) 435 $var_email .= ' | '; 436 $var_email .= $conn['connection_value']; 437 438 if ( empty($email_to) ) 439 $email_to = $var_email; 440 441 }else if ($conn['id_type'] == 2){ 442 if ( !empty($var_phone)) 443 $var_phone .= ' | '; 444 $var_phone .= $conn['connection_value']; 445 } 446 447 if (($conn['id_type'] == null) || ($conn['id_type'] == '_NONE_')){ 448 if ( $conn['type'] == 'email' ){ 449 if ( !empty($var_email) ) 450 $var_email .= ' | '; 451 $var_email .= $conn['connection_value']; 452 453 if ( empty($email_to) ) 454 $email_to = $var_email; 455 456 }else if ($conn['type'] == 'phone'){ 457 if ( !empty($var_phone)) 458 $var_phone .= ' | '; 459 $var_phone .= $conn['connection_value']; 460 } 461 } 462 endforeach; 463 464 $this->template->set_var('lang_title_email',lang("Email")); 465 $this->template->set_var('lang_email',$var_email); 466 467 $this->template->set_var('lang_title_phone',lang("Phone")); 468 $this->template->set_var('lang_phone',$var_phone); 469 470 $this->template->set_var('lang_edit',lang("edit")); 471 472 $this->template->parse("row_body","people"); 473 474 if ($params['catalog'] == 'bo_people_catalog') 475 $this->template->parse("buttom_editar","buttom"); 476 477 break; 475 }else if ($conn['type'] == 'phone'){ 476 if ( !empty($var_phone)) 477 $var_phone .= ' | '; 478 $var_phone .= $conn['connection_value']; 479 } 480 } 481 endforeach; 482 483 $this->template->set_var('lang_title_email',lang("Email")); 484 $this->template->set_var('lang_email',$var_email); 485 486 $this->template->set_var('lang_title_phone',lang("Phone")); 487 $this->template->set_var('lang_phone',$var_phone); 488 489 $this->template->set_var('lang_edit',lang("edit")); 490 491 $this->template->parse("row_body","people"); 492 493 if ($params['catalog'] == 'bo_people_catalog') 494 $this->template->parse("buttom_editar","buttom"); 495 496 break; 478 497 479 498 case 'bo_group_manager': 480 $this->template->set_var('lang_contact_title',lang("context group")); 481 $this->bo->set_catalog($params['catalog']); 482 $result = $this->bo->bo->get_single_entry($params['id'], array("id_group"=>true,"title"=>true,"short_name"=>true)); 483 $data = $this->bo->bo->get_contacts_by_group($params['id']); 484 485 $email_to = '<'.$result['short_name'].'>'; 486 487 $this->template->set_var('title_view_contact', $result['title']); 488 $this->template->set_var('email_to', $email_to); 489 490 $this->template->set_var('lang_title_name',lang("Name")); 491 $this->template->set_var('lang_title_email',lang("Email")); 492 493 foreach($data as $dados){ 494 $this->template->set_var('lang_name', $dados['names_ordered']); 495 $this->template->set_var('lang_email', $dados['connection_value']); 496 $this->template->set_var('bg',$bg=="bg-azul"?$bg="bg-branco":$bg="bg-azul"); 499 500 $this->template->set_var('lang_contact_title',lang("context group")); 501 $this->bo->set_catalog($params['catalog']); 502 $result = $this->bo->bo->get_single_entry($params['id'], array("id_group"=>true,"title"=>true,"short_name"=>true)); 503 $data = $this->bo->bo->get_contacts_by_group($params['id']); 504 505 $email_to = '<'.$result['short_name'].'>'; 506 507 $this->template->set_var('title_view_contact', $result['title']); 508 $this->template->set_var('email_to', $email_to); 509 510 $this->template->set_var('lang_title_name',lang("Name")); 511 $this->template->set_var('lang_title_email',lang("Email")); 512 513 foreach($data as $dados){ 514 $this->template->set_var('lang_name', $dados['names_ordered']); 515 $this->template->set_var('lang_email', $dados['connection_value']); 516 $this->template->set_var('bg',$bg=="bg-azul"?$bg="bg-branco":$bg="bg-azul"); 517 518 $this->template->set_var('href_details',"ui_mobilecc.contact_view&id=".$dados['id_contact']."&catalog=bo_people_catalog"); 519 520 $this->template->fp('group_rows','group_row',True); 521 } 522 523 $this->template->set_var('email_to', $email_to); 524 $this->template->parse("buttom_use","buttom_use_contact"); 525 526 $this->template->parse("row_body","group"); 527 528 break; 529 530 default: 531 if( strpos($params['catalog'],'bo_global_ldap_catalog#') === false ) 532 { 533 header('Location: ../mobile/index.php?menuaction=mobile.ui_mobilecc.init_cc'); 534 } 535 else 536 { 537 $this->bo->set_catalog($params['catalog']); 538 $fields = $this->bo->bo->get_fields(true); 539 $result = $this->bo->bo->get_single_entry($params['id'], $fields); 540 541 // SessionStart 542 session_start(); 543 $_SESSION['phpgw_info']['mobile']['photoCatalog'][$params['id']] = $result['photo']; 544 session_write_close(); 545 546 $this->template->set_var('photo', '../index.php?menuaction=mobile.ui_mobilecc.getPhoto&id=' . $params["id"]); 547 548 $this->template->set_var('cc_name',$result['names_ordered'][0]); 549 550 $this->template->set_var('lang_title_name',lang("Name")); 551 $this->template->set_var('lang_name',$result['given_names'][0]); 552 553 $this->template->set_var('lang_title_lastname',lang("Family Names")); 554 $this->template->set_var('lang_lastname',$result['family_names'][0]); 555 556 $var_phone = ""; 557 $var_email = ""; 558 foreach($result['connections'] as $conn) 559 { 560 if ( $conn['id_type'] == 1 ) 561 { 562 if ( !empty($var_email) ) 563 $var_email .= ' | '; 564 565 $var_email .= $conn['connection_value']; 566 567 if ( empty($email_to) ) 568 $email_to = $var_email; 569 } 570 else if ($conn['id_type'] == 2) 571 { 572 if ( !empty($var_phone)) 573 $var_phone .= ' | '; 574 575 $var_phone .= $conn['connection_value']; 576 } 577 578 if (($conn['id_type'] == null) || ($conn['id_type'] == '_NONE_')) 579 { 580 if ( $conn['type'] == 'email' ) 581 { 582 if ( !empty($var_email) ) 583 $var_email .= ' | '; 497 584 498 $this->template->set_var('href_details',"ui_mobilecc.contact_view&id=".$dados['id_contact']."&catalog=bo_people_catalog"); 585 $var_email .= $conn['connection_value']; 586 587 if ( empty($email_to) ) 588 $email_to = $var_email; 589 } 590 else if ($conn['type'] == 'phone') 591 { 592 if ( !empty($var_phone) ) 593 $var_phone .= ' | '; 499 594 500 $ this->template->fp('group_rows','group_row',True);595 $var_phone .= $conn['connection_value']; 501 596 } 502 503 $this->template->set_var('email_to', $email_to); 504 $this->template->parse("buttom_use","buttom_use_contact"); 505 506 $this->template->parse("row_body","group"); 507 break; 508 509 default: 510 511 if(strpos($params['catalog'],'bo_global_ldap_catalog')==false){ 512 513 $this->bo->set_catalog($params['catalog']); 514 515 $fields = $this->bo->bo->get_fields(true); 516 $result = $this->bo->bo->get_single_entry($params['id'], $fields); 517 518 $this->template->set_var('photo', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_photo&id='.$params["id"]); 519 520 $this->template->set_var('cc_name',$result['names_ordered'][0]); 521 522 $this->template->set_var('lang_title_name',lang("Name")); 523 $this->template->set_var('lang_name',$result['given_names'][0]); 524 525 $this->template->set_var('lang_title_lastname',lang("Family Names")); 526 $this->template->set_var('lang_lastname',$result['family_names'][0]); 527 528 $var_phone = ""; 529 $var_email = ""; 530 foreach($result['connections'] as $conn): 531 if ( $conn['id_type'] == 1 ){ 532 if ( !empty($var_email) ) 533 $var_email .= ' | '; 534 $var_email .= $conn['connection_value']; 535 536 if ( empty($email_to) ) 537 $email_to = $var_email; 538 539 }else if ($conn['id_type'] == 2){ 540 if ( !empty($var_phone)) 541 $var_phone .= ' | '; 542 $var_phone .= $conn['connection_value']; 543 } 544 545 if (($conn['id_type'] == null) || ($conn['id_type'] == '_NONE_')){ 546 if ( $conn['type'] == 'email' ){ 547 if ( !empty($var_email) ) 548 $var_email .= ' | '; 549 $var_email .= $conn['connection_value']; 597 } 598 } 550 599 551 if ( empty($email_to) ) 552 $email_to = $var_email; 553 554 }else if ($conn['type'] == 'phone'){ 555 if ( !empty($var_phone)) 556 $var_phone .= ' | '; 557 $var_phone .= $conn['connection_value']; 558 } 559 } 560 endforeach; 561 562 $this->template->set_var('email_to', $email_to); 563 564 $this->template->set_var('lang_title_email',lang("Email")); 565 $this->template->set_var('lang_email',$var_email); 566 567 $this->template->set_var('lang_title_phone',lang("Phone")); 568 $this->template->set_var('lang_phone',$var_phone); 569 570 $this->template->parse("row_body","people_ldap"); 571 572 }else{ 573 header('Location: ../mobile/index.php?menuaction=mobile.ui_mobilecc.init_cc'); 574 } 575 576 break; 577 } 578 579 if ( !empty($email_to)){ 600 $this->template->set_var('email_to', $email_to); 601 602 $this->template->set_var('lang_title_email',lang("Email")); 603 $this->template->set_var('lang_email',$var_email); 604 605 $this->template->set_var('lang_title_phone',lang("Phone")); 606 $this->template->set_var('lang_phone',$var_phone); 607 608 $this->template->parse("row_body","people_ldap"); 609 610 } 611 612 break; 613 } 614 615 if ( !empty($email_to)) 616 { 580 617 $this->template->set_var('email_to', $email_to); 581 618 $this->template->parse("buttom_use","buttom_use_contact"); 582 619 $this->template->parse("row_operacao","row_view_operacao"); 583 }else if ($params['catalog'] == 'bo_people_catalog'){ 620 } 621 else if ($params['catalog'] == 'bo_people_catalog') 622 { 584 623 $this->template->parse("row_operacao","row_view_operacao"); 585 624 } 586 625 626 $linkBack = explode("&", $GLOBALS['phpgw_info']['mobiletemplate']->get_back_link() ); 627 $link = $linkBack[0]."&catalog=".$params['catalog']."&".$linkBack[2]; 628 587 629 $this->template->set_var('lang_back',lang("back")); 588 $this->template->set_var('href_back',$GLOBALS['phpgw_info']['mobiletemplate']->get_back_link()); 630 631 $this->template->set_var('href_back',$link); 632 589 633 $this->template->set_var('lang_use_contact',lang("use contact")); 590 634 $this->template->set_var('lang_selecteds',lang("selecteds")); 591 635 592 636 $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out','body')); 637 } 638 639 function getPhoto() 640 { 641 $id = $_GET['id']; 642 643 session_start(); 644 645 if( isset( $_SESSION['phpgw_info']['mobile']['photoCatalog'][$id] ) ) 646 { 647 $photo = imagecreatefromstring($_SESSION['phpgw_info']['mobile']['photoCatalog'][$id]); 648 649 header("Content-Type: image/jpeg"); 650 $width = imagesx($photo); 651 $height = imagesy($photo); 652 $twidth = 70; 653 $theight = 90; 654 $small_photo = imagecreatetruecolor ($twidth, $theight); 655 imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height); 656 imagejpeg($small_photo,'',100); 657 658 unset( $_SESSION['phpgw_info']['mobile']['photoCatalog'][$id] ); 659 } 660 else 661 { 662 header('Content-type: image/png'); 663 echo file_get_contents(PHPGW_INCLUDE_ROOT.'/contactcenter/templates/default/images/photo_celepar.png'); 664 } 665 666 session_write_close(); 667 668 return; 593 669 } 594 670 -
trunk/mobile/inc/class.ui_mobilemail.inc.php
r5037 r5043 487 487 function print_mails_list($messages,$print_checkbox=false) 488 488 { 489 489 $functions = $this->common; 490 490 $p = $this->template; 491 491 $p->set_file( array( 'mobilemail_t' => 'mails_list.tpl' ) ); … … 522 522 $flag="email-lido "; 523 523 524 if( $message["Flagged"]==="F")524 if( $message["Flagged"]==="F" ) 525 525 $flag.="email-importante"; 526 526 … … 784 784 $params["type"] = $params['mobile_add_contact']['type']; 785 785 } 786 else if($params['type']=="forward"){ 786 else if($params['type']=="forward") 787 { 787 788 $this->template->set_var('from', $msg['toaddress2']); 788 789 789 $this->template->set_var('subject', "Enc:" . $msg['subject']); 790 $this->template->set_var('body_value', strip_tags($msg['body'])); // Usa a função strip_tags() para filtrar 790 791 $_name = ( isset($msg['from']['name']) ) ? $msg['from']['name'] : ""; 792 $_email = ( isset($msg['from']['email']) ) ? " ".$msg['from']['email']." " : ""; 793 $forward_msg = "\n" . lang('At %1, %2 hours, %3 wrote:', $msg['msg_day'], $msg['msg_hour'],"\"".$_name."\"".$_email ); 794 795 // Usa a função strip_tags() para filtrar 791 796 // as tags que estão presentes no corpo do e-mail. 797 $this->template->set_var('body_value', "\n\n\n" . $forward_msg . "\n" . strip_tags($msg['body']) ); 792 798 793 799 $this->template->set_var('msg_number', $_GET['msg_number']); … … 819 825 $this->template->set_var('msg_folder', $_GET['msg_folder']); 820 826 } 821 else if($params['type']=="reply"){ 827 else if($params['type']=="reply") 828 { 822 829 $this->template->set_var('from', $msg['toaddress2']); 823 830 $this->template->set_var('input_to', $msg['from']['email']); 824 825 831 $this->template->set_var('subject', "Re:" . $msg['subject']); 826 827 832 $this->template->set_var('msg_number', $_GET['msg_number']); 828 833 $this->template->set_var('msg_folder', $_GET['msg_folder']); 829 } else { 834 } 835 else 836 { 830 837 $this->template->set_var('input_to', ""); 831 838 $this->template->set_var('input_cc', ""); … … 834 841 } 835 842 836 837 843 if($params['type']=="reply" || $params['type']=="forward" || $params['type']=="reply_all" ) 844 $this->template->set_var("show_check_add_history","block"); 838 845 839 846 //tem que ser realizado no final, pois o tipo user_add é modificado para o tipo que o originou -
trunk/mobile/login.php
r5037 r5043 16 16 include_once('./mobile_header.inc.php'); 17 17 $GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] : @$_COOKIE['sessionid']; 18 19 if(isset($GLOBALS['sessionid']) && $_GET['cd'] != 10 && $_GET['cd'] != 1) 20 start_prefered_app(); 18 19 function check_logoutcode($code) 20 { 21 $_return = ''; 21 22 23 switch($code) 24 { 25 case 'logout_mobile': 26 case 1: 27 logout(); 28 $_return = lang('You have been successfully logged out'); 29 break; 30 case 2: 31 $_return = lang('Sorry, your login has expired'); 32 break; 33 case 4: 34 $_return = lang('Cookies are required to login to this site.'); 35 break; 36 case 5: 37 $_return = lang('Bad login or password'); 38 break; 39 case 6: 40 $_return = lang('Your password has expired, and you do not have access to change it'); 41 break; 42 case 98: 43 $_return = lang('Account is expired'); 44 break; 45 case 99: 46 $_return = lang('Blocked, too many attempts'); 47 break; 48 case 10: 49 $GLOBALS['phpgw']->session->phpgw_setcookie('sessionid'); 50 $GLOBALS['phpgw']->session->phpgw_setcookie('kp3'); 51 $GLOBALS['phpgw']->session->phpgw_setcookie('domain'); 52 if($GLOBALS['phpgw_info']['server']['sessions_type'] == 'php4') 53 { 54 $GLOBALS['phpgw']->session->phpgw_setcookie(PHPGW_PHPSESSID); 55 } 56 $_return = lang('Your session could not be verified.'); 57 break; 58 } 59 60 return $_return; 61 } 62 22 63 if ( $GLOBALS['phpgw_info']['server']['use_https'] > 0 ) 23 64 { … … 35 76 $tmpl = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/mobile/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 36 77 $GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = $GLOBALS['phpgw_info']['login_template_set']; 78 79 //URL Expresso 80 $url_expresso = $GLOBALS['phpgw_info']['server']['webserver_url']; 81 $url_expresso = ( !empty($url_expresso) ) ? $url_expresso : '/'; 82 83 if(strrpos($url_expresso,'/') === false || strrpos($url_expresso,'/') != (strlen($url_expresso)-1)) 84 { 85 $url_expresso .= '/'; 86 } 87 37 88 $tmpl->set_file(array('login_form' => 'login.tpl')); 38 89 $tmpl->set_block('login_form','page'); 39 90 $tmpl->set_block('login_form','success_message'); 40 91 $tmpl->set_block('login_form','error_message'); 92 $tmpl->set_var('url_expresso', $url_expresso); 93 $tmpl->set_var('lang_username', lang('username')); 94 $tmpl->set_var('lang_password', lang('password')); 95 $tmpl->set_var('lang_login', lang('login')); 41 96 42 97 //verificando a mensagem erro ou sucesso … … 44 99 $tmpl->set_var('message', $cd); 45 100 46 if(trim($cd) != "") 101 if( trim($cd) != "" ) 102 { 47 103 $tmpl->parse('message_box', (($_GET['cd'] == 1) ? 'success_message' : 'error_message') ,true); 48 //detect if the user has a mobile browser 49 50 $browser = CreateObject('phpgwapi.browser'); 104 } 105 106 //detect if the user has a mobile browser 107 $browser = CreateObject('phpgwapi.browser'); 108 $platform = false; 51 109 52 110 switch ($browser->get_platform()) … … 58 116 case browser::PLATFORM_NOKIA: 59 117 case browser::PLATFORM_ANDROID: 60 $ tmpl->set_var('os_browser',$browser->get_platform());118 $platform = $browser->get_platform(); 61 119 break; 62 default: 63 $tmpl->set_var('os_browser',false); 64 //$tmpl->set_var('os_browser',$browser->get_platform()); 65 break; 66 } 67 68 function check_logoutcode($code) { 69 switch($code) { 70 case 1: 71 logout(); 72 return lang('You have been successfully logged out'); 73 74 case 2: 75 return lang('Sorry, your login has expired'); 76 77 case 4: 78 return lang('Cookies are required to login to this site.'); 79 80 case 5: 81 return lang('Bad login or password'); 82 case 6: 83 return lang('Your password has expired, and you do not have access to change it'); 84 case 98: 85 return lang('Account is expired'); 86 case 99: 87 return lang('Blocked, too many attempts'); 88 case 10: 89 $GLOBALS['phpgw']->session->phpgw_setcookie('sessionid'); 90 $GLOBALS['phpgw']->session->phpgw_setcookie('kp3'); 91 $GLOBALS['phpgw']->session->phpgw_setcookie('domain'); 92 if($GLOBALS['phpgw_info']['server']['sessions_type'] == 'php4') { 93 $GLOBALS['phpgw']->session->phpgw_setcookie(PHPGW_PHPSESSID); 94 } 95 return lang('Your session could not be verified.'); 96 default: 97 return ''; 98 } 99 } 100 101 if($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER'])) { 120 } 121 122 $tmpl->set_var('os_browser',$platform ); 123 124 // Automatic login from browser cookies 125 if( get_var('lem',array('GET','COOKIE')) && get_var('pem',array('GET','COOKIE')) ) 126 { 102 127 $submit = True; 103 $login = $_SERVER['PHP_AUTH_USER'];104 $passwd = $_SERVER['PHP_AUTH_PW'];128 $login = base64_decode(get_var('lem',array('GET','COOKIE'))); 129 $passwd = base64_decode(get_var('pem',array('GET','COOKIE'))); 105 130 $passwd_type = 'text'; 106 } 107 // Automatic login from browser cookies 108 elseif(get_var('lem',array('GET','COOKIE')) && get_var('pem',array('GET','COOKIE'))) 109 { 110 if(!$_GET['cd'] || $_GET['cd'] == '1' || $_GET['cd'] == '10') { 131 132 if( $_GET['cd'] == 66 ) 133 { 134 unset( $_GET['cd'] ); 135 } 136 } 137 else 138 { 139 if($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER'])) 140 { 111 141 $submit = True; 112 $login = base64_decode(get_var('lem',array('GET','COOKIE')));113 $passwd = base64_decode(get_var('pem',array('GET','COOKIE')));142 $login = $_SERVER['PHP_AUTH_USER']; 143 $passwd = $_SERVER['PHP_AUTH_PW']; 114 144 $passwd_type = 'text'; 115 145 } 116 else { 117 $GLOBALS['phpgw']->session->phpgw_setcookie('lem'); 118 $GLOBALS['phpgw']->session->phpgw_setcookie('pem'); 119 } 120 } 121 else 122 { 123 $passwd = $_POST['passwd']; 124 $passwd_type = $_POST['passwd_type']; 146 else 147 { 148 $passwd = $_POST['passwd']; 149 $passwd_type = $_POST['passwd_type']; 150 } 125 151 } 126 152 … … 183 209 $tmpl->set_var('charset',$GLOBALS['phpgw']->translation->charset()); 184 210 $tmpl->set_var('cookie',$last_loginid); 185 $tmpl->set_var('lang_username', lang('username'));186 $tmpl->set_var('lang_password', lang('password'));187 $tmpl->set_var('lang_login', lang('login'));188 211 $tmpl->set_var('lang_notices', lang('notices')); 189 212 $tmpl->set_var('website_title', $GLOBALS['phpgw_info']['server']['site_title']); -
trunk/mobile/setup/setup.inc.php
r4306 r5043 14 14 $setup_info['mobile']['name'] = 'mobile'; 15 15 $setup_info['mobile']['title'] = 'Expresso Mini'; 16 $setup_info['mobile']['version'] = '2.2. 2';16 $setup_info['mobile']['version'] = '2.2.6'; 17 17 $setup_info['mobile']['app_order'] = 4; 18 18 $setup_info['mobile']['enable'] = 2; -
trunk/mobile/templates/css/mobile.css
r4359 r5043 125 125 .rodape{ padding-top:4px; height:16px; text-align:center; font-size:50%; background-color:#F6F6F6; color:#333333;} 126 126 .btn-generico{color:#FFFFFF; background-color:#434343; border:none; } 127 .contagem { float:right; position: relative; margin-rigth: 5px; color:#3E3E3D; } 127 .contagem { float:right; position: relative; margin-rigth: 5px; color:#3E3E3D; } 128 128 .nome-item{float:left; position:aboslute; font-size:11pt; color:#3E3E3D;} 129 129 .nome-item strong, .nome-item span{ margin-left:25px} -
trunk/mobile/templates/default/home_index.tpl
r4359 r5043 42 42 {default_folders_box} 43 43 <dd> 44 <a href="javascript:expand_folders()" class="email-item" style="font-size:12pt;">45 <div class="limpar_div resultado-titulo">46 <label width="100%">47 <input type="checkbox" name="personal_folders" value='1' id="search_personal_folders"/>48 49 </label> 50 </div>51 </a>44 <div class="limpar_div resultado-titulo"> 45 <input type="checkbox" name="personal_folders" value='1' id="search_personal_folders"/> 46 <label> 47 <a href="javascript:expand_folders()" class="email-item" style="font-size:12pt;"> 48 {lang_my_folders} 49 </a> 50 </label> 51 </div> 52 52 </dd> 53 53 <span id="personal_folder_box" style="display: none;"> 54 54 {personal_folders_box} 55 55 </span> 56 <dd> 57 < a href="index.php?menuaction=mobile.ui_mobilecalendar.index" class="email-item" style="font-size:12pt;">58 <div class="limpar_div resultado-titulo"> 59 <label> 60 <input type="checkbox" name="calendar_search" value='1' id="search_calendar_search">56 <dd> 57 <div class="limpar_div resultado-titulo"> 58 <label> 59 <input type="checkbox" name="calendar_search" value='1' id="search_calendar_search"> 60 <a href="index.php?menuaction=mobile.ui_mobilecalendar.index" class="email-item" style="font-size:12pt;"> 61 61 {lang_my_commitments} 62 </ label>63 </div> 64 </a> 62 </a> 63 </label> 64 </div> 65 65 </dd> 66 66 {commitments_box} 67 <dd> 68 <a href="index.php?menuaction=mobile.ui_mobilecc.init_cc" class="email-item" style="font-size:12pt;"> 69 <div class="limpar_div resultado-titulo">70 <label>71 <input type="checkbox" name="contacts_search" value='1' id="search_contacts_search"> 72 {lang_my_contacts}73 </label>74 </div>75 </a>67 <dd> 68 <div class="limpar_div resultado-titulo"> 69 <label> 70 <input type="checkbox" name="contacts_search" value='1' id="search_contacts_search"> 71 <a href="index.php?menuaction=mobile.ui_mobilecc.init_cc" class="email-item" style="font-size:12pt;"> 72 {lang_my_contacts} 73 </a> 74 </label> 75 </div> 76 76 </dd> 77 77 </dl> … … 81 81 <!-- END page --> 82 82 <!-- BEGIN folder_block --> 83 <a href="index.php?menuaction=mobile.ui_mobilemail.change_folder&folder={folder_id}"> 84 83 <a href="index.php?menuaction=mobile.ui_mobilemail.change_folder&folder={folder_id}"> 84 <dd class="{folder_class}" style="clear:both"> 85 85 <div class="nome-item"><span>{folder_name}</span></div> 86 86 <div class="contagem">[{folder_unseen}/{folder_total_msg}]</div> -
trunk/mobile/templates/default/login.tpl
r5037 r5043 22 22 document.getElementById("max_resolution").value = ((screen.width >= screen.height) ? screen.width : screen.height); 23 23 24 verifyBrowser( form );25 26 24 return true; 27 25 } 28 26 29 function verifyBrowser(form)27 function messageHidden(Element) 30 28 { 31 if('{os_browser}' != false){ 32 if(window.confirm("Você está acessando de um {os_browser}. Deseja salvar usuário e senha neste dispositivo?")) { 33 form.save_login.value = 'yes'; 34 } 35 } 29 var _div = document.getElementById(Element); 30 31 setTimeout(function() 32 { 33 _div.style.display = "none"; 34 35 }, 10000 ); 36 36 } 37 37 38 38 </script> 39 39 </head> 40 41 <body> 42 <div class="topo"> 43 <h1>{website_title} - {lang_login}</h1> 40 <body style="background:url(templates/default/images/back_pagina.jpg) repeat-x #fff;"> 41 <div id="divSuperior"> 42 <div style="height: 20px; font-size:small;"> 43 {message_box} 44 </div> 45 <div > 46 <form name="form_login" method="post" action="./login.php" id="login_form" autocomplete=off onSubmit="return validate_login(this);"> 47 <input type="hidden" name="max_resolution" id="max_resolution" value=""> 48 <input type="hidden" name="passwd_type" value="text"> 49 <input type="hidden" name="account type" value="u"> 50 <!-- input type="hidden" name="save_login" value="no" --> 51 <label>{lang_username}:</label><br/> 52 <input id="login" name="login"/><br/> 53 <label>{lang_password}:</label><br/> 54 <input id="passwd" name="passwd" type="password" autocomplete=off/><br/> 55 <input type="checkbox" name="save_login"/> 56 <label style="color:#909090;">Mantenha-me conectado</label> 57 <div style="margin-top:20px;"> 58 <button id="formButton" name="submitit" style="margin-top:5px" type="submit">{lang_login}</button> 59 </div> 60 </form> 61 </div> 62 <div class="rodape" style="float:left; margin-top: 10px;"> 63 <a href="{url_expresso}login.php?dont_redirect_if_moble=1">Versão Clássica</a> 64 </div> 44 65 </div> 45 46 {message_box} 66 67 <div id="divInferior"> 68 69 </div> 47 70 48 <form name="form_login" method="post" action="./login.php" id="login_form" autocomplete=off onSubmit="return validate_login(this);">49 <input type="hidden" name="max_resolution" id="max_resolution" value="">50 <input type="hidden" name="passwd_type" value="text">51 <input type="hidden" name="account type" value="u">52 <input type="hidden" name="save_login" value="no">53 <dt id="lista_miolo">54 <div class="login">55 <strong>{lang_username}:</strong><br/>56 <input name="login" id="login"/><br/>57 <strong>{lang_password}:</strong><br/>58 <input name="passwd" type="password" autocomplete=off/><br/>59 <button name="submitit" class="btn-contexto" style="margin-top:5px" type="submit">{lang_login}</button>60 </div>61 </dt>62 63 </form>64 65 <div class="rodape">Projeto ExpressoLivre 2004 - 2010 :: Licença de Software</div>66 <div class="rodape center"><a href="/login.php?dont_redirect_if_moble=1">Versão Clássica</a></div>67 71 </body> 68 72 </html> 69 70 73 <script type="text/javascript"> 71 74 document.getElementById('login').focus(); 72 75 </script> 76 <!-- END page --> 73 77 74 <!-- END page -->75 78 <!-- BEGIN success_message --> 76 <div class="bg-neutro"> 77 <div class="aviso-positivo"> 78 <strong>{message}</strong> 79 </div> 79 <div id="success_message"> 80 <label style="color:red;">{message}</label> 81 <script>messageHidden("success_message");</script> 80 82 </div> 81 83 <!-- END success_message --> 84 82 85 <!-- BEGIN error_message --> 83 <div class="bg-neutro"> 84 <div class="aviso-negativo"> 85 <strong>{message}</strong> 86 </div> 86 <div id="error_message"> 87 <label style="color:red;">{message}</label> 88 <script>messageHidden("error_message");</script> 87 89 </div> 88 90 <!-- END error_message --> -
trunk/mobile/templates/default/pc_template.tpl
r4277 r5043 95 95 <p>Projeto ExpressoLivre 2004 - 2010 :: Licença de Software</p> 96 96 <p><a href="index.php?menuaction=mobile.ui_home.change_template&template=mini_mobile">{lang_mini_mobile}</a></p> 97 <p><a href=" /index.php">Versão Clássica</a></p>97 <p><a href="{url_expresso}?dont_redirect_if_moble=1">Versão Clássica</a></p> 98 98 </div> 99 99 </body> -
trunk/mobile/templates/default/template.tpl
r4277 r5043 13 13 <div style="position:absolute; float:left; width:50%;"> 14 14 <div style="position:relative; float:left;"> 15 <h1 onclick=" window.location='index.php?menuaction=mobile.ui_home.index'">{global_title}</h1>15 <h1 onclick="document.location='index.php?menuaction=mobile.ui_home.index'">{global_title}</h1> 16 16 </div> 17 17 </div> … … 19 19 <div style="position:relative; float:right; width:50%; margin:2px;"> 20 20 <div style="{style_1}"> 21 <h1 onclick=" window.location='index.php?menuaction=mobile.ui_home.dicas'">Dicas</h1>21 <h1 onclick="document.location='index.php?menuaction=mobile.ui_home.dicas'">{lang_tips}</h1> 22 22 </div> 23 23 24 24 <div style="{style_2}"> 25 <h1 onclick=" window.location='{href_logout}'">{lang_logout}</h1>25 <h1 onclick="document.location='{href_logout}'">{lang_logout}</h1> 26 26 </div> 27 27 </div>
Note: See TracChangeset
for help on using the changeset viewer.