From b1f963e9bb97ea92c261f8b71fd01cfb0e541a11 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 31 Mar 2014 10:25:59 +0000 Subject: [PATCH] 2014-03-31 Miguel de Dios * godmode/agentes/agent_conf_gis.php, operation/agentes/gis_view.php: changed the style to message of error to set the standar style of new Pandora. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9681 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++ .../godmode/agentes/agent_conf_gis.php | 72 ++++++++++--------- .../operation/agentes/gis_view.php | 2 +- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3452392d85..350b294711 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2014-03-31 Miguel de Dios + + * godmode/agentes/agent_conf_gis.php, + operation/agentes/gis_view.php: changed the style to message of + error to set the standar style of new Pandora. + 2014-03-30 Junichi Satoh * include/functions_config.php, include/auth/mysql.php, diff --git a/pandora_console/godmode/agentes/agent_conf_gis.php b/pandora_console/godmode/agentes/agent_conf_gis.php index 227a4ad9c9..f0d6dae40f 100644 --- a/pandora_console/godmode/agentes/agent_conf_gis.php +++ b/pandora_console/godmode/agentes/agent_conf_gis.php @@ -37,13 +37,19 @@ $agent_name = md5($agent_name); echo "
"; if (!gis_get_agent_map($id_agente, "500px", "98%", false)) { - echo "
" . __("There is no default map.") . "
"; + ui_print_error_message(__("There is no default map. Please go to the setup for to set a default map.")); + echo ""; } if ($agentData === false) { echo "

" . __("There is no GIS data for this agent, so it's positioned in default position of map.") . "

"; } -echo "
" .__("Warning: When you change the Agent position, the agent automatically activates the 'Ignore new GIS data' option") . "
"; +echo "
" . + __("Warning: When you change the Agent position, the agent automatically activates the 'Ignore new GIS data' option") . "
"; $table->width = '85%'; $table->data = array(); @@ -88,62 +94,62 @@ function validateFormFields() { latitude = $('input[name=latitude]').val(); altitude = $('input[name=altitude]').val(); valid = true; - + $('input[name=longitude]').css('background', '#ffffff'); $('input[name=latitude]').css('background', '#ffffff'); $('input[name=altitude]').css('background', '#ffffff'); - + //Validate longitude if ((jQuery.trim(longitude).length == 0) || isNaN(parseFloat(longitude))) { $('input[name=longitude]').css('background', '#cc0000'); - + valid = false; } - + //Validate latitude if ((jQuery.trim(latitude).length == 0) || isNaN(parseFloat(latitude))) { $('input[name=latitude]').css('background', '#cc0000'); - + valid = false; } - + //Validate altitude if ((jQuery.trim(altitude).length == 0) || isNaN(parseFloat(altitude))) { $('input[name=altitude]').css('background', '#cc0000'); - + valid = false; } - + if (valid) return true; else return false; } $(document).ready ( - function () { - function changePositionAgent(e) { - var lonlat = map.getLonLatFromViewPortPx(e.xy); - var layer = map.getLayersByName("layer_for_agent_"); - - layer = layer[0]; - feature = layer.features[0]; - - lonlat.transform(map.getProjectionObject(), map.displayProjection); //transform the lonlat in object proyection to "standar proyection" - - $('input[name=latitude]').val(lonlat.lat); - $('input[name=longitude]').val(lonlat.lon); - - if ($('input[name=altitude]').val().length == 0) - $('input[name=altitude]').val(0) - - setIgnoreGISDataEnabled(); - - //return to no-standar the proyection for to move - feature.move(lonlat.transform(map.displayProjection, map.getProjectionObject())); - } + function () { + function changePositionAgent(e) { + var lonlat = map.getLonLatFromViewPortPx(e.xy); + var layer = map.getLayersByName("layer_for_agent_"); - js_activateEvents(changePositionAgent); - }); + layer = layer[0]; + feature = layer.features[0]; + + lonlat.transform(map.getProjectionObject(), map.displayProjection); //transform the lonlat in object proyection to "standar proyection" + + $('input[name=latitude]').val(lonlat.lat); + $('input[name=longitude]').val(lonlat.lon); + + if ($('input[name=altitude]').val().length == 0) + $('input[name=altitude]').val(0) + + setIgnoreGISDataEnabled(); + + //return to no-standar the proyection for to move + feature.move(lonlat.transform(map.displayProjection, map.getProjectionObject())); + } + + js_activateEvents(changePositionAgent); + }); diff --git a/pandora_console/operation/agentes/gis_view.php b/pandora_console/operation/agentes/gis_view.php index b9295589af..2e94f81d1a 100644 --- a/pandora_console/operation/agentes/gis_view.php +++ b/pandora_console/operation/agentes/gis_view.php @@ -52,7 +52,7 @@ echo "
"; 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.") . "
"; + ui_print_error_message(__("There is no default map. Please go to the setup for to set a default map.")); echo "