2013-03-01 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_gis.php: fixed the delete layers. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7764 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
85e11a4e99
commit
d533a1076f
|
@ -1,3 +1,7 @@
|
|||
2013-03-01 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_gis.php: fixed the delete layers.
|
||||
|
||||
2013-03-01 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/javascript/jquery.pandora.js
|
||||
|
|
|
@ -780,19 +780,25 @@ function gis_update_map($idMap, $map_name, $map_initial_longitude, $map_initial_
|
|||
);
|
||||
}
|
||||
|
||||
$listOldIdLayers = db_get_all_rows_sql('SELECT id_tmap_layer FROM tgis_map_layer WHERE tgis_map_id_tgis_map = ' . $idMap);
|
||||
$listOldIdLayers = db_get_all_rows_sql('SELECT id_tmap_layer
|
||||
FROM tgis_map_layer WHERE tgis_map_id_tgis_map = ' . $idMap);
|
||||
if ($listOldIdLayers == false)
|
||||
$listOldIdLayers = array();
|
||||
foreach($listOldIdLayers as $idLayer) {
|
||||
db_process_sql_delete('tgis_map_layer_has_tagente', array('tgis_map_layer_id_tmap_layer' => $idLayer['id_tmap_layer']));
|
||||
|
||||
$list_onlyIDsLayers = array();
|
||||
foreach ($listOldIdLayers as $idLayer) {
|
||||
db_process_sql_delete('tgis_map_layer_has_tagente',
|
||||
array('tgis_map_layer_id_tmap_layer' => $idLayer['id_tmap_layer']));
|
||||
|
||||
$list_onlyIDsLayers[$idLayer['id_tmap_layer']] = 0;
|
||||
}
|
||||
|
||||
|
||||
foreach ($arrayLayers as $index => $layer) {
|
||||
|
||||
|
||||
if ($layer['id'] != 0) {
|
||||
$idLayer = $layer['id'];
|
||||
unset($list_onlyIDsLayers[$idLayer]);
|
||||
|
||||
db_process_sql_update('tgis_map_layer',
|
||||
array(
|
||||
|
@ -832,6 +838,12 @@ function gis_update_map($idMap, $map_name, $map_initial_longitude, $map_initial_
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
//Delete layers that not carry the $arrayLayers
|
||||
foreach ($list_onlyIDsLayers as $idLayer => $trash) {
|
||||
db_process_sql_delete('tgis_map_layer',
|
||||
array('id_tmap_layer' => $idLayer));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue