Commit 96fa2e38f4175ae3f260135d347faeb0776b31c4
1 parent
bf9ebec8
Exists in
master
and in
7 other branches
--no commit message
Showing
3 changed files
with
37 additions
and
4 deletions
Show diff stats
classesjs/classe_php.js
| ... | ... | @@ -1546,4 +1546,16 @@ i3GEO.php = { |
| 1546 | 1546 | var p = i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=listaHierarquiaRegioes&codigo_tipo_regiao="+codigo_tipo_regiao+"&codigoregiaopai="+codigoregiaopai+"&valorregiaopai="+valorregiaopai+"&g_sid="+i3GEO.configura.sid; |
| 1547 | 1547 | i3GEO.util.ajaxGet(p,funcao); |
| 1548 | 1548 | }, |
| 1549 | + /* | |
| 1550 | + Function: aplicaFiltroRegiao | |
| 1551 | + | |
| 1552 | + Aplica um filtro no SQL que define uma camada do sistema de metadados estatisticos para filtrar para uma regiao especifica | |
| 1553 | + */ | |
| 1554 | + aplicaFiltroRegiao: function(funcao,codigo_tipo_regiao,codigo_regiao){ | |
| 1555 | + if(codigo_tipo_regiao === "" || codigo_regiao === ""){ | |
| 1556 | + return; | |
| 1557 | + } | |
| 1558 | + var p = i3GEO.configura.locaplic+"/ferramentas/metaestat/analise.php?funcao=aplicaFiltroRegiao&codigo_tipo_regiao="+codigo_tipo_regiao+"&codigoregiao="+codigo_regiao+"&g_sid="+i3GEO.configura.sid; | |
| 1559 | + i3GEO.util.ajaxGet(p,funcao); | |
| 1560 | + } | |
| 1549 | 1561 | }; |
| 1550 | 1562 | \ No newline at end of file | ... | ... |
ferramentas/metaestat/analise.php
| ... | ... | @@ -56,13 +56,13 @@ if(isset($fingerprint)){ |
| 56 | 56 | } |
| 57 | 57 | $retorno = ""; |
| 58 | 58 | switch (strtoupper($funcao)){ |
| 59 | - case "LISTADRIVES": | |
| 59 | + case "APLICAFILTROREGIAO": | |
| 60 | 60 | break; |
| 61 | 61 | } |
| 62 | 62 | if (!connection_aborted()){ |
| 63 | 63 | cpjson($retorno); |
| 64 | 64 | } |
| 65 | 65 | else |
| 66 | -{exit(); | |
| 66 | +{exit();} | |
| 67 | 67 | |
| 68 | 68 | ?> |
| 69 | 69 | \ No newline at end of file | ... | ... |
ferramentas/metaestat/locregiao.js
| ... | ... | @@ -40,6 +40,8 @@ if(typeof(i3GEOF) === 'undefined'){ |
| 40 | 40 | */ |
| 41 | 41 | i3GEOF.locregiao = { |
| 42 | 42 | //CODIGOREGIAOPAI: "", //guarda o valor da regiao pai que originou o ultimo combo |
| 43 | + ULTIMO_CODIGO_TIPO_REGIAO: "", //ultimo tipo de regiao escolhido | |
| 44 | + ULTIMO_CODIGO_REGIAO: "",//ultima regiao escolhida | |
| 43 | 45 | ATIVAFILTRO: false, //ativa ou nao os botoes que permitem filtrar a regiao. Usado quando a ferramenta e aberta com opcao de filtragem. |
| 44 | 46 | aguarde: function(obj){ |
| 45 | 47 | if(!obj){ |
| ... | ... | @@ -151,8 +153,17 @@ i3GEOF.locregiao = { |
| 151 | 153 | }, |
| 152 | 154 | comboHierarquiaRegioesOnChange: function(combo,codigoregiaopai,codigo_tipo_regiao,valorregiaopai){ |
| 153 | 155 | var onde = combo.parentNode.getElementsByTagName("div")[0]; |
| 156 | + if(valorregiaopai){ | |
| 157 | + i3GEOF.locregiao.ULTIMO_CODIGO_REGIAO = valorregiaopai.spplit(";")[0]; | |
| 158 | + } | |
| 159 | + else{ | |
| 160 | + i3GEOF.locregiao.ULTIMO_CODIGO_REGIAO = ""; | |
| 161 | + } | |
| 154 | 162 | if(codigoregiaopai){ |
| 155 | - //i3GEOF.locregiao.CODIGOREGIAOPAI = codigoregiaopai; | |
| 163 | + i3GEOF.locregiao.ULTIMO_CODIGO_TIPO_REGIAO = codigoregiaopai; | |
| 164 | + } | |
| 165 | + else{ | |
| 166 | + i3GEOF.locregiao.ULTIMO_CODIGO_TIPO_REGIAO = ""; | |
| 156 | 167 | } |
| 157 | 168 | if(combo.value == ""){ |
| 158 | 169 | onde.innerHTML = ""; |
| ... | ... | @@ -205,7 +216,17 @@ i3GEOF.locregiao = { |
| 205 | 216 | i3GEO.php.listaHierarquiaRegioes(temp,codigo_tipo_regiao,codigoregiaopai,valorregiaopai); |
| 206 | 217 | }, |
| 207 | 218 | aplicaFiltro: function(){ |
| 208 | - | |
| 219 | + var temp = function(){ | |
| 220 | + i3GEO.janela.AGUARDEMODAL = false; | |
| 221 | + i3GEO.janela.fechaAguarde("aguardeFiltroRegiao"); | |
| 222 | + i3GEO.Interface.redesenha(); | |
| 223 | + }; | |
| 224 | + if(i3GEOF.locregiao.ULTIMO_CODIGO_TIPO_REGIAO != "" && i3GEOF.locregiao.CODIGO_REGIAO != ""){ | |
| 225 | + i3GEO.janela.AGUARDEMODAL = true; | |
| 226 | + i3GEO.janela.abreAguarde("aguardeFiltroRegiao","Filtrando..."); | |
| 227 | + i3GEO.php.aplicaFiltroRegiao(temp,i3GEOF.locregiao.ULTIMO_CODIGO_TIPO_REGIAO,i3GEOF.locregiao.CODIGO_REGIAO); | |
| 228 | + i3GEO.janela.tempoMsg("O filtro é aplicado a todas as camadas oriundas do sistema de metadados estatícos."); | |
| 229 | + } | |
| 209 | 230 | }, |
| 210 | 231 | removeFiltro: function(){ |
| 211 | 232 | ... | ... |