2014-03-28 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_gis.php, operation/agentes/gis_view.php: fixed
	the GIS view for agents.
	
	Incident: 
	
	BACKPORTED FROM THE BRANCH PANDORA_5




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9664 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-03-28 13:52:32 +00:00
parent 9a5c1d3a2b
commit 6c964f06ea
3 changed files with 31 additions and 8 deletions
pandora_console

View File

@ -1,3 +1,12 @@
2014-03-28 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_gis.php, operation/agentes/gis_view.php: fixed
the GIS view for agents.
Incident: #611
BACKPORTED FROM THE BRANCH PANDORA_5
2014-03-27 Miguel de Dios <miguel.dedios@artica.es>
* include/gettext.php: fixed the PHP warnings.

View File

@ -360,8 +360,10 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
'point_agent_info', status,
agentDataGIS['id_parent']);
//TODO: Optimize, search a new position to call for all agent in the layer and or optimice code into function.
js_refreshParentLines();
if (!agentView) {
//TODO: Optimize, search a new position to call for all agent in the layer and or optimice code into function.
js_refreshParentLines();
}
}
}
}
@ -947,8 +949,11 @@ function gis_get_agent_map($agent_id, $heigth, $width, $show_history = false, $c
AND t2.default_map_connection = 1
AND t3.id_tmap_connection = t2.tgis_map_connection_id_tmap_connection");
if ($defaultMap === false)
if ($defaultMap === false) {
return false;
}
$defaultMap = $defaultMap[0];
@ -1016,7 +1021,7 @@ function gis_get_agent_map($agent_id, $heigth, $width, $show_history = false, $c
gis_print_map($agent_name . "_agent_map", $defaultMap['zoom_level'],
$defaultMap['initial_latitude'],
$defaultMap['initial_longitude'], $baselayers, $controls);
gis_make_layer("layer_for_agent_" . $agent_name);
$agent_icon = gis_get_agent_icon_map($agent_id, true);

View File

@ -33,7 +33,7 @@ ui_require_javascript_file('openlayers.pandora');
/* Get the parameters */
$period = get_parameter ("period", 86400);
$agentId = get_parameter('id_agente');
$agent_name = agents_get_name($agentId);
$agent_name = agents_get_name($id_agente);
$agentData = gis_get_data_last_position_agent($id_agente);
//Avoid the agents with characters that fails the div.
@ -49,11 +49,20 @@ foreach ($_GET as $key => $value) {
echo "<div style='margin-bottom: 30px;'></div>";
/* Map with the current position */
echo "<div id=\"" . $agent_name . "_agent_map\" style=\"border:1px solid black; width:98%; height: 39em;\"></div>";
if (!gis_get_agent_map($agentId, "500px", "98%", true, true, $period)) {
echo "<br /><div class='nf'>" . __("There is no default map.") . "</div>";
echo "<div id=\"" . $agent_name . "_agent_map\" style=\"border:1px solid black; width:98%; height: 30em;\"></div>";
if (!gis_get_agent_map($id_agente, "500px", "98%", true, true, $period)) {
echo "<br /><div class='nf'>" . __("There is no default map. Please go to the setup for to set a default map.") . "</div>";
echo "<script type='text/javascript'>
$(document).ready(function() {
$('#" . $agent_name . "_agent_map').hide();
});
</script>";
}
switch ($config["dbtype"]) {
case "mysql":
$timestampLastOperation = db_get_value_sql(