From b906f0b9ae2a1c9bf32b5805a53f4d180a055d9e Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 20 May 2013 11:16:28 +0000 Subject: [PATCH] 2013-05-20 Miguel de Dios * include/functions_gis.php, operation/gis_maps/render_view.php, operation/agentes/gis_view.php: changed the code to set the agent icon with the original size. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8162 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++ pandora_console/include/functions_gis.php | 58 ++++++++++++------- .../operation/agentes/gis_view.php | 11 +++- .../operation/gis_maps/render_view.php | 16 +++-- 4 files changed, 62 insertions(+), 29 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8257de62ba..2453ff7aea 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2013-05-20 Miguel de Dios + + * include/functions_gis.php, operation/gis_maps/render_view.php, + operation/agentes/gis_view.php: changed the code to set the agent + icon with the original size. + 2013-05-20 Miguel de Dios * extensions/net_tools.php: added a entry to godmode for set the diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index f270a6493a..d2b60321ec 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -363,20 +363,20 @@ function gis_add_agent_point($layerName, $pointName, $lat, $lon, $icon = null, $ $pointName = ''; ?> - + $agentPositionLongitude, 'latitude' => $agentPositionLatitude); - gis_add_path("layer_for_agent_".$agent_name,$agent_id, $lastPosition, $history_time); + $lastPosition = array( + 'longitude' => $agentPositionLongitude, + 'latitude' => $agentPositionLatitude); + gis_add_path("layer_for_agent_" . $agent_name, + $agent_id, $lastPosition, $history_time); } - gis_add_agent_point("layer_for_agent_".$agent_name, $agent_name, $agentPositionLatitude, $agentPositionLongitude, $agent_icon, 20, 20, $agent_id, $status, 'point_agent_info'); + + gis_add_agent_point("layer_for_agent_" . $agent_name, + $agent_name, $agentPositionLatitude, $agentPositionLongitude, + $agent_icon, $agent_icon_width, $agent_icon_height, $agent_id, + $status, 'point_agent_info'); if ($centerInAgent) { ?> diff --git a/pandora_console/operation/agentes/gis_view.php b/pandora_console/operation/agentes/gis_view.php index 131f65e98b..c9c69fc091 100644 --- a/pandora_console/operation/agentes/gis_view.php +++ b/pandora_console/operation/agentes/gis_view.php @@ -72,7 +72,9 @@ gis_activate_ajax_refresh(null, $timestampLastOperation); gis_activate_select_control(); if ($agentData === false) { - echo "

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

"; + echo "

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

"; } echo "
"; @@ -98,7 +100,9 @@ $countData = db_get_value_sql($sqlCount); /* Get the elements to present in this page */ -$sql = sprintf ("SELECT longitude, latitude, altitude, start_timestamp, end_timestamp, description, number_of_packages, manual_placement +$sql = sprintf (" + SELECT longitude, latitude, altitude, start_timestamp, + end_timestamp, description, number_of_packages, manual_placement FROM tgis_data_history WHERE tagente_id_agente = %d AND end_timestamp > FROM_UNIXTIME(%d) ORDER BY end_timestamp DESC @@ -107,7 +111,8 @@ $result = db_get_all_rows_sql ($sql, true); if ($result === false) { - echo "
".__('This agent doesn\'t have any GIS data')."
"; + echo "
" . + __('This agent doesn\'t have any GIS data.') . "
"; } else { ui_pagination ($countData, false) ; diff --git a/pandora_console/operation/gis_maps/render_view.php b/pandora_console/operation/gis_maps/render_view.php index 50f9c15826..48da1d2529 100644 --- a/pandora_console/operation/gis_maps/render_view.php +++ b/pandora_console/operation/gis_maps/render_view.php @@ -123,9 +123,11 @@ $status = array( 'ok' => __('Ok'), 'default' => __('Other')); -$buttons[]['text'] = ' ' . __('Show agents by state: ') . html_print_select($status, 'show_status', 'all', 'changeShowStatus(this.value);', '', 0, true, false, false) . " "; +$buttons[]['text'] = ' ' . __('Show agents by state: ') . + html_print_select($status, 'show_status', 'all', 'changeShowStatus(this.value);', '', 0, true, false, false) . " "; -ui_print_page_header(__('Map') . " » " . __('Map') . " " . $map['map_name'], "images/op_gis.png", false, "", false, $buttons); +ui_print_page_header(__('Map') . " » " . __('Map') . " " . $map['map_name'], + "images/op_gis.png", false, "", false, $buttons); if ($config["pure"] == 0) { echo "
"; @@ -172,11 +174,17 @@ if ($layers != false) { $icon = gis_get_agent_icon_map($idAgent, true); + $icon_size = getimagesize($icon); + $icon_width = $icon_size[0]; + $icon_height = $icon_size[1]; $status = agents_get_status($idAgent); $parent = db_get_value('id_parent', 'tagente', 'id_agente', $idAgent); - gis_add_agent_point($layer['layer_name'], io_safe_output($agentName), $coords['stored_latitude'], - $coords['stored_longitude'], $icon, 20, 20, $idAgent, $status, 'point_agent_info', $parent); + gis_add_agent_point($layer['layer_name'], + io_safe_output($agentName), $coords['stored_latitude'], + $coords['stored_longitude'], $icon, $icon_width, + $icon_height, $idAgent, $status, 'point_agent_info', + $parent); } } gis_add_parent_lines();