'',
'desc_value' => '',
'get_email' => false,
'email_as_textarea' => false,
'hide_groups' => true,
'organization' => null,
'entities' => null,
'title' => '',
'cols'=> 80,
'hide_organizations' => false,
'hide_sectors' => false,
'onlyVisibleAccounts' => true,
'useGlobalSearch' => false,
'useCCParams' => false,
'size' => 27,
'rows'=> 2);
$extractParams = array(
'name',
'id_value',
'desc_value',
'title',
'cols',
'rows',
'size',
'onlyVisibleAccounts',
'useGlobalSearch');
/* verifica se todos os parâmetros obrigatórios foram passados */
foreach ($requiredParams as $required)
if (!array_key_exists($required, $params) || (empty($params[$required])))
$smarty->trigger_error("[wf_select_user] missing required parameter(s): $required", E_USER_ERROR);
/* atribui valores default para os parâmetros não passados */
foreach ($defaultValues as $key => $value)
if (!isset($params[$key]))
$params[$key] = $value;
/* extrai alguns parâmetros da matriz de parâmetros */
foreach ($extractParams as $extract)
$$extract = $params[$extract];
$name_desc = $name . "_desc";
if ($params['get_email'] == true)
{
$extraParams = "mail=1";
if ($params['email_as_textarea'])
{
$output = <<$desc_value
EOF;
} else {
$output = <<
EOF;
}
}
else
{
$extraParams = "uid=1";
$output = <<
EOF;
}
if ($params['hide_groups'] == true)
$extraParams .= "&hidegroups=1";
if (!is_null($params['organization']))
$extraParams .= "&change_org=True&organization=" . $params['organization'];
if (!is_null($params['entities']))
$extraParams .= "&entities=" . $params['entities'];
if ($params['hide_organizations'] == true)
$extraParams .= "&hideOrganizations=1";
if ($params['hide_sectors'] == true)
$extraParams .= "&hideSectors=1";
if (empty($onlyVisibleAccounts) || $onlyVisibleAccounts === 'false')
$extraParams .= "&onlyVisibleAccounts=false";
else
$extraParams .= "&onlyVisibleAccounts=true";
if (empty($useGlobalSearch) || $useGlobalSearch === 'false')
$extraParams .= "&useGlobalSearch=false";
else
$extraParams .= "&useGlobalSearch=true";
if (!empty($params['useCCParams']) && $params['useCCParams'] !== 'false')
$extraParams .= "&useCCParams=true";
$image = Factory::getInstance('TemplateServer')->generateImageLink('add_user.png');
$output .= <<
EOF;
return $output;
}
?>