From a0ff9838d87f1b6d90a04c9ccae9df596ad79c3e Mon Sep 17 00:00:00 2001 From: vgilc Date: Fri, 30 Dec 2011 10:06:56 +0000 Subject: [PATCH] 2011-12-30 Vanessa Gil * godmode/netflow/nf_edit.php godmode/netflow/nf_item_list.php: Cascade delete filters. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5309 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 4 ++++ pandora_console/godmode/netflow/nf_edit.php | 15 +++++++++++++-- pandora_console/godmode/netflow/nf_item_list.php | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f239dc3203..0051bfe834 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2011-12-30 Vanessa Gil + * godmode/netflow/nf_edit.php + godmode/netflow/nf_item_list.php: Cascade delete filters. + 2011-12-29 Sergio Martin * godmode/agentes/module_manager_editor.php: Fixe module editor when the diff --git a/pandora_console/godmode/netflow/nf_edit.php b/pandora_console/godmode/netflow/nf_edit.php index 970c99fc86..c34e577f8d 100644 --- a/pandora_console/godmode/netflow/nf_edit.php +++ b/pandora_console/godmode/netflow/nf_edit.php @@ -43,11 +43,18 @@ $id = (int) get_parameter ('id'); $name = (string) get_parameter ('name'); if ($delete) { + $id_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $id); $result = db_process_sql_delete ('tnetflow_filter', array ('id_sg' => $id)); + + $result2 = db_process_sql_delete ('tnetflow_report_content', + array ('id_filter' => $id_filter)); - if ($result !== false) $result = true; - else $result = false; + if ($result !== false) { + $result = true; + } else { + $result = false; + } ui_print_result_message ($result, __('Successfully deleted'), @@ -61,8 +68,12 @@ if ($multiple_delete) { db_process_sql_begin(); foreach ($ids as $id) { + $id_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $id); $result = db_process_sql_delete ('tnetflow_filter', array ('id_sg' => $id)); + + $result2 = db_process_sql_delete ('tnetflow_report_content', + array ('id_filter' => $id_filter)); if ($result === false) { db_process_sql_rollback(); diff --git a/pandora_console/godmode/netflow/nf_item_list.php b/pandora_console/godmode/netflow/nf_item_list.php index 22719425f9..13c0619891 100644 --- a/pandora_console/godmode/netflow/nf_item_list.php +++ b/pandora_console/godmode/netflow/nf_item_list.php @@ -161,7 +161,7 @@ if(isset($data)) { echo ""; echo ""; }else { - echo "
".__('There are no defined filters')."
"; + echo "
".__('There are no defined items')."
"; } echo '
';