From 06b56d80c80b2a013ac5ff5bbac2be9350987eb9 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Fri, 26 Jun 2015 14:52:01 +0200 Subject: [PATCH] Add new view when no have data in this view (cherry picked from commit 15fb6f20a4e0e26fc2cf8f895f4d54d58ba792e6) --- .../general/firts_task/custom_graphs.php | 26 +++ .../general/firts_task/incidents.php | 26 +++ .../general/firts_task/map_builder.php | 8 +- .../general/firts_task/network_map.php | 8 +- .../general/firts_task/planned_downtime.php | 23 +++ .../godmode/agentes/planned_downtime.list.php | 55 ++++--- .../modules/manage_network_templates_form.php | 8 +- pandora_console/godmode/reporting/graphs.php | 45 +++--- .../godmode/reporting/map_builder.php | 34 ++-- .../operation/incidents/incident.php | 148 +++++++++--------- 10 files changed, 228 insertions(+), 153 deletions(-) create mode 100644 pandora_console/general/firts_task/custom_graphs.php create mode 100644 pandora_console/general/firts_task/incidents.php create mode 100644 pandora_console/general/firts_task/planned_downtime.php diff --git a/pandora_console/general/firts_task/custom_graphs.php b/pandora_console/general/firts_task/custom_graphs.php new file mode 100644 index 0000000000..740248ab2a --- /dev/null +++ b/pandora_console/general/firts_task/custom_graphs.php @@ -0,0 +1,26 @@ + +true, 'message'=> __('There are no custom graphs defined yet.') ) ); +?> + +
+
+ __('Custom Graphs')));?> +
+
+

+

ICMP (pings), + SNMP (detecting the topology of networks and their interfaces), and other customized + type. You can define your own customized recon script.'); ?>

+
+ +
+
+
\ No newline at end of file diff --git a/pandora_console/general/firts_task/incidents.php b/pandora_console/general/firts_task/incidents.php new file mode 100644 index 0000000000..dc3767a104 --- /dev/null +++ b/pandora_console/general/firts_task/incidents.php @@ -0,0 +1,26 @@ + +true, 'message'=> __('There are no incidents defined yet.') ) ); +?> + +
+
+ __('Incidents')));?> +
+
+

+

ICMP (pings), + SNMP (detecting the topology of networks and their interfaces), and other customized + type. You can define your own customized recon script.'); ?>

+
+ +
+
+
\ No newline at end of file diff --git a/pandora_console/general/firts_task/map_builder.php b/pandora_console/general/firts_task/map_builder.php index 23bdaa85e6..fa395ca580 100755 --- a/pandora_console/general/firts_task/map_builder.php +++ b/pandora_console/general/firts_task/map_builder.php @@ -3,21 +3,21 @@ global $config; check_login (); ui_require_css_file ('firts_task'); ?> -true, 'message'=> __('There are no recon task defined yet.') ) ); ?> +true, 'message'=> __('There are no visual console defined yet.') ) ); ?>
- __('Recon server')));?> + __('Visual Console')));?>
-

+

ICMP (pings), SNMP (detecting the topology of networks and their interfaces), and other customized type. You can define your own customized recon script.'); ?>

- +
diff --git a/pandora_console/general/firts_task/network_map.php b/pandora_console/general/firts_task/network_map.php index e22d366939..5b890caaf5 100755 --- a/pandora_console/general/firts_task/network_map.php +++ b/pandora_console/general/firts_task/network_map.php @@ -5,17 +5,17 @@ ui_require_css_file ('firts_task'); ?> true, 'message'=> __('There are no recon task defined yet.') ) ); +ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no network map defined yet.') ) ); $strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); $networkmap_types = networkmap_get_types($strict_user); ?>
- __('Recon server')));?> + __('Network Map')));?>
-

+

- +

diff --git a/pandora_console/general/firts_task/planned_downtime.php b/pandora_console/general/firts_task/planned_downtime.php new file mode 100644 index 0000000000..6e888cf495 --- /dev/null +++ b/pandora_console/general/firts_task/planned_downtime.php @@ -0,0 +1,23 @@ + +true, 'message'=> __('There are no planned downtime defined yet.') ) ); ?> + +
+
+ __('Planned Downtime')));?> +
+
+

+

ICMP (pings), + SNMP (detecting the topology of networks and their interfaces), and other customized + type. You can define your own customized recon script.'); ?>

+
+ +
+
+
diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php index 8332acd744..f2cb14e0ba 100755 --- a/pandora_console/godmode/agentes/planned_downtime.list.php +++ b/pandora_console/godmode/agentes/planned_downtime.list.php @@ -212,14 +212,14 @@ $module_name = $filter_params['module_name'] = (string) (!empty($module_id) ? $filter_params_str = http_build_query($filter_params); // Table filter -$table = new StdClass(); -$table->class = 'databox filters'; -$table->width = '100%'; -$table->rowstyle = array(); -$table->rowstyle[0] = "background-color: #f9faf9;"; -$table->rowstyle[1] = "background-color: #f9faf9;"; -$table->rowstyle[2] = "background-color: #f9faf9;"; -$table->data = array(); +$table_form = new StdClass(); +$table_form->class = 'databox filters'; +$table_form->width = '100%'; +$table_form->rowstyle = array(); +$table_form->rowstyle[0] = "background-color: #f9faf9;"; +$table_form->rowstyle[1] = "background-color: #f9faf9;"; +$table_form->rowstyle[2] = "background-color: #f9faf9;"; +$table_form->data = array(); $row = array(); @@ -231,7 +231,7 @@ $date_inputs .= "  "; $date_inputs .= __('To') . ' ' . html_print_input_text('date_to', $date_to, '', 10, 10, true); $row[] = $date_inputs; -$table->data[] = $row; +$table_form->data[] = $row; $row = array(); @@ -241,7 +241,7 @@ $row[] = __('Execution type') . ' ' . html_print_select($execution_type_fie // Show past downtimes $row[] = __('Show past downtimes') . ' ' . html_print_checkbox ("archived", 1, $show_archived, true); -$table->data[] = $row; +$table_form->data[] = $row; $row = array(); @@ -262,11 +262,8 @@ $row[] = __('Module') . ' ' . html_print_autocomplete_modules('module_name' $row[] = html_print_submit_button('Search', 'search', false, 'class="sub search"', true); -$table->data[] = $row; +$table_form->data[] = $row; -echo "
"; -html_print_table($table); -echo "
"; // View available downtimes present in database (if any of them) $table = new StdClass(); @@ -438,9 +435,13 @@ else { } if (!$downtimes) { - echo '
'.__('No planned downtime').'
'; + require_once ($config['homedir'] . "/general/firts_task/planned_downtime.php"); } else { + echo "
"; + html_print_table($table_form); + echo "
"; + ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset); foreach ($downtimes as $downtime) { @@ -571,18 +572,20 @@ else { array_push ($table->data, $data); } html_print_table ($table); -} -echo '
'; + echo '
'; + + echo '
'; + echo '
'; + html_print_button(__('Export to CSV'), 'csv_export', false, + "location.href='godmode/agentes/planned_downtime.export_csv.php?$filter_params_str'", 'class="sub next"'); + echo '
'; + echo ' '; + echo '
'; + html_print_submit_button (__('Create'), 'create', false, 'class="sub next"'); + echo '
'; + echo '
'; +} -echo '
'; -echo '
'; -html_print_button(__('Export to CSV'), 'csv_export', false, "location.href='godmode/agentes/planned_downtime.export_csv.php?$filter_params_str'", 'class="sub next"'); -echo '
'; -echo ' '; -echo '
'; -html_print_submit_button (__('Create'), 'create', false, 'class="sub next"'); -echo '
'; -echo '
'; ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascript/i18n/"); diff --git a/pandora_console/godmode/modules/manage_network_templates_form.php b/pandora_console/godmode/modules/manage_network_templates_form.php index 353236cc70..b2176426dc 100644 --- a/pandora_console/godmode/modules/manage_network_templates_form.php +++ b/pandora_console/godmode/modules/manage_network_templates_form.php @@ -141,11 +141,11 @@ else { echo ''; -echo ''; -echo ''; +echo ''; echo '"; @@ -233,11 +233,13 @@ if ($id_np > 0) { $table->cellspacing = 0; $table->class = "databox filters"; + $table->style[0] = 'font-weight: bold'; + //The form to submit when adding a list of components $filter = ''; $filter .= html_print_input_text ('ncfilter', $ncfilter, '', 50, 255, true); - $filter .= ' '.html_print_submit_button (__('Filter'), 'ncgbutton', false, 'class="sub search"', true); + $filter .= '  '.html_print_submit_button (__('Filter'), 'ncgbutton', false, 'class="sub search"', true); $filter .= ''; $group_filter = ''; diff --git a/pandora_console/godmode/reporting/graphs.php b/pandora_console/godmode/reporting/graphs.php index 6662a69a3e..828f065e33 100644 --- a/pandora_console/godmode/reporting/graphs.php +++ b/pandora_console/godmode/reporting/graphs.php @@ -182,34 +182,31 @@ if (!empty ($graphs)) { } html_print_table ($table); + + echo "
'.__('Name').''; +echo '
' . "" . __('Name') . "" . ''; html_print_input_text ("name", $name, '', 63); echo '
'.__('Description').'
' . "" . __('Description') . "" . ''; html_print_textarea ("description", 2, 60, $description); echo "
"; + echo ""; + echo ""; + echo ""; + echo "
"; + echo "
"; + if (!empty($graphs)){ + echo ""; + html_print_input_hidden('multiple_delete', 1); + html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); + echo ""; + } + if (check_acl ($config['id_user'], 0, "RW")) { + echo '
'; + html_print_submit_button (__('Create graph'), 'create', false, 'class="sub next" style="margin-right:5px;"'); + echo "
"; + } + echo "
"; + echo "
"; } else { - ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined graphs.') ) ); + require_once ($config['homedir'] . "/general/firts_task/custom_graphs.php"); } -echo ""; - echo ""; - echo ""; - echo ""; -echo "
"; - echo "
"; - if (!empty($graphs)){ - echo "
"; - html_print_input_hidden('multiple_delete', 1); - html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); - echo "
"; - } - if (check_acl ($config['id_user'], 0, "RW")) { - echo '
'; - html_print_submit_button (__('Create graph'), 'create', false, 'class="sub next" style="margin-right:5px;"'); - echo "
"; - } - echo "
"; - echo "
"; - - - - ?>