Fixed the networkmap enterprise when it is update.
This commit is contained in:
parent
9347892a02
commit
74957c30a2
|
@ -133,7 +133,12 @@ if ($not_found) {
|
||||||
ui_print_error_message(__('Not found networkmap'));
|
ui_print_error_message(__('Not found networkmap'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo '<form method="post" action="index.php?sec=maps&sec2=operation/maps/networkmap_list">';
|
if ($edit_networkmap && enterprise_installed()) {
|
||||||
|
echo '<form method="post" onsubmit="javascript: return alert_refresh_all_networkmap();" action="index.php?sec=maps&sec2=operation/maps/networkmap_list">';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo '<form method="post" action="index.php?sec=maps&sec2=operation/maps/networkmap_list">';
|
||||||
|
}
|
||||||
|
|
||||||
$table = null;
|
$table = null;
|
||||||
$table->id = 'form_editor';
|
$table->id = 'form_editor';
|
||||||
|
@ -281,6 +286,9 @@ else {
|
||||||
'class="sub next"');
|
'class="sub next"');
|
||||||
}
|
}
|
||||||
else if ($edit_networkmap) {
|
else if ($edit_networkmap) {
|
||||||
|
if (enterprise_installed()) {
|
||||||
|
ui_print_help_tip(__("Update the config of enterprise networkmap refresh all data and lost the changes."));
|
||||||
|
}
|
||||||
html_print_input_hidden ('id_networkmap', $id);
|
html_print_input_hidden ('id_networkmap', $id);
|
||||||
html_print_input_hidden ('update_networkmap', 1);
|
html_print_input_hidden ('update_networkmap', 1);
|
||||||
html_print_submit_button (__('Update networkmap'), 'crt', false,
|
html_print_submit_button (__('Update networkmap'), 'crt', false,
|
||||||
|
@ -461,4 +469,8 @@ else {
|
||||||
$("#form_editor-source_ip_mask").show();
|
$("#form_editor-source_ip_mask").show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function alert_refresh_all_networkmap() {
|
||||||
|
return confirm("<?php echo __("Do you want refresh the map and lost the changes?");?>");
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -319,6 +319,16 @@ else if ($delete_networkmap || $duplicate_networkmap || $update_networkmap) {
|
||||||
$result_update = maps_update_map($id, $values);
|
$result_update = maps_update_map($id, $values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($result_update) {
|
||||||
|
$nodes = db_get_all_rows_filter(
|
||||||
|
'titem', array('id_map' => $id));
|
||||||
|
|
||||||
|
foreach ($nodes as $node) {
|
||||||
|
db_process_sql_delete('trel_item', array('id_item' => $node['id']));
|
||||||
|
}
|
||||||
|
db_process_sql_delete('titem', array('id_map' => $id));
|
||||||
|
}
|
||||||
|
|
||||||
ui_print_result_message ($result_update,
|
ui_print_result_message ($result_update,
|
||||||
__('Successfully updated'),
|
__('Successfully updated'),
|
||||||
__('Could not be updated'));
|
__('Could not be updated'));
|
||||||
|
|
Loading…
Reference in New Issue