'',
'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,
'rows'=> 2);
$extractParams = array(
'name',
'id_value',
'desc_value',
'title',
'cols',
'rows');
/* 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";
$image = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateImageLink('add_user.png');
$output .= <<
EOF;
return $output;
}
?>