source: trunk/contactcenter/index.php @ 498

Revision 498, 2.5 KB checked in by niltonneto, 12 years ago (diff)

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

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2  /***************************************************************************\
3  * eGroupWare - Contacts Center                                              *
4  * http://www.egroupware.org                                                 *
5  * Written by:                                                               *
6  *  - Raphael Derosso Pereira <raphaelpereira@users.sourceforge.net>         *
7  *  - Jonas Goes <jqhcb@users.sourceforge.net>                               *
8  *  sponsored by Thyamad - http://www.thyamad.com                            *
9  * ------------------------------------------------------------------------- *
10  *  This program is free software; you can redistribute it and/or modify it  *
11  *  under the terms of the GNU General Public License as published by the    *
12  *  Free Software Foundation; either version 2 of the License, or (at your   *
13  *  option) any later version.                                               *
14  \***************************************************************************/
15
16        $GLOBALS['phpgw_info'] = array();
17
18        $GLOBALS['phpgw_info']['flags'] = array(
19                'currentapp' => 'contactcenter',
20                'noheader'   => true,
21                //'nonavbar'   => true
22        );
23        include('../header.inc.php');
24
25        $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['telephone_number'] = $GLOBALS['phpgw_info']['user']['telephonenumber'];
26        //Enable/Disable VoIP Service -> Voip Server Config
27        $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] = false;       
28        $voip_groups = array();
29        if($GLOBALS['phpgw_info']['server']['voip_groups']) {
30                foreach(explode(",",$GLOBALS['phpgw_info']['server']['voip_groups']) as $i => $voip_group){
31                        $a_voip = explode(";",$voip_group);                     
32                        $voip_groups[] = $a_voip[1];
33                }               
34                foreach($GLOBALS['phpgw']->accounts->membership() as $idx => $group){                   
35                        if(array_search($group['account_name'],$voip_groups) !== FALSE){                 
36                                $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] = true;
37                                break;
38                        }
39                }
40        }   
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');   
50        $obj->index();
51        $GLOBALS['phpgw']->common->phpgw_footer();
52?>
Note: See TracBrowser for help on using the repository browser.