'.__('Configuration Management').''; $source_id_group = (int) get_parameter ('source_id_group'); $source_id_agent = (int) get_parameter ('source_id_agent'); $destiny_id_group = (int) get_parameter ('destiny_id_group'); $destiny_id_agents = (array) get_parameter ('destiny_id_agent', array ()); $do_operation = (bool) get_parameter ('do_operation'); if ($do_operation) { process_manage_config ($source_id_agent, $destiny_id_agents); } $groups = get_user_groups (); $table->class = 'databox'; $table->width = '95%'; $table->data = array (); $table->style = array (); $table->style[0] = 'font-weight: bold; vertical-align:top'; $table->style[2] = 'font-weight: bold'; $table->size = array (); $table->size[0] = '15%'; $table->size[1] = '35%'; $table->size[2] = '15%'; $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, false, '', '', true); $table->data[0][2] = __('Agent'); $table->data[0][2] .= ' '; $table->data[0][3] = print_select (get_group_agents ($source_id_group, false, "none"), 'source_id_agent', $source_id_agent, false, __('Select'), 0, true); echo '
'; echo '
'; echo ''.__('Source'); print_help_icon ('manageconfig'); echo ''; print_table ($table); echo '
'; /* Target selection */ $table->id = 'target_table'; $table->data = array (); $modules = array (); if ($source_id_agent) $modules = get_agent_modules ($source_id_agent, 'nombre'); $table->data['operations'][0] = __('Operations'); $table->data['operations'][1] = ''; $table->data['operations'][1] .= print_checkbox ('copy_modules', 1, true, true); $table->data['operations'][1] .= print_label (__('Copy modules'), 'checkbox-copy_modules', true); $table->data['operations'][1] .= '
'; $table->data['operations'][1] .= ''; $table->data['operations'][1] .= print_checkbox ('copy_alerts', 1, true, true); $table->data['operations'][1] .= print_label (__('Copy alerts'), 'checkbox-copy_alerts', true); $table->data['operations'][1] .= ''; $table->data[1][0] = __('Modules'); $table->data[1][1] = ''; $table->data[1][1] .= print_select ($modules, 'target_modules[]', 0, false, '', '', true, true); $table->data[1][1] .= ''; $table->data[1][1] .= ''; $table->data[1][1] .= ''.__('No modules for this agent').''; $table->data[1][1] .= ''; $table->data[2][0] = __('Alerts'); $agent_alerts = array (); if ($source_id_agent) $agent_alerts = get_agent_alerts_simple ($source_id_agent); $alerts = array (); foreach ($agent_alerts as $alert) { $name = get_alert_template_name ($alert['id_alert_template']); $name .= ' ('.$modules[$alert['id_agent_module']].')'; $alerts[$alert['id']] = $name; } $table->data[2][1] = ''; $table->data[2][1] .= print_select ($alerts, 'target_alerts[]', 0, false, '', '', true, true); $table->data[2][1] .= ''; $table->data[2][1] .= ''; $table->data[2][1] .= ''.__('No alerts for this agent').''; $table->data[2][1] .= ''; echo ''; echo ''; /* Destiny selection */ $table->id = 'destiny_table'; $table->data = array (); $table->data[0][0] = __('Group'); $table->data[0][1] = print_select ($groups, 'destiny_id_group', $destiny_id_group, false, '', '', true); $table->data[1][0] = __('Agent'); $table->data[1][0] .= ''; $table->data[1][1] = print_select (get_group_agents ($destiny_id_group, false, "none"), 'destiny_id_agent[]', 0, false, '', '', true, true); echo ''; echo '
'; print_input_hidden ('do_operation', 1); print_submit_button (__('Go'), 'go', false, 'class="sub next"'); echo '
'; echo '
'; echo ''; require_jquery_file ('form'); require_jquery_file ('pandora.controls'); ?>