Commit 7460f5e6c62a307f73dac6150564f90386c040cc

Authored by Edmar Moretti
1 parent ae4318dc

--no commit message

admin/admin.db
No preview for this file type
classesphp/classe_atributos.php
... ... @@ -1296,6 +1296,7 @@ class Atributos
1296 1296 Processa o resultado da identificação de um elemento compondo um array de strings formatadas.
1297 1297  
1298 1298 parameters:
  1299 +
1299 1300 $listatemas - Lista de temas
1300 1301  
1301 1302 $resultados - Resultados de cada tema.
... ... @@ -1305,20 +1306,48 @@ class Atributos
1305 1306 function retornaI2($listatemas,$resultados,$map)
1306 1307 {
1307 1308 $final = array();
1308   - foreach ($listatemas as $tema)
1309   - {
  1309 + foreach ($listatemas as $tema){
  1310 + $editavel = "";
1310 1311 $layer = $map->getlayerbyname($tema);
1311 1312 $nometmp = $tema;
1312   - if (strtoupper($layer->getMetaData("TEMA")) != "NAO")
1313   - {
  1313 + if (strtoupper($layer->getMetaData("TEMA")) != "NAO"){
1314 1314 $nometmp = $layer->getMetaData("TEMA");
1315 1315 }
1316   - else if ($layer->getMetaData("ALTTEMA") != "")
1317   - {
  1316 + else if ($layer->getMetaData("ALTTEMA") != ""){
1318 1317 $nometmp = $layer->getMetaData("ALTTEMA");
1319 1318 }
1320 1319 $nometmp = $this->converte($nometmp);
1321   - $final[] = array("nome"=>$nometmp,"resultado"=>$resultados[$tema]);
  1320 + //verifica se e editavel no metaestat
  1321 + if($layer->getmetadata("METAESTATEDITAVEL") == "SIM"){
  1322 + //verifica login
  1323 + session_write_close();
  1324 + session_name("i3GeoLogin");
  1325 + if(!empty($_COOKIE["i3geocodigologin"])){
  1326 + session_id($_COOKIE["i3geocodigologin"]);
  1327 + session_start();
  1328 + //verifica usuario
  1329 + if($_SESSION["usuario"] == $_COOKIE["i3geousuariologin"]){
  1330 + //verifica se e administrador
  1331 + foreach($_SESSION["papeis"] as $p){
  1332 + if($p == 1){
  1333 + $editavel = "sim";
  1334 + }
  1335 + }
  1336 + //verifica operacao
  1337 + if(!empty($_SESSION["operacoes"]["admin/metaestat/geral"])){
  1338 + $editavel = "sim";
  1339 + }
  1340 + if($editavel == "sim"){
  1341 + include_once(__DIR__."/../admin/php/classe_metaestat.php");
  1342 + $m = $m = new Metaestat();
  1343 + $medidaVariavel = $m->listaMedidaVariavel("",$layer->getMetaData("METAESTAT_ID_MEDIDA_VARIAVEL"));
  1344 + $editavel = $medidaVariavel["colunavalor"];
  1345 + }
  1346 + }
  1347 + }
  1348 +
  1349 + }
  1350 + $final[] = array("nome"=>$nometmp,"resultado"=>$resultados[$tema],"editavel"=>$editavel);
1322 1351 }
1323 1352 return $final;
1324 1353 }
... ... @@ -2199,7 +2228,11 @@ class Atributos
2199 2228 $ident = @$layer->queryByPoint($pt, 1, -1);
2200 2229 }
2201 2230 if ($ident == MS_SUCCESS){
2202   - $ident = @$layer->queryByPoint($pt, 1, -1);
  2231 + //$ident = @$layer->queryByPoint($pt, 1, -1);
  2232 + //verifica se o layer e editavel no sistema METAESTAT
  2233 + $editavel = "nao";
  2234 +
  2235 + //
2203 2236 $sopen = $layer->open();
2204 2237 $res_count = $layer->getNumresults();
2205 2238 if(strtoupper($layer->getmetadata("convcaracter")) == "NAO"){
... ... @@ -2270,6 +2303,7 @@ class Atributos
2270 2303 $etiqueta = "sim";
2271 2304 }
2272 2305 $arraytemp = array(
  2306 + "item"=>$it,
2273 2307 "alias"=>$this->converte($itensdesc[$conta]),
2274 2308 "valor"=>$val,
2275 2309 "link"=>$link,
... ...
ferramentas/identifica/index.js
... ... @@ -624,7 +624,7 @@ i3GEOF.identifica = {
624 624 retorno {JSON} - objeto JSON com os dados <i3GEO.php.identifica3>
625 625 */
626 626 mostraDadosTema: function(retorno){
627   - var i,res="",ntemas,resultados,nres,cor,j,nitens,k,atualN = "todas",inicio=0,numResultados = 0,tip,link;
  627 + var i,res="",ntemas,resultados,nres,cor,j,nitens,k,atualN = "todas",inicio=0,numResultados = 0,tip,link,textovalor;
628 628  
629 629 if($i("i3GEOFidentificaNocorrencias"))
630 630 {atualN = $i("i3GEOFidentificaNocorrencias").value;}
... ... @@ -656,6 +656,12 @@ i3GEOF.identifica = {
656 656 nitens = resultados[j].length;
657 657 for(k=0;k<nitens;k++){
658 658 tip = "&nbsp;&nbsp;";
  659 + textovalor = resultados[j][k].valor;
  660 + if(resultados[j][k].item === retorno[i].editavel){
  661 + textovalor = "<br><img title='' src='"+i3GEO.configura.locaplic+"/imagens/branco.gif' style='margin-right:2px;position:relative;top:3px;width:12px;'>" +
  662 + "<img title='Salvar' src='"+i3GEO.configura.locaplic+"/imagens/oxygen/16x16/media-floppy.png' style='cursor:pointer;margin-right:2px;position:relative;top:3px;width:12px;'>" +
  663 + "<input size=30 type=text value='"+textovalor+"' class=digitar />";
  664 + }
659 665 if(resultados[j][k].tip && resultados[j][k].tip.toLowerCase() == "sim"){
660 666 tip = "<img style='margin-right:2px;position:relative;top:3px;width:12px;' src='"+i3GEO.configura.locaplic+"/imagens/tips.png' title='Etiqueta ativa' />";
661 667 }
... ... @@ -663,13 +669,13 @@ i3GEOF.identifica = {
663 669 tip = "<img style='margin-right:2px;position:relative;top:3px;width:12px;' src='"+i3GEO.configura.locaplic+"/imagens/branco.gif' title='' />";
664 670 }
665 671 if(resultados[j][k].link === "")
666   - {res += "<div style='width:100%;text-align:left;background-color:"+cor+"' >"+tip+resultados[j][k].alias+":&nbsp;"+resultados[j][k].valor+"</div>";}
  672 + {res += "<div style='width:100%;text-align:left;background-color:"+cor+"' >"+tip+resultados[j][k].alias+":&nbsp;"+textovalor+"</div>";}
667 673 else{
668 674 try{
669 675 link = eval(resultados[j][k].link);
670 676 }
671 677 catch(e){link = resultados[j][k].link;}
672   - res += "<div style='width:100%;text-align:left;background-color:"+cor+"' >"+tip+resultados[j][k].alias+":&nbsp;<a href='"+link+"' target=_blank >"+resultados[j][k].valor+"</a></div>";
  678 + res += "<div style='width:100%;text-align:left;background-color:"+cor+"' >"+tip+resultados[j][k].alias+":&nbsp;<a href='"+link+"' target=_blank >"+textovalor+"</a></div>";
673 679 }
674 680 if(resultados[j][k].img !== "")
675 681 {res += "<div style='width:100%;text-align:left;background-color:"+cor+"' >"+resultados[j][k].img+"</div>";}
... ...
imagens/oxygen/16x16/media-floppy.png 0 → 100644

612 Bytes