';
echo '';
echo '
';
echo '';
echo '';
echo '';
exit;
}
}
// Header
if (is_metaconsole() === true) {
agents_meta_print_header();
$sec = 'advanced';
} else {
if ($id_group) {
$title_in_header = __('Update group');
} else {
$title_in_header = __('Create group');
}
// Header.
ui_print_standard_header(
$title_in_header,
'images/group.png',
false,
'',
false,
[],
[
[
'link' => '',
'label' => __('Profiles'),
],
[
'link' => '',
'label' => __('Manage agents group'),
],
]
);
$sec = 'gagente';
}
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
if (defined('METACONSOLE')) {
if ($id_group) {
$table->head[0] = __('Update Group');
} else {
$table->head[0] = __('Create Group');
}
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
}
$table->style[0] = 'font-weight: bold';
$table->data = [];
$table->data[0][0] = __('Name');
$table->data[0][1] = html_print_input_text('name', $name, '', 35, 100, true);
$table->data[1][0] = __('Icon');
$files = list_files('images/groups_small/', 'png', 1, 0);
foreach ($files as $key => $f) {
// Remove from the list the non-desired .png files
if (strpos($f, '.bad.png') !== false || strpos($f, '.default.png') !== false || strpos($f, '.ok.png') !== false || strpos($f, '.warning.png') !== false) {
unset($files[$key]);
}
}
$table->data[1][1] = html_print_select($files, 'icon', $icon, '', 'None', '', true);
$table->data[1][1] .= ' ';
if ($icon) {
$table->data[1][1] .= html_print_image('images/groups_small/'.$icon, true);
}
$table->data[1][1] .= '';
$table->data[2][0] = __('Parent');
$acl_parent = true;
if ($id_group) {
// The user can access to the parent, but she want to edit the group.
if (!check_acl($config['id_user'], $id_parent, 'AR')) {
$acl_parent = false;
$table->data[2][1] = __('You have not access to the parent.').html_print_input_hidden('id_parent', $id_parent, true);
} else {
$table->data[2][1] = '';
$table->data[2][1] .= html_print_select_groups(
false,
'AR',
false,
'id_parent',
$id_parent,
'',
__('None'),
-1,
true,
false,
true,
'',
false,
false,
false,
$id_group
);
$table->data[2][1] .= '
';
}
} else {
$table->data[2][1] = '';
$table->data[2][1] .= html_print_input(
[
'type' => 'select_groups',
'name' => 'id_parent',
'selected' => $id_parent,
'return' => true,
'returnAllGroup' => false,
'nothing' => __('None'),
'nothing_value' => -1,
]
);
$table->data[2][1] .= '
';
}
if ($acl_parent) {
$table->data[2][1] .= ' ';
$table->data[2][1] .= html_print_image('images/groups_small/'.( $id_parent != 0 ? groups_get_icon($id_parent) : 'without_group').'.png', true);
$table->data[2][1] .= '';
}
$i = 3;
if ($config['enterprise_installed']) {
$i = 4;
$table->data[3][0] = __('Group Password');
$table->data[3][1] = html_print_input_password('group_pass', $group_pass, '', 16, 255, true);
}
$table->data[$i][0] = __('Alerts').ui_print_help_tip(__('Enable alert use in this group.'), true);
$table->data[$i][1] = html_print_checkbox_switch('alerts_enabled', 1, ! $alerts_disabled, true);
$i++;
$table->data[$i][0] = __('Propagate ACL').ui_print_help_tip(__('Propagate the same ACL security into the child subgroups.'), true);
$table->data[$i][1] = html_print_checkbox_switch('propagate', 1, $propagate, true);
$i++;
$table->data[$i][0] = __('Custom ID');
$table->data[$i][1] = html_print_input_text('custom_id', $custom_id, '', 16, 255, true);
$i++;
$table->data[$i][0] = __('Description');
$table->data[$i][1] = html_print_input_text('description', $description, '', 60, 255, true);
$i++;
$table->data[$i][0] = __('Contact').ui_print_help_tip(__('Contact information accessible through the _groupcontact_ macro'), true);
$table->data[$i][1] = html_print_textarea('contact', 4, 40, $contact, "class='min-height-0px'", true);
$i++;
$table->data[$i][0] = __('Other').ui_print_help_tip(__('Information accessible through the _group_other_ macro'), true);
$table->data[$i][1] = html_print_textarea('other', 4, 40, $other, "class='min-height-0px'", true);
$i++;
// $isFunctionSkins = enterprise_include_once('include/functions_skins.php');
// if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK && !defined('METACONSOLE')) {
// $table->data[10][0] = __('Skin');
// $table->data[10][1] = skins_print_select($config['id_user'], 'skin', $skin, '', __('None'), 0, true);
// }
$table->data[$i][0] = __('Max agents allowed').' '.ui_print_help_tip(__('Set the maximum of agents allowed for this group. 0 is unlimited.'), true);
$table->data[$i][1] = html_print_input_text('max_agents', $max_agents, '', 10, 255, true);
$i++;
if (defined('METACONSOLE')) {
$sec = 'advanced';
} else {
$sec = 'gagente';
}
echo '';
enterprise_hook('close_meta_frame');
?>