mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
2012-09-14 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora.js, extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql: cleaned source code style. * godmode/agentes/module_manager_editor_prediction.php, godmode/reporting/visual_console_builder.elements.php, godmode/reporting/reporting_builder.php, godmode/reporting/reporting_builder.item_editor.php, include/functions_ui.php: started to use the new function "ui_print_agent_autocomplete_input" to make more easy (and standar) the autocomplete agent input. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6975 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
1fdbcd86f6
commit
fd7a76859c
@ -1,3 +1,17 @@
|
|||||||
|
2012-09-14 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/javascript/pandora.js,
|
||||||
|
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql: cleaned source code
|
||||||
|
style.
|
||||||
|
|
||||||
|
* godmode/agentes/module_manager_editor_prediction.php,
|
||||||
|
godmode/reporting/visual_console_builder.elements.php,
|
||||||
|
godmode/reporting/reporting_builder.php,
|
||||||
|
godmode/reporting/reporting_builder.item_editor.php,
|
||||||
|
include/functions_ui.php: started to use the new function
|
||||||
|
"ui_print_agent_autocomplete_input" to make more easy (and standar)
|
||||||
|
the autocomplete agent input.
|
||||||
|
|
||||||
2012-09-13 Miguel de Dios <miguel.dedios@artica.es>
|
2012-09-13 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* operation/incidents/incident_detail.php,
|
* operation/incidents/incident_detail.php,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tnetflow_filter`
|
-- Table `tnetflow_filter`
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `tnetflow_filter` (
|
CREATE TABLE IF NOT EXISTS `tnetflow_filter` (
|
||||||
`id_sg` int(10) unsigned NOT NULL auto_increment,
|
`id_sg` int(10) unsigned NOT NULL auto_increment,
|
||||||
`id_name` varchar(600) NOT NULL default '0',
|
`id_name` varchar(600) NOT NULL default '0',
|
||||||
@ -16,9 +16,9 @@ CREATE TABLE IF NOT EXISTS `tnetflow_filter` (
|
|||||||
PRIMARY KEY (`id_sg`)
|
PRIMARY KEY (`id_sg`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tnetflow_report`
|
-- Table `tnetflow_report`
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `tnetflow_report` (
|
CREATE TABLE IF NOT EXISTS `tnetflow_report` (
|
||||||
`id_report` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
`id_report` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`id_name` varchar(150) NOT NULL default '',
|
`id_name` varchar(150) NOT NULL default '',
|
||||||
@ -27,9 +27,9 @@ CREATE TABLE IF NOT EXISTS `tnetflow_report` (
|
|||||||
PRIMARY KEY(`id_report`)
|
PRIMARY KEY(`id_report`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tnetflow_report_content`
|
-- Table `tnetflow_report_content`
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `tnetflow_report_content` (
|
CREATE TABLE IF NOT EXISTS `tnetflow_report_content` (
|
||||||
`id_rc` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
`id_rc` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`id_report` INTEGER UNSIGNED NOT NULL default 0,
|
`id_report` INTEGER UNSIGNED NOT NULL default 0,
|
||||||
@ -46,20 +46,20 @@ CREATE TABLE IF NOT EXISTS `tnetflow_report_content` (
|
|||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tincidencia`
|
-- Table `tincidencia`
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
ALTER TABLE `tincidencia` ADD COLUMN `id_agent` int(10) unsigned NULL default 0;
|
ALTER TABLE `tincidencia` ADD COLUMN `id_agent` int(10) unsigned NULL default 0;
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tagente`
|
-- Table `tagente`
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
ALTER TABLE `tagente` ADD COLUMN `url_address` mediumtext NULL;
|
ALTER TABLE `tagente` ADD COLUMN `url_address` mediumtext NULL;
|
||||||
ALTER TABLE `tagente` ADD COLUMN `quiet` tinyint(1) NOT NULL DEFAULT '0';
|
ALTER TABLE `tagente` ADD COLUMN `quiet` tinyint(1) NOT NULL DEFAULT '0';
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `talert_special_days`
|
-- Table `talert_special_days`
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `talert_special_days` (
|
CREATE TABLE IF NOT EXISTS `talert_special_days` (
|
||||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`date` date NOT NULL DEFAULT '0000-00-00',
|
`date` date NOT NULL DEFAULT '0000-00-00',
|
||||||
@ -68,9 +68,9 @@ CREATE TABLE IF NOT EXISTS `talert_special_days` (
|
|||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `talert_templates`
|
-- Table `talert_templates`
|
||||||
-- -----------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
ALTER TABLE `talert_templates` ADD COLUMN `special_day` tinyint(1) DEFAULT '0';
|
ALTER TABLE `talert_templates` ADD COLUMN `special_day` tinyint(1) DEFAULT '0';
|
||||||
|
|
||||||
-- -----------------------------------------------------
|
-- -----------------------------------------------------
|
||||||
|
@ -23,7 +23,9 @@ $id_agente = get_parameter('id_agente', '');
|
|||||||
$agent_name = get_parameter('agent_name', agents_get_name($id_agente));
|
$agent_name = get_parameter('agent_name', agents_get_name($id_agente));
|
||||||
$id_agente_modulo= get_parameter('id_agent_module',0);
|
$id_agente_modulo= get_parameter('id_agent_module',0);
|
||||||
$custom_integer_2 = get_parameter ('custom_integer_2', 0);
|
$custom_integer_2 = get_parameter ('custom_integer_2', 0);
|
||||||
$sql = 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = '.$id_agente_modulo;
|
$sql = 'SELECT *
|
||||||
|
FROM tagente_modulo
|
||||||
|
WHERE id_agente_modulo = '.$id_agente_modulo;
|
||||||
$row = db_get_row_sql($sql);
|
$row = db_get_row_sql($sql);
|
||||||
$is_service = false;
|
$is_service = false;
|
||||||
$is_synthetic = false;
|
$is_synthetic = false;
|
||||||
@ -96,15 +98,26 @@ if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
|
|||||||
$data[0] = '';
|
$data[0] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$data[1] = '<div id="module_data" style="top:1em; float:left; width:50%;">';
|
$data[1] = '<div id="module_data" style="top:1em; float:left; width:50%;">';
|
||||||
$data[1] .= html_print_label(__("Agent"),'agent_name', true)."<br/>";
|
$data[1] .= html_print_label(__("Agent"),'agent_name', true)."<br/>";
|
||||||
$sql = "SELECT id_agente, nombre FROM tagente";
|
|
||||||
// TODO: ACL Filter
|
$params = array();
|
||||||
//Image src with skins
|
$params['return'] = true;
|
||||||
$src_code = html_print_image('images/lightning.png', true, false, true);
|
$params['show_helptip'] = true;
|
||||||
$data[1] .= html_print_input_text_extended ('agent_name',$agent_name, 'text_agent_name', '', 30, 100, $is_service, '',
|
$params['input_name'] = 'agent_name';
|
||||||
array('style' => 'background: url(' . $src_code . ') no-repeat right;'), true, false);
|
$params['value'] = $agent_name;
|
||||||
$data[1] .= '<a href="#" class="tip"> <span>' . __("Type at least two characters to search") . '</span></a> <br/>';
|
$params['javascript_is_function_select'] = true;
|
||||||
|
$params['selectbox_id'] = 'prediction_module';
|
||||||
|
$params['none_module_text'] = __('Select Module');
|
||||||
|
$params['use_hidden_input_idagent'] = true;
|
||||||
|
$params['hidden_input_idagent_id'] = 'hidden-id_agente';
|
||||||
|
$data[1] .= ui_print_agent_autocomplete_input($params);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$data[1] .= html_print_label(__("Module"),'prediction_module',true);
|
$data[1] .= html_print_label(__("Module"),'prediction_module',true);
|
||||||
if($id_agente) {
|
if($id_agente) {
|
||||||
$sql = "SELECT id_agente_modulo, nombre
|
$sql = "SELECT id_agente_modulo, nombre
|
||||||
@ -170,7 +183,6 @@ unset ($table_advanced->data[3]);
|
|||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
agent_module_autocomplete ("#text_agent_name", "#id_agente", "#prediction_module");
|
|
||||||
<?php
|
<?php
|
||||||
enterprise_hook('setup_services_synth', array($is_service, $is_synthetic, $is_synthetic_avg, $is_netflow, $ops));
|
enterprise_hook('setup_services_synth', array($is_service, $is_synthetic, $is_synthetic_avg, $is_netflow, $ops));
|
||||||
?>
|
?>
|
||||||
|
@ -494,7 +494,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
if (metaconsole_load_external_db($connection) == NOERR)
|
if (metaconsole_load_external_db($connection) == NOERR)
|
||||||
$agent_name = db_get_value_filter('nombre', 'tagente', array('id_agente' => $idAgent));
|
$agent_name = db_get_value_filter('nombre', 'tagente', array('id_agente' => $idAgent));
|
||||||
// Append server name
|
// Append server name
|
||||||
if (!empty($agent_name))
|
if (!empty($agent_name))
|
||||||
$agent_name .= ' (' . $server_name . ')';
|
$agent_name .= ' (' . $server_name . ')';
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
@ -502,12 +502,23 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
else {
|
else {
|
||||||
$agent_name = agents_get_name ($idAgent);
|
$agent_name = agents_get_name ($idAgent);
|
||||||
}
|
}
|
||||||
html_print_input_hidden('id_agent', $idAgent) .
|
|
||||||
html_print_input_text_extended ('agent', $agent_name,
|
html_print_input_hidden('id_agent', $idAgent);
|
||||||
'text-agent', '', 30, 100, false, '',
|
|
||||||
array('style' => 'background: url(images/lightning.png) no-repeat right;'))
|
|
||||||
. ui_print_help_tip(__("Type at least two characters to search"), false);
|
|
||||||
html_print_input_hidden ('server_name', $server_name);
|
html_print_input_hidden ('server_name', $server_name);
|
||||||
|
|
||||||
|
$params = array();
|
||||||
|
$params['show_helptip'] = true;
|
||||||
|
$params['input_name'] = 'agent';
|
||||||
|
$params['value'] = $agent_name;
|
||||||
|
$params['javascript_is_function_select'] = true;
|
||||||
|
$params['selectbox_id'] = 'id_agent_module';
|
||||||
|
$params['add_none_module'] = false;
|
||||||
|
$params['use_hidden_input_idagent'] = true;
|
||||||
|
$params['hidden_input_idagent_id'] = 'hidden-id_agent';
|
||||||
|
$params['use_input_server'] = true;
|
||||||
|
$params['input_server_id'] = 'hidden-server_name';
|
||||||
|
ui_print_agent_autocomplete_input($params);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -538,11 +549,11 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
//Restore db connection
|
//Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
html_print_select_from_sql($sql, 'id_agent_module', $idAgentModule, '', '', '0');
|
html_print_select_from_sql($sql, 'id_agent_module', $idAgentModule, '', '', '0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
?>
|
?>
|
||||||
<select style="max-width: 180px" id="id_agent_module" name="id_agent_module" disabled="disabled">
|
<select style="max-width: 180px" id="id_agent_module" name="id_agent_module" disabled="disabled">
|
||||||
<option value="0"><?php echo __('Select an Agent first'); ?></option>
|
<option value="0"><?php echo __('Select an Agent first'); ?></option>
|
||||||
@ -582,7 +593,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
if($dates === ENTERPRISE_NOT_HOOK) {
|
if($dates === ENTERPRISE_NOT_HOOK) {
|
||||||
$dates = array();
|
$dates = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
html_print_select($dates, 'date', '', '', __('Last'), 0, false, false, false, '', false, "min-width: 180px");
|
html_print_select($dates, 'date', '', '', __('Last'), 0, false, false, false, '', false, "min-width: 180px");
|
||||||
html_print_input_hidden('date_selected',$date);
|
html_print_input_hidden('date_selected',$date);
|
||||||
?>
|
?>
|
||||||
@ -610,7 +621,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
}
|
}
|
||||||
html_print_select_from_sql($query_sql, 'id_custom_graph', $idCustomGraph, 'change_custom_graph();', __('None'), 0);
|
html_print_select_from_sql($query_sql, 'id_custom_graph', $idCustomGraph, 'change_custom_graph();', __('None'), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$style_button_create_custom_graph = 'style="display: none;"';
|
$style_button_create_custom_graph = 'style="display: none;"';
|
||||||
$style_button_edit_custom_graph = '';
|
$style_button_edit_custom_graph = '';
|
||||||
if (empty($idCustomGraph)) {
|
if (empty($idCustomGraph)) {
|
||||||
@ -657,14 +668,16 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
<td style="vertical-align: top;"><?php echo __('Query SQL'); ?></td>
|
<td style="vertical-align: top;"><?php echo __('Query SQL'); ?></td>
|
||||||
<td style=""><?php html_print_textarea('sql', 5, 25, $sql); ?></td>
|
<td style=""><?php html_print_textarea('sql', 5, 25, $sql); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="row_servers" style="" class="datos">
|
<tr id="row_servers" style="" class="datos">
|
||||||
<td style="vertical-align: top;"><?php echo __('Server'); ?></td>
|
<td style="vertical-align: top;"><?php echo __('Server'); ?></td>
|
||||||
<td style=""><?php
|
<td style="">
|
||||||
|
<?php
|
||||||
if ($config ['metaconsole'] != 1 or !defined('METACONSOLE'))
|
if ($config ['metaconsole'] != 1 or !defined('METACONSOLE'))
|
||||||
html_print_select ($servers, 'combo_server', $server_name, '', __('Select server'), 0, false, false, true, '', true);
|
html_print_select ($servers, 'combo_server', $server_name, '', __('Select server'), 0, false, false, true, '', true);
|
||||||
else
|
else
|
||||||
html_print_select ($servers, 'combo_server', $server_name, '', __('Select server'), 0);
|
html_print_select ($servers, 'combo_server', $server_name, '', __('Select server'), 0);
|
||||||
?></td>
|
?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="row_header" style="" class="datos">
|
<tr id="row_header" style="" class="datos">
|
||||||
<td style="vertical-align: top;"><?php echo __('Serialized header') . ui_print_help_tip(__("The separator character is |"), true);?></td>
|
<td style="vertical-align: top;"><?php echo __('Serialized header') . ui_print_help_tip(__("The separator character is |"), true);?></td>
|
||||||
@ -696,14 +709,16 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
</tr>
|
</tr>
|
||||||
<tr id="row_order_uptodown" style="" class="datos">
|
<tr id="row_order_uptodown" style="" class="datos">
|
||||||
<td><?php echo __('Order');?></td>
|
<td><?php echo __('Order');?></td>
|
||||||
<td><?php
|
<td>
|
||||||
|
<?php
|
||||||
echo __('Ascending');
|
echo __('Ascending');
|
||||||
html_print_radio_button ('radiobutton_order_uptodown', 2, '', $order_uptodown);
|
html_print_radio_button ('radiobutton_order_uptodown', 2, '', $order_uptodown);
|
||||||
echo __('Descending');
|
echo __('Descending');
|
||||||
html_print_radio_button ('radiobutton_order_uptodown', 1, '', $order_uptodown);
|
html_print_radio_button ('radiobutton_order_uptodown', 1, '', $order_uptodown);
|
||||||
echo __('By agent name');
|
echo __('By agent name');
|
||||||
html_print_radio_button ('radiobutton_order_uptodown', 3, '', $order_uptodown);
|
html_print_radio_button ('radiobutton_order_uptodown', 3, '', $order_uptodown);
|
||||||
?></td>
|
?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="row_quantity" style="" class="datos">
|
<tr id="row_quantity" style="" class="datos">
|
||||||
<td style="vertical-align: top;"><?php echo __('Quantity (n)'); ?></td>
|
<td style="vertical-align: top;"><?php echo __('Quantity (n)'); ?></td>
|
||||||
@ -711,14 +726,16 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
</tr>
|
</tr>
|
||||||
<tr id="row_max_min_avg" style="" class="datos">
|
<tr id="row_max_min_avg" style="" class="datos">
|
||||||
<td><?php echo __('Display');?></td>
|
<td><?php echo __('Display');?></td>
|
||||||
<td><?php
|
<td>
|
||||||
|
<?php
|
||||||
echo __('Max');
|
echo __('Max');
|
||||||
html_print_radio_button ('radiobutton_max_min_avg', 1, '', $top_n);
|
html_print_radio_button ('radiobutton_max_min_avg', 1, '', $top_n);
|
||||||
echo __('Min');
|
echo __('Min');
|
||||||
html_print_radio_button ('radiobutton_max_min_avg', 2, '', $top_n);
|
html_print_radio_button ('radiobutton_max_min_avg', 2, '', $top_n);
|
||||||
echo __('Avg');
|
echo __('Avg');
|
||||||
html_print_radio_button ('radiobutton_max_min_avg', 3, '', $top_n);
|
html_print_radio_button ('radiobutton_max_min_avg', 3, '', $top_n);
|
||||||
?></td>
|
?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="row_exception_condition_value" style="" class="datos">
|
<tr id="row_exception_condition_value" style="" class="datos">
|
||||||
<td style="vertical-align: top;"><?php echo __('Value'); ?></td>
|
<td style="vertical-align: top;"><?php echo __('Value'); ?></td>
|
||||||
@ -756,7 +773,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||||||
<tr id="row_sort" style="" class="datos">
|
<tr id="row_sort" style="" class="datos">
|
||||||
<td><?php echo __('Order') . ui_print_help_tip(__('SLA items sorted by fulfillment value'), true);?></td>
|
<td><?php echo __('Order') . ui_print_help_tip(__('SLA items sorted by fulfillment value'), true);?></td>
|
||||||
<td><?php html_print_select ($show_sort_options, 'combo_sla_sort_options', $sla_sorted_by, '', __('None'), 0); ?></td>
|
<td><?php html_print_select ($show_sort_options, 'combo_sla_sort_options', $sla_sorted_by, '', __('None'), 0); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="row_show_in_landscape" style="" class="datos">
|
<tr id="row_show_in_landscape" style="" class="datos">
|
||||||
<td><?php echo __('Show in landscape');?></td>
|
<td><?php echo __('Show in landscape');?></td>
|
||||||
<td><?php html_print_checkbox('show_in_landscape', 1, $show_in_landscape, false, false,
|
<td><?php html_print_checkbox('show_in_landscape', 1, $show_in_landscape, false, false,
|
||||||
@ -868,7 +885,20 @@ function print_SLA_list($width, $action, $idItem = null) {
|
|||||||
<td>
|
<td>
|
||||||
<input id="hidden-id_agent_sla" name="id_agent_sla" value="" type="hidden">
|
<input id="hidden-id_agent_sla" name="id_agent_sla" value="" type="hidden">
|
||||||
<input id="hidden-server_name" name="server_name" value="" type="hidden">
|
<input id="hidden-server_name" name="server_name" value="" type="hidden">
|
||||||
<input style="background: transparent url(images/lightning.png) no-repeat right;" name="agent_sla" id="text-agent_sla" size="15" maxlength="20" type="text"><a href="#" class="tip"> <span>Type at least two characters to search</span></a></td>
|
<?php
|
||||||
|
$params = array();
|
||||||
|
$params['show_helptip'] = true;
|
||||||
|
$params['input_name'] = 'agent_sla';
|
||||||
|
$params['value'] = '';
|
||||||
|
$params['use_hidden_input_idagent'] = true;
|
||||||
|
$params['hidden_input_idagent_id'] = 'hidden-id_agent_sla';
|
||||||
|
$params['javascript_is_function_select'] = true;
|
||||||
|
$params['selectbox_id'] = 'id_agent_module_sla';
|
||||||
|
$params['add_none_module'] = false;
|
||||||
|
$params['use_input_server'] = true;
|
||||||
|
$params['input_server_id'] = 'hidden-server_name';
|
||||||
|
ui_print_agent_autocomplete_input($params);
|
||||||
|
?>
|
||||||
<td><select id="id_agent_module_sla" name="id_agente_modulo_sla" disabled="disabled" style="max-width: 180px"><option value="0"><?php echo __('Select an Agent first'); ?></option></select></td>
|
<td><select id="id_agent_module_sla" name="id_agente_modulo_sla" disabled="disabled" style="max-width: 180px"><option value="0"><?php echo __('Select an Agent first'); ?></option></select></td>
|
||||||
<td><input name="sla_min" id="text-sla_min" size="10" maxlength="10" type="text"></td>
|
<td><input name="sla_min" id="text-sla_min" size="10" maxlength="10" type="text"></td>
|
||||||
<td><input name="sla_max" id="text-sla_max" size="10" maxlength="10" type="text"></td>
|
<td><input name="sla_max" id="text-sla_max" size="10" maxlength="10" type="text"></td>
|
||||||
@ -963,10 +993,24 @@ function print_General_list($width, $action, $idItem = null) {
|
|||||||
<td>
|
<td>
|
||||||
<input id="hidden-id_agent_general" name="id_agent_general" value="" type="hidden">
|
<input id="hidden-id_agent_general" name="id_agent_general" value="" type="hidden">
|
||||||
<input id="hidden-server_name_general" name="server_name_general" value="" type="hidden">
|
<input id="hidden-server_name_general" name="server_name_general" value="" type="hidden">
|
||||||
<input style="background: transparent url(images/lightning.png) no-repeat right;" name="agent_general" id="text-agent_general" size="15" maxlength="20" type="text"><a href="#" class="tip"> <span>Type at least two characters to search</span></a></td>
|
<?php
|
||||||
|
$params = array();
|
||||||
|
$params['show_helptip'] = true;
|
||||||
|
$params['input_name'] = 'agent_general';
|
||||||
|
$params['value'] = '';
|
||||||
|
$params['use_hidden_input_idagent'] = true;
|
||||||
|
$params['hidden_input_idagent_id'] = 'hidden-id_agent_general';
|
||||||
|
$params['javascript_is_function_select'] = true;
|
||||||
|
$params['selectbox_id'] = 'id_agent_module_general';
|
||||||
|
$params['add_none_module'] = false;
|
||||||
|
$params['use_input_server'] = true;
|
||||||
|
$params['input_server_id'] = 'hidden-server_name_general';
|
||||||
|
ui_print_agent_autocomplete_input($params);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
<td><select id="id_agent_module_general" name="id_agente_modulo_general" disabled="disabled" style="max-width: 180px"><option value="0"><?php echo __('Select an Agent first'); ?></option></select></td>
|
<td><select id="id_agent_module_general" name="id_agente_modulo_general" disabled="disabled" style="max-width: 180px"><option value="0"><?php echo __('Select an Agent first'); ?></option></select></td>
|
||||||
<?php $operation = array ('avg'=>'avg','max'=>'max','min'=>'min','sum'=>'sum'); ?>
|
<?php $operation = array ('avg'=>'avg','max'=>'max','min'=>'min','sum'=>'sum'); ?>
|
||||||
<td><?php html_print_select ($operation, 'id_operation_module_general', 0, false, '', '', false, false, true, 'width: 200px', true); ?></td>
|
<td><?php html_print_select ($operation, 'id_operation_module_general', 0, false, '', '', false, false, true, 'width: 200px', false); ?></td>
|
||||||
<td style="text-align: center;"><a href="javascript: addGeneralRow();"><?php html_print_image("images/disk.png", false); ?></a></td>
|
<td style="text-align: center;"><a href="javascript: addGeneralRow();"><?php html_print_image("images/disk.png", false); ?></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -980,19 +1024,15 @@ function print_General_list($width, $action, $idItem = null) {
|
|||||||
<span style="display: none" id="module_general_text"><?php echo __('Select an Agent first'); ?></span>
|
<span style="display: none" id="module_general_text"><?php echo __('Select an Agent first'); ?></span>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_require_javascript_file ('pandora_inventory', ENTERPRISE_DIR.'/include/javascript/');
|
ui_require_javascript_file ('pandora_inventory', ENTERPRISE_DIR.'/include/javascript/');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
agent_module_autocomplete('#text-agent', '#hidden-id_agent', '#id_agent_module', '#hidden-server_name', undefined, <?php echo '"' . ui_get_full_url(false) . '"'; ?>);
|
|
||||||
agent_module_autocomplete('#text-agent_sla', '#hidden-id_agent_sla', '#id_agent_module_sla', '#hidden-server_name', undefined, <?php echo '"' . ui_get_full_url(false) . '"'; ?>);
|
|
||||||
agent_module_autocomplete('#text-agent_general', '#hidden-id_agent_general', '#id_agent_module_general', '#hidden-server_name_general', '#id_operation_module_general', <?php echo '"' . ui_get_full_url(false) . '"'; ?>);
|
|
||||||
|
|
||||||
chooseType();
|
chooseType();
|
||||||
chooseSQLquery();
|
chooseSQLquery();
|
||||||
|
|
||||||
$("#text-time_to, #text-time_from").timeEntry ({
|
$("#text-time_to, #text-time_from").timeEntry ({
|
||||||
spinnerImage: 'images/time-entry.png',
|
spinnerImage: 'images/time-entry.png',
|
||||||
spinnerSize: [20, 20, 0],
|
spinnerSize: [20, 20, 0],
|
||||||
@ -1004,7 +1044,7 @@ $(document).ready (function () {
|
|||||||
function create_custom_graph() {
|
function create_custom_graph() {
|
||||||
<?php
|
<?php
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
// Metaconsole activated
|
// Metaconsole activated
|
||||||
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
?>
|
?>
|
||||||
@ -1047,14 +1087,14 @@ function create_custom_graph() {
|
|||||||
success: function (data) {
|
success: function (data) {
|
||||||
server_url = data;
|
server_url = data;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.location.href = server_url + "/index.php?sec=reporting&sec2=godmode/reporting/graph_builder&create=Create graph" + hash_data;
|
window.location.href = server_url + "/index.php?sec=reporting&sec2=godmode/reporting/graph_builder&create=Create graph" + hash_data;
|
||||||
}
|
}
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
?>
|
?>
|
||||||
window.location.href = "index.php?sec=reporting&sec2=godmode/reporting/graph_builder&create=Create graph";
|
window.location.href = "index.php?sec=reporting&sec2=godmode/reporting/graph_builder&create=Create graph";
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@ -1065,14 +1105,14 @@ function edit_custom_graph() {
|
|||||||
var id_graph = $("#id_custom_graph").val();
|
var id_graph = $("#id_custom_graph").val();
|
||||||
<?php
|
<?php
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
// Metaconsole activated
|
// Metaconsole activated
|
||||||
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||||
?>
|
?>
|
||||||
var agent_server_temp;
|
var agent_server_temp;
|
||||||
var id_element_graph;
|
var id_element_graph;
|
||||||
var id_server;
|
var id_server;
|
||||||
|
|
||||||
if (id_graph.indexOf("|") != -1){
|
if (id_graph.indexOf("|") != -1){
|
||||||
agent_server_temp = id_graph.split('|');
|
agent_server_temp = id_graph.split('|');
|
||||||
id_element_graph = agent_server_temp[0];
|
id_element_graph = agent_server_temp[0];
|
||||||
@ -1109,10 +1149,10 @@ function edit_custom_graph() {
|
|||||||
success: function (data) {
|
success: function (data) {
|
||||||
server_url = data;
|
server_url = data;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.location.href = server_url + "/index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id=" + id_element_graph + hash_data;
|
window.location.href = server_url + "/index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id=" + id_element_graph + hash_data;
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
?>
|
?>
|
||||||
@ -1126,7 +1166,7 @@ function change_custom_graph() {
|
|||||||
//Hidden the button create or edit custom graph
|
//Hidden the button create or edit custom graph
|
||||||
if ($("#id_custom_graph").val() != "0") {
|
if ($("#id_custom_graph").val() != "0") {
|
||||||
$("#meta_servers").val(0);
|
$("#meta_servers").val(0);
|
||||||
$("#meta_target_servers").css('display', 'none');
|
$("#meta_target_servers").css('display', 'none');
|
||||||
$("#button-create_graph").css("display", "none");
|
$("#button-create_graph").css("display", "none");
|
||||||
$("#button-edit_graph").css("display", "");
|
$("#button-edit_graph").css("display", "");
|
||||||
}
|
}
|
||||||
@ -1140,7 +1180,7 @@ function change_custom_graph() {
|
|||||||
|
|
||||||
function chooseSQLquery() {
|
function chooseSQLquery() {
|
||||||
var idCustom = $("#id_custom").val();
|
var idCustom = $("#id_custom").val();
|
||||||
|
|
||||||
if (idCustom == 0) {
|
if (idCustom == 0) {
|
||||||
$("#sql_example").html('');
|
$("#sql_example").html('');
|
||||||
}
|
}
|
||||||
@ -1228,7 +1268,7 @@ function addSLARow() {
|
|||||||
var slaMin = $("input[name=sla_min]").val();
|
var slaMin = $("input[name=sla_min]").val();
|
||||||
var slaMax = $("input[name=sla_max]").val();
|
var slaMax = $("input[name=sla_max]").val();
|
||||||
var slaLimit = $("input[name=sla_limit]").val();
|
var slaLimit = $("input[name=sla_limit]").val();
|
||||||
|
|
||||||
if ((idAgent != '') && (slaMin != '') && (slaMax != '')
|
if ((idAgent != '') && (slaMin != '') && (slaMax != '')
|
||||||
&& (slaLimit != '')) {
|
&& (slaLimit != '')) {
|
||||||
//Truncate nameAgent
|
//Truncate nameAgent
|
||||||
@ -1270,7 +1310,7 @@ function addSLARow() {
|
|||||||
params.push("sla_max=" + slaMax);
|
params.push("sla_max=" + slaMax);
|
||||||
params.push("sla_limit=" + slaLimit);
|
params.push("sla_limit=" + slaLimit);
|
||||||
params.push("server_name=" + serverName);
|
params.push("server_name=" + serverName);
|
||||||
|
|
||||||
params.push("page=include/ajax/reporting.ajax");
|
params.push("page=include/ajax/reporting.ajax");
|
||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
@ -1281,7 +1321,7 @@ function addSLARow() {
|
|||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data['correct']) {
|
if (data['correct']) {
|
||||||
row = $("#sla_template").clone();
|
row = $("#sla_template").clone();
|
||||||
|
|
||||||
$("#row", row).show();
|
$("#row", row).show();
|
||||||
$("#row", row).attr('id', 'sla_' + data['id']);
|
$("#row", row).attr('id', 'sla_' + data['id']);
|
||||||
$(".agent_name", row).html(nameAgent);
|
$(".agent_name", row).html(nameAgent);
|
||||||
@ -1302,7 +1342,7 @@ function addSLARow() {
|
|||||||
.html ($("#module_sla_text").html()));
|
.html ($("#module_sla_text").html()));
|
||||||
$("input[name=sla_min]").val('');
|
$("input[name=sla_min]").val('');
|
||||||
$("input[name=sla_max]").val('');
|
$("input[name=sla_max]").val('');
|
||||||
$("input[name=sla_limit]").val('');
|
$("input[name=sla_limit]").val('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1317,7 +1357,7 @@ function addGeneralRow() {
|
|||||||
var operation = $("#id_operation_module_general").val();
|
var operation = $("#id_operation_module_general").val();
|
||||||
var nameModule = $("#id_agent_module_general :selected").text();
|
var nameModule = $("#id_agent_module_general :selected").text();
|
||||||
var nameOperation = $("#id_operation_module_general :selected").text();
|
var nameOperation = $("#id_operation_module_general :selected").text();
|
||||||
|
|
||||||
if (idAgent != '') {
|
if (idAgent != '') {
|
||||||
//Truncate nameAgent
|
//Truncate nameAgent
|
||||||
var params = [];
|
var params = [];
|
||||||
@ -1457,7 +1497,7 @@ function chooseType() {
|
|||||||
$("#row_date").hide();
|
$("#row_date").hide();
|
||||||
$("#row_agent_multi").hide();
|
$("#row_agent_multi").hide();
|
||||||
$("#row_module_multi").hide();
|
$("#row_module_multi").hide();
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'event_report_group':
|
case 'event_report_group':
|
||||||
$("#row_description").show();
|
$("#row_description").show();
|
||||||
@ -1491,7 +1531,7 @@ function chooseType() {
|
|||||||
$("#row_module").show();
|
$("#row_module").show();
|
||||||
$("#row_interval").show();
|
$("#row_interval").show();
|
||||||
$("#row_show_in_two_columns").show();
|
$("#row_show_in_two_columns").show();
|
||||||
break;
|
break;
|
||||||
case 'custom_graph':
|
case 'custom_graph':
|
||||||
$("#row_description").show();
|
$("#row_description").show();
|
||||||
$("#row_period").show();
|
$("#row_period").show();
|
||||||
@ -1723,7 +1763,7 @@ function chooseType() {
|
|||||||
$("#row_module_multi").show();
|
$("#row_module_multi").show();
|
||||||
$("#row_date").show();
|
$("#row_date").show();
|
||||||
$("#row_show_in_two_columns").show();
|
$("#row_show_in_two_columns").show();
|
||||||
|
|
||||||
$("#id_agents").change(agent_changed_by_multiple_agents_inventory);
|
$("#id_agents").change(agent_changed_by_multiple_agents_inventory);
|
||||||
$("#id_agents").trigger('change');
|
$("#id_agents").trigger('change');
|
||||||
|
|
||||||
@ -1749,4 +1789,4 @@ function chooseType() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
@ -184,7 +184,7 @@ switch ($action) {
|
|||||||
$pos_delete = (string)get_parameter('delete_m', 'below');
|
$pos_delete = (string)get_parameter('delete_m', 'below');
|
||||||
|
|
||||||
$countItems = db_get_sql('SELECT COUNT(id_rc)
|
$countItems = db_get_sql('SELECT COUNT(id_rc)
|
||||||
FROM treport_content WHERE id_report = ' . $idReport);
|
FROM treport_content WHERE id_report = ' . $idReport);
|
||||||
|
|
||||||
if (($countItems < $position_to_delete) || ($position_to_delete < 1)) {
|
if (($countItems < $position_to_delete) || ($position_to_delete < 1)) {
|
||||||
$resultOperationDB = false;
|
$resultOperationDB = false;
|
||||||
@ -196,7 +196,8 @@ switch ($action) {
|
|||||||
case 'above':
|
case 'above':
|
||||||
if ($position_to_delete == 1) {
|
if ($position_to_delete == 1) {
|
||||||
$resultOperationDB = false;
|
$resultOperationDB = false;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach ($items as $key => $item) {
|
foreach ($items as $key => $item) {
|
||||||
if ($i < $position_to_delete) {
|
if ($i < $position_to_delete) {
|
||||||
@ -209,11 +210,15 @@ switch ($action) {
|
|||||||
case 'below':
|
case 'below':
|
||||||
if ($position_to_delete == $countItems) {
|
if ($position_to_delete == $countItems) {
|
||||||
$resultOperationDB = false;
|
$resultOperationDB = false;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach ($items as $key => $item) {
|
foreach ($items as $key => $item) {
|
||||||
if ($i > $position_to_delete) {
|
if ($i > $position_to_delete) {
|
||||||
$resultOperationDB = db_process_sql_delete('treport_content', array('id_rc' => $item['id_rc']));
|
$resultOperationDB =
|
||||||
|
db_process_sql_delete(
|
||||||
|
'treport_content',
|
||||||
|
array('id_rc' => $item['id_rc']));
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -248,14 +253,17 @@ switch ($action) {
|
|||||||
// Page header for metaconsole
|
// Page header for metaconsole
|
||||||
if ($enterpriseEnable and defined('METACONSOLE')) {
|
if ($enterpriseEnable and defined('METACONSOLE')) {
|
||||||
// Bread crumbs
|
// Bread crumbs
|
||||||
ui_meta_add_breadcrumb(array('link' => 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder', 'text' => __('Reporting')));
|
ui_meta_add_breadcrumb(
|
||||||
|
array(
|
||||||
ui_meta_print_page_header($nav_bar);
|
'link' => 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder',
|
||||||
|
'text' => __('Reporting')));
|
||||||
|
|
||||||
|
ui_meta_print_page_header($nav_bar);
|
||||||
|
|
||||||
// Print header
|
// Print header
|
||||||
ui_meta_print_header(__('Reporting'), "", $buttons);
|
ui_meta_print_header(__('Reporting'), "", $buttons);
|
||||||
}
|
}
|
||||||
// Page header for normal console
|
// Page header for normal console
|
||||||
else
|
else
|
||||||
ui_print_page_header (__('Reporting').' » '.__('Custom reporting'), "images/reporting.png", false, "",false, $buttons);
|
ui_print_page_header (__('Reporting').' » '.__('Custom reporting'), "images/reporting.png", false, "",false, $buttons);
|
||||||
|
|
||||||
@ -553,7 +561,7 @@ switch ($action) {
|
|||||||
$metaconsole_report = 1;
|
$metaconsole_report = 1;
|
||||||
else
|
else
|
||||||
$metaconsole_report = 0;
|
$metaconsole_report = 0;
|
||||||
|
|
||||||
$idOrResult = db_process_sql_insert('treport',
|
$idOrResult = db_process_sql_insert('treport',
|
||||||
array('name' => $reportName,
|
array('name' => $reportName,
|
||||||
'id_group' => $idGroupReport,
|
'id_group' => $idGroupReport,
|
||||||
@ -1044,11 +1052,9 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
// Sort functionality for metaconsole
|
// Sort functionality for metaconsole
|
||||||
else if ($config['metaconsole'] == 1) {
|
else if ($config['metaconsole'] == 1) {
|
||||||
|
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'agent':
|
case 'agent':
|
||||||
case 'module':
|
case 'module':
|
||||||
|
|
||||||
$sql = "SELECT id_rc, id_agent, id_agent_module, server_name FROM treport_content WHERE %s ORDER BY server_name";
|
$sql = "SELECT id_rc, id_agent, id_agent_module, server_name FROM treport_content WHERE %s ORDER BY server_name";
|
||||||
$sql = sprintf($sql, 'id_report = ' . $idReport, '%s');
|
$sql = sprintf($sql, 'id_report = ' . $idReport, '%s');
|
||||||
|
|
||||||
@ -1061,14 +1067,14 @@ switch ($action) {
|
|||||||
if (!empty($report_items)) {
|
if (!empty($report_items)) {
|
||||||
|
|
||||||
foreach ($report_items as $report_item) {
|
foreach ($report_items as $report_item) {
|
||||||
|
|
||||||
$connection = metaconsole_get_connection($report_item['server_name']);
|
$connection = metaconsole_get_connection($report_item['server_name']);
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'agent':
|
case 'agent':
|
||||||
$agents_name = agents_get_agents(array('id_agente' => $report_item['id_agent']), 'nombre');
|
$agents_name = agents_get_agents(array('id_agente' => $report_item['id_agent']), 'nombre');
|
||||||
|
|
||||||
// Item without agent
|
// Item without agent
|
||||||
@ -1089,18 +1095,18 @@ switch ($action) {
|
|||||||
$element_name = '';
|
$element_name = '';
|
||||||
else {
|
else {
|
||||||
$element_name = $module_name;
|
$element_name = $module_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
metaconsole_restore_db_force();
|
metaconsole_restore_db_force();
|
||||||
|
|
||||||
$temp_sort[$report_item['id_rc']] = $element_name;
|
$temp_sort[$report_item['id_rc']] = $element_name;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Performes sorting
|
// Performes sorting
|
||||||
switch ($dir) {
|
switch ($dir) {
|
||||||
case 'up':
|
case 'up':
|
||||||
asort($temp_sort);
|
asort($temp_sort);
|
||||||
@ -1117,9 +1123,9 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Free resources
|
// Free resources
|
||||||
unset($temp_sort);
|
unset($temp_sort);
|
||||||
unset($report_items);
|
unset($report_items);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -1136,15 +1142,15 @@ switch ($action) {
|
|||||||
$sql = sprintf($sql, 'DESC');
|
$sql = sprintf($sql, 'DESC');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ids = db_get_all_rows_sql($sql);
|
$ids = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = 1;
|
$count = 1;
|
||||||
$resultOperationDB = true;
|
$resultOperationDB = true;
|
||||||
foreach($ids as $id) {
|
foreach($ids as $id) {
|
||||||
@ -1157,7 +1163,7 @@ switch ($action) {
|
|||||||
|
|
||||||
$count = $count + 1;
|
$count = $count + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
@ -1270,7 +1276,7 @@ $buttons = array(
|
|||||||
'text' => '<a href="index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=item_editor&action=new&id_report=' . $idReport . '">' .
|
'text' => '<a href="index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder&tab=item_editor&action=new&id_report=' . $idReport . '">' .
|
||||||
html_print_image("images/config.png", true, array ("title" => __('Item editor'))) .'</a>')
|
html_print_image("images/config.png", true, array ("title" => __('Item editor'))) .'</a>')
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($enterpriseEnable) {
|
if ($enterpriseEnable) {
|
||||||
$buttons = reporting_enterprise_add_Tabs($buttons, $idReport);
|
$buttons = reporting_enterprise_add_Tabs($buttons, $idReport);
|
||||||
}
|
}
|
||||||
@ -1278,7 +1284,7 @@ if ($enterpriseEnable) {
|
|||||||
$buttons['view'] = array('active' => false,
|
$buttons['view'] = array('active' => false,
|
||||||
'text' => '<a href="index.php?sec=reporting&sec2=' . $config['homedir'] . '/operation/reporting/reporting_viewer&id=' . $idReport . '">' .
|
'text' => '<a href="index.php?sec=reporting&sec2=' . $config['homedir'] . '/operation/reporting/reporting_viewer&id=' . $idReport . '">' .
|
||||||
html_print_image("images/reporting.png", true, array ("title" => __('View report'))) .'</a>');
|
html_print_image("images/reporting.png", true, array ("title" => __('View report'))) .'</a>');
|
||||||
|
|
||||||
$buttons[$activeTab]['active'] = true;
|
$buttons[$activeTab]['active'] = true;
|
||||||
|
|
||||||
if ($idReport != 0) {
|
if ($idReport != 0) {
|
||||||
@ -1296,11 +1302,11 @@ else {
|
|||||||
if ($enterpriseEnable and defined('METACONSOLE')) {
|
if ($enterpriseEnable and defined('METACONSOLE')) {
|
||||||
// Bread crumbs
|
// Bread crumbs
|
||||||
ui_meta_add_breadcrumb(array('link' => 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder', 'text' => __('Reporting')));
|
ui_meta_add_breadcrumb(array('link' => 'index.php?sec=reporting&sec2=' . $config['homedir'] . '/godmode/reporting/reporting_builder', 'text' => __('Reporting')));
|
||||||
|
|
||||||
ui_meta_print_page_header($nav_bar);
|
ui_meta_print_page_header($nav_bar);
|
||||||
|
|
||||||
// Print header
|
// Print header
|
||||||
ui_meta_print_header(__('Reporting'). $textReportName, "", $buttons);
|
ui_meta_print_header(__('Reporting'). $textReportName, "", $buttons);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ui_print_page_header(__('Reporting') . $textReportName, "images/reporting_edit.png", false, "reporting_" . $activeTab . "_tab", true, $buttons);
|
ui_print_page_header(__('Reporting') . $textReportName, "images/reporting_edit.png", false, "reporting_" . $activeTab . "_tab", true, $buttons);
|
||||||
|
@ -184,9 +184,14 @@ foreach ($layoutDatas as $layoutData) {
|
|||||||
$cell_content_enterprise = enterprise_visual_map_print_list_element('agent', $layoutData);
|
$cell_content_enterprise = enterprise_visual_map_print_list_element('agent', $layoutData);
|
||||||
}
|
}
|
||||||
if ($cell_content_enterprise === false) {
|
if ($cell_content_enterprise === false) {
|
||||||
$table->data[$i + 2][0] = '<a href="#" class="tip"> <span>' . __("Type at least two characters to search.") . '</span></a>' .
|
$params = array();
|
||||||
html_print_input_text_extended ('agent_' . $idLayoutData, agents_get_name($layoutData['id_agent']), 'text-agent_' . $idLayoutData, '', 15, 100, false, '',
|
$params['return'] = true;
|
||||||
array('class' => 'text-agent', 'style' => 'background: #ffffff url(images/lightning.png) no-repeat right;'), true);
|
$params['show_helptip'] = true;
|
||||||
|
$params['input_name'] = 'agent_' . $idLayoutData;
|
||||||
|
$params['value'] = agents_get_name($layoutData['id_agent']);
|
||||||
|
$params['javascript_is_function_select'] = true;
|
||||||
|
$params['selectbox_id'] = 'module_' . $idLayoutData;
|
||||||
|
$table->data[$i + 2][0] = ui_print_agent_autocomplete_input($params);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$table->data[$i + 2][0] = $cell_content_enterprise;
|
$table->data[$i + 2][0] = $cell_content_enterprise;
|
||||||
@ -281,72 +286,13 @@ ui_require_javascript_file ('wz_jsgraphics');
|
|||||||
ui_require_javascript_file ('pandora_visual_console');
|
ui_require_javascript_file ('pandora_visual_console');
|
||||||
ui_require_jquery_file('ajaxqueue');
|
ui_require_jquery_file('ajaxqueue');
|
||||||
ui_require_jquery_file('bgiframe');
|
ui_require_jquery_file('bgiframe');
|
||||||
ui_require_jquery_file('autocomplete');
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
$(".label_color").attachColorPicker();
|
$(".label_color").attachColorPicker();
|
||||||
//$(".ColorPickerDivSample").css('float', 'right');
|
//$(".ColorPickerDivSample").css('float', 'right');
|
||||||
});
|
});
|
||||||
|
|
||||||
var idText = $("#ip_text").html();
|
var idText = $("#ip_text").html();
|
||||||
|
|
||||||
$(".text-agent").autocomplete(
|
|
||||||
"ajax.php",
|
|
||||||
{
|
|
||||||
minChars: 2,
|
|
||||||
scroll:true,
|
|
||||||
extraParams: {
|
|
||||||
page: "operation/agentes/exportdata",
|
|
||||||
all: "enabled",
|
|
||||||
search_agents: 1,
|
|
||||||
id_group: function() { return $("#group").val(); }
|
|
||||||
},
|
|
||||||
formatItem: function (data, i, total) {
|
|
||||||
if (total == 0)
|
|
||||||
$(".text-agent").css ('background-color', '#cc0000');
|
|
||||||
else
|
|
||||||
$(".text-agent").css ('background-color', '');
|
|
||||||
if (data == "")
|
|
||||||
return false;
|
|
||||||
return data[0]+'<br><span class="ac_extra_field">' + idText + ': '+data[1]+'</span>';
|
|
||||||
},
|
|
||||||
delay: 200
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
$(".text-agent").result (
|
|
||||||
function (event, data, formatted) {
|
|
||||||
var id = $(this).attr('id').replace('text-agent_', '');
|
|
||||||
|
|
||||||
selectAgent = true;
|
|
||||||
var agent_name = this.value;
|
|
||||||
$('#module_' + id).fadeOut ('normal', function () {
|
|
||||||
$('#module_' + id).empty ();
|
|
||||||
var inputs = [];
|
|
||||||
inputs.push ("filter=disabled = 0");
|
|
||||||
inputs.push ("agent_name=" + agent_name);
|
|
||||||
inputs.push ("get_agent_modules_json=1");
|
|
||||||
inputs.push ("page=operation/agentes/ver_agente");
|
|
||||||
jQuery.ajax ({
|
|
||||||
data: inputs.join ("&"),
|
|
||||||
type: 'GET',
|
|
||||||
url: action="ajax.php",
|
|
||||||
timeout: 10000,
|
|
||||||
dataType: 'json',
|
|
||||||
success: function (data) {
|
|
||||||
$('#module_' + id).append ($('<option></option>').attr ('value', 0).text ("--"));
|
|
||||||
jQuery.each (data, function (i, val) {
|
|
||||||
s = js_html_entity_decode (val['nombre']);
|
|
||||||
$('#module_' + id).append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
|
|
||||||
});
|
|
||||||
$('#module_' + id).fadeIn ('normal');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -2073,6 +2073,11 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
$helptip_text = $parameters['helptip_text'];
|
$helptip_text = $parameters['helptip_text'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$use_hidden_input_idagent = false; //Default value
|
||||||
|
if (isset($parameters['use_hidden_input_idagent'])) {
|
||||||
|
$use_hidden_input_idagent = $parameters['use_hidden_input_idagent'];
|
||||||
|
}
|
||||||
|
|
||||||
$print_hidden_input_idagent = false; //Default value
|
$print_hidden_input_idagent = false; //Default value
|
||||||
if (isset($parameters['print_hidden_input_idagent'])) {
|
if (isset($parameters['print_hidden_input_idagent'])) {
|
||||||
$print_hidden_input_idagent = $parameters['print_hidden_input_idagent'];
|
$print_hidden_input_idagent = $parameters['print_hidden_input_idagent'];
|
||||||
@ -2085,7 +2090,7 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
|
|
||||||
$hidden_input_idagent_id = 'hidden-' . $input_name; //Default value
|
$hidden_input_idagent_id = 'hidden-' . $input_name; //Default value
|
||||||
if (isset($parameters['hidden_input_idagent_id'])) {
|
if (isset($parameters['hidden_input_idagent_id'])) {
|
||||||
$hidden_input_idagent_name = $parameters['hidden_input_idagent_id'];
|
$hidden_input_idagent_id = $parameters['hidden_input_idagent_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$hidden_input_idagent_value = 0; //Default value
|
$hidden_input_idagent_value = 0; //Default value
|
||||||
@ -2118,6 +2123,21 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
$add_none_module = $parameters['add_none_module'];
|
$add_none_module = $parameters['add_none_module'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$none_module_text = '--'; //Default value
|
||||||
|
if (isset($parameters['none_module_text'])) {
|
||||||
|
$none_module_text = $parameters['none_module_text'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$use_input_server = false; //Default value
|
||||||
|
if (isset($parameters['use_input_server'])) {
|
||||||
|
$use_input_server = $parameters['use_input_server'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$input_server_id = false; //Default value
|
||||||
|
if (isset($parameters['input_server_id'])) {
|
||||||
|
$input_server_id = $parameters['input_server_id'];
|
||||||
|
}
|
||||||
|
|
||||||
// Javascript configurations
|
// Javascript configurations
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
$javascript = true; //Default value
|
$javascript = true; //Default value
|
||||||
@ -2157,7 +2177,7 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
if (' . ((int)$add_none_module) . ') {
|
if (' . ((int)$add_none_module) . ') {
|
||||||
$("#' . $selectbox_id . '")
|
$("#' . $selectbox_id . '")
|
||||||
.append($("<option></option>")
|
.append($("<option></option>")
|
||||||
.attr("value", 0).text("--"));
|
.attr("value", 0).text("' . $none_module_text . '"));
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery.each (data, function(i, val) {
|
jQuery.each (data, function(i, val) {
|
||||||
@ -2226,6 +2246,7 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
select: function( event, ui ) {
|
select: function( event, ui ) {
|
||||||
var agent_name = ui.item.name;
|
var agent_name = ui.item.name;
|
||||||
var agent_id = ui.item.id;
|
var agent_id = ui.item.id;
|
||||||
|
var server_name = ui.item.ip;
|
||||||
|
|
||||||
//Put the name
|
//Put the name
|
||||||
$(this).val(agent_name);
|
$(this).val(agent_name);
|
||||||
@ -2234,10 +2255,15 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||||||
' . $javascript_name_function_select . '(agent_name);
|
' . $javascript_name_function_select . '(agent_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (' . ((int)$print_hidden_input_idagent) . ') {
|
if ((' . ((int)$print_hidden_input_idagent) . ')
|
||||||
|
|| (' . ((int)$use_hidden_input_idagent) . ')) {
|
||||||
$("#' . $hidden_input_idagent_id . '").val(agent_id);
|
$("#' . $hidden_input_idagent_id . '").val(agent_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (' . ((int)$use_input_server) . ') {
|
||||||
|
$("#' . $input_server_id . '").val(server_name);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -454,7 +454,7 @@ function agent_module_autocomplete (id_agent_name, id_agent_id, id_agent_module_
|
|||||||
homedir_path = '';
|
homedir_path = '';
|
||||||
if (homedir == undefined)
|
if (homedir == undefined)
|
||||||
homedir_path = '.';
|
homedir_path = '.';
|
||||||
else
|
else
|
||||||
homedir_path = homedir;
|
homedir_path = homedir;
|
||||||
|
|
||||||
$(id_agent_name).autocomplete({
|
$(id_agent_name).autocomplete({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user