From dbc42489d0bd6f80cec0ae99df0042a9cc089a68 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 13 Mar 2012 17:53:58 +0000 Subject: [PATCH] 2012-03-13 Miguel de Dios * godmode/reporting/reporting_builder.item_editor.php: added button near to the list custom graph to create or edit the custom grap selected. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5760 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++ .../reporting_builder.item_editor.php | 39 +++++++++++++++++-- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c960635316..5ae4a51d2f 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-03-13 Miguel de Dios + + * godmode/reporting/reporting_builder.item_editor.php: added button near to + the list custom graph to create or edit the custom grap selected. + 2012-03-13 Miguel de Dios * godmode/reporting/graph_builder.main.php: fixed lost require PHP functions diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index e5a7a07301..ab27398202 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -511,7 +511,6 @@ html_print_input_hidden('id_item', $idItem); if ($config['metaconsole'] == 1) { $graphs = array(); $graphs = metaconsole_get_custom_graphs(); - html_print_select ($graphs, 'id_custom_graph', $idCustomGraph, '', '--', 0); } else { switch ($config["dbtype"]) { @@ -523,8 +522,21 @@ html_print_input_hidden('id_item', $idItem); $query_sql = 'SELECT id_graph, name FROM tgraph WHERE private = 0 OR (private = 1 AND id_user = \''.$config["id_user"].'\')'; break; } - html_print_select_from_sql($query_sql, 'id_custom_graph', $idCustomGraph, '', '--', 0); } + html_print_select_from_sql($query_sql, 'id_custom_graph', $idCustomGraph, 'change_custom_graph();', '--', 0); + + $style_button_create_custom_graph = 'style="display: none;"'; + $style_button_edit_custom_graph = ''; + if (empty($idCustomGraph)) { + $style_button_create_custom_graph = ''; + $style_button_edit_custom_graph = 'style="display: none;"'; + } + echo " "; + html_print_button(__("Create"), 'create_graph', false, + 'create_custom_graph();', 'class="sub add" ' . $style_button_create_custom_graph); + + html_print_button(__("Edit"), 'edit_graph', false, + 'edit_custom_graph();', 'class="sub config" ' . $style_button_edit_custom_graph); ?> @@ -847,7 +859,7 @@ function print_General_list($width, $action, $idItem = null) { } ?> -