Merge branch 'ent-10734-sistema-de-favoritos-no-actualiza-nombre-en-el-menu-lateral-del-objeto-favorito-consola-visual' into 'develop', JJOS.

Ent 10734 sistema de favoritos no actualiza nombre en el menu lateral del objeto favorito consola visual

See merge request artica/pandorafms!5613
This commit is contained in:
Jimmy Olano 2023-04-04 11:57:45 +00:00
commit 89aa227b98
10 changed files with 33 additions and 0 deletions

View File

@ -1195,6 +1195,8 @@ if ($update_agent) {
]
);
ui_update_name_fav_element($id_agente, 'Agents', $alias);
ui_print_success_message(__('Successfully updated'));
db_pandora_audit(
AUDIT_LOG_AGENT_MANAGEMENT,

View File

@ -237,6 +237,8 @@ if ($update) {
['id_filter' => $id]
);
ui_update_name_fav_element($id, 'Events', $id_name);
ui_print_result_message(
$result,
__('Successfully updated'),

View File

@ -534,6 +534,7 @@ if ($is_management_allowed === true && $update_group === true) {
}
if ($result) {
ui_update_name_fav_element($id_group, 'Groups', $name);
ui_print_success_message(__('Group successfully updated'));
} else {
ui_print_error_message(__('There was a problem modifying group'));

View File

@ -1429,6 +1429,8 @@ switch ($action) {
['id_report' => $idReport]
);
ui_update_name_fav_element($idReport, 'Reporting', $new_values['name']);
$auditMessage = ($resultOperationDB === true) ? 'Update report' : 'Fail try to update report';
db_pandora_audit(
AUDIT_LOG_REPORT_MANAGEMENT,

View File

@ -293,6 +293,7 @@ switch ($activeTab) {
}
if ($result !== false) {
ui_update_name_fav_element($idVisualConsole, 'Visual_Console', $values['name']);
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
sprintf('Update visual console #%s', $idVisualConsole)

View File

@ -2065,6 +2065,7 @@ if (check_login()) {
if ($result === false) {
echo 'error';
} else {
ui_update_name_fav_element($id, 'Modules', $values['ag_modulename']);
echo 'ok';
}
}

View File

@ -7895,4 +7895,22 @@ function ui_print_fav_menu($id_element, $url, $label, $section)
$output .= html_print_input_text('label_fav_menu', '', '', 25, 255, true, false, true);
$output .= '</div>';
return $output;
}
function ui_update_name_fav_element($id_element, $section, $label)
{
$label = io_safe_output($label);
if (strlen($label) > 18) {
$label = io_safe_input(substr($label, 0, 18).'...');
}
db_process_sql_update(
'tfavmenu_user',
['label' => $label],
[
'section' => $section,
'id_element' => $id_element,
]
);
}

View File

@ -1002,6 +1002,10 @@ class Manager implements PublicLogin
$res = $this->put($values);
}
if ($res !== false) {
ui_update_name_fav_element($this->dashboardId, 'Dashboard_', $name);
}
$result = [
'error' => ($res === false) ? 1 : 0,
'error_mesage' => __('Error create or update dashboard'),

View File

@ -507,6 +507,7 @@ else if ($update_networkmap || $copy_networkmap || $delete) {
$values,
['id' => $id]
);
ui_update_name_fav_element($id, 'Network_map', $name);
}
$result_txt = ui_print_result_message(

View File

@ -517,6 +517,7 @@ if (is_ajax() === true) {
$return['error'] = false;
error_log('Failed to reset map '.$map_id);
} else {
ui_update_name_fav_element($map_id, 'Network_map', $new_values['name']);
$return['error'] = true;
}
} else {