Changeset 3729


Ignore:
Timestamp:
02/02/11 15:28:29 (13 years ago)
Author:
asaikawa
Message:

Ticket #1524 - Adicionado o parametro useCCParams nos componentes, indicando que serao usados os parametros do CC

Location:
branches/2.2/workflow
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/workflow/inc/class.WorkflowLDAP.inc.php

    r3327 r3729  
    4848         * @access public 
    4949         */ 
    50         function WorkflowLDAP() 
    51         { 
    52                 $this->dataSource =& Factory::getInstance('WorkflowObjects')->getLDAP(); 
     50        function WorkflowLDAP($useCCParams = false) 
     51        { 
     52                $this->dataSource =& Factory::getInstance('WorkflowObjects')->getLDAP($useCCParams); 
    5353 
    5454                /* get the required parameters */ 
  • branches/2.2/workflow/inc/class.WorkflowObjects.inc.php

    r3167 r3729  
    197197        /** 
    198198         * Retorna um recurso de LDAP 
     199         * @param bool $useCCParams Indica se deve usar os parâmetros do Contact Center 
    199200         * @return resource O recurso LDAP 
    200201         * @access public 
    201202         */ 
    202         function &getLDAP() 
     203        function &getLDAP($useCCParams = false) 
    203204        { 
    204205                if (!isset($this->cache['ldap'])) 
     
    207208                        $this->assureEnvironment(); 
    208209 
    209                         /* check where the connection parameters are */ 
    210                         $connectionInfo = (isset($GLOBALS['phpgw_info']['server']['ldap_host'])) ? 
    211                                 $GLOBALS['phpgw_info']['server'] : 
    212                                 $_SESSION['phpgw_info']['workflow']['server']; 
    213  
    214                         /* load required information */ 
    215                         $ldapConfigValues = galaxia_get_config_values(array('ldap_host' => '', 'ldap_user' => '', 'ldap_password'=> '', 'ldap_follow_referrals' => '')); 
    216                         if (empty($ldapConfigValues['ldap_host'])) 
    217                                 $ldapConfigValues['ldap_host'] = $connectionInfo['ldap_host']; 
     210                        if($useCCParams) 
     211                        { 
     212                                /* get the contact center's connection parameters */ 
     213                                $ajaxConfig = &Factory::newInstance('ajax_config', 'contactcenter'); 
     214                                $config = $ajaxConfig->read_repository(); 
     215 
     216                                $ldapConfigValues['ldap_host'] = $config['cc_ldap_host0']; 
     217                                $ldapConfigValues['ldap_user'] = $config['cc_ldap_browse_dn0']; 
     218                                $ldapConfigValues['ldap_password'] = $config['cc_ldap_pw0']; 
     219                                $ldapConfigValues['ldap_follow_referrals'] = 1; 
     220                        } 
     221                        else 
     222                        { 
     223                                /* check where the connection parameters are */ 
     224                                $connectionInfo = (isset($GLOBALS['phpgw_info']['server']['ldap_host'])) ? 
     225                                        $GLOBALS['phpgw_info']['server'] : 
     226                                        $_SESSION['phpgw_info']['workflow']['server']; 
     227 
     228                                /* load required information */ 
     229                                $ldapConfigValues = galaxia_get_config_values(array('ldap_host' => '', 'ldap_user' => '', 'ldap_password'=> '', 'ldap_follow_referrals' => '')); 
     230                                if (empty($ldapConfigValues['ldap_host'])) 
     231                                        $ldapConfigValues['ldap_host'] = $connectionInfo['ldap_host']; 
     232                        } 
    218233 
    219234                        /* connect to the LDAP server */ 
  • branches/2.2/workflow/inc/class.bo_participants.inc.php

    r3704 r3729  
    3434        function bo_participants() 
    3535        { 
    36                 $this->ldap = &Factory::getInstance('WorkflowLDAP'); 
     36                $useCCParams = (isset($_REQUEST['useCCParams']) && $_REQUEST['useCCParams'] !== 'false') ? (bool)$_REQUEST['useCCParams'] : false; 
     37 
     38                $this->ldap = &Factory::getInstance('WorkflowLDAP', $useCCParams); 
    3739        } 
    3840 
  • branches/2.2/workflow/inc/class.ui_participants.inc.php

    r3720 r3729  
    136136                $smarty->assign('target', $_REQUEST['target_element']); 
    137137                $smarty->assign('usePreffix', $usePreffix); 
     138                $smarty->assign('useCCParams', $_REQUEST['useCCParams']); 
    138139                $smarty->assign('hideOrganizations', $hideOrganizations); 
    139140                $smarty->assign('hideSectors', $hideSectors); 
  • branches/2.2/workflow/inc/smarty/wf_plugins/function.wf_select_user.php

    r3715 r3729  
    3838                'onlyVisibleAccounts' => true, 
    3939                'useGlobalSearch' => false, 
     40                'useCCParams' => false, 
    4041                'rows'=> 2); 
    4142        $extractParams = array( 
     
    106107        else 
    107108                $extraParams .= "&useGlobalSearch=true"; 
     109        if (!empty($params['useCCParams']) && $params['useCCParams'] !== 'false') 
     110                $extraParams .= "&useCCParams=true"; 
    108111 
    109112        $image = Factory::getInstance('TemplateServer')->generateImageLink('add_user.png'); 
  • branches/2.2/workflow/inc/smarty/wf_plugins/function.wf_select_users.php

    r3715 r3729  
    2828                'onlyVisibleAccounts' => true, 
    2929                'useGlobalSearch' => false, 
     30                'useCCParams' => false, 
    3031                'get_email' => false, 
    3132                'value' => array()); 
     
    7273        else 
    7374                $extraParams .= "&useGlobalSearch=true"; 
     75        if (!empty($params['useCCParams']) && $params['useCCParams'] !== 'false') 
     76                $extraParams .= "&useCCParams=true"; 
    7477 
    7578        $output = '<table border="0"><tr><td>'; 
  • branches/2.2/workflow/js/jscode/participants.js

    r3167 r3729  
    2727                entities: $F('entities'), 
    2828                id: $F('id'), 
    29                 usePreffix: $F('usePreffix') 
     29                usePreffix: $F('usePreffix'), 
     30                useCCParams: $F('useCCParams') 
    3031        }; 
    3132        callAjax('bo_participants', 'getSectors', resultGetSectors, params); 
     
    3940                entities: $F('entities'), 
    4041                id: $F('id'), 
    41                 usePreffix: $F('usePreffix') 
     42                usePreffix: $F('usePreffix'), 
     43                useCCParams: $F('useCCParams') 
    4244        }; 
    4345        callAjax('bo_participants', 'getEntities', resultGetParticipants, params); 
     
    356358                entities: $F('entities'), 
    357359                id: $F('id'), 
    358                 usePreffix: $F('usePreffix') 
     360                usePreffix: $F('usePreffix'), 
     361                useCCParams: $F('useCCParams') 
    359362        }; 
    360363        callAjax('bo_participants', 'globalSearch', resultPerformGlobalSearch, params); 
  • branches/2.2/workflow/templates/default/participants.tpl

    r3715 r3729  
    1414<input type="hidden" id="target" value="{$target}"/> 
    1515<input type="hidden" id="usePreffix" value="{$usePreffix}"/> 
     16<input type="hidden" id="useCCParams" value="{$useCCParams}"/> 
    1617<table border="0" width="400"> 
    1718{if !($hideOrganizations && $hideSectors)} 
Note: See TracChangeset for help on using the changeset viewer.