2010-07-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: added the function "print_select_groups" to print the field select box for groups with tree style. * include/functions_db.php: in function "get_user_groups" added test to false value in parameter $privilege for get all groups without ACL test. Fixed in function "get_user_groups_tree" the call to "get_user_groups" with the correct parameters. * operation/incidents/incident.php, operation/incidents/incident_detail.php, operation/events/events.php, operation/agentes/status_monitor.php, operation/agentes/estado_agente.php, operation/agentes/alerts_status.functions.php, operation/agentes/exportdata.php, operation/agentes/networkmap.php, operation/messages/message.php, general/ui/agents_list.php, godmode/groups/configure_group.php, godmode/groups/group_list.php, godmode/agentes/massive_add_alerts.php, godmode/agentes/massive_delete_agents.php, godmode/agentes/massive_config.php, godmode/agentes/massive_delete_action_alerts.php, godmode/agentes/massive_delete_alerts.php, godmode/agentes/modificar_agente.php, godmode/agentes/massive_delete_modules.php, godmode/agentes/massive_add_action_alerts.php, godmode/agentes/planned_downtime.php, godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php, godmode/servers/manage_recontask_form.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/alert_compounds.php, godmode/alerts/configure_alert_template.php, godmode/alerts/configure_alert_action.php, godmode/setup/gis_step_2.php, godmode/users/configure_user.php, godmode/gis_maps/configure_gis_map.php, godmode/reporting/graph_builder.main.php, godmode/reporting/reporting_builder.main.php, godmode/reporting/visual_console_builder.data.php: changed the fields select box of group to tree style select box for groups. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3009 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
11107f82e4
commit
cebd7b2ceb
|
@ -1,3 +1,41 @@
|
|||
2010-07-15 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_html.php: added the function "print_select_groups" to
|
||||
print the field select box for groups with tree style.
|
||||
|
||||
* include/functions_db.php: in function "get_user_groups" added test to
|
||||
false value in parameter $privilege for get all groups without ACL test.
|
||||
Fixed in function "get_user_groups_tree" the call to "get_user_groups" with
|
||||
the correct parameters.
|
||||
|
||||
* operation/incidents/incident.php, operation/incidents/incident_detail.php,
|
||||
operation/events/events.php, operation/agentes/status_monitor.php,
|
||||
operation/agentes/estado_agente.php,
|
||||
operation/agentes/alerts_status.functions.php,
|
||||
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
|
||||
operation/messages/message.php, general/ui/agents_list.php,
|
||||
godmode/groups/configure_group.php, godmode/groups/group_list.php,
|
||||
godmode/agentes/massive_add_alerts.php,
|
||||
godmode/agentes/massive_delete_agents.php,
|
||||
godmode/agentes/massive_config.php,
|
||||
godmode/agentes/massive_delete_action_alerts.php,
|
||||
godmode/agentes/massive_delete_alerts.php,
|
||||
godmode/agentes/modificar_agente.php,
|
||||
godmode/agentes/massive_delete_modules.php,
|
||||
godmode/agentes/massive_add_action_alerts.php,
|
||||
godmode/agentes/planned_downtime.php,
|
||||
godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php,
|
||||
godmode/servers/manage_recontask_form.php,
|
||||
godmode/alerts/configure_alert_compound.php,
|
||||
godmode/alerts/alert_compounds.php,
|
||||
godmode/alerts/configure_alert_template.php,
|
||||
godmode/alerts/configure_alert_action.php, godmode/setup/gis_step_2.php,
|
||||
godmode/users/configure_user.php, godmode/gis_maps/configure_gis_map.php,
|
||||
godmode/reporting/graph_builder.main.php,
|
||||
godmode/reporting/reporting_builder.main.php,
|
||||
godmode/reporting/visual_console_builder.data.php: changed the fields select
|
||||
box of group to tree style select box for groups.
|
||||
|
||||
2010-07-15 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions.php: added function "array_key_to_offset" to resolve
|
||||
|
|
|
@ -66,7 +66,7 @@ if ($show_filter_form) {
|
|||
$data = array ();
|
||||
$data = array ();
|
||||
$data[] = __('Group');
|
||||
$data[] = print_select (get_user_groups (false, $access),
|
||||
$data[] = print_select_groups(false, $access, true,
|
||||
'id_group', '', '', '', '', true);
|
||||
if (! $odd)
|
||||
array_push ($table->data, $data);
|
||||
|
|
|
@ -137,8 +137,7 @@ $table->data[2][1] = print_input_text_extended ('id_parent', get_agent_name ($id
|
|||
$table->data[2][1] .= print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). " " . print_help_icon("cascade_protection", true);
|
||||
|
||||
$table->data[3][0] = __('Group');
|
||||
$groups = get_user_groups (false, "AR", false);
|
||||
$table->data[3][1] = print_select ($groups, 'grupo', $grupo, '', '', 0, true);
|
||||
$table->data[3][1] = print_select_groups(false, "AR", false, 'grupo', $grupo, '', '', 0, true);
|
||||
|
||||
$table->data[4][0] = __('Interval');
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ if ((isset($_GET["operacion"])) AND ($update_group == -1) ) {
|
|||
$group_select = get_user_groups ($config['id_user']);
|
||||
$grouplist = implode (',', array_keys ($group_select));
|
||||
|
||||
echo print_select ($group_select, 'id_group', $id_group, '', '', '', true);
|
||||
echo print_select_groups($config['id_user'], "AR", true, 'id_group', $id_group, '', '', '', true);
|
||||
echo ' ';
|
||||
echo '<input type=submit name="update_group" class="sub upd" value="'.__('Filter').'">';
|
||||
echo '<br><br>';
|
||||
|
|
|
@ -92,7 +92,7 @@ $table->size[1] = '85%';
|
|||
|
||||
$table->data = array ();
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = print_select ($groups, 'id_group', $id_group,
|
||||
$table->data[0][1] = print_select_groups(false, "AR", true, 'id_group', $id_group,
|
||||
false, '', '', true);
|
||||
|
||||
$table->data[1][0] = __('Agents');
|
||||
|
|
|
@ -101,7 +101,7 @@ $table->size[1] = '85%';
|
|||
$table->data = array ();
|
||||
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = print_select ($groups, 'id_group', $id_group,
|
||||
$table->data[0][1] = print_select_groups(false, "AR", true, 'id_group', $id_group,
|
||||
'', 'Select', -1, true, false, true, '', false);
|
||||
|
||||
$table->data[1][0] = __('Agent');
|
||||
|
|
|
@ -58,7 +58,7 @@ $table->size[3] = '35%';
|
|||
/* Source selection */
|
||||
$table->id = 'source_table';
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = print_select ($groups, 'source_id_group', $source_id_group,
|
||||
$table->data[0][1] = print_select_groups(false, "AR", true, 'source_id_group', $source_id_group,
|
||||
false, '', '', true);
|
||||
$table->data[0][2] = __('Agent');
|
||||
$table->data[0][2] .= ' <span id="source_agent_loading" class="invisible">';
|
||||
|
|
|
@ -92,7 +92,7 @@ $table->size[1] = '85%';
|
|||
|
||||
$table->data = array ();
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = print_select ($groups, 'id_group', $id_group,
|
||||
$table->data[0][1] = print_select_groups(false, "AR", true, 'id_group', $id_group,
|
||||
false, '', '', true);
|
||||
|
||||
$table->data[1][0] = __('Agents');
|
||||
|
|
|
@ -82,7 +82,7 @@ $table->size[1] = '85%';
|
|||
|
||||
$table->data = array ();
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = print_select ($groups, 'id_group', $id_group,
|
||||
$table->data[0][1] = print_select_groups(false, "AR", true, 'id_group', $id_group,
|
||||
false, '', '', true);
|
||||
|
||||
$table->data[1][0] = __('Agents');
|
||||
|
|
|
@ -100,7 +100,7 @@ $table->data[0][1] = print_select (index_array ($templates, 'id', 'name'),
|
|||
'id_alert_template', $id_alert_template, false, __('Select'), 0, true);
|
||||
|
||||
$table->data[1][0] = __('Group');
|
||||
$table->data[1][1] = print_select ($groups, 'id_group', $id_group,
|
||||
$table->data[1][1] = print_select_groups(false, "AR", true, 'id_group', $id_group,
|
||||
'', '', '', true, false, true, '', $id_alert_template == 0);
|
||||
|
||||
$table->data[2][0] = __('Agent');
|
||||
|
|
|
@ -103,7 +103,7 @@ $table->data[0][1] = print_select (index_array ($modules, 'nombre', 'nombre'),
|
|||
'module_name', $module_name, false, __('Select'), '', true);
|
||||
|
||||
$table->data[1][0] = __('Group');
|
||||
$table->data[1][1] = print_select ($groups, 'id_group', $id_group,
|
||||
$table->data[1][1] = print_select_groups(false, "AR", true, 'id_group', $id_group,
|
||||
false, '', '', true, false, true, '', empty ($module_name));
|
||||
|
||||
$table->data[2][0] = __('Agent');
|
||||
|
|
|
@ -68,7 +68,7 @@ echo "<table cellpadding='4' cellspacing='4' class='databox' width='770'><tr>";
|
|||
echo "<td valign='top'>".__('Group')."</td>";
|
||||
echo "<td valign='top'>";
|
||||
|
||||
print_select (get_user_groups(), "ag_group", $ag_group, 'this.form.submit();', '', 0);
|
||||
print_select_groups(false, "AR", true, "ag_group", $ag_group, 'this.form.submit();', '', 0);
|
||||
|
||||
echo "<td valign='top'>
|
||||
<noscript>
|
||||
|
|
|
@ -158,7 +158,7 @@ if ($create_downtime || $update_downtime) {
|
|||
$table->data[4][1] .= print_input_text ('time_to', $time_to, '', 7, 7, true);
|
||||
|
||||
$table->data[5][0] = __('Group');
|
||||
$table->data[5][1] = print_select ($groups, 'id_group', $id_group, '', '', 0, true);
|
||||
$table->data[5][1] = print_select_groups(false, "AR", true, 'id_group', $id_group, '', '', 0, true);
|
||||
echo '<form method="POST" action="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime">';
|
||||
|
||||
if ($id_downtime > 0){
|
||||
|
@ -206,7 +206,7 @@ if ($create_downtime || $update_downtime) {
|
|||
|
||||
echo "<form method=post action='index.php?sec=gagente&sec2=godmode/agentes/planned_downtime&first_update=1&id_downtime=$id_downtime'>";
|
||||
|
||||
print_select ($groups, 'filter_group', $filter_group);
|
||||
print_select_groups(false, "AR", true, 'filter_group', $filter_group);
|
||||
echo "<br /><br />";
|
||||
print_submit_button (__('Filter by group'), '', false, 'class="sub next"',false);
|
||||
echo "</form>";
|
||||
|
|
|
@ -94,7 +94,7 @@ $table->size[2] = '15%';
|
|||
$table->size[3] = '35%';
|
||||
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = print_select ($groups, 'id_group', $id_group, false, '',
|
||||
$table->data[0][1] = print_select_groups(0, "LM", true, 'id_group', $id_group, false, '',
|
||||
'', true);
|
||||
$table->data[0][2] = __('Agent');
|
||||
$table->data[0][2] .= ' <span id="agent_loading" class="invisible">';
|
||||
|
|
|
@ -60,7 +60,7 @@ $table->data[0][1] = print_input_text ('name', $name, '', 35, 255, true);
|
|||
$table->data[1][0] = __('Group');
|
||||
|
||||
$groups = get_user_groups ();
|
||||
$table->data[1][1] = print_select ($groups, 'group', $group, '', '', 0, true);
|
||||
$table->data[1][1] = print_select_groups(false, "AR", true, 'group', $group, '', '', 0, true);
|
||||
|
||||
$table->data[2][0] = __('Command');
|
||||
$table->data[2][1] = print_select_from_sql ('SELECT id, name FROM talert_commands',
|
||||
|
|
|
@ -536,7 +536,7 @@ if ($step == 1) {
|
|||
$table->size[3] = '40%';
|
||||
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = print_select ($groups, 'search_id_group', $id_group,
|
||||
$table->data[0][1] = print_select_groups(false, "AR", true, 'search_id_group', $id_group,
|
||||
false, '', '', true);
|
||||
$table->data[0][2] = __('Agent');
|
||||
$table->data[0][3] = print_select (get_group_agents ($id_group, false, "none"),
|
||||
|
|
|
@ -443,7 +443,7 @@ if ($step == 2) {
|
|||
|
||||
$table->data[0][1] .= " ". __("Group");
|
||||
$groups = get_user_groups ();
|
||||
$table->data[0][1] .= " ".print_select ($groups, 'id_group', $id_group, '', '', 0, true);
|
||||
$table->data[0][1] .= " ".print_select_groups(false, "AR", true, 'id_group', $id_group, '', '', 0, true);
|
||||
|
||||
$table->data[1][0] = __('Description');
|
||||
$table->data[1][1] = print_textarea ('description', 10, 30,
|
||||
|
|
|
@ -335,7 +335,7 @@ $table->data[1][1] = "<table class='databox' border='0' id='map_connection'>
|
|||
</table>";
|
||||
|
||||
$table->data[2][0] = __('Group') . print_help_tip (__('Group that owns the map'), true). ':';
|
||||
$table->data[2][1] = print_select_from_sql('SELECT id_grupo, nombre FROM tgrupo', 'map_group_id', $map_group_id, '', __('All'), '0', true);
|
||||
$table->data[2][1] = print_select_groups(false, false, false, 'map_group_id', $map_group_id, '', __('All'), '0', true);
|
||||
|
||||
$table->data[3][0] = __('Default zoom') . print_help_tip (__('Default zoom level when opening the map'), true). ':';
|
||||
$table->data[3][1] = print_input_text ('map_zoom_level', $map_zoom_level, '', 2, 4, true) . print_input_hidden('map_levels_zoom', $map_levels_zoom, true);
|
||||
|
@ -383,7 +383,7 @@ $table->data[1][1] = '<div id="form_layer">
|
|||
</tr>
|
||||
<tr>
|
||||
<td>' . __('Show agents from group') . ':</td>
|
||||
<td colspan="3">' . print_select_from_sql('SELECT 0 as id_grupo, "'.__('All').'" as nombre FROM tgrupo UNION SELECT id_grupo, nombre FROM tgrupo', 'layer_group_form', '-1', '', __('None'), '-1', true) . '</td>
|
||||
<td colspan="3">' . print_select_groups(false, false, true, 'layer_group_form', '-1', '', __('None'), '-1', true) . '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"><hr /></td>
|
||||
|
|
|
@ -78,7 +78,7 @@ $sql = 'SELECT id_grupo, nombre FROM tgrupo ';
|
|||
if ($id_group)
|
||||
$sql .= sprintf ('WHERE id_grupo != %d', $id_group);
|
||||
$groups = get_user_groups();
|
||||
$table->data[2][1] = print_select($groups, 'id_parent', 0, '', '', '', true);
|
||||
$table->data[2][1] = print_select_groups(false, "AR", true, 'id_parent', 0, '', '', '', true);
|
||||
$table->data[2][1] .= ' <span id="parent_preview">';
|
||||
if ($id_parent) {
|
||||
echo '<img src="images/groups_small/'.get_group_icon ($id_parent).'.png" />';
|
||||
|
|
|
@ -159,7 +159,7 @@ $table->align = array ();
|
|||
$table->align[3] = 'center';
|
||||
$table->data = array ();
|
||||
|
||||
$groups = get_user_groups_tree ($config['id_user'], "AR", false);
|
||||
$groups = get_user_groups_tree ($config['id_user'], "AR", true);
|
||||
$iterator = 0;
|
||||
|
||||
foreach ($groups as $id_group => $group) {
|
||||
|
|
|
@ -103,7 +103,7 @@ echo ">";
|
|||
|
||||
$group_select = get_user_groups ($config['id_user']);
|
||||
echo "<td><b>".__('Group')."</b></td><td>" .
|
||||
print_select ($group_select, 'graph_id_group', $id_group, '', '', '', true) .
|
||||
print_select_groups($config['id_user'], "AR", true, 'graph_id_group', $id_group, '', '', '', true) .
|
||||
"</td></tr>";
|
||||
echo "<tr>";
|
||||
echo "<td class='datos2'><b>".__('Description')."</b></td>";
|
||||
|
|
|
@ -52,7 +52,7 @@ $table->data['name'][0] = __('Name');
|
|||
$table->data['name'][1] = print_input_text('name', $reportName, __('Name'), 20, 40, true);
|
||||
|
||||
$table->data['group'][0] = __('Group');
|
||||
$table->data['group'][1] = print_select ($groups, 'id_group', $idGroupReport, false, '', '', true);
|
||||
$table->data['group'][1] = print_select_groups(false, "AR", true, 'id_group', $idGroupReport, false, '', '', true);
|
||||
|
||||
$table->data['description'][0] = __('Description');
|
||||
$table->data['description'][1] = print_textarea('description', 5, 15, $description, '', true);
|
||||
|
|
|
@ -48,7 +48,7 @@ $table->data[0][0] = __('Name:');
|
|||
$table->data[0][1] = print_input_text ('name', $visualConsoleName, '', 15, 50, true);
|
||||
$table->data[1][0] = __('Group:');
|
||||
$groups = get_user_groups ($config['id_user']);
|
||||
$table->data[1][1] = print_select ($groups, 'id_group', $idGroup, '', '', '', true);
|
||||
$table->data[1][1] = print_select_groups($config['id_user'], "AR", true, 'id_group', $idGroup, '', '', '', true);
|
||||
$backgrounds_list = list_files ('images/console/background/', "jpg", 1, 0);
|
||||
$backgrounds_list = array_merge ($backgrounds_list, list_files ('images/console/background/', "png", 1, 0));
|
||||
$table->data[2][0] = __('Background');
|
||||
|
|
|
@ -108,9 +108,7 @@ $table->data[6][1] .= '<a href="#" class="tip"> <span>'.__('Ports defined l
|
|||
// Group
|
||||
$table->data[7][0] = "<b>".__('Group');
|
||||
$groups = get_user_groups (false, "AR", false);
|
||||
$table->data[7][1] = print_select ($groups, 'id_group', $id_group, '', '', 0, true);
|
||||
//$table->data[7][1] = print_select_from_sql ('SELECT id_grupo, nombre FROM tgrupo ORDER BY nombre', "id_group", $id_group, '', 'All', 0, true);
|
||||
|
||||
$table->data[7][1] = print_select_groups(false, "AR", false, 'id_group', $id_group, '', '', 0, true);
|
||||
|
||||
// Incident
|
||||
$values = array (0 => __('No'), 1 => __('Yes'));
|
||||
|
|
|
@ -150,7 +150,7 @@ $table->data[0][0] = __('Connection Name') .print_help_tip (__('Descriptive name
|
|||
$table->data[0][1] = print_input_text ('name', $mapConnection_name, '', 30, 60, true);
|
||||
|
||||
$table->data[1][0] = __("Group") .print_help_tip (__('Group that owns the connection'), true) . ":";
|
||||
$table->data[1][1] = print_select_from_sql('SELECT id_grupo, nombre FROM tgrupo', 'group', $mapConnection_group, '', __('All'), '0', true);
|
||||
$table->data[1][1] = print_select_groups(false, false, false, 'group', $mapConnection_group, '', __('All'), '0', true);
|
||||
|
||||
$table->data[2][0] = __('Number of zoom levels') . ":";
|
||||
$table->data[2][1] = print_input_text ('num_levels_zoom', $mapConnection_numLevelsZoom, '', 4, 10, true);
|
||||
|
|
|
@ -321,7 +321,7 @@ $data = array ();
|
|||
$data[0] = '<form method="post">';
|
||||
$data[0] .= print_select (get_profiles (), 'assign_profile', 0, '', __('None'),
|
||||
0, true, false, false);
|
||||
$data[1] = print_select (get_user_groups ($config['id_user'], 'UM'),
|
||||
$data[1] = print_select_groups($config['id_user'], "UM", true,
|
||||
'assign_group', -1, '', __('None'), -1, true, false, false);
|
||||
$data[2] = print_input_image ('add', 'images/add.png', 1, '', true);
|
||||
$data[2] .= print_input_hidden ('id', $id, true);
|
||||
|
|
|
@ -1477,7 +1477,7 @@ function get_all_model_groups () {
|
|||
* Get all the groups a user has reading privileges.
|
||||
*
|
||||
* @param string User id
|
||||
* @param string The privilege to evaluate
|
||||
* @param string The privilege to evaluate, and it is false then no check ACL.
|
||||
* @param boolean $returnAllGroup Flag the return group, by default true.
|
||||
* @param boolean $returnAllColumns Flag to return all columns of groups.
|
||||
*
|
||||
|
@ -1507,7 +1507,15 @@ function get_user_groups ($id_user = false, $privilege = "AR", $returnAllGroup =
|
|||
}
|
||||
|
||||
foreach ($groups as $group) {
|
||||
if (give_acl ($id_user, $group["id_grupo"], $privilege)) {
|
||||
if ($privilege === false) {
|
||||
if ($returnAllColumns) {
|
||||
$user_groups[$group['id_grupo']] = $group;
|
||||
}
|
||||
else {
|
||||
$user_groups[$group['id_grupo']] = $group['nombre'];
|
||||
}
|
||||
}
|
||||
else if (give_acl ($id_user, $group["id_grupo"], $privilege)) {
|
||||
if ($returnAllColumns) {
|
||||
$user_groups[$group['id_grupo']] = $group;
|
||||
}
|
||||
|
@ -1566,7 +1574,7 @@ function get_user_groups_tree_recursive($groups, $parent = 0, $deep = 0) {
|
|||
* @return array A treefield list of the groups the user has certain privileges.
|
||||
*/
|
||||
function get_user_groups_tree($id_user = false, $privilege = "AR", $returnAllGroup = true) {
|
||||
$user_groups = get_user_groups (false, "AR", true, true);
|
||||
$user_groups = get_user_groups ($id_user, $privilege, $returnAllGroup, true);
|
||||
|
||||
$user_groups_tree = get_user_groups_tree_recursive($user_groups);
|
||||
|
||||
|
|
|
@ -139,6 +139,47 @@ function print_select_style ($fields, $name, $selected = '', $style='', $script
|
|||
echo $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the groups of user of fields in a popup menu of a form.
|
||||
*
|
||||
* @param string User id
|
||||
* @param string The privilege to evaluate
|
||||
* @param boolean $returnAllGroup Flag the return group, by default true.
|
||||
* @param boolean $returnAllColumns Flag to return all columns of groups.
|
||||
* @param array Array with dropdown values. Example: $fields["value"] = "label"
|
||||
* @param string Select form name
|
||||
* @param variant Current selected value. Can be a single value or an
|
||||
* array of selected values (in combination with multiple)
|
||||
* @param string Javascript onChange code.
|
||||
* @param string Label when nothing is selected.
|
||||
* @param variant Value when nothing is selected
|
||||
* @param bool Whether to return an output string or echo now (optional, echo by default).
|
||||
* @param bool Set the input to allow multiple selections (optional, single selection by default).
|
||||
* @param bool Whether to sort the options or not (optional, unsorted by default).
|
||||
* @param string $style The string of style.
|
||||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
*/
|
||||
function print_select_groups($id_user = false, $privilege = "AR", $returnAllGroup = true,
|
||||
$name, $selected = '', $script = '', $nothing = '', $nothing_value = 0, $return = false,
|
||||
$multiple = false, $sort = true, $class = '', $disabled = false, $style = false, $option_style = false) {
|
||||
|
||||
$user_groups = get_user_groups ($id_user, $privilege, $returnAllGroup, true);
|
||||
|
||||
$user_groups_tree = get_user_groups_tree_recursive($user_groups);
|
||||
|
||||
$fields = array();
|
||||
foreach ($user_groups_tree as $group) {
|
||||
$fields[$group['id_grupo']] = str_repeat(" ", $group['deep']) . $group['nombre'];
|
||||
}
|
||||
|
||||
$output = print_select ($fields, $name, $selected, $script, $nothing, $nothing_value,
|
||||
$return, $multiple, false, $class, $disabled, $style, $option_style);
|
||||
|
||||
if ($return) {
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints an array of fields in a popup menu of a form.
|
||||
|
|
|
@ -43,7 +43,7 @@ function printFormFilterAlert($id_group, $filter, $free_search, $url) {
|
|||
$table->style = array ();
|
||||
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = print_select (get_user_groups (), "ag_group", $id_group,
|
||||
$table->data[0][1] = print_select_groups(false, "AR", true, "ag_group", $id_group,
|
||||
'javascript:this.form.submit();', '', '', true);
|
||||
|
||||
$alert_status_filter = array();
|
||||
|
|
|
@ -81,7 +81,7 @@ echo '<table cellpadding="4" cellspacing="4" class="databox" width="95%">';
|
|||
echo '<tr><td style="white-space:nowrap;">'.__('Group').': ';
|
||||
|
||||
$groups = get_user_groups ();
|
||||
print_select ($groups, 'group_id', $group_id, 'this.form.submit()', '', '');
|
||||
print_select_groups(false, "AR", true, 'group_id', $group_id, 'this.form.submit()', '', '');
|
||||
|
||||
echo '</td><td style="white-space:nowrap;">';
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ $table->data[0][0] = '<b>'.__('Group').'</b>';
|
|||
|
||||
$groups = get_user_groups ($config['id_user'], "AR");
|
||||
|
||||
$table->data[0][1] = print_select ($groups, "group", $group, 'this.form.submit();', '', 0, true, false, true, 'w130', false);
|
||||
$table->data[0][1] = print_select_groups($config['id_user'], "AR", true, "group", $group, 'this.form.submit();', '', 0, true, false, true, 'w130', false);
|
||||
|
||||
//Agent selector
|
||||
$table->data[1][0] = '<b>'.__('Source agent').'</b>';
|
||||
|
|
|
@ -67,7 +67,7 @@ echo '<form action="index.php?sec=estado&sec2=operation/agentes/networkmap&a
|
|||
echo '<table cellpadding="4" cellspacing="4" class="databox" width="100%">';
|
||||
echo '<tr>';
|
||||
echo '<td valign="top">' . __('Group') . '<br />';
|
||||
print_select_from_sql ('SELECT id_grupo, nombre FROM tgrupo WHERE id_grupo > 0 ORDER BY nombre', 'group', $group, '', 'All', 0, false);
|
||||
print_select_groups(false, false, false, 'group', $group, '', 'All', 0, false);
|
||||
echo '</td>';
|
||||
echo '<td valign="top">' . __('Layout') . '<br />';
|
||||
print_select ($layout_array, 'layout', $layout, '', '', '');
|
||||
|
|
|
@ -44,7 +44,7 @@ echo '<table cellspacing="4" cellpadding="4" width="750" class="databox">';
|
|||
echo '<tr><td valign="middle">'.__('Group').'</td>';
|
||||
echo '<td valign="middle">';
|
||||
|
||||
print_select (get_user_groups (), "ag_group", $ag_group, 'this.form.submit();',
|
||||
print_select_groups(false, "AR", true, "ag_group", $ag_group, 'this.form.submit();',
|
||||
'', '0', false, false, false, 'w130', false, 'width:150px;');
|
||||
|
||||
echo "</td>";
|
||||
|
|
|
@ -271,7 +271,7 @@ echo '<table style="float:left;" width="550" cellpadding="4" cellspacing="4" cla
|
|||
|
||||
// Group combo
|
||||
echo "<td>".__('Group')."</td><td>";
|
||||
print_select ($groups, 'ev_group', $ev_group, '', '', 0, false, false, false, 'w130');
|
||||
print_select_groups($config["id_user"], "IR", true, 'ev_group', $ev_group, '', '', 0, false, false, false, 'w130');
|
||||
echo "</td>";
|
||||
|
||||
// Event type
|
||||
|
|
|
@ -209,7 +209,7 @@ print_select (get_users_info (), "usuario", $usuario, 'javascript:this.form.subm
|
|||
|
||||
echo '</td></tr><tr><td colspan=3>';
|
||||
|
||||
print_select ($groups, "grupo", $grupo, 'javascript:this.form.submit();', '', '',false,false,false,'w155');
|
||||
print_select_groups($config["id_user"], "IR", true, "grupo", $grupo, 'javascript:this.form.submit();', '', '',false,false,false,'w155');
|
||||
|
||||
echo " ";
|
||||
|
||||
|
|
|
@ -259,9 +259,9 @@ echo '</td><td class="datos2"><b>'.__('Group').'</b></td><td class="datos2">';
|
|||
|
||||
// Group combo
|
||||
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||
print_select (get_user_groups ($config["id_user"], "IR"), "grupo_form", $id_grupo, '', '', '', false, false, false, 'w135');
|
||||
print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, false, 'w135');
|
||||
} else {
|
||||
print_select (get_user_groups ($config["id_user"], "IR"), "grupo_form", $id_grupo, '', '', '', false, false, true, 'w135', true);
|
||||
print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, true, 'w135', true);
|
||||
}
|
||||
|
||||
echo '</td></tr><tr><td class="datos"><b>'.__('Priority').'</b></td><td class="datos">';
|
||||
|
|
|
@ -89,7 +89,7 @@ if (isset ($_GET["new_msg"])) { //create message
|
|||
|
||||
print_select ($users, "dest_user", $dest_user, '', __('-Select user-'), false, false, false, '', false);
|
||||
echo ' - '.__('OR').' - ';
|
||||
print_select ($groups, "dest_group", $dest_group, '', __('-Select group-'), false, false, false, '', false);
|
||||
print_select_groups($config["id_user"], "AR", true, "dest_group", $dest_group, '', __('-Select group-'), false, false, false, '', false);
|
||||
|
||||
echo '</td></tr><tr><td class="datos">'.__('Subject').':</td><td class="datos">';
|
||||
print_input_text ("subject", $subject, '', 50, 70, false);
|
||||
|
|
Loading…
Reference in New Issue