Commit eae7c3555ab2a5ee2f4ae6b36d5ff15dafcc07fb

Authored by Edmar Moretti
1 parent f75c05e6

Correção na carga da lista de sistemas adicionais na ferramenta de identificação

aplicmap/geral1.map
@@ -367,6 +367,9 @@ LAYER @@ -367,6 +367,9 @@ LAYER
367 LAYER 367 LAYER
368 METADATA 368 METADATA
369 "TEMA" "Rosa dos ventos" 369 "TEMA" "Rosa dos ventos"
  370 + "IDENTIFICA" "nao"
  371 + "TABELA" "nao"
  372 +
370 END 373 END
371 NAME "rosadosventos" 374 NAME "rosadosventos"
372 SIZEUNITS PIXELS 375 SIZEUNITS PIXELS
aplicmap/geral1windows.map
@@ -366,6 +366,9 @@ LAYER @@ -366,6 +366,9 @@ LAYER
366 LAYER 366 LAYER
367 METADATA 367 METADATA
368 "TEMA" "Rosa dos ventos" 368 "TEMA" "Rosa dos ventos"
  369 + "IDENTIFICA" "nao"
  370 + "TABELA" "nao"
  371 +
369 END 372 END
370 NAME "rosadosventos" 373 NAME "rosadosventos"
371 SIZEUNITS PIXELS 374 SIZEUNITS PIXELS
classesjs/classe_interface.js
@@ -973,8 +973,8 @@ i3GEO.Interface = { @@ -973,8 +973,8 @@ i3GEO.Interface = {
973 nlayers = layers.length, 973 nlayers = layers.length,
974 i; 974 i;
975 for(i=0;i<nlayers;i++){ 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 layers[i].redraw(); 978 layers[i].redraw();
979 } 979 }
980 } 980 }
classesphp/classe_menutemas.php
@@ -314,6 +314,40 @@ Array @@ -314,6 +314,40 @@ Array
314 return $sistemas; 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 function: procurartemas 351 function: procurartemas
318 352
319 Procura um tema no menu de temas considerando apenas os subgrupos. 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,6 +1809,18 @@ Pega a lista de grupos do menu.
1809 $retorno = array("idmenu"=>$idmenu,"grupos"=>$m->pegaListaDeGrupos($idmenu,$listasistemas,$listasgrupos)); 1809 $retorno = array("idmenu"=>$idmenu,"grupos"=>$m->pegaListaDeGrupos($idmenu,$listasistemas,$listasgrupos));
1810 break; 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 Valor: PEGASISTEMAS 1824 Valor: PEGASISTEMAS
1813 1825
1814 Pega a lista de sistemas. 1826 Pega a lista de sistemas.
@@ -1820,7 +1832,6 @@ Pega a lista de sistemas. @@ -1820,7 +1832,6 @@ Pega a lista de sistemas.
1820 $m = new Menutemas($map_file,$perfil,$locaplic,"",$editores,$idioma); 1832 $m = new Menutemas($map_file,$perfil,$locaplic,"",$editores,$idioma);
1821 $retorno = $m->pegaSistemas(); 1833 $retorno = $m->pegaSistemas();
1822 break; 1834 break;
1823 -  
1824 /* 1835 /*
1825 Valor: PEGALISTADESUBGRUPOS 1836 Valor: PEGALISTADESUBGRUPOS
1826 1837
ferramentas/identifica/index.js.php
@@ -149,12 +149,16 @@ i3GEOF.identifica = { @@ -149,12 +149,16 @@ i3GEOF.identifica = {
149 //verifica se existem sistemas para identificar 149 //verifica se existem sistemas para identificar
150 // 150 //
151 if(i3GEOF.identifica.mostraSistemasAdicionais === true){ 151 if(i3GEOF.identifica.mostraSistemasAdicionais === true){
  152 + /*
152 if (i3GEO.parametros.locidentifica !== ""){ 153 if (i3GEO.parametros.locidentifica !== ""){
153 if(i3GEO.tempXMLSISTEMAS === undefined) 154 if(i3GEO.tempXMLSISTEMAS === undefined)
154 {i3GEO.util.ajaxexecASXml(i3GEO.parametros.locidentifica,"i3GEOF.identifica.montaListaSistemas");} 155 {i3GEO.util.ajaxexecASXml(i3GEO.parametros.locidentifica,"i3GEOF.identifica.montaListaSistemas");}
155 else 156 else
156 {i3GEOF.identifica.montaListaSistemas(i3GEO.tempXMLSISTEMAS);} 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 if (i3GEO.temaAtivo !== "") 163 if (i3GEO.temaAtivo !== "")
160 {i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo);} 164 {i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo);}
@@ -366,34 +370,28 @@ i3GEOF.identifica = { @@ -366,34 +370,28 @@ i3GEOF.identifica = {
366 370
367 O resultado é inserido no div com id "listaSistemas". 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 Cada sistema consiste em uma URL para a qual serão passados os parâmetros x e y. 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 var divins,sisig,sistema,pub,exec,temp,t,linhas,ltema; 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 divins = $i("i3GEOidentificalistaSistemas"); 380 divins = $i("i3GEOidentificalistaSistemas");
383 - sis = xmlDoc.getElementsByTagName("FUNCAO"); 381 + sis = retorno.data;
384 for (ig=0;ig<sis.length;ig++) 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 if(pub === "NAO" || pub === "nao") 390 if(pub === "NAO" || pub === "nao")
393 {sistema = "<s>"+sistema+"</s>";} 391 {sistema = "<s>"+sistema+"</s>";}
394 } 392 }
395 } 393 }
396 - exec = sis[ig].getElementsByTagName("ABRIR")[0].firstChild.nodeValue; 394 + exec = sis[ig].ABRIR;
397 temp = exec.split('"'); 395 temp = exec.split('"');
398 if(temp.length === 1) 396 if(temp.length === 1)
399 {exec = '"'+exec+'"';} 397 {exec = '"'+exec+'"';}
@@ -401,8 +399,8 @@ i3GEOF.identifica = { @@ -401,8 +399,8 @@ i3GEOF.identifica = {
401 if(temp.length !== 2) 399 if(temp.length !== 2)
402 {exec += '+"?"';} 400 {exec += '+"?"';}
403 t = "blank"; 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 i3GEOF.identifica.sistemasAdicionais.push(sistema+","+exec+","+t); 404 i3GEOF.identifica.sistemasAdicionais.push(sistema+","+exec+","+t);
407 } 405 }
408 if (i3GEOF.identifica.sistemasAdicionais.length > 0) 406 if (i3GEOF.identifica.sistemasAdicionais.length > 0)