Fixed the networkmap enterprise when it is update.
This commit is contained in:
parent
9347892a02
commit
74957c30a2
|
@ -132,8 +132,13 @@ else {
|
|||
if ($not_found) {
|
||||
ui_print_error_message(__('Not found networkmap'));
|
||||
}
|
||||
else {
|
||||
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->id = 'form_editor';
|
||||
|
@ -281,6 +286,9 @@ else {
|
|||
'class="sub next"');
|
||||
}
|
||||
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 ('update_networkmap', 1);
|
||||
html_print_submit_button (__('Update networkmap'), 'crt', false,
|
||||
|
@ -461,4 +469,8 @@ else {
|
|||
$("#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>
|
||||
|
|
|
@ -319,6 +319,16 @@ else if ($delete_networkmap || $duplicate_networkmap || $update_networkmap) {
|
|||
$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,
|
||||
__('Successfully updated'),
|
||||
__('Could not be updated'));
|
||||
|
|
Loading…
Reference in New Issue