Index: trunk/workflow/inc/class.bo_participants.inc.php
===================================================================
--- trunk/workflow/inc/class.bo_participants.inc.php	(revision 2591)
+++ trunk/workflow/inc/class.bo_participants.inc.php	(revision 3041)
@@ -74,5 +74,5 @@
 		{
 			$preffix = ($usePreffix) ? 'u' : '';
-			$ents = $this->ldap->getUsers($params['context']);
+			$ents = $this->ldap->getUsers($params['context'], $params['onlyVisibleAccounts']);
 			foreach ($ents as $ent)
 				$output[$preffix . $ent[$id]] = $ent['name'];
@@ -162,7 +162,9 @@
 		$searchLists = (strpos($entities, 'l') !== false);
 
+		$onlyVisibleAccounts = $params['onlyVisibleAccounts'];
+
 		/* faz a busca */
 		$output = array();
-		$output['participants'] = $this->ldap->search($searchTerm, $searchUsers, $searchGroups, $searchLists);
+		$output['participants'] = $this->ldap->search($searchTerm, $searchUsers, $searchGroups, $searchLists, null, $onlyVisibleAccounts);
 
 		/* limita os resultados e define uma mensagem que será exibida */
Index: trunk/workflow/inc/class.ui_participants.inc.php
===================================================================
--- trunk/workflow/inc/class.ui_participants.inc.php	(revision 2591)
+++ trunk/workflow/inc/class.ui_participants.inc.php	(revision 3041)
@@ -92,4 +92,10 @@
 		$hideSectors = ($_REQUEST['hideSectors'] == '1') ? true : false;
 
+		// the default value of $onlyVisibleAccounts is true
+		if((isset($_REQUEST['onlyVisibleAccounts'])) && (empty($_REQUEST['onlyVisibleAccounts']) || $_REQUEST['onlyVisibleAccounts'] === 'false'))
+			$onlyVisibleAccounts = false;
+		else
+			$onlyVisibleAccounts = true;
+
 		/* define the initial organization */
 		$selectedOrganization = $ldap->getOrganizationFromDN($userDN);
@@ -117,7 +123,7 @@
 		$smarty->assign('organizations', $organizationList);
 		$smarty->assign('selectedOrganization', $selectedOrganization);
-		$smarty->assign('sectors', $this->bo->getSectors(array('organization' => $selectedOrganization), true));
+		$smarty->assign('sectors', $this->bo->getSectors(array('organization' => $selectedOrganization, 'onlyVisibleAccounts' => $onlyVisibleAccounts), true));
 		$smarty->assign('selectedSector', $selectedSector);
-		$smarty->assign('participants', $this->bo->getEntities(array('entities' => $entities, 'id' => $id, 'context' => $selectedSector, 'usePreffix' => $usePreffix), true));
+		$smarty->assign('participants', $this->bo->getEntities(array('entities' => $entities, 'id' => $id, 'context' => $selectedSector, 'onlyVisibleAccounts' => $onlyVisibleAccounts, 'usePreffix' => $usePreffix), true));
 		$smarty->assign('entities', $entities);
 		$smarty->assign('id', $id);
@@ -126,4 +132,5 @@
 		$smarty->assign('hideOrganizations', $hideOrganizations);
 		$smarty->assign('hideSectors', $hideSectors);
+		$smarty->assign('onlyVisibleAccounts', $onlyVisibleAccounts);
 		$smarty->assign('header', $smarty->expressoHeader);
 		$smarty->assign('txt_loading', lang("loading"));
Index: trunk/workflow/inc/class.WorkflowLDAP.inc.php
===================================================================
--- trunk/workflow/inc/class.WorkflowLDAP.inc.php	(revision 2591)
+++ trunk/workflow/inc/class.WorkflowLDAP.inc.php	(revision 3041)
@@ -377,7 +377,10 @@
 	 * @access public
 	 */
-	function getUsers($context)
-	{
-		$filter = '(&(phpgwaccounttype=u)(!(phpgwAccountVisible=-1)))';
+	function getUsers($context, $onlyVisibleAccounts = true)
+	{
+		$filter = '(phpgwaccounttype=u)';
+		if($onlyVisibleAccounts)
+			$filter = '(&' . $filter . '(!(phpgwAccountVisible=-1)))';
+
 		$elements = array('uidnumber', 'cn', 'mail');
 		return $this->getEntities($context, $filter, $elements, 'u', false);
@@ -561,5 +564,5 @@
 	 * @access public
 	 */
-	function search($searchTerm, $includeUsers = true, $includeGroups = false, $includeLists = false, $context = null)
+	function search($searchTerm, $includeUsers = true, $includeGroups = false, $includeLists = false, $context = null, $onlyVisibleAccounts = true)
 	{
 		if (!($includeUsers || $includeGroups || $includeLists))
@@ -586,5 +589,9 @@
 			$entityFilter = $entityFilter[0];
 
-		$filter = "(&{$entityFilter}(cn={$searchTerm})(!(phpgwAccountVisible=-1)))";
+		if($onlyVisibleAccounts)
+			$filter = "(&{$entityFilter}(cn={$searchTerm})(!(phpgwAccountVisible=-1)))";
+		else
+			$filter = "(&{$entityFilter}(cn={$searchTerm}))";
+
 		$resourceIdentifier = ldap_search($this->dataSource, $context, $filter, array('cn', 'uidnumber', 'gidnumber', 'phpgwaccounttype', 'mail'));
 		ldap_sort($this->dataSource, $resourceIdentifier, 'cn');
Index: trunk/workflow/inc/smarty/wf_plugins/function.wf_select_user.php
===================================================================
--- trunk/workflow/inc/smarty/wf_plugins/function.wf_select_user.php	(revision 2591)
+++ trunk/workflow/inc/smarty/wf_plugins/function.wf_select_user.php	(revision 3041)
@@ -12,4 +12,5 @@
  * - email_as_textarea : indica se o campo que receberá os emails deve ser um textarea (valor true) ou input type text (valor false). Este parâmetro só tem validade se get_email for true.
  * - hide_groups : indica se deve-se omitir os grupos na tela de seleção.
+ * - onlyVisibleAccounts : indica se devem ser recuperadas apenas as contas visíveis, ou se as ocultas também devem ser listadas.
  * - organization : nome da organização que estará previamente selecionada.
  * - title : texto da tooltip que aparecerá quando o usuário colocar o mouse sobre o ícone para adicionar usuário.
@@ -35,4 +36,5 @@
 		'hide_organizations' => false,
 		'hide_sectors' => false,
+		'onlyVisibleAccounts' => true,
 		'rows'=> 2);
 	$extractParams = array(
@@ -42,5 +44,6 @@
 		'title',
 		'cols',
-		'rows');
+		'rows',
+		'onlyVisibleAccounts');
 
 	/* verifica se todos os parâmetros obrigatórios foram passados */
@@ -93,9 +96,13 @@
 	if ($params['hide_sectors'] == true)
 		$extraParams .= "&hideSectors=1";
+	if (empty($onlyVisibleAccounts) || $onlyVisibleAccounts === 'false')
+		$extraParams .= "&onlyVisibleAccounts=false";
+	else
+		$extraParams .= "&onlyVisibleAccounts=true";
 
 	$image = Factory::getInstance('TemplateServer')->generateImageLink('add_user.png');
 
-$output .= <<<EOF
-	<a alt="$title" title="$title" href="javascript:void(0)" onclick="openParticipants('$name', '$extraParams');"><img border="0" alt="" src="$image" /></a>
+	$output .= <<<EOF
+		<a alt="$title" title="$title" href="javascript:void(0)" onclick="openParticipants('$name', '$extraParams');"><img border="0" alt="" src="$image" /></a>
 EOF;
 	return $output;
Index: trunk/workflow/inc/smarty/wf_plugins/function.wf_select_users.php
===================================================================
--- trunk/workflow/inc/smarty/wf_plugins/function.wf_select_users.php	(revision 2591)
+++ trunk/workflow/inc/smarty/wf_plugins/function.wf_select_users.php	(revision 3041)
@@ -8,4 +8,5 @@
  * - value : usuários e grupos previamente selecionados. Deve estar no formato de matriz, seguindo o seguinte padrão: ::$matriz["u123"]="Nome do usuário 123" ; $matriz["g321"]="Nome do grupo 321" e, assim por diante.
  * - hide_groups : indica se deve-se omitir os grupos na tela de seleção.
+ * - onlyVisibleAccounts : indica se devem ser recuperadas apenas as contas visíveis, ou se as ocultas também devem ser listadas.
  * - organization : nome da organização que estará previamente selecionada.
  * @param object &$smarty Instância do objeto smarty em uso
@@ -24,8 +25,10 @@
 		'hide_organizations' => false,
 		'hide_sectors' => false,
+		'onlyVisibleAccounts' => true,
 		'value' => array());
 	$extractParams = array(
 		'name',
-		'value');
+		'value',
+		'onlyVisibleAccounts');
 
 	/* verifica se todos os parâmetros obrigatórios foram passados */
@@ -54,4 +57,8 @@
 	if ($params['hide_sectors'] == true)
 		$extraParams .= "&hideSectors=1";
+	if (empty($onlyVisibleAccounts) || $onlyVisibleAccounts === 'false')
+		$extraParams .= "&onlyVisibleAccounts=false";
+	else
+		$extraParams .= "&onlyVisibleAccounts=true";
 
 	$output = '<table border="0"><tr><td>';
@@ -66,7 +73,7 @@
 	$output .= "</td><td>";
 	$output .= <<<EOF
-		<a href='javascript:void(0)' onclick="openParticipants(500, 270, '$name', '$extraParams');"><img border="0" src="$imagesPath/add_group.png"></a>
+		<a href='javascript:void(0)' onclick="openParticipants(500, 315, '$name', '$extraParams');"><img border="0" src="$imagesPath/add_group.png"></a>
 		<br />
-		<a href='javascript:void(0)' onclick="openParticipants(500, 270, '$name', '$extraParams');">Adicionar</a>
+		<a href='javascript:void(0)' onclick="openParticipants(500, 315, '$name', '$extraParams');">Adicionar</a>
 		<br /><br />
 		<a href='javascript:void(0)' onclick="delUsers('$name');"><img border="0" src="$imagesPath/delete_group.png"></a>
