';
$table->width = '95%';
$table->class = "databox_color";
$table->head = array ();
$table->style = array ();
$table->style[0] = 'font-weight: bold; width: 150px;';
$table->data = array ();
$groups = users_get_groups ($config["id_user"], "AR",false);
$agents = agents_get_group_agents (array_keys ($groups));
$table->data[0][0] = __('Parent');
$table->data[0][1] = html_print_input_text_extended ('id_parent', agents_get_name ($id_parent), 'text-id_parent', '', 30, 100, false, '',
array('style' => 'background: url(images/lightning.png) no-repeat right;'), true)
. '
' . __("Type at least two characters to search") . '';
$table->data[0][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). " " . ui_print_help_icon("cascade_protection", true);
$table->data[1][0] = __('Group');
$table->data[1][1] = html_print_select_groups(false, "AR", false, 'group', $group, '', __('No change'), -1, true, false, true, '', false, 'width: 150px;');
$table->data[2][0] = __('Interval');
$intervals = array ();
$intervals[30] = human_time_description_raw (30);
$intervals[60] = human_time_description_raw (60);
$intervals[300] = human_time_description_raw (300);
$intervals[600] = human_time_description_raw (600);
$intervals[1200] = human_time_description_raw (1200);
$intervals[1800] = human_time_description_raw (1800);
$intervals[3600] = human_time_description_raw (3600);
$intervals[7200] = human_time_description_raw (7200);
$table->data[2][1] = html_print_extended_select_for_time ($intervals, 'interval', $interval, '', '', '0', 10, true, 'width: 150px') . __(" seconds.");
$table->data[3][0] = __('OS');
$table->data[3][1] = html_print_select_from_sql ('SELECT id_os, name FROM tconfig_os',
'id_os', $id_os, '', __('No change'), -1, true, false, true, false, 'width: 105px;');
$table->data[3][1] .= '
';
$table->data[3][1] .= ui_print_os_icon ($id_os, false, true);
$table->data[3][1] .= '';
// Network server
$none = '';
if ($server_name == '' && $id_agente)
$none = __('None');
$table->data[4][0] = __('Server');
$table->data[4][1] = html_print_select (servers_get_names (),
'server_name', $server_name, '', __('No change'), -1, true, false, true, '', false, 'width: 150px;');
// Description
$table->data[5][0] = __('Description');
$table->data[5][1] = html_print_input_text ('description', $description, '', 45, 255, true);
html_print_table ($table);
unset($table);
$custom_id = '';
$mode = -1;
$disabled = -1;
$new_agent = true;
$icon_path = '';
$update_gis_data = -1;
$cascade_protection = -1;
$table->width = '95%';
$table->class = "databox_color";
$table->head = array ();
$table->style = array ();
$table->style[0] = 'font-weight: bold; width: 150px;';
$table->data = array ();
// Custom ID
$table->data[0][0] = __('Custom ID');
$table->data[0][1] = html_print_input_text ('custom_id', $custom_id, '', 16, 255, true);
// Learn mode / Normal mode
$table->data[1][0] = __('Module definition') . ui_print_help_icon("module_definition", true);
$table->data[1][1] = __('No change').' '.html_print_radio_button_extended ("mode", -1, '', $mode, false, '', 'style="margin-right: 40px;"', true);
$table->data[1][1] .= __('Learning mode').' '.html_print_radio_button_extended ("mode", 1, '', $mode, false, '', 'style="margin-right: 40px;"', true);
$table->data[1][1] .= __('Normal mode').' '.html_print_radio_button_extended ("mode", 0, '', $mode, false, '', 'style="margin-right: 40px;"', true);
// Status (Disabled / Enabled)
$table->data[2][0] = __('Status');
$table->data[2][1] = __('No change').' '.html_print_radio_button_extended ("disabled", -1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
$table->data[2][1] .= __('Disabled').' '.html_print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
$table->data[2][1] .= __('Active').' '.html_print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
// Remote configuration
$table->data[3][0] = __('Remote configuration');
// Delete remote configuration
$table->data[3][1] = '
'. __('Delete available remote configurations').' (';
$table->data[3][1] .= '';
$table->data[3][1] .= ') '.html_print_radio_button_extended ("delete_conf", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true).'
';
$table->data[3][1] .= '
'.__('Not available').'
';
$listIcons = gis_get_array_list_icons();
$arraySelectIcon = array();
foreach ($listIcons as $index => $value) $arraySelectIcon[$index] = $index;
$path = 'images/gis_map/icons/'; //TODO set better method the path
$table->data[4][0] = __('Agent icon');
$table->data[4][1] = html_print_select($arraySelectIcon, "icon_path", $icon_path, "changeIcons();", __('None'), '', true) .
' ' . __('Without status') . ': ' . html_print_image($path . $icon_path . 'default.png', true, array("id" => 'icon_without_status',"style" => 'display:none;')) .
' ' . __('Default') . ': ' . html_print_image($path . $icon_path . 'default.png', true, array("id" => 'icon_default',"style" => 'display:none;')) .
' ' . __('Ok') . ': ' . html_print_image($path . $icon_path . 'ok.png', true, array("id" => 'icon_ok',"style" => 'display:none;')) .
' ' . __('Bad') . ': ' . html_print_image($path . $icon_path . 'bad.png', true, array("id" => 'icon_bad',"style" => 'display:none;')) . ' ' . __('Warning') . ': ' . html_print_image($path . $icon_path . 'warning.png', true, array("id" => 'icon_warning',"style" => 'display:none;'));
if ($config['activate_gis']) {
$table->data[5][0] = __('Ignore new GIS data:');
$table->data[5][1] = __('No change').' '.html_print_radio_button_extended ("update_gis_data", -1, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
$table->data[5][1] .= __('Disabled').' '.html_print_radio_button_extended ("update_gis_data", 0, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
$table->data[5][1] .= __('Active').' '.html_print_radio_button_extended ("update_gis_data", 1, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
}
ui_toggle(html_print_table ($table, true), __('Advanced options'));
unset($table);
$table->width = '95%';
$table->class = "databox_color";
$table->head = array ();
$table->style = array ();
$table->style[0] = 'font-weight: bold; width: 150px;';
$table->data = array ();
$fields = db_get_all_fields_in_table('tagent_custom_fields');
if ($fields === false) $fields = array();
foreach ($fields as $field) {
$data[0] = '
'.$field['name'].'';
$custom_value = db_get_value_filter('description', 'tagent_custom_data', array('id_field' => $field['id_field'], 'id_agent' => $id_agente));
if ($custom_value === false) {
$custom_value = '';
}
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true);
array_push ($table->data, $data);
}
if (!empty($fields)) {
ui_toggle(html_print_table ($table, true), __('Custom fields'));
}
echo '
';
echo '
';
html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
html_print_input_hidden ('update_agents', 1);
html_print_input_hidden ('id_agente', $id_agente);
echo "
"; // Shown and hide div
echo '