Show agent alias in gis maps with entities - #98

This commit is contained in:
enriquecd 2017-03-17 11:55:34 +01:00
parent 8d4b730b6c
commit 27d4a6c316
2 changed files with 15 additions and 1 deletions

View File

@ -1347,6 +1347,20 @@ function agents_get_alias ($id_agent, $case = 'none') {
}
}
function agents_get_alias_by_name ($name, $case = 'none') {
$alias = (string) db_get_value ('alias', 'tagente', 'nombre', $name);
switch ($case) {
case 'upper':
return mb_strtoupper($alias, 'UTF-8');
case 'lower':
return mb_strtolower($alias, 'UTF-8');
case 'none':
default:
return ($alias);
}
}
/**
* Get the number of pandora data packets in the database.
*

View File

@ -1074,7 +1074,7 @@ function gis_get_agent_map($agent_id, $heigth, $width, $show_history = false, $c
gis_add_agent_point("layer_for_agent_" . $agent_name,
$clean_agent_name, $agentPositionLatitude, $agentPositionLongitude,
io_safe_output(agents_get_alias_by_name($clean_agent_name)), $agentPositionLatitude, $agentPositionLongitude,
$agent_icon, $agent_icon_width, $agent_icon_height, $agent_id,
$status, 'point_agent_info');