Commit 8a28f152b45f096792ca2b7d07446ed12309fc09

Authored by Edmar Moretti
1 parent c8f2e7d3

$1

admin/admin.db
No preview for this file type
classesjs/classe_mapa.js
... ... @@ -580,7 +580,11 @@ i3GEO.mapa = {
580 580 Abre a janela de dialogo da ferramenta de cartogramas estatisticos METAESTAT
581 581 */
582 582 metaestat: function(){
583   - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","index.js","i3GEOF.metaestat.inicia()");
  583 + var temp = function(){
  584 + i3GEOF.metaestat.MULTIPARAMETROS = true;
  585 + i3GEOF.metaestat.inicia();
  586 + };
  587 + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","index.js",temp);
584 588 },
585 589 /*
586 590 Function: metaestatListaMapas
... ...
classesjs/classe_util.js
... ... @@ -1324,7 +1324,7 @@ i3GEO.util = {
1324 1324  
1325 1325 js {String} - endereco do JS
1326 1326  
1327   - ini {String} - funcao que sera executada ao ser carregado o script (pode ser "")
  1327 + ini {String} ou {function} - funcao que sera executada ao ser carregado o script (pode ser "")
1328 1328  
1329 1329 id - id do elemento script que sera criado
1330 1330  
... ... @@ -1352,7 +1352,12 @@ i3GEO.util = {
1352 1352 if(i3GEO.janela){
1353 1353 i3GEO.janela.fechaAguarde(id+"aguarde");
1354 1354 }
1355   - eval(ini);
  1355 + if(YAHOO.lang.isFunction(ini)){
  1356 + ini.call();
  1357 + }
  1358 + else{
  1359 + eval(ini);
  1360 + }
1356 1361 }
1357 1362 };
1358 1363 }
... ... @@ -1361,7 +1366,12 @@ i3GEO.util = {
1361 1366 if(i3GEO.janela){
1362 1367 i3GEO.janela.fechaAguarde(id+"aguarde");
1363 1368 }
1364   - eval(ini);
  1369 + if(YAHOO.lang.isFunction(ini)){
  1370 + ini.call();
  1371 + }
  1372 + else{
  1373 + eval(ini);
  1374 + }
1365 1375 };
1366 1376 }
1367 1377 i3GEO.janela.ESTILOAGUARDE = tipojanela;
... ... @@ -1695,30 +1705,44 @@ i3GEO.util = {
1695 1705 Parametros:
1696 1706  
1697 1707 id {String} - id do elemento select que sera criado
1698   -
  1708 +
1699 1709 nomes {Array} - array com os nomes
1700   -
  1710 +
1701 1711 valores {Array} - array com os valores
1702 1712  
1703 1713 obj {objeto} - objeto contendo name e value, exemplo {"nome":"a","valor":"1"}
1704 1714  
1705   - prefixo {string} - Prefixo que sera usado no id de cada elemento
1706   -
1707 1715 estilo {string} - string inserida no item style do container do combo
1708 1716  
  1717 + funcaoclick {string} - string inserida no evento onclick
  1718 +
1709 1719 */
1710   - checkCombo: function(id,nomes,valores,prefixo,estilo){
1711   - var n, i, combo = "",n;
1712   - n = valores.length;
  1720 + checkCombo: function(id,nomes,valores,estilo,funcaoclick){
  1721 + var i, combo = "",
  1722 + n = valores.length;
1713 1723 if (n > 0){
1714 1724 combo = "<div style='"+estilo+"'><table class=lista3 id="+id+" >";
1715 1725 for (i=0;i<n;i++){
1716   - combo += "<tr><td><input size=2 style='cursor:pointer' type=checkbox name='"+prefixo+"_"+valores[i]+"' /></td><td>"+nomes[i]+"</td>";
  1726 + combo += "<tr><td><input onclick="+funcaoclick+" size=2 style='top:1px;cursor:pointer' type=checkbox value='"+valores[i]+"' /></td><td>"+nomes[i]+"</td>";
1717 1727 }
1718 1728 combo += "</table></div>";
1719 1729 }
1720 1730 return combo;
1721 1731 },
  1732 + valoresCheckCombo: function(id){
  1733 + var el = $i(id),
  1734 + res = [],n,i;
  1735 + if(el){
  1736 + el = el.getElementsByTagName("input");
  1737 + n = el.length;
  1738 + for(i=0;i<n;i++){
  1739 + if(el[i].checked === true){
  1740 + res.push(el[i].value);
  1741 + }
  1742 + }
  1743 + }
  1744 + return res;
  1745 + },
1722 1746 /*
1723 1747 Function: checkTemas
1724 1748  
... ... @@ -2228,7 +2252,7 @@ i3GEO.util = {
2228 2252  
2229 2253 nomejs {string} - nome do arquivo javascript
2230 2254  
2231   - nomefuncao {string} - nome da funcao do javascript carregado que sera executado apos a carga, exemplo: i3GEOF.locregiao.abreComFiltro()
  2255 + nomefuncao {string} ou {function} - nome da funcao do javascript carregado que sera executado apos a carga, exemplo: i3GEOF.locregiao.abreComFiltro()
2232 2256 */
2233 2257 dialogoFerramenta: function(mensagem,dir,nome,nomejs,nomefuncao){
2234 2258 if(typeof(console) !== 'undefined'){console.info(mensagem);}
... ...
ferramentas/metaestat/index.js
... ... @@ -1360,14 +1360,20 @@ i3GEOF.metaestat = {
1360 1360 return "";
1361 1361 }
1362 1362 //se tiver parametro e todos estiverem vazios, aborta
1363   - var i,n,c,
  1363 + var i,n,c,j,k,val,
1364 1364 t=[],
1365 1365 dados = i3GEOF.metaestat.parametros.dados;
1366 1366 n = dados.length;
1367 1367 for(i=0;i<n;i++){
1368 1368 c = $i("comboparametro_"+dados[i].id_parametro_medida+"_"+dados[i].id_pai);
1369   - if(c && c.value != ""){
1370   - t.push(dados[i].coluna+'="'+c.value+'"');
  1369 + if(c){
  1370 + if(c.value != "" && i3GEOF.metaestat.MULTIPARAMETROS === false){
  1371 + t.push(dados[i].coluna+'="'+c.value+'"');
  1372 + }
  1373 + else{
  1374 + val = i3GEO.util.valoresCheckCombo(c.id);
  1375 + t.push(dados[i].coluna+' IN ("'+val.join('","')+'")');
  1376 + }
1371 1377 }
1372 1378 }
1373 1379 if(t.length > 0){
... ... @@ -2231,11 +2237,11 @@ i3GEOF.metaestat = {
2231 2237 oc = "'i3GEOF.metaestat.parametros.antesCombo();i3GEOF.metaestat.parametros.combos(\""+id_parametro_medida+"\")'",
2232 2238 filho = i3GEOF.metaestat.parametros.retornaIdFilho(id_parametro_medida),
2233 2239 i,novoel;
2234   - if(filho == false){
  2240 + if(filho === false && i3GEOF.metaestat.MULTIPARAMETROS === false){
2235 2241 oc = "i3GEOF.metaestat.comum.adicionaCamada()";
2236 2242 }
2237 2243 ins = "<p class=paragrafo >"+titulo+"</p>";
2238   - if(i3GEOF.metaestat.MULTIPARAMETROS == false){
  2244 + if(i3GEOF.metaestat.MULTIPARAMETROS === false){
2239 2245 ins += "<select id='combo"+idcombo+"' style='background:beige;width:"+(i3GEOF.metaestat.LARGURA - 20)+"px' onchange="+oc+" ><option value=''>---</option>";
2240 2246 for(i=0;i<n;i++){
2241 2247 ins += "<option value='"+dados[i]+"'>"+dados[i]+"</option>";
... ... @@ -2247,8 +2253,8 @@ i3GEOF.metaestat = {
2247 2253 "combo"+idcombo,
2248 2254 dados,
2249 2255 dados,
2250   - "c"+id_parametro_medida,
2251   - "overflow:auto;width:"+(i3GEOF.metaestat.LARGURA - 20)+"px;height:50px;border:1px solid gray;background-color:white"
  2256 + "overflow:auto;width:"+(i3GEOF.metaestat.LARGURA - 20)+"px;height:50px;border:1px solid gray;background-color:white",
  2257 + oc
2252 2258 );
2253 2259 }
2254 2260 novoel = document.createElement("div");
... ...