diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ad3c6192a7..d4ddf44f0a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2014-03-28 Miguel de Dios + + * 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 * include/gettext.php: fixed the PHP warnings. diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index 8b844dc5cf..b826c993a8 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -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); diff --git a/pandora_console/operation/agentes/gis_view.php b/pandora_console/operation/agentes/gis_view.php index f0fc357bd6..b9295589af 100644 --- a/pandora_console/operation/agentes/gis_view.php +++ b/pandora_console/operation/agentes/gis_view.php @@ -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 "
"; /* Map with the current position */ -echo "
"; -if (!gis_get_agent_map($agentId, "500px", "98%", true, true, $period)) { - echo "
" . __("There is no default map.") . "
"; +echo "
"; + +if (!gis_get_agent_map($id_agente, "500px", "98%", true, true, $period)) { + echo "
" . __("There is no default map. Please go to the setup for to set a default map.") . "
"; + echo ""; } + + + switch ($config["dbtype"]) { case "mysql": $timestampLastOperation = db_get_value_sql(