Index: trunk/workflow/inc/class.bo_utils.inc.php
===================================================================
--- trunk/workflow/inc/class.bo_utils.inc.php	(revision 2591)
+++ trunk/workflow/inc/class.bo_utils.inc.php	(revision 2974)
@@ -86,4 +86,6 @@
 			$ret_name = empty($params['name']) ? 'cn' : $params['name'];
 
+			$ret_complement = empty($params['complement']) ? '' : $params['complement']; 
+
 			$ajaxConfig = &Factory::newInstance('ajax_config', 'contactcenter');
 			$config = $ajaxConfig->read_repository();
@@ -103,5 +105,9 @@
 
 				$filter     = '(&(uid=*)(phpgwAccountType=u)(!(phpgwAccountVisible=-1))(cn=*' . $cn . '*))';
-				$attrib_ret = array('cn', $ret_id, $ret_name);
+
+				if($ret_complement != '')
+					$attrib_ret = array('cn', $ret_id, $ret_name, $ret_complement);
+				else
+					$attrib_ret = array('cn', $ret_id, $ret_name);
 
 				$r = ldap_search($ds, $ldapconfig['basedn'], $filter, $attrib_ret, 0, 0, 5);
@@ -114,7 +120,17 @@
 						$result = ldap_get_entries($ds, $r);
 						foreach($result as $value){
-							$output['values'][] = array(
+   						  if($value[$ret_name][0] != ""){ 
+							if($params['complement'] != ''){
+									$complement = " >> " . $value[$ret_complement][0];
+									$output['values'][] = array(
+									'id'   => $value[$ret_id],
+									'name' => trim(ucwords(strtolower($value[$ret_name][0]))) . $complement );
+								}
+							else{
+								$output['values'][] = array(
 								'id'   => $value[$ret_id],
 								'name' => trim(ucwords(strtolower($value[$ret_name][0]))));
+							}
+						  }	
 						}
 
Index: trunk/workflow/inc/smarty/plugins/function.html_options.php
===================================================================
--- trunk/workflow/inc/smarty/plugins/function.html_options.php	(revision 795)
+++ trunk/workflow/inc/smarty/plugins/function.html_options.php	(revision 2974)
@@ -89,5 +89,5 @@
 
     if(!empty($name)) {
-        $_html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
+        $_html_result = '<select name="' . $name . '"' . $extra . "\n" . $_html_result . '</select>' . "\n";
     }
 
@@ -96,4 +96,71 @@
 }
 
+function smarty_function_html_boxoptions($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+    
+    $name = null;
+    $values = null;
+    $options = null;
+    $selected = array();
+    $output = null;
+    
+    $extra = '';
+    
+    foreach($params as $_key => $_val) {
+        switch($_key) {
+            case 'name':
+                $$_key = (string)$_val;
+                break;
+            
+            case 'options':
+                $$_key = (array)$_val;
+                break;
+                
+            case 'values':
+            case 'output':
+                $$_key = array_values((array)$_val);
+                break;
+
+            case 'selected':
+                $$_key = array_map('strval', array_values((array)$_val));
+                break;
+
+            default:
+                if(!is_array($_val)) {
+                    $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+                } else {
+                    $smarty->trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if (!isset($options) && !isset($values))
+        return ''; /* raise error here? */
+
+    $_html_result = '';
+
+    if (isset($options)) {
+
+        foreach ($options as $_key=>$_val)
+            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+
+    } else {
+
+        foreach ($values as $_i=>$_key) {
+            $_val = isset($output[$_i]) ? $output[$_i] : '';
+            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+        }
+
+    }
+
+    if(!empty($name)) {
+        $_html_result = '<select name="' . $name . '"' . $extra . ' style="height: 100px;" size="5">' . "\n" . $_html_result . '</select>' . "\n";
+    }
+
+    return $_html_result;
+
+}
 function smarty_function_html_options_optoutput($key, $value, $selected) {
     if(!is_array($value)) {
Index: trunk/workflow/inc/smarty/wf_plugins/function.wf_select_ldap_users.php
===================================================================
--- trunk/workflow/inc/smarty/wf_plugins/function.wf_select_ldap_users.php	(revision 2591)
+++ trunk/workflow/inc/smarty/wf_plugins/function.wf_select_ldap_users.php	(revision 2974)
@@ -23,5 +23,5 @@
  */
 function smarty_function_wf_select_ldap_users($params, &$smarty)
-{
+{ 
     require_once $smarty->_get_plugin_filepath('function','html_options');
 	$imagesPath = substr(Factory::getInstance('TemplateServer')->generateImageLink(''), 0, -1);
@@ -42,5 +42,6 @@
 		'class_btn',
 		'opt_id',
-		'opt_name');
+		'opt_name',
+		'opt_complement');
 
 	/* verifica se todos os parâmetros obrigatórios foram passados */
@@ -78,10 +79,10 @@
 	$output = <<<EOF
 		<input type="text" id="$name_input" name="$name_input" size="$size_input" />
-		<input type="button" class="$class_btn" value="$value_btn" onclick="search_ldap_users_by_cn(document.getElementById('$name_input').value, '$name', '$opt_id', '$opt_name', $handleExpiredSessions)" />
+		<input type="button" class="$class_btn" value="$value_btn" onclick="search_ldap_users_by_cn(document.getElementById('$name_input').value, '$name', '$opt_id', '$opt_name','$opt_complement', $handleExpiredSessions)" />
 		&nbsp;<img id="$name_img" border="0" src="$imagesPath/loading.gif" style="display:none">
-		<span id="$name_span" style="display:none">&nbsp;&nbsp;&nbsp;&nbsp;<b>Selecione o nome: </b>
+		<span id="$name_span" style="display:none">&nbsp;&nbsp;&nbsp;&nbsp;<b>Selecione um nome abaixo: </b><br><br>
 EOF;
 
-	$output .= smarty_function_html_options(array_merge(array(
+	$output .= smarty_function_html_boxoptions(array_merge(array(
 											'name'    => $name,
 											'id'      => $name,
Index: trunk/workflow/js/jscode/wf_select_ldap_users.js
===================================================================
--- trunk/workflow/js/jscode/wf_select_ldap_users.js	(revision 795)
+++ trunk/workflow/js/jscode/wf_select_ldap_users.js	(revision 2974)
@@ -9,5 +9,5 @@
  * @param String opt_name Atributo que será atribuído ao name (innerHTML) das options da combo, por padrão é o 'cn'
  */
-function search_ldap_users_by_cn(cn, target, opt_id, opt_name, handleExpiredSessions)
+function search_ldap_users_by_cn(cn, target, opt_id, opt_name, opt_complement,  handleExpiredSessions)
 {
 /* Método que trata o retorno da chamada Ajax. Atribui os valores retornados à combobox */
@@ -47,5 +47,5 @@
 
 	var url = '$this.bo_utils.search_ldap_users_by_cn';
-	var param = "cn=" + cn + "&target=" + target + "&id=" + opt_id + "&name=" + opt_name;
+	var param = "cn=" + cn + "&target=" + target + "&id=" + opt_id + "&name=" + opt_name + "&complement=" + opt_complement; 
 
 	document.getElementById(target + "_img").show();
