Commit eae7c3555ab2a5ee2f4ae6b36d5ff15dafcc07fb
1 parent
f75c05e6
Exists in
master
and in
7 other branches
Correção na carga da lista de sistemas adicionais na ferramenta de identificação
Showing
6 changed files
with
68 additions
and
19 deletions
Show diff stats
aplicmap/geral1.map
aplicmap/geral1windows.map
classesjs/classe_interface.js
| ... | ... | @@ -973,8 +973,8 @@ i3GEO.Interface = { |
| 973 | 973 | nlayers = layers.length, |
| 974 | 974 | i; |
| 975 | 975 | for(i=0;i<nlayers;i++){ |
| 976 | - if(layers[i].visibility === true){ | |
| 977 | - layers[i].mergeNewParams({r:Math.random()}); | |
| 976 | + layers[i].mergeNewParams({r:Math.random()}); | |
| 977 | + if(layers[i].visibility === true){ | |
| 978 | 978 | layers[i].redraw(); |
| 979 | 979 | } |
| 980 | 980 | } | ... | ... |
classesphp/classe_menutemas.php
| ... | ... | @@ -314,6 +314,40 @@ Array |
| 314 | 314 | return $sistemas; |
| 315 | 315 | } |
| 316 | 316 | /* |
| 317 | +function: pegaSistemasI | |
| 318 | + | |
| 319 | +Retorna a lista de sistemas especiais de identificação de temas. | |
| 320 | + | |
| 321 | +parameters: | |
| 322 | + | |
| 323 | +Return: | |
| 324 | + | |
| 325 | +Array | |
| 326 | +*/ | |
| 327 | + function pegaSistemasI() | |
| 328 | + { | |
| 329 | + error_reporting(0); | |
| 330 | + include_once($this->locaplic."/admin/php/xml.php"); | |
| 331 | + $xmlsistemas = simplexml_load_string(geraXmlIdentifica(implode(" ",$this->perfil),$this->locaplic,$this->editores)); | |
| 332 | + $sistemas = array(); | |
| 333 | + foreach($xmlsistemas->FUNCAO as $s) | |
| 334 | + { | |
| 335 | + $publicado = $this->ixml($s,"PUBLICADO"); | |
| 336 | + if(strtolower($publicado) != "nao" || $this->editor) | |
| 337 | + { | |
| 338 | + $nomesis = $this->ixml($s,"NOMESIS"); | |
| 339 | + $ps = $this->ixml($s,"PERFIL"); | |
| 340 | + $perfis = str_replace(","," ",$ps); | |
| 341 | + $perfis = explode(" ",$perfis); | |
| 342 | + if (($this->array_in_array($this->perfil,$perfis)) || ($ps == "")) | |
| 343 | + { | |
| 344 | + $sistemas[] = array("PUBLICADO"=>$publicado,"NOME"=>$nomesis,"TARGET"=>($this->ixml($s,"TARGET")),"ABRIR"=>($this->ixml($s,"ABRIR"))); | |
| 345 | + } | |
| 346 | + } | |
| 347 | + } | |
| 348 | + return $sistemas; | |
| 349 | + } | |
| 350 | +/* | |
| 317 | 351 | function: procurartemas |
| 318 | 352 | |
| 319 | 353 | Procura um tema no menu de temas considerando apenas os subgrupos. | ... | ... |
classesphp/mapa_controle.php
| ... | ... | @@ -1809,6 +1809,18 @@ Pega a lista de grupos do menu. |
| 1809 | 1809 | $retorno = array("idmenu"=>$idmenu,"grupos"=>$m->pegaListaDeGrupos($idmenu,$listasistemas,$listasgrupos)); |
| 1810 | 1810 | break; |
| 1811 | 1811 | /* |
| 1812 | +Valor: PEGASISTEMASIDENTIFICACAO | |
| 1813 | + | |
| 1814 | +Pega a lista de sistemas especiais de identificação de elementos no mapa | |
| 1815 | + | |
| 1816 | +<Menutemas->pegaSistemasI> | |
| 1817 | +*/ | |
| 1818 | + case "PEGASISTEMASIDENTIFICACAO": | |
| 1819 | + include_once("classe_menutemas.php"); | |
| 1820 | + $m = new Menutemas($map_file,$perfil,$locaplic,"",$editores,$idioma); | |
| 1821 | + $retorno = $m->pegaSistemasI(); | |
| 1822 | + break; | |
| 1823 | +/* | |
| 1812 | 1824 | Valor: PEGASISTEMAS |
| 1813 | 1825 | |
| 1814 | 1826 | Pega a lista de sistemas. |
| ... | ... | @@ -1820,7 +1832,6 @@ Pega a lista de sistemas. |
| 1820 | 1832 | $m = new Menutemas($map_file,$perfil,$locaplic,"",$editores,$idioma); |
| 1821 | 1833 | $retorno = $m->pegaSistemas(); |
| 1822 | 1834 | break; |
| 1823 | - | |
| 1824 | 1835 | /* |
| 1825 | 1836 | Valor: PEGALISTADESUBGRUPOS |
| 1826 | 1837 | ... | ... |
ferramentas/identifica/index.js.php
| ... | ... | @@ -149,12 +149,16 @@ i3GEOF.identifica = { |
| 149 | 149 | //verifica se existem sistemas para identificar |
| 150 | 150 | // |
| 151 | 151 | if(i3GEOF.identifica.mostraSistemasAdicionais === true){ |
| 152 | + /* | |
| 152 | 153 | if (i3GEO.parametros.locidentifica !== ""){ |
| 153 | 154 | if(i3GEO.tempXMLSISTEMAS === undefined) |
| 154 | 155 | {i3GEO.util.ajaxexecASXml(i3GEO.parametros.locidentifica,"i3GEOF.identifica.montaListaSistemas");} |
| 155 | 156 | else |
| 156 | 157 | {i3GEOF.identifica.montaListaSistemas(i3GEO.tempXMLSISTEMAS);} |
| 157 | 158 | } |
| 159 | + */ | |
| 160 | + var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=pegaSistemasIdentificacao&g_sid="+i3GEO.configura.sid; | |
| 161 | + cpJSON.call(p,"foo",i3GEOF.identifica.montaListaSistemas); | |
| 158 | 162 | } |
| 159 | 163 | if (i3GEO.temaAtivo !== "") |
| 160 | 164 | {i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo);} |
| ... | ... | @@ -366,34 +370,28 @@ i3GEOF.identifica = { |
| 366 | 370 | |
| 367 | 371 | O resultado é inserido no div com id "listaSistemas". |
| 368 | 372 | |
| 369 | - A lista de sistemas é obtida de um XML definido no i3Geo na variável i3GEO.parametros.locidentifica | |
| 370 | - | |
| 371 | 373 | Cada sistema consiste em uma URL para a qual serão passados os parâmetros x e y. |
| 372 | 374 | |
| 373 | - Parametros: | |
| 374 | - | |
| 375 | - xmlDoc - documento xml | |
| 376 | 375 | */ |
| 377 | - montaListaSistemas: function(xmlDoc){ | |
| 376 | + montaListaSistemas: function(retorno){ | |
| 378 | 377 | var divins,sisig,sistema,pub,exec,temp,t,linhas,ltema; |
| 379 | - if (xmlDoc !== undefined) | |
| 378 | + if (retorno !== undefined) | |
| 380 | 379 | { |
| 381 | - i3GEO.tempXMLSISTEMAS = xmlDoc; | |
| 382 | 380 | divins = $i("i3GEOidentificalistaSistemas"); |
| 383 | - sis = xmlDoc.getElementsByTagName("FUNCAO"); | |
| 381 | + sis = retorno.data; | |
| 384 | 382 | for (ig=0;ig<sis.length;ig++) |
| 385 | 383 | { |
| 386 | - sistema = sis[ig].getElementsByTagName("NOMESIS")[0].firstChild.nodeValue; | |
| 387 | - if(sis[ig].getElementsByTagName("PUBLICADO")[0]) | |
| 384 | + sistema = sis[ig].NOME; | |
| 385 | + if(sis[ig].PUBLICADO) | |
| 388 | 386 | { |
| 389 | - if(sis[ig].getElementsByTagName("PUBLICADO")[0].firstChild) | |
| 387 | + if(sis[ig].PUBLICADO) | |
| 390 | 388 | { |
| 391 | - pub = sis[ig].getElementsByTagName("PUBLICADO")[0].firstChild.nodeValue; | |
| 389 | + pub = sis[ig].PUBLICADO; | |
| 392 | 390 | if(pub === "NAO" || pub === "nao") |
| 393 | 391 | {sistema = "<s>"+sistema+"</s>";} |
| 394 | 392 | } |
| 395 | 393 | } |
| 396 | - exec = sis[ig].getElementsByTagName("ABRIR")[0].firstChild.nodeValue; | |
| 394 | + exec = sis[ig].ABRIR; | |
| 397 | 395 | temp = exec.split('"'); |
| 398 | 396 | if(temp.length === 1) |
| 399 | 397 | {exec = '"'+exec+'"';} |
| ... | ... | @@ -401,8 +399,8 @@ i3GEOF.identifica = { |
| 401 | 399 | if(temp.length !== 2) |
| 402 | 400 | {exec += '+"?"';} |
| 403 | 401 | t = "blank"; |
| 404 | - if (sis[ig].getElementsByTagName("TARGET")[0]) | |
| 405 | - {t = sis[ig].getElementsByTagName("TARGET")[0].firstChild.nodeValue;} | |
| 402 | + if (sis[ig].TARGET) | |
| 403 | + {t = sis[ig].TARGET;} | |
| 406 | 404 | i3GEOF.identifica.sistemasAdicionais.push(sistema+","+exec+","+t); |
| 407 | 405 | } |
| 408 | 406 | if (i3GEOF.identifica.sistemasAdicionais.length > 0) | ... | ... |