diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 69faf61159..45794559d3 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ +2010-02-18 Miguel de Dios + + * include/functions_html.php: hightlight that the parameter $script in + function print_input_text_extended isn't in use. + + * include/functions_gis.php: create function "getDataLastPositionAgent" + that return row of position and other data for id agent. + + * godmode/agentes/agent_conf_gis.php: add the validate fields and adapt + to new tables. + + * godmode/agentes/configurar_agente.php: adapt to new tables. + 2010-02-17 Pablo de la ConcepciĆ³n * pandoradb.sql, extras/pandoradb_migrate_v3.0_to_v3.1.sql: Modified data diff --git a/pandora_console/godmode/agentes/agent_conf_gis.php b/pandora_console/godmode/agentes/agent_conf_gis.php index 085745d4d2..509af2026b 100644 --- a/pandora_console/godmode/agentes/agent_conf_gis.php +++ b/pandora_console/godmode/agentes/agent_conf_gis.php @@ -25,12 +25,22 @@ require_javascript_file('openlayers.pandora'); echo "

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

"; -$agentData = get_db_row_sql('SELECT * FROM tagente WHERE id_agente = 8'); +$agentData = getDataLastPositionAgent($id_agente); +$updateGisData = get_db_value('update_gis_data','tagente', 'id_agente', $id_agente); +$agent_name = get_agent_name($id_agente); /* Map with the current position */ -echo "
"; +echo "
"; echo getAgentMap($id_agente, "500px", "98%", false); + + +if ($agentData === false) { + echo "

" . __("There aren't any GIS data of agent, then it's positioned in default position of map.") . "

"; +} + +echo "

" . __("Warning: When you change the position the agent automatily enabled ignore GIS Data") . "

"; + $table->width = '60%'; $table->data = array(); @@ -39,20 +49,23 @@ $table->colspan[0][0] = 2; $table->data[0][0] = __('Agent coords:'); $table->data[1][0] = __('Longitude: '); -$table->data[1][1] = print_input_text ('longitude', $agentData['last_longitude'], '', 10, 10, true); +$table->data[1][1] = print_input_text_extended ('longitude', $agentData['stored_longitude'], 'text-longitude', '', 10, 10, false, '', + array('onchange' => "setIgnoreGISDataEnabled()", 'onkeyup' => "setIgnoreGISDataEnabled()"), true); $table->data[2][0] = __('Latitude: '); -$table->data[2][1] = print_input_text ('latitude', $agentData['last_latitude'], '', 10, 10, true); +$table->data[2][1] = print_input_text_extended ('latitude', $agentData['stored_latitude'], 'text-latitude', '', 10, 10, false, '', + array('onchange' => "setIgnoreGISDataEnabled()", 'onkeyup' => "setIgnoreGISDataEnabled()"), true); $table->data[3][0] = __('Altitude: '); -$table->data[3][1] = print_input_text ('altitude', $agentData['last_altitude'], '', 10, 10, true); +$table->data[3][1] = print_input_text_extended ('altitude', $agentData['stored_altitude'], 'text-altitude', '', 10, 10, false, '', + array('onchange' => "setIgnoreGISDataEnabled()", 'onkeyup' => "setIgnoreGISDataEnabled()"), true); $table->data[4][0] = __('Ignore new GIS data:'); -$table->data[4][1] = __('Disabled').' '.print_radio_button_extended ("update_gis_data", 0, '', $agentData['update_gis_data'], false, '', 'style="margin-right: 40px;"', true); -$table->data[4][1] .= __('Active').' '.print_radio_button_extended ("update_gis_data", 1, '', $agentData['update_gis_data'], false, '', 'style="margin-right: 40px;"', true); +$table->data[4][1] = __('Disabled').' '.print_radio_button_extended ("update_gis_data", 1, '', $updateGisData, false, '', 'style="margin-right: 40px;"', true); +$table->data[4][1] .= __('Active').' '.print_radio_button_extended ("update_gis_data", 0, '', $updateGisData, false, '', 'style="margin-right: 40px;"', true); $url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente; -echo "
"; +echo ""; print_input_hidden('update_gis', 1); print_table($table); @@ -62,11 +75,54 @@ echo ''; echo "
"; ?>