Feature in progress... (New networkmap)

This commit is contained in:
Arturo Gonzalez 2016-02-01 14:16:38 +01:00
parent 0e433e3eb1
commit 93e1e75193
2 changed files with 75 additions and 23 deletions

View File

@ -0,0 +1,59 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
global $config;
check_login ();
// ACL for the general permission
$networkmaps_read = check_acl ($config['id_user'], 0, "MR");
$networkmaps_write = check_acl ($config['id_user'], 0, "MW");
$networkmaps_manage = check_acl ($config['id_user'], 0, "MM");
$id = (int)get_parameter('id_networkmap', 0);
$name = (string) get_parameter ('name');
$description = (string) get_parameter ('description');
$id_group = (int) get_parameter ('id_group');
$type = (string) get_parameter ('type');
if ($name == "")
$result = false;
else {
//FUNCION
/*$result = networkmap_update_networkmap ($id,
array ('name' => $name,
'id_group' => $id_group,
'description' => $description),
'type' => $type);*/
$result = false;
}
$info = ' Name: ' . $name . ' Description: ' . $description . ' ID group: ' . $id_group . ' Type: ' . $type;
if ($id) {
db_pandora_audit("Networkmap management", "Update networkmap #" . $id, false, false, $info);
}
else {
db_pandora_audit("Networkmap management", "Fail to update networkmap #$id", false, false, $info);
}
ui_print_result_message ($result,
__('Successfully updated'),
__('Could not be updated'));
?>

View File

@ -131,12 +131,11 @@ else {
$data['name'] = $networkmap['name'];
/*CUANDO HAYA VENTANA DE EDICIÓN SE REDIRIGE ALLÍ
$data['name'] = '<a href="index.php?' .
'sec=maps&' .
'sec2=enterprise/dashboard/main_dashboard&' .
'id_dashboard=' . $networkmap['id'] .'">' .
$networkmap['name'] . '</a>';*/
'sec2=operation/maps/networkmap_editor&' .
'id_networkmap=' . $networkmap['id'] .'">' .
$networkmap['name'] . '</a>';
$data['type'] = $networkmap['type'];
@ -154,31 +153,25 @@ else {
ui_print_group_icon($networkmap['id_group'], true);
}
$data['copy'] = '<a href="index.php?' . '" alt="' . __('Copy') . '">' .
$data['copy'] = '<a href="index.php?' .
'sec=maps&;' .
'sec2=operation/maps/networkmap_list' .
'duplicate_networkmap=1&id_networkmap=' . $networkmap['id'] . '" alt="' . __('Copy') . '">' .
html_print_image("images/copy.png", true) . '</a>';
/*CUANDO HAYA FORMA DE COPIAR SE ACTUALIZARÁ
'<a href="index.php?' .
'sec=reporting&amp;' .
'sec2=' . ENTERPRISE_DIR . '/dashboard/dashboards&amp;' .
'duplicate_dashboard=1&amp;id_dashboard=' . $dashboard['id'] . '" alt="' . __('Copy') . '">' .
html_print_image("images/copy.png", true) . '</a>';*/
$data['edit'] = '<a href="index.php?' . '" alt="' . __('Edit') . '">' .
$data['edit'] = '<a href="index.php?' .
'sec=maps&;' .
'sec2=operation/maps/networkmap_editor' .
'id_networkmap=' . $networkmap['id'] .'">' .
html_print_image("images/edit.png", true) . '</a>';
/*CUANDO HAYA FORMA DE EDITAR SE ACTUALIZARÁ*/
$data['delete'] = '<a href="index.php?' . '" alt="' . __('Delete') . '" onclick="javascript: if (!confirm(\'' . __('Are you sure?') . '\')) return false;">' .
$data['delete'] = '<a href="index.php?' .
'sec=maps&;' .
'sec2=operation/maps/networkmap_list' .
'delete_networkmap=1&id_networkmap=' . $networkmap['id'] . '" alt="' . __('Delete') .
'" onclick="javascript: if (!confirm(\'' . __('Are you sure?') . '\')) return false;">' .
html_print_image('images/cross.png', true) . '</a>';
/*CUANDO HAYA FORMA DE BORRAR SE ACTUALIZARÁ
'<a href="index.php?' .
'sec=reporting&amp;' .
'sec2=' . ENTERPRISE_DIR . '/dashboard/dashboards&amp;' .
'delete_dashboard=1&amp;id_dashboard=' . $dashboard['id'] . '" alt="' . __('Delete') . '" onclick="javascript: if (!confirm(\'' . __('Are you sure?') . '\')) return false;">' .
html_print_image('images/cross.png', true) . '</a>';*/
$table->data[] = $data;
}
html_print_table($table);