Ignore:
Timestamp:
08/17/10 16:17:12 (14 years ago)
Author:
viani
Message:

Ticket #1135 - Merged r1990:3166 from /trunk/workflow into /branches/2.2/workflow

File:
1 edited

Legend:

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

    r795 r3167  
    1111 
    1212require_once 'class.bo_ajaxinterface.inc.php'; 
    13 require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php'; 
    14 require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'; 
    1513 
    1614/** 
     
    3432        { 
    3533                parent::bo_ajaxinterface(); 
    36                 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBExpresso(); 
     34                $this->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso(); 
    3735        } 
    3836 
     
    6664         */ 
    6765        function search_ldap_users_by_cn($params) 
    68         { 
     66        {  
    6967                // parâmetro a ser procurado no ldap 
    7068                $cn = trim(ereg_replace(' +', ' ', $params['cn'])); 
     
    8886                        $ret_name = empty($params['name']) ? 'cn' : $params['name']; 
    8987 
    90                         $ajaxConfig = new ajax_config('contactcenter'); 
     88                        $ret_complement = empty($params['complement']) ? '' : $params['complement']; 
     89 
     90                        $ajaxConfig = &Factory::newInstance('ajax_config', 'contactcenter'); 
    9191                        $config = $ajaxConfig->read_repository(); 
    9292 
     
    105105 
    106106                                $filter     = '(&(uid=*)(phpgwAccountType=u)(!(phpgwAccountVisible=-1))(cn=*' . $cn . '*))'; 
    107                                 $attrib_ret = array('cn', $ret_id, $ret_name); 
     107 
     108                                if($ret_complement != '') 
     109                                        $attrib_ret = array('cn', $ret_id, $ret_name, $ret_complement); 
     110                                else 
     111                                        $attrib_ret = array('cn', $ret_id, $ret_name); 
    108112 
    109113                                $r = ldap_search($ds, $ldapconfig['basedn'], $filter, $attrib_ret, 0, 0, 5); 
     
    114118                                        } 
    115119                                        elseif(ldap_count_entries($ds, $r) < 200){ 
     120 
    116121                                                $result = ldap_get_entries($ds, $r); 
    117                                                 foreach($result as $value){ 
    118                                                         $output['values'][] = array( 
    119                                                                 'id'   => $value[$ret_id], 
    120                                                                 'name' => trim(ucwords(strtolower($value[$ret_name][0])))); 
     122 
     123                                                foreach($result as $value){  
     124                                                        if( ($value[$ret_name][0] != '') && ($value[$ret_complement][0] != '') ){ 
     125                                                                        $complement = " >> " . $value[$ret_complement][0]; 
     126                                                                        $output['values'][] = array( 
     127                                                                                                                                 'id'   => $value[$ret_id], 
     128                                                                                                                                 'name' => trim(ucwords(strtolower($value[$ret_name][0]))) . $complement 
     129                                                                                                                           );  
     130 
     131                                                        } 
     132                                                elseif($value[$ret_name][0] != ''){ 
     133                                                                $output['values'][] = array( 
     134                                                                                                                         'id'   => $value[$ret_id], 
     135                                                                                                                         'name' => trim(ucwords(strtolower($value[$ret_name][0]))) 
     136                                                                                                                   );  
     137                                                        } 
     138                                                else{ 
     139                                                                $output['values'][] = array( 
     140                                                                                                                         'id'   => '', 
     141                                                                                                                         'name' => "-- Selecione uma Opção --" 
     142                                                                                                                   );  
     143                                                        } 
     144 
    121145                                                } 
    122  
    123146 
    124147                                                foreach ($output['values'] as $key => $value){ 
     
    142165                else{ 
    143166                        $output['msg'] = 'Não digite caracteres especiais nem números. Apenas letras e espaços são permitidos.'; 
    144                 } 
     167                }  
    145168                return $output; 
    146169        } 
Note: See TracChangeset for help on using the changeset viewer.