Changeset 3041 for trunk/workflow/inc
- Timestamp:
- 07/13/10 09:58:07 (14 years ago)
- Location:
- trunk/workflow/inc
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/workflow/inc/class.WorkflowLDAP.inc.php
r2591 r3041 377 377 * @access public 378 378 */ 379 function getUsers($context) 380 { 381 $filter = '(&(phpgwaccounttype=u)(!(phpgwAccountVisible=-1)))'; 379 function getUsers($context, $onlyVisibleAccounts = true) 380 { 381 $filter = '(phpgwaccounttype=u)'; 382 if($onlyVisibleAccounts) 383 $filter = '(&' . $filter . '(!(phpgwAccountVisible=-1)))'; 384 382 385 $elements = array('uidnumber', 'cn', 'mail'); 383 386 return $this->getEntities($context, $filter, $elements, 'u', false); … … 561 564 * @access public 562 565 */ 563 function search($searchTerm, $includeUsers = true, $includeGroups = false, $includeLists = false, $context = null )566 function search($searchTerm, $includeUsers = true, $includeGroups = false, $includeLists = false, $context = null, $onlyVisibleAccounts = true) 564 567 { 565 568 if (!($includeUsers || $includeGroups || $includeLists)) … … 586 589 $entityFilter = $entityFilter[0]; 587 590 588 $filter = "(&{$entityFilter}(cn={$searchTerm})(!(phpgwAccountVisible=-1)))"; 591 if($onlyVisibleAccounts) 592 $filter = "(&{$entityFilter}(cn={$searchTerm})(!(phpgwAccountVisible=-1)))"; 593 else 594 $filter = "(&{$entityFilter}(cn={$searchTerm}))"; 595 589 596 $resourceIdentifier = ldap_search($this->dataSource, $context, $filter, array('cn', 'uidnumber', 'gidnumber', 'phpgwaccounttype', 'mail')); 590 597 ldap_sort($this->dataSource, $resourceIdentifier, 'cn'); -
trunk/workflow/inc/class.bo_participants.inc.php
r2591 r3041 74 74 { 75 75 $preffix = ($usePreffix) ? 'u' : ''; 76 $ents = $this->ldap->getUsers($params['context'] );76 $ents = $this->ldap->getUsers($params['context'], $params['onlyVisibleAccounts']); 77 77 foreach ($ents as $ent) 78 78 $output[$preffix . $ent[$id]] = $ent['name']; … … 162 162 $searchLists = (strpos($entities, 'l') !== false); 163 163 164 $onlyVisibleAccounts = $params['onlyVisibleAccounts']; 165 164 166 /* faz a busca */ 165 167 $output = array(); 166 $output['participants'] = $this->ldap->search($searchTerm, $searchUsers, $searchGroups, $searchLists );168 $output['participants'] = $this->ldap->search($searchTerm, $searchUsers, $searchGroups, $searchLists, null, $onlyVisibleAccounts); 167 169 168 170 /* limita os resultados e define uma mensagem que será exibida */ -
trunk/workflow/inc/class.ui_participants.inc.php
r2591 r3041 92 92 $hideSectors = ($_REQUEST['hideSectors'] == '1') ? true : false; 93 93 94 // the default value of $onlyVisibleAccounts is true 95 if((isset($_REQUEST['onlyVisibleAccounts'])) && (empty($_REQUEST['onlyVisibleAccounts']) || $_REQUEST['onlyVisibleAccounts'] === 'false')) 96 $onlyVisibleAccounts = false; 97 else 98 $onlyVisibleAccounts = true; 99 94 100 /* define the initial organization */ 95 101 $selectedOrganization = $ldap->getOrganizationFromDN($userDN); … … 117 123 $smarty->assign('organizations', $organizationList); 118 124 $smarty->assign('selectedOrganization', $selectedOrganization); 119 $smarty->assign('sectors', $this->bo->getSectors(array('organization' => $selectedOrganization ), true));125 $smarty->assign('sectors', $this->bo->getSectors(array('organization' => $selectedOrganization, 'onlyVisibleAccounts' => $onlyVisibleAccounts), true)); 120 126 $smarty->assign('selectedSector', $selectedSector); 121 $smarty->assign('participants', $this->bo->getEntities(array('entities' => $entities, 'id' => $id, 'context' => $selectedSector, ' usePreffix' => $usePreffix), true));127 $smarty->assign('participants', $this->bo->getEntities(array('entities' => $entities, 'id' => $id, 'context' => $selectedSector, 'onlyVisibleAccounts' => $onlyVisibleAccounts, 'usePreffix' => $usePreffix), true)); 122 128 $smarty->assign('entities', $entities); 123 129 $smarty->assign('id', $id); … … 126 132 $smarty->assign('hideOrganizations', $hideOrganizations); 127 133 $smarty->assign('hideSectors', $hideSectors); 134 $smarty->assign('onlyVisibleAccounts', $onlyVisibleAccounts); 128 135 $smarty->assign('header', $smarty->expressoHeader); 129 136 $smarty->assign('txt_loading', lang("loading")); -
trunk/workflow/inc/smarty/wf_plugins/function.wf_select_user.php
r2591 r3041 12 12 * - 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. 13 13 * - hide_groups : indica se deve-se omitir os grupos na tela de seleção. 14 * - onlyVisibleAccounts : indica se devem ser recuperadas apenas as contas visíveis, ou se as ocultas também devem ser listadas. 14 15 * - organization : nome da organização que estará previamente selecionada. 15 16 * - title : texto da tooltip que aparecerá quando o usuário colocar o mouse sobre o ícone para adicionar usuário. … … 35 36 'hide_organizations' => false, 36 37 'hide_sectors' => false, 38 'onlyVisibleAccounts' => true, 37 39 'rows'=> 2); 38 40 $extractParams = array( … … 42 44 'title', 43 45 'cols', 44 'rows'); 46 'rows', 47 'onlyVisibleAccounts'); 45 48 46 49 /* verifica se todos os parâmetros obrigatórios foram passados */ … … 93 96 if ($params['hide_sectors'] == true) 94 97 $extraParams .= "&hideSectors=1"; 98 if (empty($onlyVisibleAccounts) || $onlyVisibleAccounts === 'false') 99 $extraParams .= "&onlyVisibleAccounts=false"; 100 else 101 $extraParams .= "&onlyVisibleAccounts=true"; 95 102 96 103 $image = Factory::getInstance('TemplateServer')->generateImageLink('add_user.png'); 97 104 98 $output .= <<<EOF99 <a alt="$title" title="$title" href="javascript:void(0)" onclick="openParticipants('$name', '$extraParams');"><img border="0" alt="" src="$image" /></a>105 $output .= <<<EOF 106 <a alt="$title" title="$title" href="javascript:void(0)" onclick="openParticipants('$name', '$extraParams');"><img border="0" alt="" src="$image" /></a> 100 107 EOF; 101 108 return $output; -
trunk/workflow/inc/smarty/wf_plugins/function.wf_select_users.php
r2591 r3041 8 8 * - 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. 9 9 * - hide_groups : indica se deve-se omitir os grupos na tela de seleção. 10 * - onlyVisibleAccounts : indica se devem ser recuperadas apenas as contas visíveis, ou se as ocultas também devem ser listadas. 10 11 * - organization : nome da organização que estará previamente selecionada. 11 12 * @param object &$smarty Instância do objeto smarty em uso … … 24 25 'hide_organizations' => false, 25 26 'hide_sectors' => false, 27 'onlyVisibleAccounts' => true, 26 28 'value' => array()); 27 29 $extractParams = array( 28 30 'name', 29 'value'); 31 'value', 32 'onlyVisibleAccounts'); 30 33 31 34 /* verifica se todos os parâmetros obrigatórios foram passados */ … … 54 57 if ($params['hide_sectors'] == true) 55 58 $extraParams .= "&hideSectors=1"; 59 if (empty($onlyVisibleAccounts) || $onlyVisibleAccounts === 'false') 60 $extraParams .= "&onlyVisibleAccounts=false"; 61 else 62 $extraParams .= "&onlyVisibleAccounts=true"; 56 63 57 64 $output = '<table border="0"><tr><td>'; … … 66 73 $output .= "</td><td>"; 67 74 $output .= <<<EOF 68 <a href='javascript:void(0)' onclick="openParticipants(500, 270, '$name', '$extraParams');"><img border="0" src="$imagesPath/add_group.png"></a>75 <a href='javascript:void(0)' onclick="openParticipants(500, 315, '$name', '$extraParams');"><img border="0" src="$imagesPath/add_group.png"></a> 69 76 <br /> 70 <a href='javascript:void(0)' onclick="openParticipants(500, 270, '$name', '$extraParams');">Adicionar</a>77 <a href='javascript:void(0)' onclick="openParticipants(500, 315, '$name', '$extraParams');">Adicionar</a> 71 78 <br /><br /> 72 79 <a href='javascript:void(0)' onclick="delUsers('$name');"><img border="0" src="$imagesPath/delete_group.png"></a>
Note: See TracChangeset
for help on using the changeset viewer.