source: trunk/contactcenter/index.php @ 1598

Revision 1598, 3.5 KB checked in by rafaelraymundo, 11 years ago (diff)

Ticket #704 - Incluido outro campo para busca utilizando atributo do LDAP

  • 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
27        $prefs = CreateObject('contactcenter.ui_preferences');
28        $actual = $prefs->get_preferences();
29
30        $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['empNumShow'] = false;
31        $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['cellShow'] = false;
32        $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['departmentShow'] = false;
33
34        if ($actual['empNum'])
35        {
36                $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['empNumShow'] = true;
37        }
38
39        if ($actual['cell'])
40        {
41                $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['cellShow'] = true;
42        }
43
44        if ($actual['department'])
45        {
46                $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['departmentShow'] = true;
47        }
48
49
50       
51        //Enable/Disable VoIP Service -> Voip Server Config
52        $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] = false;       
53        $voip_groups = array();
54        if($GLOBALS['phpgw_info']['server']['voip_groups']) {
55                foreach(explode(",",$GLOBALS['phpgw_info']['server']['voip_groups']) as $i => $voip_group){
56                        $a_voip = explode(";",$voip_group);                     
57                        $voip_groups[] = $a_voip[1];
58                }               
59                foreach($GLOBALS['phpgw']->accounts->membership() as $idx => $group){                   
60                        if(array_search($group['account_name'],$voip_groups) !== FALSE){                 
61                                $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] = true;
62                                break;
63                        }
64                }
65        }
66
67        // Verificar se há contatos compartilhados para o usuario logado
68        $acl = CreateObject("phpgwapi.acl",$GLOBALS['phpgw_info']['user']['account_id']);
69        $grants = $acl->get_grants("contactcenter");
70        foreach($grants as $id => $rights){
71                if ($id != $GLOBALS['phpgw_info']['user']['account_id']) {
72                        $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['shared_contacts'] = true;             
73                }
74        }
75        $obj = CreateObject('phpgwapi.config','contactcenter');
76        $opts = $obj->read_repository();
77        echo '<script> var v_label = \'' . $opts['cc_ldap_legend'] . '\'; var v_atrib = \'' . $opts['cc_ldap_atrib'] . '\';  v_min = \'' . $opts['cc_ldap_min'] . '\' </script>';
78        $opts = null;
79        $obj = CreateObject('contactcenter.ui_data');
80                $obj->index();
81       
82       
83        $GLOBALS['phpgw']->common->phpgw_footer();
84?>
Note: See TracBrowser for help on using the repository browser.