Changeset 3167 for branches/2.2/workflow/inc/class.bo_utils.inc.php
- Timestamp:
- 08/17/10 16:17:12 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/workflow/inc/class.bo_utils.inc.php
r795 r3167 11 11 12 12 require_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';15 13 16 14 /** … … 34 32 { 35 33 parent::bo_ajaxinterface(); 36 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBExpresso();34 $this->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso(); 37 35 } 38 36 … … 66 64 */ 67 65 function search_ldap_users_by_cn($params) 68 { 66 { 69 67 // parâmetro a ser procurado no ldap 70 68 $cn = trim(ereg_replace(' +', ' ', $params['cn'])); … … 88 86 $ret_name = empty($params['name']) ? 'cn' : $params['name']; 89 87 90 $ajaxConfig = new ajax_config('contactcenter'); 88 $ret_complement = empty($params['complement']) ? '' : $params['complement']; 89 90 $ajaxConfig = &Factory::newInstance('ajax_config', 'contactcenter'); 91 91 $config = $ajaxConfig->read_repository(); 92 92 … … 105 105 106 106 $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); 108 112 109 113 $r = ldap_search($ds, $ldapconfig['basedn'], $filter, $attrib_ret, 0, 0, 5); … … 114 118 } 115 119 elseif(ldap_count_entries($ds, $r) < 200){ 120 116 121 $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 121 145 } 122 123 146 124 147 foreach ($output['values'] as $key => $value){ … … 142 165 else{ 143 166 $output['msg'] = 'Não digite caracteres especiais nem números. Apenas letras e espaços são permitidos.'; 144 } 167 } 145 168 return $output; 146 169 }
Note: See TracChangeset
for help on using the changeset viewer.