Changeset 4628 for branches/2.2
- Timestamp:
- 06/24/11 13:42:26 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/mobile/inc/class.ui_mobilecc.inc.php
r3964 r4628 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; … … 504 505 default: 505 506 506 if(strpos($params['catalog'],'bo_global_ldap_catalog')==false){ 507 if( strpos($params['catalog'],'bo_global_ldap_catalog') === false ) 508 { 509 header('Location: ../mobile/index.php?menuaction=mobile.ui_mobilecc.init_cc'); 510 } 511 else 512 { 507 513 508 514 $this->bo->set_catalog($params['catalog']); … … 510 516 $fields = $this->bo->bo->get_fields(true); 511 517 $result = $this->bo->bo->get_single_entry($params['id'], $fields); 512 513 $this->template->set_var('photo', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_photo&id='.$params["id"]); 518 519 // SessionStart 520 session_start(); 521 $_SESSION['phpgw_info']['mobile']['photoCatalog'][$params['id']] = $result['photo']; 522 session_write_close(); 523 524 525 $this->template->set_var('photo', '../index.php?menuaction=mobile.ui_mobilecc.getPhoto&id=' . $params["id"]); 514 526 515 527 $this->template->set_var('cc_name',$result['names_ordered'][0]); … … 565 577 $this->template->parse("row_body","people_ldap"); 566 578 567 }else{568 header('Location: ../mobile/index.php?menuaction=mobile.ui_mobilecc.init_cc');569 579 } 570 580 … … 572 582 } 573 583 574 if ( !empty($email_to)){ 584 if ( !empty($email_to)) 585 { 575 586 $this->template->set_var('email_to', $email_to); 576 587 $this->template->parse("buttom_use","buttom_use_contact"); … … 587 598 $GLOBALS['phpgw_info']['mobiletemplate']->set_content($this->template->fp('out','body')); 588 599 } 600 601 function getPhoto() 602 { 603 $id = $_GET['id']; 604 605 session_start(); 606 607 if( isset( $_SESSION['phpgw_info']['mobile']['photoCatalog'][$id] ) ) 608 { 609 $photo = imagecreatefromstring($_SESSION['phpgw_info']['mobile']['photoCatalog'][$id]); 610 611 header("Content-Type: image/jpeg"); 612 $width = imagesx($photo); 613 $height = imagesy($photo); 614 $twidth = 70; 615 $theight = 90; 616 $small_photo = imagecreatetruecolor ($twidth, $theight); 617 imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height); 618 imagejpeg($small_photo,'',100); 619 620 unset( $_SESSION['phpgw_info']['mobile']['photoCatalog'][$id] ); 621 } 622 else 623 { 624 header('Content-type: image/png'); 625 echo file_get_contents(PHPGW_INCLUDE_ROOT.'/contactcenter/templates/default/images/photo_celepar.png'); 626 } 627 628 session_write_close(); 629 630 return; 631 } 589 632 590 633 /**
Note: See TracChangeset
for help on using the changeset viewer.