Changeset 498


Ignore:
Timestamp:
10/01/08 16:34:26 (16 years ago)
Author:
niltonneto
Message:

Implementação que verifica se algum usuário compartilhou contatos com usuário logado. O ramo "compartilhado"
só irá aparecer se existir tal compartilhamento.

Location:
trunk/contactcenter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/contactcenter/inc/class.bo_contactcenter.inc.php

    r285 r498  
    324324                                return false; 
    325325                        } 
    326                          
    327326                        $this->tree = array( 
    328327                                0 => array( 
     328                                        'type' => 'sql' 
     329                                ), 
     330                                1 => array( 
    329331                                        'type' => 'sql' 
    330332                                ), 
     
    346348                                ) 
    347349                        ); 
    348                          
     350                        if($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['shared_contacts']){ 
     351                                $this->tree[2] = array('type' => 'sql'); 
     352                                $this->tree['branches'][2] = array('name' => lang('Shared'), 
     353                                                                                'type'       => 'catalog', 
     354                                                                                'class'      => 'bo_shared_catalog_manager', 
     355                                                                                'icon'       => 'people-mini.png', 
     356                                                                                'sub_branch' => false); 
     357                                unset($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['shared_contacts']); 
     358                        } 
    349359                        $ldap = CreateObject('contactcenter.bo_ldap_manager'); 
    350360                        $ldap_srcs = $ldap->get_all_ldap_sources(); 
     
    352362                        if ($ldap_srcs) 
    353363                        { 
    354                                 $i = 2; 
     364                                $i = count($this->tree['branches']); //os Indices dos tipos tem o mesmo numero do de ramos. 
    355365                                reset($ldap_srcs); 
    356366                                while (list($id,) = each($ldap_srcs)) 
     
    392402                        if ($ldap_srcs) 
    393403                        { 
    394                                 $i = count($this->tree); 
     404                                $i = count($this->tree['branches']);//os Indices dos tipos tem o mesmo numero do de ramos. 
    395405 
    396406                                reset($ldap_srcs); 
  • trunk/contactcenter/index.php

    r395 r498  
    3939                } 
    4040        }     
    41         $obj = CreateObject('contactcenter.ui_data'); 
     41        // Verificar se há contatos compartilhados para o usuario logado 
     42        $acl = CreateObject("phpgwapi.acl",$GLOBALS['phpgw_info']['user']['account_id']);  
     43        $grants = $acl->get_grants("contactcenter"); 
     44        foreach($grants as $id => $rights){ 
     45                if ($id != $GLOBALS['phpgw_info']['user']['account_id']) { 
     46                        $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['shared_contacts'] = true;               
     47                } 
     48        } 
     49        $obj = CreateObject('contactcenter.ui_data');    
    4250        $obj->index(); 
    4351        $GLOBALS['phpgw']->common->phpgw_footer(); 
Note: See TracChangeset for help on using the changeset viewer.