2010-03-01 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_gis.php: now function "getAgentMap" return true or false
	if there is default map or not.

	* operation/agentes/gis_view.php, godmode/agentes/agent_conf_gis.php: show
	message of error when there isn't a default map



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2436 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2010-03-01 11:17:27 +00:00
parent e2d9a80a8a
commit f1b67fc083
4 changed files with 22 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2010-03-01 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_gis.php: now function "getAgentMap" return true or false
if there is default map or not.
* operation/agentes/gis_view.php, godmode/agentes/agent_conf_gis.php: show
message of error when there isn't a default map
2010-03-01 Miguel de Dios <miguel.dedios@artica.es>
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: update with the new data in

View File

@ -31,7 +31,10 @@ $agent_name = get_agent_name($id_agente);
/* Map with the current position */
echo "<div id=\"" . $agent_name . "_agent_map\" style=\"border:1px solid black; width:98%; height: 30em;\"></div>";
echo getAgentMap($id_agente, "500px", "98%", false);
if (!getAgentMap($id_agente, "500px", "98%", false)) {
echo "<br /><div class='nf'>" . __("There is no default map.") . "</div>";
}

View File

@ -775,7 +775,7 @@ function updateMap($idMap, $map_name, $map_initial_longitude, $map_initial_latit
* @param $centerInAgent boolean Default is true, set the map center in the icon agent.
* @param $history_time: Number of seconds in the past to show from where to start the history path.
*
* @return A div tag with the map and the agent and the history path if asked.
* @return boolean True ok and false fail.
*/
function getAgentMap($agent_id, $heigth, $width, $show_history = false, $centerInAgent = true, $history_time = 86400) {
$defaultMap = get_db_all_rows_sql("
@ -786,6 +786,10 @@ function getAgentMap($agent_id, $heigth, $width, $show_history = false, $centerI
WHERE t1.default_map = 1 AND t2.tgis_map_id_tgis_map = t1.id_tgis_map
AND t2.default_map_connection = 1
AND t3.id_tmap_connection = t2.tgis_map_connection_id_tmap_connection");
if ($defaultMap === false)
return false;
$defaultMap = $defaultMap[0];
$agent_position = getDataLastPositionAgent($agent_id);
@ -837,6 +841,8 @@ function getAgentMap($agent_id, $heigth, $width, $show_history = false, $centerI
</script>
<?php
}
return true;
}
/**

View File

@ -40,7 +40,9 @@ echo "<h3>" . __("Map with the last position/s") . " " . human_time_description
/* Map with the current position */
echo "<div id=\"".$agent_name."_agent_map\" style=\"border:1px solid black; width:98%; height: 30em;\"></div>";
echo getAgentMap($agentId, "500px", "98%", true, true, $period);
if (!getAgentMap($agentId, "500px", "98%", true, true, $period)) {
echo "<br /><div class='nf'>" . __("There is no default map.") . "</div>";
}
$timestampLastOperation = get_db_value_sql("SELECT UNIX_TIMESTAMP()");