From 16b5a1277feb417346032d12a219eabd87bd8896 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 5 Mar 2010 11:16:20 +0000 Subject: [PATCH] 2010-03-05 Miguel de Dios * include/functions_gis.php: clean source code delete obsolete unused function "get_agent_last_coords". Fixed the function "get_agent_icon_map" now show default icon for agent without modules. * operation/gis_maps/ajax.php: improve the style of bubble info agent and fixed the position for agent without data GIS. * operation/agentes/gis_view.php: clean the style delete the header. Change the text of refresh button. Show the last coords for the agent. * images/gis_map/icons/cross.pink.png, images/gis_map/icons/circle.pink.png: add this image icons for to use in the preview map of config connection map. * godmode/agentes/agent_conf_gis.php: clean the style delete the header. * godmode/setup/gis_step_2.php: use the pink icons for the center and default position in the preview map. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2476 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 20 ++++++++++++++++ .../godmode/agentes/agent_conf_gis.php | 2 +- pandora_console/godmode/setup/gis_step_2.php | 4 ++-- .../images/gis_map/icons/circle.pink.png | Bin 0 -> 439 bytes .../images/gis_map/icons/cross.pink.png | Bin 0 -> 351 bytes pandora_console/include/functions_gis.php | 13 +++++------ .../operation/agentes/gis_view.php | 12 +++++++--- pandora_console/operation/gis_maps/ajax.php | 22 ++++++++++++------ 8 files changed, 53 insertions(+), 20 deletions(-) create mode 100755 pandora_console/images/gis_map/icons/circle.pink.png create mode 100755 pandora_console/images/gis_map/icons/cross.pink.png diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ca0d61f51d..92b30238ee 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,23 @@ +2010-03-05 Miguel de Dios + + * include/functions_gis.php: clean source code delete obsolete unused + function "get_agent_last_coords". Fixed the function "get_agent_icon_map" + now show default icon for agent without modules. + + * operation/gis_maps/ajax.php: improve the style of bubble info agent and + fixed the position for agent without data GIS. + + * operation/agentes/gis_view.php: clean the style delete the header. Change + the text of refresh button. Show the last coords for the agent. + + * images/gis_map/icons/cross.pink.png, images/gis_map/icons/circle.pink.png: + add this image icons for to use in the preview map of config connection map. + + * godmode/agentes/agent_conf_gis.php: clean the style delete the header. + + * godmode/setup/gis_step_2.php: use the pink icons for the center and + default position in the preview map. + 2010-03-04 Sancho Lerena * install.php: Fixed a bad render in IE. diff --git a/pandora_console/godmode/agentes/agent_conf_gis.php b/pandora_console/godmode/agentes/agent_conf_gis.php index 1ba56561cf..3d9982673e 100644 --- a/pandora_console/godmode/agentes/agent_conf_gis.php +++ b/pandora_console/godmode/agentes/agent_conf_gis.php @@ -23,7 +23,7 @@ require_once ('include/functions_html.php'); require_javascript_file('openlayers.pandora'); -echo "

" . __('Agent configuration') . " » " . __('Configure GIS data') . "

"; +echo "
"; $agentData = getDataLastPositionAgent($id_agente); $updateGisData = get_db_value('update_gis_data','tagente', 'id_agente', $id_agente); diff --git a/pandora_console/godmode/setup/gis_step_2.php b/pandora_console/godmode/setup/gis_step_2.php index 5c15b07463..56d3a0fdb6 100755 --- a/pandora_console/godmode/setup/gis_step_2.php +++ b/pandora_console/godmode/setup/gis_step_2.php @@ -438,8 +438,8 @@ function refreshMapViewSecondStep() { layer = js_makeLayer('temp_layer', true, null); - centerPoint = js_addPointExtent('temp_layer', '', $('input[name=center_longitude]').val(), $('input[name=center_latitude]').val(), 'images/dot_green.png', 11, 11, 'center', ''); - GISDefaultPositionPoint = js_addPointExtent('temp_layer', '', $('input[name=default_longitude]').val(), $('input[name=default_latitude]').val(), 'images/dot_red.png', 11, 11, 'default', ''); + centerPoint = js_addPointExtent('temp_layer', '', $('input[name=center_longitude]').val(), $('input[name=center_latitude]').val(), 'images/gis_map/icons/circle.pink.png', 11, 11, 'center', ''); + GISDefaultPositionPoint = js_addPointExtent('temp_layer', '', $('input[name=default_longitude]').val(), $('input[name=default_latitude]').val(), 'images/gis_map/icons/cross.pink.png', 11, 11, 'default', ''); js_activateEvents(changePoints); } diff --git a/pandora_console/images/gis_map/icons/circle.pink.png b/pandora_console/images/gis_map/icons/circle.pink.png new file mode 100755 index 0000000000000000000000000000000000000000..454b990532d68709270779523f8a95a34705d738 GIT binary patch literal 439 zcmV;o0Z9IdP)b%78FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H10W?WOK~y-6wbe~(!!Qtr;aAgug!jHf7g;$b;M|~#fVRDfPvjn< zH;AD)-K2}2!6$H{#?y^c5}W=cc0ZVv(1Q@8kx^CpF~-b*2Vm)NtCn^FAjr0%*#IxV zv#Nd!_Vz(z%-rFg6unPKjv1LvNdc&+C@J@^yxtkidqeZ6s&5y7s?wnXfhS zGOU_fJw6B$fE9An}^`}{RAF$u{LSc=1~GBSI!)+Hme4!4q) zc5&*nF-b{jX%{kD>O}2wsT+Ipr}r+v#{D{i$v?ev5>XHnL=6RP5UF^d~B%Vwsg zm%n(qzHvk4A10njKU@+%{7@CxHt(O8LXP%op_Nf@-W3=ZR0+?K$=i0rcH*m3s~m0s zRZLtp!6DG-%99|)tj}1Xh=!ESAM)VAnvQrw4?71 zG^ohr^&RgTe~DWM4fm`#iA literal 0 HcmV?d00001 diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index 26f7fd6b36..39c48208eb 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -656,12 +656,6 @@ function getLayers($idMap) { return $layers; } -function get_agent_last_coords($idAgent) { - $coords = get_db_row_sql("SELECT last_latitude, last_longitude, last_altitude, nombre FROM tagente WHERE id_agente = " . $idAgent); - - return $coords; -} - function get_agent_icon_map($idAgent, $state = false, $status = null) { $row = get_db_row_sql('SELECT id_grupo, icon_path FROM tagente WHERE id_agente = ' . $idAgent); @@ -678,6 +672,9 @@ function get_agent_icon_map($idAgent, $state = false, $status = null) { else { if ($status === null) { $status = get_agent_status($idAgent); + if ($status === null) { + $status = -1; + } } switch ($status) { case 1: @@ -698,7 +695,9 @@ function get_agent_icon_map($idAgent, $state = false, $status = null) { $state = '.default'; break; } - return $icon . $state . ".png"; + $returnIcon = $icon . $state . ".png"; + + return $returnIcon; } } diff --git a/pandora_console/operation/agentes/gis_view.php b/pandora_console/operation/agentes/gis_view.php index 36a458c3d5..751103dff7 100644 --- a/pandora_console/operation/agentes/gis_view.php +++ b/pandora_console/operation/agentes/gis_view.php @@ -35,7 +35,7 @@ $agentId = get_parameter('id_agente'); $agent_name = get_agent_name($agentId); $agentData = getDataLastPositionAgent($id_agente); -echo "

" . __("Map with the last position/s") . " " . human_time_description ($period) ."

"; +echo "
"; /* Map with the current position */ echo "
"; @@ -65,12 +65,18 @@ $intervals[86400] = human_time_description_raw (86400); $intervals[172800] = human_time_description_raw (172800); $intervals[604800] = human_time_description_raw (604800); +echo "
"; +$dataLastPosition = getDataLastPositionAgent($agentId); +if ($dataLastPosition !== false) { + echo "" . __("Last position in ") . $dataLastPosition['start_timestamp'] . ": " . + $dataLastPosition['stored_longitude'] . ", " . $dataLastPosition['stored_latitude'] . ", " . $dataLastPosition['stored_altitude']; +} echo "
"; echo "
"; echo __("Period to show data as path") . ": "; print_extended_select_for_time ($intervals, 'period', $period, '', '', '0', 10); -echo __(" seconds."); -print_submit_button(__('Refresh'), 'refresh', false, 'class = "sub upd"'); +echo __(" seconds.") . " "; +print_submit_button(__('Refresh path'), 'refresh', false, 'class = "sub upd"'); echo "
"; echo "

" . __("Positional data from the last") . " " . human_time_description ($period) ."

"; diff --git a/pandora_console/operation/gis_maps/ajax.php b/pandora_console/operation/gis_maps/ajax.php index 23b7349086..b9af37810e 100644 --- a/pandora_console/operation/gis_maps/ajax.php +++ b/pandora_console/operation/gis_maps/ajax.php @@ -124,7 +124,15 @@ switch ($opt) { $returnJSON = array(); $returnJSON['correct'] = 1; $returnJSON['content'] = __('Agent') . ': '.$row['nombre'].'
'; - $returnJSON['content'] .= __('Position (Long, Lat, Alt)') . ': (' . $agentDataGIS['stored_longitude'] . ', ' . $agentDataGIS['stored_latitude'] . ', ' . $agentDataGIS['stored_altitude'] . ')
'; + + //it's positioned in default position of map. + if ($agentDataGIS === false) { + $returnJSON['content'] .= __('Position (Long, Lat, Alt)') . ': ' . __("Default position of map.") . '
'; + } + else + { + $returnJSON['content'] .= __('Position (Long, Lat, Alt)') . ': (' . $agentDataGIS['stored_longitude'] . ', ' . $agentDataGIS['stored_latitude'] . ', ' . $agentDataGIS['stored_altitude'] . ')
'; + } $agent_ip_address = get_agent_address ($id_agente); if ($agent_ip_address || $agent_ip_address != '') { $returnJSON['content'] .= __('IP Address').': '.get_agent_address ($id_agente).'
'; @@ -145,14 +153,14 @@ switch ($opt) { } $returnJSON['content'] .= __('Group').': '.print_group_icon ($row["id_grupo"], true).' ('.get_group_name ($row["id_grupo"]).')
'; $returnJSON['content'] .= __('Agent Version').': '.$row["agent_version"].'
'; - $returnJSON['content'] .= __('Last contact')." / ".__('Remote').': '. $row["ultimo_contacto"]. " / "; + $returnJSON['content'] .= __('Last contact') . ": "; if ($row["ultimo_contacto_remoto"] == "0000-00-00 00:00:00") { - $returnJSON['content'] .=__('Never'); - } else { - $returnJSON['content'] .= $row["ultimo_contacto_remoto"]; + $returnJSON['content'] .=__('Never') ."
"; } - - + else { + $returnJSON['content'] .= $row["ultimo_contacto_remoto"] ."
"; + } + $returnJSON['content'] .= __('Remote').': '. $row["ultimo_contacto"]; echo json_encode($returnJSON);