';
-echo ''.html_print_input(
+echo ' | '.html_print_input(
[
'type' => 'select_multiple_modules_filtered',
'uniqId' => 'modules',
diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php
index 7993d7e38a..bdbee9a14b 100644
--- a/pandora_console/godmode/reporting/graph_builder.php
+++ b/pandora_console/godmode/reporting/graph_builder.php
@@ -222,7 +222,7 @@ function add_quotes($item)
if ($add_module === true) {
$id_graph = get_parameter('id');
- $id_agent_modules = explode(',', get_parameter('id_modules'));
+ $id_modules = explode(',', get_parameter('id_modules'));
$id_agents = explode(',', get_parameter('id_agents'));
$weight = get_parameter('weight');
@@ -230,11 +230,10 @@ if ($add_module === true) {
// Safe output remove all entities.
io_safe_output_array($id_modules, '');
- // We need to put the entities again
- // to browse in db.
- io_safe_input_array($id_modules);
-
+ $id_agent_modules = db_get_all_rows_sql(
+ 'SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente IN ('.implode(',', $id_agents).") AND nombre IN ('".implode("','", $id_modules)."')"
+ );
if (count($id_agent_modules) > 0 && $id_agent_modules != '') {
$order = db_get_row_sql("SELECT `field_order` from tgraph_source WHERE id_graph=$id_graph ORDER BY `field_order` DESC");
@@ -242,7 +241,7 @@ if ($add_module === true) {
$order = $order['field_order'];
foreach ($id_agent_modules as $id_agent_module) {
$order++;
- $result = db_process_sql_insert('tgraph_source', ['id_graph' => $id_graph, 'id_agent_module' => $id_agent_module, 'weight' => $weight, 'field_order' => $order]);
+ $result = db_process_sql_insert('tgraph_source', ['id_graph' => $id_graph, 'id_agent_module' => $id_agent_module['id_agente_modulo'], 'weight' => $weight, 'field_order' => $order]);
}
} else {
$result = false;
diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php
index b7f21f392d..81bb15757f 100644
--- a/pandora_console/include/functions_html.php
+++ b/pandora_console/include/functions_html.php
@@ -1491,11 +1491,11 @@ function html_print_select_multiple_modules_filtered(array $data):string
$output .= '';
$output .= html_print_input(
[
- 'type' => 'text',
- 'name' => 'agent-searchBar-'.$uniqId,
- 'onKeyUp' => 'searchAgent(\''.$uniqId.'\')',
- 'value' => __('Type for search...'),
- 'return' => true,
+ 'type' => 'text',
+ 'name' => 'agent-searchBar-'.$uniqId,
+ 'onKeyUp' => 'searchAgent(\''.$uniqId.'\')',
+ 'placeholder' => __('Type to search agents'),
+ 'return' => true,
]
);
@@ -1504,11 +1504,11 @@ function html_print_select_multiple_modules_filtered(array $data):string
$output .= ' ';
$output .= html_print_input(
[
- 'type' => 'text',
- 'name' => 'module-searchBar-'.$uniqId,
- 'onKeyUp' => 'searchModule(\''.$uniqId.'\')',
- 'return' => true,
- 'value' => 'test',
+ 'type' => 'text',
+ 'name' => 'module-searchBar-'.$uniqId,
+ 'onKeyUp' => 'searchModule(\''.$uniqId.'\')',
+ 'return' => true,
+ 'placeholder' => __('Type to search modules'),
]
);
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index bec08fdb10..ba89e2d915 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -8501,6 +8501,8 @@ div#err_msg_centralised {
min-width: 250px !important;
}
-#select_multiple_modules_filtered > div > div > select {
- max-width: 250px !important;
+#select_multiple_modules_filtered > div > div > input {
+ max-width: 250px;
+ width: 95%;
+ height: 95%;
}
|