Changed name by alias. Ticket #74.

This commit is contained in:
Daniel Maya 2016-09-22 10:27:35 +02:00
parent 3e9afb523e
commit 21dd508e53
12 changed files with 164 additions and 91 deletions

View File

@ -150,22 +150,27 @@ $table->style[0] = 'font-weight: bold; width: 150px;';
$table->data = array ();
$table->align[2] = 'center';
html_debug($alias);
if(!$new_agent && $alias != ''){
$table->data[0][0] = __('Agent name') .
ui_print_help_tip (__("The agent's name must be the same as the one defined at the console"), true);
$table->data[0][1] = html_print_input_text ('agente', $nombre_agente, '', 50, 100,true);
$table->data[0][0] = __('Agent name') .
ui_print_help_tip (__("The agent's name must be the same as the one defined at the console"), true);
$table->data[0][1] = html_print_input_text ('agente', $nombre_agente, '', 50, 100,true);
$table->data[0][2] = __('QR Code Agent view');
$table->data[0][2] = __('QR Code Agent view');
if ($id_agente) {
if ($id_agente) {
$table->data[0][1] .= "&nbsp;<b>" . __("ID") . "</b>&nbsp; $id_agente &nbsp;";
$table->data[0][1] .= '&nbsp;&nbsp;<a href="index.php?sec=gagente&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'">';
$table->data[0][1] .= html_print_image ("images/zoom.png",
true, array ("border" => 0, "title" => __('Agent detail')));
$table->data[0][1] .= '</a>';
$table->data[0][1] .= "&nbsp;<b>" . __("ID") . "</b>&nbsp; $id_agente &nbsp;";
$table->data[0][1] .= '&nbsp;&nbsp;<a href="index.php?sec=gagente&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'">';
$table->data[0][1] .= html_print_image ("images/zoom.png",
true, array ("border" => 0, "title" => __('Agent detail')));
$table->data[0][1] .= '</a>';
}
}
// Remote configuration available
if (!$new_agent) {
if (isset($filename)) {
@ -197,17 +202,21 @@ if (!$new_agent) {
if (!$new_agent) {
$table->data[0][1] .= "&nbsp;&nbsp;<span align='right'><a onClick=\"if (!confirm('" . __('Are you sure?') . "')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=$id_agente&search=&offset=0&sort_field=&sort=none'>" . html_print_image('images/cross.png', true, array('title' => __("Delete agent"))) . "</a>";
}
$table->data[1][0] = __('Alias');
$table->data[1][1] = html_print_input_text ('alias', $alias, '', 50, 100, true);
$table->data[1][0] = __('IP Address');
$table->data[1][1] = html_print_input_text ('direccion', $direccion_agente, '', 16, 100, true);
$table->data[2][0] = __('IP Address');
$table->data[2][1] = html_print_input_text ('direccion', $direccion_agente, '', 16, 100, true);
if ($id_agente) {
$table->data[1][1] .= '&nbsp;&nbsp;&nbsp;&nbsp;';
$table->data[2][1] .= '&nbsp;&nbsp;&nbsp;&nbsp;';
$ip_all = agents_get_addresses ($id_agente);
$table->data[1][1] .= html_print_select ($ip_all, "address_list", $direccion_agente, '', '', 0, true);
$table->data[1][1] .= "&nbsp;". html_print_checkbox ("delete_ip", 1, false, true).__('Delete selected');
$table->data[2][1] .= html_print_select ($ip_all, "address_list", $direccion_agente, '', '', 0, true);
$table->data[2][1] .= "&nbsp;". html_print_checkbox ("delete_ip", 1, false, true).__('Delete selected');
}
?>
@ -217,66 +226,69 @@ if ($id_agente) {
}
</style>
<?php
$table->rowspan[1][2] = 3;
if ($id_agente) {
$table->data[1][2] =
"<a id='qr_code_agent_view' href='javascript: show_dialog_qrcode(null, \"" .
ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agente) . "\" );'></a>";
}
else {
$table->data[1][2] = __("Only it is show when<br />the agent is saved.");
if(!$new_agent){
$table->rowspan[2][2] = 3;
if ($id_agente) {
$table->data[2][2] =
"<a id='qr_code_agent_view' href='javascript: show_dialog_qrcode(null, \"" .
ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agente) . "\" );'></a>";
}
else {
$table->data[2][2] = __("Only it is show when<br />the agent is saved.");
}
}
$groups = users_get_groups ($config["id_user"], "AR",false);
$agents = agents_get_group_agents (array_keys ($groups));
$table->data[2][0] = __('Parent');
$table->data[3][0] = __('Parent');
$params = array();
$params['return'] = true;
$params['show_helptip'] = true;
$params['input_name'] = 'id_parent';
$params['value'] = agents_get_name ($id_parent);
$table->data[2][1] = ui_print_agent_autocomplete_input($params);
$table->data[3][1] = ui_print_agent_autocomplete_input($params);
$table->data[2][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). "&nbsp;" . ui_print_help_icon("cascade_protection", true);
$table->data[3][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). "&nbsp;" . ui_print_help_icon("cascade_protection", true);
$table->data[3][0] = __('Group');
$table->data[3][1] = html_print_select_groups(false, "AR", false, 'grupo', $grupo, '', '', 0, true);
$table->data[3][1] .= ' <span id="group_preview">';
$table->data[3][1] .= ui_print_group_icon ($grupo, true);
$table->data[3][1] .= '</span>';
$table->data[4][0] = __('Group');
$table->data[4][1] = html_print_select_groups(false, "AR", false, 'grupo', $grupo, '', '', 0, true);
$table->data[4][1] .= ' <span id="group_preview">';
$table->data[4][1] .= ui_print_group_icon ($grupo, true);
$table->data[4][1] .= '</span>';
$table->data[4][0] = __('Interval');
$table->data[5][0] = __('Interval');
$table->data[4][1] = html_print_extended_select_for_time ('intervalo', $intervalo, '', '', '0', 10, true);
$table->data[5][1] = html_print_extended_select_for_time ('intervalo', $intervalo, '', '', '0', 10, true);
if ($intervalo < SECONDS_5MINUTES) {
$table->data[4][1] .= clippy_context_help("interval_agent_min");
$table->data[5][1] .= clippy_context_help("interval_agent_min");
}
$table->data[5][0] = __('OS');
$table->data[5][1] = html_print_select_from_sql ('SELECT id_os, name FROM tconfig_os',
$table->data[6][0] = __('OS');
$table->data[6][1] = html_print_select_from_sql ('SELECT id_os, name FROM tconfig_os',
'id_os', $id_os, '', '', '0', true);
$table->data[5][1] .= ' <span id="os_preview">';
$table->data[5][1] .= ui_print_os_icon ($id_os, false, true);
$table->data[5][1] .= '</span>';
$table->data[6][1] .= ' <span id="os_preview">';
$table->data[6][1] .= ui_print_os_icon ($id_os, false, true);
$table->data[6][1] .= '</span>';
// Network server
$servers = servers_get_names();
if (!array_key_exists($server_name, $servers)) {
$server_Name = 0; //Set the agent have not server.
}
$table->data[6][0] = __('Server');
$table->data[7][0] = __('Server');
if ($new_agent) {
//Set first server by default.
$servers_get_names = servers_get_names();
$array_keys_servers_get_names = array_keys($servers_get_names);
$server_name = reset($array_keys_servers_get_names);
}
$table->data[6][1] = html_print_select (servers_get_names (),
$table->data[7][1] = html_print_select (servers_get_names (),
'server_name', $server_name, '', __('None'), 0, true). ' ' . ui_print_help_icon ('agent_server', true);
// Description
$table->data[7][0] = __('Description');
$table->data[7][1] = html_print_input_text ('comentarios', $comentarios,
$table->data[8][0] = __('Description');
$table->data[8][1] = html_print_input_text ('comentarios', $comentarios,
'', 45, 200, true);
html_print_table ($table);
@ -531,5 +543,7 @@ ui_require_jquery_file('bgiframe');
echo ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agente);
?>",
"#qr_code_agent_view", 128, 128);
$("#text-agente").prop('disabled', true);
});
</script>

View File

@ -73,6 +73,7 @@ $campo_3 = "";
$maximo = 0;
$minimo = 0;
$nombre_agente = "";
$alias = "";
$direccion_agente = get_parameter('direccion', '');
$direccion_agente = trim(io_safe_output($direccion_agente));
$direccion_agente = io_safe_input($direccion_agente);
@ -146,7 +147,8 @@ $module_macros = array ();
// Create agent
if ($create_agent) {
$nombre_agente = (string) get_parameter_post("agente",'');
$nombre_agente = md5($alias . $direccion_agente);
$alias = (string) get_parameter_post("alias",'');
$direccion_agente = (string) get_parameter_post("direccion",'');
$direccion_agente = trim(io_safe_output($direccion_agente));
$direccion_agente = io_safe_input($direccion_agente);
@ -177,18 +179,19 @@ if ($create_agent) {
}
// Check if agent exists (BUG WC-50518-2)
if ($nombre_agente == "") {
$agent_creation_error = __('No agent name specified');
if ($alias == "") {
$agent_creation_error = __('No agent alias specified');
$agent_created_ok = 0;
}
elseif (agents_get_agent_id ($nombre_agente)) {
/*elseif (agents_get_agent_id ($nombre_agente)) {
$agent_creation_error =
__('There is already an agent in the database with this name');
$agent_created_ok = 0;
}
}*/
else {
$id_agente = db_process_sql_insert ('tagente',
array ('nombre' => $nombre_agente,
'alias' => $alias,
'direccion' => $direccion_agente,
'id_grupo' => $grupo,
'intervalo' => $intervalo,
@ -237,7 +240,7 @@ if ($create_agent) {
' Quiet: ' . (int)$quiet;
db_pandora_audit("Agent management",
"Created agent $nombre_agente", false, true, $info);
"Created agent $alias", false, true, $info);
}
else {
$id_agente = 0;
@ -550,10 +553,9 @@ if ($id_agente) {
default:
break;
}
ui_print_page_header (
agents_get_name ($id_agente) . ' ' . $tab_description,
"images/setup.png", false, $help_header , true, $onheader);
$agent = db_get_row ('tagente', 'id_agente', $id_agente);
ui_print_page_header ($agent["nombre"],
"images/setup.png", false, $help_header , true, $onheader,$agent["alias"] . ' ' . $tab_description);
}
else {
// Create agent
@ -637,6 +639,7 @@ $update_agent = (bool) get_parameter ('update_agent');
if ($update_agent) { // if modified some agent paramenter
$id_agente = (int) get_parameter_post ("id_agente");
$nombre_agente = str_replace('`','&lsquo;',(string) get_parameter_post ("agente", ""));
$alias = str_replace('`','&lsquo;',(string) get_parameter_post ("alias", ""));
$direccion_agente = (string) get_parameter_post ("direccion", '');
$direccion_agente = trim(io_safe_output($direccion_agente));
$direccion_agente = io_safe_input($direccion_agente);
@ -700,14 +703,14 @@ if ($update_agent) { // if modified some agent paramenter
}
//Verify if there is another agent with the same name but different ID
if ($nombre_agente == "") {
ui_print_error_message(__('No agent name specified'));
if ($alias == "") {
ui_print_error_message(__('No agent alias specified'));
//If there is an agent with the same name, but a different ID
}
elseif (agents_get_agent_id ($nombre_agente) > 0 &&
/*elseif (agents_get_agent_id ($nombre_agente) > 0 &&
agents_get_agent_id ($nombre_agente) != $id_agente) {
ui_print_error_message(__('There is already an agent in the database with this name'));
}
}*/
else {
//If different IP is specified than previous, add the IP
if ($direccion_agente != '' &&
@ -727,7 +730,7 @@ if ($update_agent) { // if modified some agent paramenter
'id_parent' => $id_parent,
'id_os' => $id_os,
'modo' => $modo,
'nombre' => $nombre_agente,
'alias' => $alias,
'direccion' => $direccion_agente,
'id_grupo' => $grupo,
'intervalo' => $intervalo,
@ -771,8 +774,8 @@ if ($update_agent) { // if modified some agent paramenter
enterprise_hook ('update_agent', array ($id_agente));
ui_print_success_message (__('Successfully updated'));
db_pandora_audit("Agent management",
"Updated agent $nombre_agente", false, false, $info);
"Updated agent $alias", false, false, $info);
}
}
}
@ -797,6 +800,10 @@ if ($id_agente) {
$intervalo = $agent["intervalo"]; // Define interval in seconds
$nombre_agente = $agent["nombre"];
$alias = $agent["alias"];
if(empty ($alias)){
$alias = $nombre_agente;
}
$direccion_agente = $agent["direccion"];
$grupo = $agent["id_grupo"];
$ultima_act = $agent["ultimo_contacto"];

View File

@ -276,6 +276,7 @@ if ($search != "") {
$search_sql .= ")";
}else{
$search_sql = " AND ( nombre " . $order_collation . "
LIKE '%$search%' OR alias " . $order_collation . "
LIKE '%$search%') ";
}
}
@ -369,7 +370,7 @@ else {
FROM tagente
WHERE 1=1
%s
ORDER BY %s %s %s LIMIT %d OFFSET %d', $search_sql, $order['field'], $order['field2'],
ORDER BY %s %s, %s %s LIMIT %d OFFSET %d', $search_sql, $order['field'],$order['order'], $order['field2'],
$order['order'], $config["block_size"], $offset);
break;
case "oracle":
@ -380,7 +381,7 @@ else {
FROM tagente
WHERE 1=1
%s
ORDER BY %s %s %s', $search_sql, $order['field'], $order['field2'], $order['order']);
ORDER BY %s %s, %s %s', $search_sql, $order['field'],$order['order'], $order['field2'], $order['order']);
$sql = oracle_recode_query ($sql, $set);
break;
}
@ -515,11 +516,14 @@ if ($agents !== false) {
else {
$main_tab = 'module';
}
echo "<a href='index.php?sec=gagente&
if($agent["alias"] == ''){
$agent["alias"] = $agent["nombre"];
}
echo "<a alt =".$agent["nombre"]." href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&tab=$main_tab&
id_agente=" . $agent["id_agente"] . "'>" .
ui_print_truncate_text($agent["nombre"], 'agent_medium', true, true, true, '[&hellip;]', 'font-size: 7pt') .
'<span style="font-size: 7pt" title="' . $agent["nombre"] . '">'.$agent["alias"].'</span>' .
"</a>";
echo "</strong>";
if ($agent["disabled"]) {

View File

@ -113,11 +113,12 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
$filter_agents[] = '(UPPER(nombre) LIKE UPPER(\'%'.$string.'%\'))';
break;
}
$agents = agents_get_agents($filter_agents, array ('id_agente', 'nombre', 'direccion'));
$agents = agents_get_agents($filter_agents, array ('id_agente', 'nombre', 'direccion','alias'));
if ($agents !== false) {
foreach ($agents as $agent) {
$data[] = array('id' => $agent['id_agente'],
'name' => io_safe_output($agent['nombre']),
'alias' => io_safe_output($agent['alias']),
'ip' => io_safe_output($agent['direccion']),
'filter' => 'agent');
}
@ -136,11 +137,12 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
$filter_address[] = '(UPPER(nombre) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(direccion) LIKE UPPER(\'%'.$string.'%\'))';
break;
}
$agents = agents_get_agents($filter_address, array ('id_agente', 'nombre', 'direccion'));
$agents = agents_get_agents($filter_address, array ('id_agente', 'nombre', 'direccion', 'alias'));
if ($agents !== false) {
foreach ($agents as $agent) {
$data[] = array('id' => $agent['id_agente'],
'name' => io_safe_output($agent['nombre']),
'alias' => io_safe_output($agent['alias']),
'ip' => io_safe_output($agent['direccion']),
'filter' => 'address');
}
@ -159,16 +161,40 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
$filter_description[] = '(UPPER(nombre) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(direccion) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(comentarios) LIKE UPPER(\'%'.$string.'%\'))';
break;
}
$agents = agents_get_agents($filter_description, array ('id_agente', 'nombre', 'direccion'));
$agents = agents_get_agents($filter_description, array ('id_agente', 'nombre', 'direccion', 'alias'));
if ($agents !== false) {
foreach ($agents as $agent) {
$data[] = array('id' => $agent['id_agente'],
'name' => io_safe_output($agent['nombre']),
'alias' => io_safe_output($agent['alias']),
'ip' => io_safe_output($agent['direccion']),
'filter' => 'description');
}
}
//Get agents for only the alias
$filter_description = $filter;
switch ($config['dbtype']) {
case "mysql":
$filter_description[] = '(nombre COLLATE utf8_general_ci NOT LIKE "%'.$string.'%" AND direccion NOT LIKE "%'.$string.'%" AND comentarios NOT LIKE "%'.$string.'%" AND alias LIKE "%'.$string.'%")';
break;
case "postgresql":
$filter_description[] = '(nombre NOT LIKE \'%'.$string.'%\' AND direccion NOT LIKE \'%'.$string.'%\' AND comentarios NOT LIKE \'%'.$string.'%\' AND alias LIKE \'%'.$string.'%\')';
break;
case "oracle":
$filter_description[] = '(UPPER(nombre) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(direccion) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(comentarios) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(alias) LIKE UPPER(\'%'.$string.'%\'))';
break;
}
$agents = agents_get_agents($filter_description, array ('id_agente', 'nombre', 'direccion', 'alias'));
if ($agents !== false) {
foreach ($agents as $agent) {
$data[] = array('id' => $agent['id_agente'],
'name' => io_safe_output($agent['nombre']),
'alias' => io_safe_output($agent['alias']),
'ip' => io_safe_output($agent['direccion']),
'filter' => 'alias');
}
}
echo json_encode($data);
return;
}

View File

@ -2383,7 +2383,7 @@ function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = fal
* @return string Header HTML
*/
function ui_print_page_header ($title, $icon = "", $return = false, $help = "", $godmode = false, $options = "",$modal = false, $message = "") {
function ui_print_page_header ($title, $icon = "", $return = false, $help = "", $godmode = false, $options = "", $alias = "") {
$title = io_safe_input_html($title);
if (($icon == "") && ($godmode == true)) {
$icon = "images/gm_setup.png";
@ -2409,8 +2409,13 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "",
$buffer .= '<ul class="mn"><li class="' . $type . '">&nbsp;' . '&nbsp; ';
$buffer .= '<span style="">' .
ui_print_truncate_text($title, 46);
if(empty($alias)){
$buffer .= '<span style="">' .
ui_print_truncate_text($title, 38);
}else{
$buffer .= '<span style="">' .
'<span title='.$title.'>'.$alias.'</span>';
}
if ($modal){
$buffer .= "
<div id='publienterprise' class='".$message."' title='Community version' style='float: right;margin-top: -2px !important; margin-left: 2px !important;'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>
@ -3257,10 +3262,10 @@ function ui_print_agent_autocomplete_input($parameters) {
})
.data("ui-autocomplete")._renderItem = function( ul, item ) {
if (item.ip == "") {
text = "<a>" + item.name + "</a>";
text = "<a>" + item.alias+ "</a>";
}
else {
text = "<a>" + item.name
text = "<a>" + item.alias
+ "<br><span style=\"font-size: 70%; font-style: italic;\">IP:" + item.ip + "</span></a>";
}
@ -3284,6 +3289,12 @@ function ui_print_agent_autocomplete_input($parameters) {
.append(text)
.appendTo(ul);
break;
case \'alias\':
return $("<li style=\'background: #a8e7eb;\'></li>")
.data("item.autocomplete", item)
.append(text)
.appendTo(ul);
break;
}

View File

@ -362,7 +362,7 @@ if ($search != "") {
$search_sql .= ")";
}else{
$search_sql = " AND ( nombre " . $order_collation . "
LIKE '%$search%') ";
LIKE '%$search%' OR alias ".$order_collation." LIKE '%$search%') ";
}
}
@ -436,6 +436,8 @@ else {
array ('id_agente',
'id_grupo',
'nombre',
'alias',
'id_os',
'ultimo_contacto',
'intervalo',
@ -546,7 +548,7 @@ foreach ($agents as $agent) {
if ($agent['quiet']) {
$data[0] .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . "&nbsp;";
}
$data[0] .= ui_print_agent_name($agent["id_agente"], true, 60, 'font-size:6.5pt !important;', true);
$data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'"> <span style="font-size: 7pt;font-weight:bold" title ="' . $agent["nombre"]. '">'.$agent["alias"].'</span></a>';
$data[0] .= '</span>';
$data[0] .= '<div class="agentleft_' . $agent["id_agente"] . '" style="visibility: hidden; clear: left;">';
$data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'">'.__('View').'</a>';

View File

@ -73,8 +73,12 @@ $table_agent->styleTable = 'padding:0px;';
$table_agent->data = array();
$data = array();
$agent_name = ui_print_agent_name ($agent["id_agente"], true, 500,
"font-size: medium;", true);
/*$agent_name = ui_print_agent_name ($agent["id_agente"], true, 500,
"font-size: medium;", true);*/
$agent_name = "<a alt =".$agent["nombre"]." href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=" . $agent["id_agente"] . "'>" .
'<span style="font-size: medium;font-weight:bold" title="' . $agent["nombre"] . '">'.$agent["alias"].'</span>' .
"</a>";
if ($agent['disabled']) {
$agent_name = "<em>" . $agent_name . "</em>" . ui_print_help_tip(__('Disabled'), true);

View File

@ -1094,8 +1094,7 @@ switch($tab) {
break;
}
ui_print_page_header(agents_get_name($id_agente) .
$header_description, $icon, false, "", false, $onheader);
ui_print_page_header($agent["nombre"] , $icon, false, "", false, $onheader, $agent["alias"] . $header_description);
switch ($tab) {

View File

@ -138,7 +138,8 @@ if ($searchAgents) {
}else{
$search_sql = " t1.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
t1.direccion COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%'";
t1.direccion COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
t1.alias COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%'";
}
$sql = "
FROM tagente t1
@ -190,7 +191,8 @@ if ($searchAgents) {
}else{
$search_sql = " lower(t1.nombre) LIKE '%%" . strtolower($stringSearchSQL) . "%%' OR
lower(t2.nombre) LIKE '%%" . strtolower($stringSearchSQL) . "%%' OR
lower(t1.direccion) LIKE '%%" . strtolower($stringSearchSQL) . "%%'";
lower(t1.direccion) LIKE '%%" . strtolower($stringSearchSQL) . "%%' OR
lower(t1.alias) LIKE '%%" . strtolower($stringSearchSQL) . "%%'";
}
$sql = "
FROM tagente t1
@ -220,8 +222,8 @@ if ($searchAgents) {
";
break;
}
$select = "SELECT t1.id_agente, t1.ultimo_contacto, t1.nombre, t1.id_os, t1.intervalo, t1.id_grupo, t1.disabled";
$select = "SELECT t1.id_agente, t1.ultimo_contacto, t1.nombre, t1.id_os, t1.intervalo, t1.id_grupo, t1.disabled, t1.alias";
if ($only_count) {
$limit = " ORDER BY " . $order['field'] . " " . $order['order'] .
" LIMIT " . $config["block_size"] . " OFFSET 0";

View File

@ -87,10 +87,12 @@ else {
$modulesCell = reporting_tiny_stats($agent_info, true);
if ($agent['disabled']) {
$cellName = "<em>" . ui_print_agent_name ($agent["id_agente"], true, "text-transform: uppercase;") . ui_print_help_tip(__('Disabled'), true) . "</em>";
$cellName = "<em>" . '<a style href=index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].' title='.$agent["nombre"].'><b>'.
'<span style>'.$agent["alias"].'</span></b></a>'. ui_print_help_tip(__('Disabled'), true) . "</em>";
}
else {
$cellName = ui_print_agent_name ($agent["id_agente"], true, "text-transform: uppercase;");
$cellName = '<a style href=index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].' title='.$agent["nombre"].'><b>'.
'<span style>'.$agent["alias"].'</span></b></a>';
}
$last_time = strtotime ($agent["ultimo_contacto"]);

View File

@ -88,8 +88,9 @@ else {
$utimestamp_sql = $utimestamp_sql[0];
$agentCell = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $module['id_agente'] . '">' .
$module['agent_name'] . '</a>';
$agent = db_get_row ('tagente', 'id_agente', $module['id_agente']);
$agentCell = '<a title='.$module['agent_name'].' href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $module['id_agente'] . '">' .
$agent['alias'] . '</a>';
$typeCell = ui_print_moduletype_icon($module["id_tipo_modulo"], true);

View File

@ -80,6 +80,7 @@ CREATE TABLE IF NOT EXISTS `tagente` (
`fired_count` bigint(20) NOT NULL default '0',
`update_module_count` tinyint(1) NOT NULL default '0',
`update_alert_count` tinyint(1) NOT NULL default '0',
`alias` varchar(600) NOT NULL default '',
PRIMARY KEY (`id_agente`),
KEY `nombre` (`nombre`(255)),
KEY `direccion` (`direccion`),