mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-08-14 06:18:40 +02:00
#10324 delete fav menu when delete element
This commit is contained in:
parent
651b605f55
commit
728991ad9a
@ -197,6 +197,14 @@ if ($delete_layout || $copy_layout) {
|
||||
'tlayout',
|
||||
['id' => $id_layout]
|
||||
);
|
||||
db_process_sql_delete(
|
||||
'tfavmenu_user',
|
||||
[
|
||||
'id_user' => $config['id_user'],
|
||||
'id_element' => $id_layout,
|
||||
'section' => 'Visual_Console',
|
||||
]
|
||||
);
|
||||
|
||||
$auditMessage = ((bool) $result === true) ? 'Delete visual console' : 'Fail try to delete visual console';
|
||||
db_pandora_audit(
|
||||
|
@ -2733,6 +2733,16 @@ function agents_delete_agent($id_agents, $disableACL=false)
|
||||
enterprise_include_once('include/functions_agents.php');
|
||||
enterprise_hook('agent_delete_from_cache', [$id_agent]);
|
||||
|
||||
// Delete agent from fav menu.
|
||||
db_process_sql_delete(
|
||||
'tfavmenu_user',
|
||||
[
|
||||
'id_user' => $config['id_user'],
|
||||
'id_element' => $id_agent,
|
||||
'section' => 'Agents',
|
||||
]
|
||||
);
|
||||
|
||||
// Break the loop on error.
|
||||
if ((bool) $error === true) {
|
||||
break;
|
||||
|
@ -221,6 +221,8 @@ function reports_update_report($id_report, $values)
|
||||
*/
|
||||
function reports_delete_report($id_report)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$id_report = safe_int($id_report);
|
||||
if (empty($id_report)) {
|
||||
return false;
|
||||
@ -231,6 +233,16 @@ function reports_delete_report($id_report)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Delete report from fav menu.
|
||||
db_process_sql_delete(
|
||||
'tfavmenu_user',
|
||||
[
|
||||
'id_user' => $config['id_user'],
|
||||
'id_element' => $id_report,
|
||||
'section' => 'Reporting',
|
||||
]
|
||||
);
|
||||
|
||||
@db_process_sql_delete('treport_content', ['id_report' => $id_report]);
|
||||
return @db_process_sql_delete('treport', ['id_report' => $id_report]);
|
||||
}
|
||||
|
@ -568,6 +568,16 @@ class Manager implements PublicLogin
|
||||
'tdashboard',
|
||||
['id' => $this->dashboardId]
|
||||
);
|
||||
|
||||
// Delete dashboard from fav menu.
|
||||
\db_process_sql_delete(
|
||||
'tfavmenu_user',
|
||||
[
|
||||
'id_user' => $config['id_user'],
|
||||
'id_element' => $this->dashboardId,
|
||||
'section' => 'Dashboard',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// Audit.
|
||||
|
@ -548,6 +548,15 @@ else if ($update_networkmap || $copy_networkmap || $delete) {
|
||||
|
||||
$result = networkmap_delete_networkmap($id);
|
||||
|
||||
// Delete network map from fav menu.
|
||||
db_process_sql_delete(
|
||||
'tfavmenu_user',
|
||||
[
|
||||
'id_user' => $config['id_user'],
|
||||
'id_element' => $id,
|
||||
'section' => 'Network_map',
|
||||
]
|
||||
);
|
||||
$result_txt = ui_print_result_message(
|
||||
$result,
|
||||
__('Succesfully deleted'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user