Ignore:
Timestamp:
09/06/11 14:54:54 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #2265 - Implementado um checkbox para permitir o salvamento da senha em dispositivos móveis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/mobile/inc/class.ui_mobilecc.inc.php

    r4762 r5063  
    2323                        'contact_add' => true, 
    2424                        'contact_edit' => true, 
    25                         'getPhoto'  => true 
     25                        'getPhoto'  => true 
    2626                ); 
    2727                var $template; 
     
    4242                                $this->set_page_info_to_default(); 
    4343                        } 
    44                          
    45                         //if() 
    46  
    4744                } 
    4845                 
     
    6663                public function change_max_results($params) { 
    6764                        $this->page_info['actual_max_contacts'] = $params['results']; 
     65                        $this->save_session(); 
    6866                        $this->contacts_list(); 
     67                } 
     68                 
     69                public function change_letter($params) 
     70                { 
     71                        if( $params['letter'] ) 
     72                        { 
     73                                $this->page_info['actual_letter'] = $params['letter']; 
     74                        } 
     75                        $this->page_info['actual_max_contacts'] = 10; 
    6976                        $this->save_session(); 
    70                 } 
    71                  
    72                 public function change_letter($params) { 
    73                         $this->page_info['actual_letter'] = $params['letter']; 
     77                        $this->contacts_list($params); 
     78                } 
     79                 
     80                public function change_catalog($params) 
     81                { 
     82                        $this->page_info['actual_catalog'] = $params['catalog']; 
     83                        $this->page_info['actual_letter'] = 'a'; 
    7484                        $this->page_info['actual_max_contacts'] = 10; 
    75                         $this->contacts_list(); 
    7685                        $this->save_session(); 
    77                 } 
    78                  
    79                 public function change_catalog($params) { 
    80  
    81                         if( $params['catalog'] ) $this->page_info['actual_catalog'] = $params['catalog']; 
    82                         $this->page_info['actual_max_contacts'] = 10; 
    83                         $this->page_info['actual_letter'] = 'a'; 
    84                          
    8586                        $this->contacts_list($params); 
    86                          
    87                         $this->save_session(); 
    8887                } 
    8988                 
     
    9796                        $this->set_page_info_to_default(); 
    9897                        $this->page_info['request_from'] = $params['request_from']; //Para escolher contato vindo de outro modulo, mudo apenas o request_from 
     98                        $this->save_session(); 
    9999                        $this->contacts_list(); 
    100                         $this->save_session(); 
    101100                } 
    102101                 
     
    109108                public function init_cc($params) { 
    110109                        $this->set_page_info_to_default(); 
     110                        $this->save_session(); 
    111111                        $this->contacts_list($params); 
    112                         $this->save_session(); 
    113112                } 
    114113                 
     
    162161                        //Combo de catálogos 
    163162                        $catalogs = $this->bo->get_all_catalogs(); 
    164                         foreach($catalogs as $catalog) { 
     163 
     164                        foreach($catalogs as $catalog) 
     165                        { 
    165166                                $this->template->set_var("catalog_value",$catalog["catalog"]); 
    166167                                $this->template->set_var("catalog_name",$catalog["label"]); 
    167                                 if($this->page_info['actual_catalog']==$catalog['catalog']) 
     168                                 
     169                                if( $this->page_info['actual_catalog'] == $catalog['catalog'] ) 
    168170                                        $this->template->set_var("selected","selected"); 
    169171                                else 
    170172                                        $this->template->set_var("selected"," "); 
     173                                 
    171174                                $this->template->fp("catalogs","catalog_row",true); 
    172175                        } 
    173                         $this->bo->set_catalog($this->page_info["actual_catalog"]); 
    174                         $contacts = $this->bo->search($this->page_info["actual_letter"]."%", 
    175                                                                                         $this->page_info["actual_max_contacts"]); 
    176                                  
    177                          
     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                         
    178197                        //Letras da paginação 
    179198                        $max_letters = 5; 
     
    243262                 */ 
    244263                 
    245                 function delete_contacts($params) { 
     264                function delete_contacts($params) 
     265                { 
    246266                        $this->bo->set_catalog($params['catalog']); 
    247267 
     
    370390                 * @return $contact 
    371391                 */ 
    372                 function contact_view($params) { 
    373  
    374                         if ( empty($params['id']) || empty($params['catalog']) ){ 
     392                function contact_view($params) 
     393                { 
     394 
     395                        if ( empty($params['id']) || empty($params['catalog']) ) 
     396                        { 
    375397                                header('Location: ../mobile/index.php?menuaction=mobile.ui_mobilecc.init_cc'); 
    376398                        } 
     
    398420                        $email_to = ""; 
    399421 
    400                         switch ($params['catalog']){ 
     422                        switch ($params['catalog']) 
     423                        { 
    401424 
    402425                                case 'bo_shared_people_manager'; 
    403426                                case 'bo_people_catalog': 
    404427 
    405                                                                 $this->template->set_var('lang_contact_title',lang("context contact")); 
    406                                                                 $this->bo->set_catalog($params['catalog']); 
    407  
    408                                                                 $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)); 
    409  
    410                                                                 asort($result['connections']); 
    411  
    412                                                                 $this->template->set_var('photo', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_photo&id='.$params['id']); 
    413                                                                 $this->template->set_var('id',$params['id']); 
    414                                                                 $this->template->set_var('catalog',$params['catalog']); 
    415                                          
    416                                                                 $this->template->set_var('cc_name',$result['names_ordered']); 
    417                                                                 $this->template->set_var('lang_title_alias',lang("Alias")); 
    418                                                                 $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']; 
    419471                                                                 
    420                                                                 $this->template->set_var('lang_title_name',lang("Name")); 
    421                                                                 $this->template->set_var('lang_name',$result['given_names']); 
     472                                                                if ( empty($email_to) ) 
     473                                                                        $email_to = $var_email; 
    422474                                                                 
    423                                                                 $this->template->set_var('lang_title_lastname',lang("Family Names")); 
    424                                                                 $this->template->set_var('lang_lastname',$result['family_names']); 
    425                                                                  
    426                                                                 $var_phone = ""; 
    427                                                                 $var_email = ""; 
    428                                                                 foreach($result['connections'] as $conn): 
    429                                                                         if ( $conn['id_type'] == 1 ){ 
    430                                                                                 if ( !empty($var_email) ) 
    431                                                                                         $var_email .= ' | '; 
    432                                                                                 $var_email .= $conn['connection_value']; 
    433                                                                                  
    434                                                                                 if ( empty($email_to) ) 
    435                                                                                         $email_to = $var_email; 
    436                                                                                  
    437                                                                         }else if ($conn['id_type'] == 2){ 
    438                                                                                 if ( !empty($var_phone)) 
    439                                                                                         $var_phone .= ' | '; 
    440                                                                                 $var_phone .= $conn['connection_value']; 
    441                                                                         } 
    442  
    443                                                                         if (($conn['id_type'] == null) || ($conn['id_type'] == '_NONE_')){ 
    444                                                                                 if ( $conn['type'] == 'email' ){ 
    445                                                                                         if ( !empty($var_email) ) 
    446                                                                                                 $var_email .= ' | '; 
    447                                                                                         $var_email .= $conn['connection_value']; 
    448                                                                                          
    449                                                                                         if ( empty($email_to) ) 
    450                                                                                                 $email_to = $var_email; 
    451                                                                                          
    452                                                                                 }else if ($conn['type'] == 'phone'){ 
    453                                                                                         if ( !empty($var_phone)) 
    454                                                                                                 $var_phone .= ' | '; 
    455                                                                                         $var_phone .= $conn['connection_value']; 
    456                                                                                 } 
    457                                                                         } 
    458                                                                 endforeach; 
    459                                                                  
    460                                                                 $this->template->set_var('lang_title_email',lang("Email")); 
    461                                                                 $this->template->set_var('lang_email',$var_email); 
    462                                                                  
    463                                                                 $this->template->set_var('lang_title_phone',lang("Phone")); 
    464                                                                 $this->template->set_var('lang_phone',$var_phone); 
    465                                  
    466                                                                 $this->template->set_var('lang_edit',lang("edit")); 
    467                                                                  
    468                                                                 $this->template->parse("row_body","people"); 
    469                                                                  
    470                                                                 if ($params['catalog'] == 'bo_people_catalog') 
    471                                                                         $this->template->parse("buttom_editar","buttom"); 
    472                                                                          
    473                                                         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; 
    474497                                                         
    475498                                case 'bo_group_manager': 
    476                                                                 $this->template->set_var('lang_contact_title',lang("context group")); 
    477                                                                 $this->bo->set_catalog($params['catalog']); 
    478                                                                 $result = $this->bo->bo->get_single_entry($params['id'], array("id_group"=>true,"title"=>true,"short_name"=>true)); 
    479                                                                 $data   = $this->bo->bo->get_contacts_by_group($params['id']); 
    480  
    481                                                                 $email_to = '<'.$result['short_name'].'>'; 
    482                                                                  
    483                                                                 $this->template->set_var('title_view_contact', $result['title']); 
    484                                                                 $this->template->set_var('email_to', $email_to); 
    485  
    486                                                                 $this->template->set_var('lang_title_name',lang("Name")); 
    487                                                                 $this->template->set_var('lang_title_email',lang("Email")); 
    488                                                                  
    489                                                                 foreach($data as $dados){ 
    490                                                                         $this->template->set_var('lang_name', $dados['names_ordered']); 
    491                                                                         $this->template->set_var('lang_email', $dados['connection_value']); 
    492                                                                         $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 .= ' | '; 
    493584                                                                         
    494                                                                         $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 .= ' | '; 
    495594                                                                         
    496                                                                         $this->template->fp('group_rows','group_row',True); 
     595                                                                        $var_phone .= $conn['connection_value']; 
    497596                                                                } 
    498  
    499                                                                 $this->template->set_var('email_to', $email_to); 
    500                                                                 $this->template->parse("buttom_use","buttom_use_contact"); 
    501                                                                  
    502                                                                 $this->template->parse("row_body","group"); 
    503                                                         break; 
    504                                                  
    505                                 default:                 
    506  
    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                                                                 { 
    513  
    514                                                                         $this->bo->set_catalog($params['catalog']); 
    515  
    516                                                                         $fields = $this->bo->bo->get_fields(true); 
    517                                                                         $result = $this->bo->bo->get_single_entry($params['id'], $fields); 
    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"]); 
    526  
    527                                                                         $this->template->set_var('cc_name',$result['names_ordered'][0]); 
    528  
    529                                                                         $this->template->set_var('lang_title_name',lang("Name")); 
    530                                                                         $this->template->set_var('lang_name',$result['given_names'][0]); 
    531                                                                          
    532                                                                         $this->template->set_var('lang_title_lastname',lang("Family Names")); 
    533                                                                         $this->template->set_var('lang_lastname',$result['family_names'][0]); 
    534                                                                          
    535                                                                         $var_phone = ""; 
    536                                                                         $var_email = ""; 
    537                                                                         foreach($result['connections'] as $conn): 
    538                                                                                 if ( $conn['id_type'] == 1 ){ 
    539                                                                                         if ( !empty($var_email) ) 
    540                                                                                                 $var_email .= ' | '; 
    541                                                                                         $var_email .= $conn['connection_value']; 
    542                                                                                          
    543                                                                                         if ( empty($email_to) ) 
    544                                                                                                 $email_to = $var_email; 
    545                                                                                          
    546                                                                                 }else if ($conn['id_type'] == 2){ 
    547                                                                                         if ( !empty($var_phone)) 
    548                                                                                                 $var_phone .= ' | '; 
    549                                                                                         $var_phone .= $conn['connection_value']; 
    550                                                                                 } 
    551  
    552                                                                                 if (($conn['id_type'] == null) || ($conn['id_type'] == '_NONE_')){ 
    553                                                                                         if ( $conn['type'] == 'email' ){ 
    554                                                                                                 if ( !empty($var_email) ) 
    555                                                                                                         $var_email .= ' | '; 
    556                                                                                                 $var_email .= $conn['connection_value']; 
     597                                                        } 
     598                                                } 
    557599                                                                                                 
    558                                                                                                 if ( empty($email_to) ) 
    559                                                                                                         $email_to = $var_email; 
    560                                                                                                  
    561                                                                                         }else if ($conn['type'] == 'phone'){ 
    562                                                                                                 if ( !empty($var_phone)) 
    563                                                                                                         $var_phone .= ' | '; 
    564                                                                                                 $var_phone .= $conn['connection_value']; 
    565                                                                                         } 
    566                                                                                 } 
    567                                                                         endforeach; 
    568                                                  
    569                                                                         $this->template->set_var('email_to', $email_to); 
    570                                                                          
    571                                                                         $this->template->set_var('lang_title_email',lang("Email")); 
    572                                                                         $this->template->set_var('lang_email',$var_email); 
    573                                                                          
    574                                                                         $this->template->set_var('lang_title_phone',lang("Phone")); 
    575                                                                         $this->template->set_var('lang_phone',$var_phone); 
    576  
    577                                                                         $this->template->parse("row_body","people_ldap"); 
    578  
    579                                                                 } 
    580  
    581                                                         break; 
     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; 
    582613                        } 
    583614 
     
    587618                                $this->template->parse("buttom_use","buttom_use_contact"); 
    588619                                $this->template->parse("row_operacao","row_view_operacao"); 
    589                         }else if ($params['catalog'] == 'bo_people_catalog'){ 
     620                        } 
     621                        else if ($params['catalog'] == 'bo_people_catalog') 
     622                        { 
    590623                                $this->template->parse("row_operacao","row_view_operacao"); 
    591624                        } 
    592625 
    593626                        $linkBack = explode("&", $GLOBALS['phpgw_info']['mobiletemplate']->get_back_link() ); 
    594                         $link = $linkBack[0]."&".$params['catalog']."&".$linkBack[2]; 
     627                        $link = $linkBack[0]."&catalog=".$params['catalog']."&".$linkBack[2]; 
    595628                         
    596629                        $this->template->set_var('lang_back',lang("back")); 
     630                         
    597631                        $this->template->set_var('href_back',$link); 
     632                         
    598633                        $this->template->set_var('lang_use_contact',lang("use contact")); 
    599634                        $this->template->set_var('lang_selecteds',lang("selecteds")); 
     
    602637                } 
    603638                 
    604                 function getPhoto() 
    605                 { 
    606                     $id = $_GET['id']; 
    607  
    608                     session_start(); 
    609  
    610                     if( isset( $_SESSION['phpgw_info']['mobile']['photoCatalog'][$id] ) ) 
    611                     { 
    612                         $photo = imagecreatefromstring($_SESSION['phpgw_info']['mobile']['photoCatalog'][$id]); 
    613  
    614                         header("Content-Type: image/jpeg"); 
    615                         $width = imagesx($photo); 
    616                         $height = imagesy($photo); 
    617                         $twidth = 70; 
    618                         $theight = 90; 
    619                         $small_photo = imagecreatetruecolor ($twidth, $theight); 
    620                         imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height); 
    621                         imagejpeg($small_photo,'',100); 
    622  
    623                         unset( $_SESSION['phpgw_info']['mobile']['photoCatalog'][$id] ); 
    624                     }     
    625                     else 
    626                     { 
    627                         header('Content-type: image/png'); 
    628                         echo file_get_contents(PHPGW_INCLUDE_ROOT.'/contactcenter/templates/default/images/photo_celepar.png'); 
    629                     } 
    630  
    631                     session_write_close(); 
    632  
    633                     return; 
    634                 } 
     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; 
     669                } 
    635670 
    636671                /** 
     
    679714                                $view = true; 
    680715 
    681                                 if ( !isset($params['erro'])){ 
     716                                if ( !isset($params['erro'])) 
     717                                { 
    682718                                        $this->bo->set_catalog($params['catalog']); 
    683719                                        $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)); 
     
    773809                                        $data['connections']['default_phone']['connection_value'] = $params['phone']; 
    774810                                } 
    775          
    776811                                $this->bo->set_catalog($params['catalog']); 
    777812                                $contact_id = $this->bo->bo->quick_add($data); 
     
    807842                        else 
    808843                        { 
    809  
    810844                                $this->bo->set_catalog($params['catalog']); 
    811845                                $types = $this->bo->bo->get_all_connections_types(); 
     
    896930                         
    897931                } 
    898  
    899                  
    900932        } 
    901          
    902          
    903933?> 
Note: See TracChangeset for help on using the changeset viewer.