#11679 Fix linked module name

This commit is contained in:
miguel angel rasteu 2023-09-07 16:29:18 +02:00
parent 0dc2a3492d
commit f445066d13
4 changed files with 26 additions and 14 deletions

View File

@ -1155,7 +1155,9 @@ if (check_login()) {
); );
} }
$data[2] .= '<a href ="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$id_agente.'&amp;tab=module&amp;id_agent_module='.$module['id_agente_modulo'].'&amp;edit_module='.$module['id_modulo'].'">';
$data[2] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '&hellip;', 'font-size: 9pt;'); $data[2] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '&hellip;', 'font-size: 9pt;');
$data[2] .= '</a>';
if (empty($module['extended_info']) === false) { if (empty($module['extended_info']) === false) {
$data[2] .= ui_print_help_tip($module['extended_info'], true, '/images/default_list.png'); $data[2] .= ui_print_help_tip($module['extended_info'], true, '/images/default_list.png');
} }

View File

@ -19,17 +19,25 @@ require_once $config['homedir'].'/include/functions_users.php';
$searchModules = check_acl($config['id_user'], 0, 'AR'); $searchModules = check_acl($config['id_user'], 0, 'AR');
if ($config['style'] === 'pandora_black') {
$selectModuleNameUp = ''; $selectModuleNameUp = '';
$selectModuleNameDown = ''; $selectModuleNameDown = '';
$selectAgentNameUp = ''; $selectAgentNameUp = '';
$selectAgentNameDown = ''; $selectAgentNameDown = '';
} else {
$selectModuleNameUp = '_black';
$selectModuleNameDown = '_black';
$selectAgentNameUp = '_black';
$selectAgentNameDown = '_black';
}
$is_admin = (bool) db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']); $is_admin = (bool) db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
switch ($sortField) { switch ($sortField) {
case 'module_name': case 'module_name':
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectModuleNameUp = $selected; $selectModuleNameUp = $selected_module;
$order = [ $order = [
'field' => 'module_name', 'field' => 'module_name',
'order' => 'ASC', 'order' => 'ASC',
@ -37,7 +45,7 @@ switch ($sortField) {
break; break;
case 'down': case 'down':
$selectModuleNameDown = $selected; $selectModuleNameDown = $selected_module;
$order = [ $order = [
'field' => 'module_name', 'field' => 'module_name',
'order' => 'DESC', 'order' => 'DESC',
@ -49,7 +57,7 @@ switch ($sortField) {
case 'agent_name': case 'agent_name':
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectAgentNameUp = $selected; $selectAgentNameUp = $selected_module;
$order = [ $order = [
'field' => 'agent_name', 'field' => 'agent_name',
'order' => 'ASC', 'order' => 'ASC',
@ -57,7 +65,7 @@ switch ($sortField) {
break; break;
case 'down': case 'down':
$selectAgentNameDown = $selected; $selectAgentNameDown = $selected_module;
$order = [ $order = [
'field' => 'agent_name', 'field' => 'agent_name',
'order' => 'DESC', 'order' => 'DESC',
@ -67,7 +75,7 @@ switch ($sortField) {
break; break;
default: default:
$selectModuleNameUp = $selected; $selectModuleNameUp = $selected_module;
$order = [ $order = [
'field' => 'module_name', 'field' => 'module_name',
'order' => 'ASC', 'order' => 'ASC',

View File

@ -30,10 +30,9 @@ if (!$modules || !$searchModules) {
$table->cellspacing = 4; $table->cellspacing = 4;
$table->width = '98%'; $table->width = '98%';
$table->class = 'info_table'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->head[0] = __('Module').' <a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=module_name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectModuleNameUp]).'</a><a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=module_name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectModuleNameDown]).'</a>'; $table->head[0] = __('Module').' <a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=module_name&sort=up">'.html_print_image('images/sort_up'.$selectModuleNameUp.'.png', true).'</a><a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=module_name&sort=down">'.html_print_image('images/sort_down'.$selectModuleNameDown.'.png', true).'</a>';
$table->head[1] = __('Agent').' <a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=agent_name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectAgentNameUp]).'</a><a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=agent_name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectAgentNameDown]).'</a>'; $table->head[1] = __('Agent').' <a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=agent_name&sort=up">'.html_print_image('images/sort_up'.$selectAgentNameUp.'.png', true).'</a><a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=agent_name&sort=down">'.html_print_image('images/sort_down'.$selectAgentNameDown.'.png', true).'</a>';
$table->head[2] = __('Type'); $table->head[2] = __('Type');
$table->head[3] = __('Interval'); $table->head[3] = __('Interval');
$table->head[4] = __('Status'); $table->head[4] = __('Status');
@ -80,6 +79,9 @@ if (!$modules || !$searchModules) {
$module['datos'] = modules_get_last_value($module['id_agente_modulo']); $module['datos'] = modules_get_last_value($module['id_agente_modulo']);
$module['module_name'] = $module['nombre']; $module['module_name'] = $module['nombre'];
$linked_module_name = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$id_agente.'&amp;tab=module&amp;id_agent_module='.$module['id_agente_modulo'].'&amp;edit_module='.$module['id_modulo'].'">';
$linked_module_name .= $module['module_name'];
$linked_module_name .= '</a>';
// To search the monitor status // To search the monitor status
$status_sql = sprintf('SELECT estado from tagente_estado where id_agente_modulo ='.$module['id_agente_modulo']); $status_sql = sprintf('SELECT estado from tagente_estado where id_agente_modulo ='.$module['id_agente_modulo']);
$status_sql = db_process_sql($status_sql); $status_sql = db_process_sql($status_sql);
@ -226,7 +228,7 @@ if (!$modules || !$searchModules) {
array_push( array_push(
$table->data, $table->data,
[ [
$module['module_name'], $linked_module_name,
$agentCell, $agentCell,
$typeCell, $typeCell,
$intervalCell, $intervalCell,

View File

@ -60,7 +60,7 @@ $order = null;
$sortField = get_parameter('sort_field'); $sortField = get_parameter('sort_field');
$sort = get_parameter('sort', 'none'); $sort = get_parameter('sort', 'none');
$selected = 'border: 1px solid black;'; $selected = 'border: 1px solid black;';
$selected_module = '_green';
if ($searchMain) { if ($searchMain) {
$main_tab = [ $main_tab = [
'text' => "<a href='index.php?search_category=main&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image( 'text' => "<a href='index.php?search_category=main&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(