Commit e7466624790ba8bd3eaf088c10c02139eb794a6f

Authored by Edmar Moretti
1 parent bb1cc731

Reformulação da ferramenta tabela para uso de templates Mustache

ferramentas/tabela/dependencias.php 0 → 100755
... ... @@ -0,0 +1,30 @@
  1 +<?php
  2 +/**
  3 + * Carrega os programas javascript necessarios para a ferramenta
  4 + * Esse programa e usado na tag <script> ou com a funcao scripttag do i3Geo
  5 + * Alem de carregar os scripts, carrega tambem o template no formato MUSTACHE, definindo a variavel
  6 + * javascript i3GEOF.tabela.MUSTACHE
  7 + * O template e substituido pelos valores definidos em index.js no momento da inicializacao da ferramenta
  8 + */
  9 +if(extension_loaded('zlib')){
  10 + ob_start('ob_gzhandler');
  11 +}
  12 +header("Content-type: text/javascript");
  13 +include("index.js");
  14 +include("dicionario.js");
  15 +echo "\n";
  16 +/**
  17 + * Inclui o template mustache do HTML usado para criar o conteudo da janela
  18 + */
  19 +echo 'i3GEOF.tabela.MUSTACHE = "';
  20 +$texto = file_get_contents("template_mst.html");
  21 +$texto = str_replace("\n", "", $texto);
  22 +$texto = str_replace("\r", "", $texto);
  23 +$texto = str_replace("\t", "", $texto);
  24 +$texto = str_replace('"', "'", $texto);
  25 +echo $texto;
  26 +echo '";';
  27 +if(extension_loaded('zlib')){
  28 + ob_end_flush();
  29 +}
  30 +?>
0 31 \ No newline at end of file
... ...
ferramentas/tabela/index.js
... ... @@ -4,479 +4,434 @@ if (typeof (i3GEOF) === &#39;undefined&#39;) {
4 4 /*
5 5 * Classe: i3GEOF.tabela
6 6 */
7   -i3GEOF.tabela =
8   - {
9   - /**
10   - * Array com os ids das janelas ja criadas
11   - */
12   - janelas : [],
13   - propJanelas : {},
14   - /*
15   - * Para efeitos de compatibilidade antes da vers&atilde;o 4.7 que n&atilde;o tinha dicion&aacute;rio
16   - */
17   - criaJanelaFlutuante : function() {
18   - i3GEOF.tabela.iniciaDicionario();
19   - },
20   - /*
21   - * Function: iniciaDicionario
22   - *
23   - * Carrega o dicion&aacute;rio e chama a fun&ccedil;&atilde;o que inicia a ferramenta
24   - *
25   - * O Javascript &eacute; carregado com o id i3GEOF.nomedaferramenta.dicionario_script
26   - */
27   - iniciaDicionario : function() {
28   - if (typeof (i3GEOF.tabela.dicionario) === 'undefined') {
29   - i3GEO.util.scriptTag(
30   - i3GEO.configura.locaplic + "/ferramentas/tabela/dicionario.js",
31   - "i3GEOF.tabela.iniciaJanelaFlutuante()",
32   - "i3GEOF.tabela.dicionario_script");
33   - } else {
34   - i3GEOF.tabela.iniciaJanelaFlutuante();
35   - }
36   - },
37   - /*
38   - * Function: inicia
39   - *
40   - * Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante
41   - *
42   - * Parametro:
43   - *
44   - * iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta
45   - */
46   - inicia : function(iddiv, idjanela) {
47   - var onButtonClick = function(p_sType, p_aArgs, botao) {
48   - var oMenuItem = p_aArgs[1];
49   - if (oMenuItem) {
50   - if (oMenuItem.value != "") {
51   - i3GEO.mapa.ativaTema(oMenuItem.value);
52   - botao.set(
  7 +i3GEOF.tabela = {
  8 + /**
  9 + * Array com os ids das janelas ja criadas
  10 + */
  11 + janelas : [],
  12 + /**
  13 + * Objeto com as propriedades de cada janela. A chave e o id da janela
  14 + * armazenado em i3GEO.tabela.janelas
  15 + */
  16 + propJanelas : {},
  17 + /**
  18 + * Template no formato mustache
  19 + * E preenchido na carga do javascript com o programa dependencias.php
  20 + */
  21 + MUSTACHE : "",
  22 + /**
  23 + * Susbtitutos para o template
  24 + */
  25 + mustacheHash : function(idjanela) {
  26 + return {
  27 + "idjanela" : idjanela,
  28 + "locaplic" : i3GEO.configura.locaplic,
  29 + "propriedades" : $trad('p13'),
  30 + "registros" : $trad(
  31 + 3,
  32 + i3GEOF.tabela.dicionario),
  33 + "estatisticas" : $trad(
  34 + 4,
  35 + i3GEOF.tabela.dicionario),
  36 + "relat" : $trad(
  37 + 5,
  38 + i3GEOF.tabela.dicionario),
  39 + "atuatab" : $trad(
  40 + 8,
  41 + i3GEOF.tabela.dicionario),
  42 + "colleg" : $trad(
  43 + 9,
  44 + i3GEOF.tabela.dicionario),
  45 + "sellinhas" : $trad(
  46 + 10,
  47 + i3GEOF.tabela.dicionario),
  48 + "atvsel" : $trad(
  49 + 11,
  50 + i3GEOF.tabela.dicionario),
  51 + "limpselmap" : $trad(
  52 + 12,
  53 + i3GEOF.tabela.dicionario),
  54 + "limpsel" : $trad(
  55 + 13,
  56 + i3GEOF.tabela.dicionario),
  57 + "criatemasel" : $trad(
  58 + 14,
  59 + i3GEOF.tabela.dicionario),
  60 + "criatema" : $trad(
  61 + 15,
  62 + i3GEOF.tabela.dicionario),
  63 + "grafico" : $trad(
  64 + 42,
  65 + i3GEOF.tabela.dicionario),
  66 + "vinctab" : $trad(
  67 + 43,
  68 + i3GEOF.tabela.dicionario),
  69 + "vinculos" : $trad(
  70 + 44,
  71 + i3GEOF.tabela.dicionario),
  72 + "de" : $trad(
  73 + 16,
  74 + i3GEOF.tabela.dicionario),
  75 + "ini" : $inputText(
  76 + "",
  77 + "",
  78 + idjanela
  79 + + 'i3GEOtabelainicio',
  80 + "",
  81 + 5,
  82 + "1"),
  83 + "ate" : $trad(
  84 + 17,
  85 + i3GEOF.tabela.dicionario),
  86 + "fim" : $inputText(
  87 + "",
  88 + "",
  89 + idjanela
  90 + + 'i3GEOtabelafim',
  91 + "",
  92 + 5,
  93 + "20"),
  94 + "vertodos" : $trad(
  95 + 40,
  96 + i3GEOF.tabela.dicionario),
  97 + "atuareg" : $trad(
  98 + 18,
  99 + i3GEOF.tabela.dicionario),
  100 + "listar" : $trad(
  101 + 19,
  102 + i3GEOF.tabela.dicionario),
  103 + "itemcalc" : $trad(
  104 + 20,
  105 + i3GEOF.tabela.dicionario),
  106 + "excluicalc" : $trad(
  107 + 21,
  108 + i3GEOF.tabela.dicionario),
  109 + "calc" : $trad(
  110 + 22,
  111 + i3GEOF.tabela.dicionario),
  112 + "paraqueas" : $trad(
  113 + 23,
  114 + i3GEOF.tabela.dicionario),
  115 + "itensrel" : $trad(
  116 + 24,
  117 + i3GEOF.tabela.dicionario),
  118 + "itensagr" : $trad(
  119 + 25,
  120 + i3GEOF.tabela.dicionario),
  121 + "incarea" : $trad(
  122 + 26,
  123 + i3GEOF.tabela.dicionario),
  124 + "incestat" : $trad(
  125 + 27,
  126 + i3GEOF.tabela.dicionario),
  127 + "excvalor" : $trad(
  128 + 28,
  129 + i3GEOF.tabela.dicionario),
  130 + "excvalori" : $inputText(
  131 + "",
  132 + "",
  133 + idjanela
  134 + + 'i3GEOtabelaexcestat',
  135 + "",
  136 + 10,
  137 + ""),
  138 + "relattext" : $trad(
  139 + 29,
  140 + i3GEOF.tabela.dicionario),
  141 + "filtro" : $inputText(
  142 + "",
  143 + "",
  144 + idjanela
  145 + + 'i3GEOtabelafiltro1',
  146 + "",
  147 + 5,
  148 + "")
  149 + };
  150 + },
  151 + /*
  152 + * Function: iniciaDicionario (Depreciado na versao 6.0)
  153 + *
  154 + */
  155 + iniciaDicionario : function() {
  156 + i3GEOF.tabela.iniciaJanelaFlutuante();
  157 + },
  158 + /*
  159 + * Function: inicia
  160 + *
  161 + * Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante
  162 + *
  163 + * Parametro:
  164 + *
  165 + * iddiv {String} - id do div que receber&aacute; o conteudo HTML da
  166 + * ferramenta
  167 + */
  168 + inicia : function(iddiv, idjanela) {
  169 + var onButtonClick = function(p_sType, p_aArgs, botao) {
  170 + var oMenuItem = p_aArgs[1];
  171 + if (oMenuItem) {
  172 + if (oMenuItem.value != "") {
  173 + i3GEO.mapa.ativaTema(oMenuItem.value);
  174 + botao.set(
53 175 "label",
54   - "<span class='cabecalhoTemas' >" + oMenuItem.cfg.getProperty("text") + "</span>&nbsp;&nbsp;");
55   - i3GEOF.tabela.propJanelas[idjanela].tema = oMenuItem.value;
56   - $i(idjanela + "_corpo").innerHTML = "";
57   - i3GEOF.tabela.inicia(
  176 + "<span class='cabecalhoTemas' >"
  177 + + oMenuItem.cfg.getProperty("text")
  178 + + "</span>&nbsp;&nbsp;");
  179 + i3GEOF.tabela.propJanelas[idjanela].tema = oMenuItem.value;
  180 + $i(idjanela
  181 + + "_corpo").innerHTML = "";
  182 + i3GEOF.tabela.inicia(
58 183 iddiv,
59 184 idjanela);
60   - }
61 185 }
62   - };
63   - i3GEO.janela.comboCabecalhoTemas(
64   - idjanela + "i3GEOFtabelaComboCabeca",
65   - idjanela + "i3GEOFtabelaComboCabecaSel",
  186 + }
  187 + };
  188 + i3GEO.janela.comboCabecalhoTemas(
  189 + idjanela
  190 + + "i3GEOFtabelaComboCabeca",
  191 + idjanela
  192 + + "i3GEOFtabelaComboCabecaSel",
66 193 "tabela",
67 194 "ligadosComTabela",
68 195 onButtonClick);
69   - if (i3GEOF.tabela.propJanelas[idjanela].tema === "") {
70   - $i(iddiv).innerHTML = "";// '<p style="position: relative;
71   - // top: 0px; font-size: 15px;
72   - // text-align:
73   - // left;">'+$trad("x33")+'</p>';
74   - return;
75   - }
76   - try {
77   - $i(iddiv).innerHTML = i3GEOF.tabela.html(idjanela);
  196 + if (i3GEOF.tabela.propJanelas[idjanela].tema === "") {
  197 + $i(iddiv).innerHTML = "";
  198 + return;
  199 + }
  200 + try {
  201 + $i(iddiv).innerHTML = i3GEOF.tabela.html(idjanela);
  202 + i3GEO.guias.mostraGuiaFerramenta(
  203 + idjanela
  204 + + "i3GEOtabelaguia1",
  205 + idjanela
  206 + + "i3GEOtabelaguia");
  207 + // eventos das guias
  208 + $i(idjanela
  209 + + "i3GEOtabelaguia6").onclick = function() {
78 210 i3GEO.guias.mostraGuiaFerramenta(
79   - idjanela + "i3GEOtabelaguia1",
80   - idjanela + "i3GEOtabelaguia");
81   - // eventos das guias
82   - $i(idjanela + "i3GEOtabelaguia6").onclick = function() {
83   - i3GEO.guias.mostraGuiaFerramenta(
84   - idjanela + "i3GEOtabelaguia6",
85   - idjanela + "i3GEOtabelaguia");
86   - };
87   - $i(idjanela + "i3GEOtabelaguia1").onclick = function() {
88   - i3GEO.guias.mostraGuiaFerramenta(
89   - idjanela + "i3GEOtabelaguia1",
90   - idjanela + "i3GEOtabelaguia");
91   - };
92   - $i(idjanela + "i3GEOtabelaguia3").onclick = function() {
93   - i3GEO.guias.mostraGuiaFerramenta(
94   - idjanela + "i3GEOtabelaguia3",
95   - idjanela + "i3GEOtabelaguia");
96   - if (!$i(idjanela + "i3GEOtabelaComboItensGuia3")) {
97   - i3GEOF.tabela.comboItensEstat(idjanela);
98   - }
99   - };
100   - // relatorio
101   - $i(idjanela + "i3GEOtabelaguia5").onclick = function() {
102   - i3GEO.guias.mostraGuiaFerramenta(
103   - idjanela + "i3GEOtabelaguia5",
104   - idjanela + "i3GEOtabelaguia");
105   - i3GEO.util.checkItensEditaveis(
  211 + idjanela
  212 + + "i3GEOtabelaguia6",
  213 + idjanela
  214 + + "i3GEOtabelaguia");
  215 + };
  216 + $i(idjanela
  217 + + "i3GEOtabelaguia1").onclick = function() {
  218 + i3GEO.guias.mostraGuiaFerramenta(
  219 + idjanela
  220 + + "i3GEOtabelaguia1",
  221 + idjanela
  222 + + "i3GEOtabelaguia");
  223 + };
  224 + $i(idjanela
  225 + + "i3GEOtabelaguia3").onclick = function() {
  226 + i3GEO.guias.mostraGuiaFerramenta(
  227 + idjanela
  228 + + "i3GEOtabelaguia3",
  229 + idjanela
  230 + + "i3GEOtabelaguia");
  231 + if (!$i(idjanela
  232 + + "i3GEOtabelaComboItensGuia3")) {
  233 + i3GEOF.tabela.comboItensEstat(idjanela);
  234 + }
  235 + };
  236 + // relatorio
  237 + $i(idjanela
  238 + + "i3GEOtabelaguia5").onclick = function() {
  239 + i3GEO.guias.mostraGuiaFerramenta(
  240 + idjanela
  241 + + "i3GEOtabelaguia5",
  242 + idjanela
  243 + + "i3GEOtabelaguia");
  244 + i3GEO.util.checkItensEditaveis(
106 245 i3GEOF.tabela.propJanelas[idjanela].tema,
107 246 function(retorno) {
108 247 if (retorno.tipo === "dados") {
109   - $i(idjanela + "i3GEOtabelaitensrelatorio").innerHTML = retorno.dados;
  248 + $i(idjanela
  249 + + "i3GEOtabelaitensrelatorio").innerHTML = retorno.dados;
110 250 }
111 251 },
112   - idjanela + "i3GEOtabelaitensrelatorio",
  252 + idjanela
  253 + + "i3GEOtabelaitensrelatorio",
113 254 "320px",
114 255 "",
115 256 "sim");
116   - i3GEO.util.comboItens(
117   - idjanela + "i3GEOtabelaagrupaItem",
  257 + i3GEO.util.comboItens(
  258 + idjanela
  259 + + "i3GEOtabelaagrupaItem",
118 260 i3GEOF.tabela.propJanelas[idjanela].tema,
119 261 function(retorno) {
120 262 if (retorno.tipo === "erro") {
121   - $i(idjanela + "i3GEOtabelaagrupamento").innerHTML = "<br><br><span style='color:red'>" + $trad(
122   - 2,
123   - i3GEOF.tabela.dicionario) + "</span><br><br>";
  263 + $i(idjanela
  264 + + "i3GEOtabelaagrupamento").innerHTML = "<br><br><span style='color:red'>"
  265 + + $trad(
  266 + 2,
  267 + i3GEOF.tabela.dicionario)
  268 + + "</span><br><br>";
124 269 } else {
125   - $i(idjanela + "i3GEOtabelaagrupamento").innerHTML = retorno.dados;
  270 + $i(idjanela
  271 + + "i3GEOtabelaagrupamento").innerHTML = retorno.dados;
126 272 }
127 273 },
128   - idjanela + "i3GEOtabelaagrupamento",
  274 + idjanela
  275 + + "i3GEOtabelaagrupamento",
129 276 "");
130   - };
131   - new YAHOO.widget.Button(
132   - idjanela + "i3GEOtabelabotao2",
133   - {
134   - onclick : {
135   - fn : function() {
136   - i3GEOF.tabela.ativaSelecao(idjanela);
137   - }
138   - }
139   - });
140   - new YAHOO.widget.Button(
141   - idjanela + "i3GEOtabelabotao3",
142   - {
143   - onclick : {
144   - fn : function() {
145   - i3GEOF.tabela.limpaSelecao(idjanela);
146   - }
147   - }
148   - });
149   - new YAHOO.widget.Button(
150   - idjanela + "i3GEOtabelabotao6",
151   - {
152   - onclick : {
153   - fn : function() {
154   - i3GEOF.tabela.criaNovoTema(idjanela);
155   - }
156   - }
157   - });
158   - new YAHOO.widget.Button(
159   - idjanela + "i3GEOtabelabotaoLista",
160   - {
161   - onclick : {
162   - fn : function() {
163   - i3GEOF.tabela.pegaRegistros(idjanela);
164   - }
165   - }
166   - });
167   - new YAHOO.widget.Button(
168   - idjanela + "i3GEOtabelaGraficoI",
169   - {
170   - onclick : {
171   - fn : function() {
172   - i3GEO.mapa.ativaTema(i3GEOF.tabela.propJanelas[idjanela].tema);
173   - i3GEO.analise.dialogo.graficoInterativo1();
174   - }
175   - }
176   - });
177   - $i(idjanela + "i3GEOtabelabotaoLista-button").style.minHeight = "1em";
178   - $i(idjanela + "i3GEOtabelabotaoLista-button").style.padding = "0px 15px";
179   - $i(idjanela + "i3GEOtabelabotaoLista-button").style.lineHeight = "1.3";
180   - $i(idjanela + "i3GEOtabelabotaoLista").style.position = "relative";
181   - $i(idjanela + "i3GEOtabelabotaoLista").style.top = "2px";
182   -
183   - new YAHOO.widget.Button(
184   - idjanela + "i3GEOtabelabotao4",
185   - {
186   - onclick : {
187   - fn : function() {
188   - i3GEOF.tabela.estatistica(idjanela);
189   - }
190   - }
191   - });
192   -
193   - new YAHOO.widget.Button(
194   - idjanela + "i3GEOtabelabotao7",
195   - {
196   - onclick : {
197   - fn : function() {
198   - i3GEOF.tabela.relatorioTabela(idjanela);
199   - }
200   - }
201   - });
202   - new YAHOO.widget.Button(
203   - idjanela + "i3GEOtabelabotao5",
204   - {
205   - onclick : {
206   - fn : function() {
207   - i3GEOF.tabela.relatorioTexto(idjanela);
208   - }
209   - }
210   - });
211   - new YAHOO.widget.Button(
212   - idjanela + "i3GEOtabelabotaoVinculos",
213   - {
214   - onclick : {
215   - fn : function() {
216   - i3GEOF.tabela.vinculos.iniciaJanelaFlutuante();
217   - }
218   - }
219   - });
220   - i3GEO.util.mensagemAjuda(
221   - idjanela + "i3GEOtabelamen1",
222   - $i(idjanela + "i3GEOtabelamen1").innerHTML);
223   -
224   - if (i3GEO.parametros.r.toLowerCase() !== "sim") {
225   - $i(idjanela + "i3GEOtabelaguia4obj").innerHTML = $trad("x22");
  277 + };
  278 + new YAHOO.widget.Button(idjanela
  279 + + "i3GEOtabelabotao2", {
  280 + onclick : {
  281 + fn : function() {
  282 + i3GEOF.tabela.ativaSelecao(idjanela);
  283 + }
226 284 }
227   - i3GEOF.tabela.pegaRegistros(idjanela);
228   - } catch (erro) {
229   - i3GEO.janela.tempoMsg(erro);
230   - }
231   - },
232   - /*
233   - * Function: html
234   - *
235   - * Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta
236   - *
237   - * Retorno:
238   - *
239   - * String com o c&oacute;digo html
240   - */
241   - html : function(idjanela) {
242   - var ins = '';// <p class="paragrafo" >
243   - ins += '<div id=' + idjanela + 'guiasYUI class="yui-navset" style="top:0px;cursor:pointer;left:0px;">';
244   - ins += '<ul class="yui-nav" style="border-width:0pt 0pt 0px;border-color:rgb(240,240,240);border-bottom-color:white;">';
245   - ins +=
246   - ' <li><a ><em><div id="' + idjanela +
247   - 'i3GEOtabelaguia6" style="text-align:center;left:0px;" ><img class="ticPropriedades2" style="height:14px" title="' +
248   - $trad("p13") + '" src="' + i3GEO.configura.locaplic + '/imagens/visual/default/branco.gif"></div></em></a></li>';
249   - ins += ' <li><a ><em><div id="' + idjanela + 'i3GEOtabelaguia1" style="text-align:center;left:0px;" >' + $trad(
250   - 3,
251   - i3GEOF.tabela.dicionario) + '</div></em></a></li>';
252   - ins += ' <li><a ><em><div id="' + idjanela + 'i3GEOtabelaguia3" style="text-align:center;left:0px;" >' + $trad(
253   - 4,
254   - i3GEOF.tabela.dicionario) + '</div></em></a></li>';
255   - ins += ' <li><a ><em><div id="' + idjanela + 'i3GEOtabelaguia5" style="text-align:center;left:0px;" >' + $trad(
256   - 5,
257   - i3GEOF.tabela.dicionario) + '</div></em></a></li>';
258   - ins += '</ul>';
259   - ins += '</div><br>';
260   - ins +=
261   - ' <div id=' + idjanela +
262   - 'i3GEOtabelaresultadotab style="background-color:#F2F2F2;position:relative;top:5px;left:0px"></div>';
263   - // propriedades
264   - ins += ' <div id=' + idjanela + 'i3GEOtabelaguia6obj style="width:99%">';
265   - ins += ' <table summary="" class=lista2 >';
266   - ins += ' <tr>';
267   - ins +=
268   - ' <td><input style="cursor:pointer;border:0px solid white;" onclick="i3GEOF.tabela.pegaRegistros(\'' + idjanela +
269   - '\')" type=checkbox id=' + idjanela + 'i3GEOtabelatipolista /></td>';
270   - ins += ' <td>' + $trad(
271   - 8,
272   - i3GEOF.tabela.dicionario) + '</td>';
273   - ins += ' </tr>';
274   - ins += ' <tr>';
275   - ins +=
276   - ' <td><input style="cursor:pointer;border:0px solid white;" onclick="i3GEOF.tabela.pegaRegistros(\'' + idjanela +
277   - '\')" type=checkbox id=' + idjanela + 'i3GEOtabelalegenda /></td>';
278   - ins += ' <td>' + $trad(
279   - 9,
280   - i3GEOF.tabela.dicionario) + '</td>';
281   - ins += ' </tr>';
282   - ins += ' </table>';
283   - ins += ' </div>';
  285 + });
  286 + new YAHOO.widget.Button(idjanela
  287 + + "i3GEOtabelabotao3", {
  288 + onclick : {
  289 + fn : function() {
  290 + i3GEOF.tabela.limpaSelecao(idjanela);
  291 + }
  292 + }
  293 + });
  294 + new YAHOO.widget.Button(idjanela
  295 + + "i3GEOtabelabotao6", {
  296 + onclick : {
  297 + fn : function() {
  298 + i3GEOF.tabela.criaNovoTema(idjanela);
  299 + }
  300 + }
  301 + });
  302 + new YAHOO.widget.Button(idjanela
  303 + + "i3GEOtabelabotaoLista", {
  304 + onclick : {
  305 + fn : function() {
  306 + i3GEOF.tabela.pegaRegistros(idjanela);
  307 + }
  308 + }
  309 + });
  310 + new YAHOO.widget.Button(idjanela
  311 + + "i3GEOtabelaGraficoI", {
  312 + onclick : {
  313 + fn : function() {
  314 + i3GEO.mapa.ativaTema(i3GEOF.tabela.propJanelas[idjanela].tema);
  315 + i3GEO.analise.dialogo.graficoInterativo1();
  316 + }
  317 + }
  318 + });
  319 + $i(idjanela
  320 + + "i3GEOtabelabotaoLista-button").style.minHeight = "1em";
  321 + $i(idjanela
  322 + + "i3GEOtabelabotaoLista-button").style.padding = "0px 15px";
  323 + $i(idjanela
  324 + + "i3GEOtabelabotaoLista-button").style.lineHeight = "1.3";
  325 + $i(idjanela
  326 + + "i3GEOtabelabotaoLista").style.position = "relative";
  327 + $i(idjanela
  328 + + "i3GEOtabelabotaoLista").style.top = "2px";
284 329  
285   - ins += ' <div id=' + idjanela + 'i3GEOtabelaguia1obj style="width:99%">';
286   - ins += ' <div id=' + idjanela + 'i3GEOtabelacombot style="position:relative;top:5px;left:0px;display:none;">';
287   - ins += ' </div>';
288   - ins += ' <input title="' + $trad(
289   - 10,
290   - i3GEOF.tabela.dicionario) + '" id=' + idjanela + 'i3GEOtabelabotao2 size=25 type=button value="' + $trad(
291   - 11,
292   - i3GEOF.tabela.dicionario) + '" />';
293   - ins += ' <input title="' + $trad(
294   - 12,
295   - i3GEOF.tabela.dicionario) + '" id=' + idjanela + 'i3GEOtabelabotao3 size=25 type=button value="' + $trad(
296   - 13,
297   - i3GEOF.tabela.dicionario) + '"/>';
298   - ins += ' <input title="' + $trad(
299   - 14,
300   - i3GEOF.tabela.dicionario) + '" id=' + idjanela + 'i3GEOtabelabotao6 size=30 type=button value="' + $trad(
301   - 15,
302   - i3GEOF.tabela.dicionario) + '"/>';
303   - ins += ' <input id=' + idjanela + 'i3GEOtabelaGraficoI type=button value="' + $trad(
304   - 42,
305   - i3GEOF.tabela.dicionario) + '" />';
306   - ins += ' <input title="' + $trad(
307   - 43,
308   - i3GEOF.tabela.dicionario) + '" id=' + idjanela + 'i3GEOtabelabotaoVinculos size=30 type=button value="' + $trad(
309   - 44,
310   - i3GEOF.tabela.dicionario) + '"/>';
  330 + new YAHOO.widget.Button(idjanela
  331 + + "i3GEOtabelabotao4", {
  332 + onclick : {
  333 + fn : function() {
  334 + i3GEOF.tabela.estatistica(idjanela);
  335 + }
  336 + }
  337 + });
311 338  
312   - ins +=
313   - ' <div id=' +
314   - idjanela +
315   - 'i3GEOtabelacontador style="background-color:rgb(240,240,240);width:100%;position:relative;top:15px;left:0px;text-align:left;height:25px;">';
316   - ins +=
317   - ' ' + $trad(
318   - 16,
319   - i3GEOF.tabela.dicionario) + ' <img style=cursor:pointer onclick="i3GEOF.tabela.menos(\'' + idjanela + '\')" src="' +
320   - i3GEO.configura.locaplic + '/imagens/minus.gif" />';
321   - ins += $inputText(
322   - "",
323   - "",
324   - idjanela + "i3GEOtabelainicio",
325   - "",
326   - 5,
327   - "1");
328   - ins += ' ' + $trad(
329   - 17,
330   - i3GEOF.tabela.dicionario) + "&nbsp;";
331   - ins +=
332   - ' <img style=cursor:pointer onclick="i3GEOF.tabela.mais(\'' + idjanela + '\')" src="' + i3GEO.configura.locaplic +
333   - '/imagens/plus.gif" />';
334   - ins += $inputText(
335   - "",
336   - "",
337   - idjanela + "i3GEOtabelafim",
338   - "",
339   - 5,
340   - "20");
341   - ins +=
342   - ' <img title="' + $trad(
343   - 40,
344   - i3GEOF.tabela.dicionario) + '"style="cursor:pointer;position:relative;" onclick="i3GEOF.tabela.todos(\'' + idjanela +
345   - '\')" src="' + i3GEO.configura.locaplic + '/imagens/dot.gif" />';
346   - ins +=
347   - ' <input title="' + $trad(
348   - 18,
349   - i3GEOF.tabela.dicionario) + '" id=' + idjanela +
350   - 'i3GEOtabelabotaoLista size=25 style="position:relative;" type=button value="' + $trad(
351   - 19,
352   - i3GEOF.tabela.dicionario) + '"/>';
353   - // ins += ' <a href="#" onclick="i3GEOF.tabela.novaJanela()"
354   - // >'+$trad(36,i3GEOF.tabela.dicionario)+'</a>';
355   - ins += ' </div>';
356   - ins += ' <div id=' + idjanela + 'i3GEOtabelaregistros style="position:relative;top:20px;left:0px;text-align:left;">';
357   - ins += ' </div>';
358   - ins += ' </div>';
  339 + new YAHOO.widget.Button(idjanela
  340 + + "i3GEOtabelabotao7", {
  341 + onclick : {
  342 + fn : function() {
  343 + i3GEOF.tabela.relatorioTabela(idjanela);
  344 + }
  345 + }
  346 + });
  347 + new YAHOO.widget.Button(idjanela
  348 + + "i3GEOtabelabotao5", {
  349 + onclick : {
  350 + fn : function() {
  351 + i3GEOF.tabela.relatorioTexto(idjanela);
  352 + }
  353 + }
  354 + });
  355 + new YAHOO.widget.Button(idjanela
  356 + + "i3GEOtabelabotaoVinculos", {
  357 + onclick : {
  358 + fn : function() {
  359 + i3GEOF.tabela.vinculos.iniciaJanelaFlutuante();
  360 + }
  361 + }
  362 + });
  363 + i3GEO.util.mensagemAjuda(
  364 + idjanela
  365 + + "i3GEOtabelamen1",
  366 + $i(idjanela
  367 + + "i3GEOtabelamen1").innerHTML);
359 368  
360   - ins += ' <div id=' + idjanela + 'i3GEOtabelaguia3obj style="display:none;width:99%;left:0px" >';
361   - ins += ' <p class="paragrafo" ><label>' + $trad(
362   - 20,
363   - i3GEOF.tabela.dicionario) + ':</label> <span id=' + idjanela + 'i3GEOtabelaitensGuia3 ></span>';
364   - ins += ' <p class="paragrafo" ><label>' + $trad(
365   - 21,
366   - i3GEOF.tabela.dicionario) + ':</label>';
367   - ins += $inputText(
368   - "",
369   - "",
370   - idjanela + "i3GEOtabelafiltro1",
371   - "",
372   - 5,
373   - "");
374   - ins += ' <p class="paragrafo" ><input id=' + idjanela + 'i3GEOtabelabotao4 size=30 type=button value="' + $trad(
375   - 22,
376   - i3GEOF.tabela.dicionario) + '"/>';
377   - ins +=
378   - ' <div id="' + idjanela +
379   - 'i3GEOtabelaoperacoes" style="font-size:12px;text-align:left;position:relative;top:15px;left:0px;" >';
380   - ins += ' </div><br>';
381   - ins += ' <div id=' + idjanela + 'i3GEOtabelamen1 style="position:relative;top:25px;left:0px;width:100%" >';
382   - ins += ' <p class="paragrafo" >' + $trad(
383   - 23,
384   - i3GEOF.tabela.dicionario);
385   - ins += ' </div>';
386   - ins += ' </div>';
387   - // relatorios
388   - ins += ' <div id=' + idjanela + 'i3GEOtabelaguia5obj style="width:99%;display:none">';
389   - ins += ' <p class="paragrafo" >' + $trad(
390   - 24,
391   - i3GEOF.tabela.dicionario) + ':';
392   - ins +=
393   - ' <p class="paragrafo" ><div id=' + idjanela +
394   - 'i3GEOtabelaitensrelatorio class=digitar style="text-align:left;overflow:auto;height:100px">';
395   - ins += ' </div><br>';
396   - ins += ' <p class="paragrafo" >' + $trad(
397   - 25,
398   - i3GEOF.tabela.dicionario) + ':';
399   - ins += ' <p class="paragrafo" ><div id=' + idjanela + 'i3GEOtabelaagrupamento style="text-align:left;">';
400   - ins += ' </div>';
401   - ins +=
402   - ' <p class="paragrafo" ><br><input style="cursor:pointer" type=checkbox id=' + idjanela + 'i3GEOtabelacalculaarea />' +
403   - $trad(
404   - 26,
405   - i3GEOF.tabela.dicionario);
406   - ins +=
407   - ' <p class="paragrafo" ><input style="cursor:pointer" type=checkbox id=' + idjanela + 'i3GEOtabelacalculaestat />' +
408   - $trad(
409   - 27,
410   - i3GEOF.tabela.dicionario);
411   - ins += ' <p class="paragrafo" >' + $trad(
412   - 28,
413   - i3GEOF.tabela.dicionario) + ': ';
414   - ins += $inputText(
415   - "",
416   - "",
417   - idjanela + "i3GEOtabelaexcestat",
418   - "",
419   - 10,
420   - "");
421   - ins += ' <p class="paragrafo" ><input id=' + idjanela + 'i3GEOtabelabotao7 size=30 type=button value="' + $trad(
422   - 5,
423   - i3GEOF.tabela.dicionario) + '"/>';
424   - ins += ' <input id=' + idjanela + 'i3GEOtabelabotao5 size=25 type=button value="' + $trad(
425   - 29,
426   - i3GEOF.tabela.dicionario) + '"/>';
427   - ins +=
428   - ' <form method=post style="display:none" id=' + idjanela + 'i3GEOtabelarelatorio action="' + i3GEO.configura.locaplic +
429   - '/ferramentas/tabela/relatorio.php" target="_blank" >';
430   - ins += ' <input type=hidden id=' + idjanela + 'i3GEOtabelaarearelh name=arearel value=nao />';
431   - ins += ' <input type=hidden id=' + idjanela + 'i3GEOtabelastatrelh name=statrel value=nao />';
432   - ins += ' <input type=hidden id=' + idjanela + 'i3GEOtabelatemarelh name=temarel value="" />';
433   - ins += ' <input type=hidden id=' + idjanela + 'i3GEOtabelag_sidh name=g_sid value="" />';
434   - ins += ' <input type=hidden id=' + idjanela + 'i3GEOtabelaitemagruparelh name=itemagruparel value="" />';
435   - ins += ' <input type=hidden id=' + idjanela + 'i3GEOtabelaitensrelh name=itensrel value="" />';
436   - ins += ' <input type=hidden id=' + idjanela + 'i3GEOtabelanomesrelh name=nomesrel value="" />';
437   - ins += ' <input type=hidden id=' + idjanela + 'i3GEOtabelaordemrel name=ordemrel value="" />';
438   - ins += ' <input type=hidden id=' + idjanela + 'i3GEOtabelaexcluirvalorh name=excluirvalor value="" />';
439   - ins += ' <input type=hidden id=' + idjanela + 'i3GEOtabelatiporelh name=tiporel value="" />';
440   - ins += ' </form>';
441   - ins += ' </div>';
442   - return ins;
443   - },
444   - /*
445   - * Function: criaJanelaFlutuante
446   - *
447   - * Cria a janela flutuante para controle da ferramenta.
448   - */
449   - iniciaJanelaFlutuante : function() {
450   - var minimiza, cabecalho, janela, divid, temp, titulo, id = "tabela" + parseInt(
451   - Math.random() * 1000000,
452   - 10);
453   - // i3GEO.janela.tempoMsg($trad(38,i3GEOF.tabela.dicionario));
454   - i3GEOF.tabela.janelas.push(id);
455   - i3GEOF.tabela.propJanelas[id] = {};
456   - i3GEOF.tabela.propJanelas[id].colunas = {
457   - "itens" : [],
458   - "alias" : []
459   - };
460   - i3GEOF.tabela.propJanelas[id].registros = [];
461   - i3GEOF.tabela.propJanelas[id].tema = i3GEO.temaAtivo;
462   - i3GEOF.tabela.propJanelas[id].atualiza = false;
  369 + if (i3GEO.parametros.r.toLowerCase() !== "sim") {
  370 + $i(idjanela
  371 + + "i3GEOtabelaguia4obj").innerHTML = $trad("x22");
  372 + }
  373 + i3GEOF.tabela.pegaRegistros(idjanela);
  374 + } catch (erro) {
  375 + i3GEO.janela.tempoMsg(erro);
  376 + }
  377 + },
  378 + /*
  379 + * Function: html
  380 + *
  381 + * Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das
  382 + * op&ccedil;&otilde;es da ferramenta
  383 + *
  384 + * Retorno:
  385 + *
  386 + * String com o c&oacute;digo html
  387 + */
  388 + html : function(idjanela) {
  389 + var ins = Mustache.render(
  390 + i3GEOF.tabela.MUSTACHE,
  391 + i3GEOF.tabela.mustacheHash(idjanela));
  392 + return ins;
  393 + },
  394 + /*
  395 + * Function: criaJanelaFlutuante
  396 + *
  397 + * Cria a janela flutuante para controle da ferramenta.
  398 + */
  399 + iniciaJanelaFlutuante : function() {
  400 + var minimiza, cabecalho, janela, divid, temp, titulo, id = "tabela"
  401 + + parseInt(
  402 + Math.random() * 1000000,
  403 + 10);
  404 + // i3GEO.janela.tempoMsg($trad(38,i3GEOF.tabela.dicionario));
  405 + i3GEOF.tabela.janelas.push(id);
  406 + i3GEOF.tabela.propJanelas[id] = {};
  407 + i3GEOF.tabela.propJanelas[id].colunas = {
  408 + "itens" : [],
  409 + "alias" : []
  410 + };
  411 + i3GEOF.tabela.propJanelas[id].registros = [];
  412 + i3GEOF.tabela.propJanelas[id].tema = i3GEO.temaAtivo;
  413 + i3GEOF.tabela.propJanelas[id].atualiza = false;
463 414  
464   - cabecalho = function() {
465   - i3GEOF.tabela.ativaFoco(id);
466   - };
467   - minimiza = function() {
468   - i3GEO.janela.minimiza(id);
469   - };
470   - duplica = function() {
471   - i3GEOF.tabela.iniciaJanelaFlutuante();
472   - };
473   - // cria a janela flutuante
474   - titulo =
475   - "<div id='" + id + "i3GEOFtabelaComboCabeca' class='comboTemasCabecalho'></div>&nbsp;&nbsp;&nbsp;" + $trad(
476   - 1,
477   - i3GEOF.tabela.dicionario) + " <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic +
478   - "/ajuda_usuario.php?idcategoria=5&idajuda=39' >&nbsp;&nbsp;&nbsp;</a>";
479   - janela = i3GEO.janela.cria(
  415 + cabecalho = function() {
  416 + i3GEOF.tabela.ativaFoco(id);
  417 + };
  418 + minimiza = function() {
  419 + i3GEO.janela.minimiza(id);
  420 + };
  421 + duplica = function() {
  422 + i3GEOF.tabela.iniciaJanelaFlutuante();
  423 + };
  424 + // cria a janela flutuante
  425 + titulo = "<div id='"
  426 + + id
  427 + + "i3GEOFtabelaComboCabeca' class='comboTemasCabecalho'></div>&nbsp;&nbsp;&nbsp;"
  428 + + $trad(
  429 + 1,
  430 + i3GEOF.tabela.dicionario)
  431 + + " <a class=ajuda_usuario target=_blank href='"
  432 + + i3GEO.configura.locaplic
  433 + + "/ajuda_usuario.php?idcategoria=5&idajuda=39' >&nbsp;&nbsp;&nbsp;</a>";
  434 + janela = i3GEO.janela.cria(
480 435 "500px",
481 436 "400px",
482 437 "",
... ... @@ -490,117 +445,137 @@ i3GEOF.tabela =
490 445 minimiza,
491 446 "",
492 447 true,
493   - i3GEO.configura.locaplic + "/imagens/oxygen/16x16/view-form-table.png",
  448 + i3GEO.configura.locaplic
  449 + + "/imagens/oxygen/16x16/view-form-table.png",
494 450 duplica);
495   - divid = janela[2].id;
496   - if (i3GEOF.tabela.janelas.length > 1) {
497   - temp = janela[0].cfg.config;
498   - janela[0].moveTo(
499   - temp.x.value + (i3GEOF.tabela.janelas.length * 50),
500   - temp.y.value + (i3GEOF.tabela.janelas.length * 15));
501   - }
502   - $i(id + "_corpo").style.backgroundColor = "white";
503   - i3GEOF.tabela.propJanelas[id].aguarde = $i(id + "_imagemCabecalho").style;
504   - i3GEOF.tabela.propJanelas[id].atualiza = true;
505   - // indica se a janela sera atualizada na navegacao
506   - temp = 'i3GEOF.tabela.propJanelas["' + id + '"].atualiza = this.checked';
507   - janela[0]
508   - .setFooter("<div style=background-color:#F2F2F2; ><input class='inputsb' style='cursor:pointer;position:relative;top:2px;' onclick='" +
509   - temp + "' type=checkbox />&nbsp;" + $trad(
  451 + divid = janela[2].id;
  452 + if (i3GEOF.tabela.janelas.length > 1) {
  453 + temp = janela[0].cfg.config;
  454 + janela[0].moveTo(
  455 + temp.x.value
  456 + + (i3GEOF.tabela.janelas.length * 50),
  457 + temp.y.value
  458 + + (i3GEOF.tabela.janelas.length * 15));
  459 + }
  460 + $i(id
  461 + + "_corpo").style.backgroundColor = "white";
  462 + i3GEOF.tabela.propJanelas[id].aguarde = $i(id
  463 + + "_imagemCabecalho").style;
  464 + i3GEOF.tabela.propJanelas[id].atualiza = true;
  465 + // indica se a janela sera atualizada na navegacao
  466 + temp = 'i3GEOF.tabela.propJanelas["'
  467 + + id
  468 + + '"].atualiza = this.checked';
  469 + janela[0].setFooter("<div style=background-color:#F2F2F2; ><input class='inputsb' style='cursor:pointer;position:relative;top:2px;' onclick='"
  470 + + temp
  471 + + "' type=checkbox />&nbsp;"
  472 + + $trad(
510 473 41,
511   - i3GEOF.tabela.dicionario) + " (" + id + ")</div>");
  474 + i3GEOF.tabela.dicionario)
  475 + + " ("
  476 + + id
  477 + + ")</div>");
512 478  
513   - i3GEOF.tabela.inicia(
  479 + i3GEOF.tabela.inicia(
514 480 divid,
515 481 id);
516   - // inicia os eventos
517   - if (i3GEO.Interface.ATUAL === "openlayers") {
518   - if (i3GEO.eventos.NAVEGAMAPA.toString().search(
  482 + // inicia os eventos
  483 + if (i3GEO.Interface.ATUAL === "openlayers") {
  484 + if (i3GEO.eventos.NAVEGAMAPA.toString().search(
519 485 'i3GEOF.tabela.atualizaListaDeRegistros()') < 0) {
520   - i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.tabela.atualizaListaDeRegistros()");
521   - }
  486 + i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.tabela.atualizaListaDeRegistros()");
522 487 }
523   - if (i3GEO.Interface.ATUAL === "googlemaps" && !tabelaDragend) {
524   - tabelaDragend = google.maps.event.addListener(
  488 + }
  489 + if (i3GEO.Interface.ATUAL === "googlemaps"
  490 + && !tabelaDragend) {
  491 + tabelaDragend = google.maps.event.addListener(
525 492 i3GeoMap,
526 493 "dragend",
527 494 function() {
528 495 i3GEOF.tabela.atualizaListaDeRegistros();
529 496 });
530   - tabelaZoomend = google.maps.event.addListener(
  497 + tabelaZoomend = google.maps.event.addListener(
531 498 i3GeoMap,
532 499 "zoomend",
533 500 function() {
534 501 i3GEOF.tebela.atualizaListaDeRegistros();
535 502 });
536   - }
537   - if (i3GEO.Interface.ATUAL === "googleearth" && !tabelaDragend) {
538   - tabelaDragend = google.earth.addEventListener(
  503 + }
  504 + if (i3GEO.Interface.ATUAL === "googleearth"
  505 + && !tabelaDragend) {
  506 + tabelaDragend = google.earth.addEventListener(
539 507 i3GeoMap.getView(),
540 508 "viewchangeend",
541 509 function() {
542 510 i3GEOF.tabela.atualizaListaDeRegistros();
543 511 });
544   - }
  512 + }
545 513  
546   - temp = function() {
547   - i3GEOF.tabela.janelas.remove(id);
548   - i3GEOF.tabela.propJanelas[id] = null;
549   - if (i3GEOF.tabela.janelas.length === 0) {
550   - if (i3GEO.Interface.ATUAL === "openlayers") {
551   - i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.tabela.atualizaListaDeRegistros()");
552   - }
553   - if (i3GEO.Interface.ATUAL === "googlemaps") {
554   - google.maps.event.removeListener(tabelaDragend);
555   - google.maps.event.removeListener(tabelaZoomend);
556   - }
557   - if (i3GEO.Interface.ATUAL === "googleearth") {
558   - google.earth.removeEventListener(tabelaDragend);
559   - }
  514 + temp = function() {
  515 + i3GEOF.tabela.janelas.remove(id);
  516 + i3GEOF.tabela.propJanelas[id] = null;
  517 + if (i3GEOF.tabela.janelas.length === 0) {
  518 + if (i3GEO.Interface.ATUAL === "openlayers") {
  519 + i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.tabela.atualizaListaDeRegistros()");
560 520 }
561   - };
562   - YAHOO.util.Event.addListener(
  521 + if (i3GEO.Interface.ATUAL === "googlemaps") {
  522 + google.maps.event.removeListener(tabelaDragend);
  523 + google.maps.event.removeListener(tabelaZoomend);
  524 + }
  525 + if (i3GEO.Interface.ATUAL === "googleearth") {
  526 + google.earth.removeEventListener(tabelaDragend);
  527 + }
  528 + }
  529 + };
  530 + YAHOO.util.Event.addListener(
563 531 janela[0].close,
564 532 "click",
565 533 temp);
566   - },
567   - atualizaCombosCabecalhos : function() {
568   - var i, id, n = i3GEOF.tabela.janelas.length;
569   - for (i = 0; i < n; i++) {
570   - id = i3GEOF.tabela.janelas[i];
571   - i3GEO.janela.comboCabecalhoTemas(
572   - id + "i3GEOFtabelaComboCabeca",
573   - id + "i3GEOFtabelaComboCabecaSel",
  534 + },
  535 + atualizaCombosCabecalhos : function() {
  536 + var i, id, n = i3GEOF.tabela.janelas.length;
  537 + for (i = 0; i < n; i++) {
  538 + id = i3GEOF.tabela.janelas[i];
  539 + i3GEO.janela.comboCabecalhoTemas(
  540 + id
  541 + + "i3GEOFtabelaComboCabeca",
  542 + id
  543 + + "i3GEOFtabelaComboCabecaSel",
574 544 "tabela",
575 545 "ligadosComTabela");
576   - }
577   - },
578   - /*
579   - * Function: ativaFoco
580   - *
581   - * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado
582   - */
583   - ativaFoco : function(id) {
584   - if (i3GEOF.tabela.propJanelas[id].tema !== "" && i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.tabela.propJanelas[id].tema) === "") {
585   - i3GEO.janela.tempoMsg($trad(
  546 + }
  547 + },
  548 + /*
  549 + * Function: ativaFoco
  550 + *
  551 + * Refaz a interface da ferramenta quando a janela flutuante tem seu foco
  552 + * ativado
  553 + */
  554 + ativaFoco : function(id) {
  555 + if (i3GEOF.tabela.propJanelas[id].tema !== ""
  556 + && i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.tabela.propJanelas[id].tema) === "") {
  557 + i3GEO.janela.tempoMsg($trad(
586 558 30,
587 559 i3GEOF.tabela.dicionario));
588   - }
589   - var i = $i(id + "_c").style;
590   - i3GEO.janela.ULTIMOZINDEX++;
591   - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX;
592   - },
593   - vinculos : {
594   - ligacoes : [],
595   - iniciaJanelaFlutuante : function() {
596   - var janela, titulo;
597   - // cria a janela flutuante
598   - titulo =
599   - "&nbsp;&nbsp;&nbsp;" + $trad(
600   - 44,
601   - i3GEOF.tabela.dicionario) + " <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic +
602   - "/ajuda_usuario.php?idcategoria=5&idajuda=120' >&nbsp;&nbsp;&nbsp;</a>";
603   - janela = i3GEO.janela.cria(
  560 + }
  561 + var i = $i(id
  562 + + "_c").style;
  563 + i3GEO.janela.ULTIMOZINDEX++;
  564 + i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX;
  565 + },
  566 + vinculos : {
  567 + ligacoes : [],
  568 + iniciaJanelaFlutuante : function() {
  569 + var janela, titulo;
  570 + // cria a janela flutuante
  571 + titulo = "&nbsp;&nbsp;&nbsp;"
  572 + + $trad(
  573 + 44,
  574 + i3GEOF.tabela.dicionario)
  575 + + " <a class=ajuda_usuario target=_blank href='"
  576 + + i3GEO.configura.locaplic
  577 + + "/ajuda_usuario.php?idcategoria=5&idajuda=120' >&nbsp;&nbsp;&nbsp;</a>";
  578 + janela = i3GEO.janela.cria(
604 579 "300px",
605 580 "300px",
606 581 "",
... ... @@ -614,49 +589,63 @@ i3GEOF.tabela =
614 589 "",
615 590 "",
616 591 true,
617   - i3GEO.configura.locaplic + "/imagens/oxygen/16x16/edit-table-cell-merge.png");
618   - divid = janela[2].id;
619   - if (i3GEOF.tabela.janelas.length > 1) {
620   - temp = janela[0].cfg.config;
621   - janela[0].moveTo(
622   - temp.x.value + (i3GEOF.tabela.janelas.length * 50),
623   - temp.y.value + (i3GEOF.tabela.janelas.length * 15));
624   - }
625   - $i("i3GEOFtabelaVinculos_corpo").style.backgroundColor = "white";
626   - i3GEOF.tabela.vinculos.inicia();
627   - },
628   - html : function() {
629   - var ins =
630   - "" + " <fieldset class=subbloco >" + " <p class=paragrafo >" + $trad(
631   - 45,
632   - i3GEOF.tabela.dicionario) + "<br>" + i3GEOF.tabela.comboJanelas(
633   - "i3GEOFTabelaOpcoesAdicionaVinculoT1",
634   - "i3GEOF.tabela.vinculos.comboColunasT1()") +
635   - " <div id=i3GEOFTabelaVinculoT1Colunas style=position:relative;left:10px ></div>" + " <p class=paragrafo >" +
636   - $trad(
  592 + i3GEO.configura.locaplic
  593 + + "/imagens/oxygen/16x16/edit-table-cell-merge.png");
  594 + divid = janela[2].id;
  595 + if (i3GEOF.tabela.janelas.length > 1) {
  596 + temp = janela[0].cfg.config;
  597 + janela[0].moveTo(
  598 + temp.x.value
  599 + + (i3GEOF.tabela.janelas.length * 50),
  600 + temp.y.value
  601 + + (i3GEOF.tabela.janelas.length * 15));
  602 + }
  603 + $i("i3GEOFtabelaVinculos_corpo").style.backgroundColor = "white";
  604 + i3GEOF.tabela.vinculos.inicia();
  605 + },
  606 + html : function() {
  607 + var ins = ""
  608 + + " <fieldset class=subbloco >"
  609 + + " <p class=paragrafo >"
  610 + + $trad(
  611 + 45,
  612 + i3GEOF.tabela.dicionario)
  613 + + "<br>"
  614 + + i3GEOF.tabela.comboJanelas(
  615 + "i3GEOFTabelaOpcoesAdicionaVinculoT1",
  616 + "i3GEOF.tabela.vinculos.comboColunasT1()")
  617 + + " <div id=i3GEOFTabelaVinculoT1Colunas style=position:relative;left:10px ></div>"
  618 + + " <p class=paragrafo >"
  619 + + $trad(
637 620 46,
638   - i3GEOF.tabela.dicionario) + "<br>" + i3GEOF.tabela.comboJanelas(
  621 + i3GEOF.tabela.dicionario)
  622 + + "<br>"
  623 + + i3GEOF.tabela.comboJanelas(
639 624 "i3GEOFTabelaOpcoesAdicionaVinculoT2",
640   - "i3GEOF.tabela.vinculos.comboColunasT2()") +
641   - " <div id=i3GEOFTabelaVinculoT2Colunas style=position:relative;left:10px ></div>" +
642   - " <p class=paragrafo ><input id=i3GEOFTabelaVinculoBotaoCriar size=25 type=button value='" + $trad(
  625 + "i3GEOF.tabela.vinculos.comboColunasT2()")
  626 + + " <div id=i3GEOFTabelaVinculoT2Colunas style=position:relative;left:10px ></div>"
  627 + + " <p class=paragrafo ><input id=i3GEOFTabelaVinculoBotaoCriar size=25 type=button value='"
  628 + + $trad(
643 629 47,
644   - i3GEOF.tabela.dicionario) + "' /></p>" + " </fieldset>" +
645   - " <fieldset class=subbloco id=i3GEOFtabelaVinculosLista >" + " </fieldset>";
646   - return ins;
647   - },
648   - inicia : function() {
649   - $i("i3GEOFtabelaVinculos_corpo").innerHTML = i3GEOF.tabela.vinculos.html();
650   - new YAHOO.widget.Button(
  630 + i3GEOF.tabela.dicionario)
  631 + + "' /></p>"
  632 + + " </fieldset>"
  633 + + " <fieldset class=subbloco id=i3GEOFtabelaVinculosLista >"
  634 + + " </fieldset>";
  635 + return ins;
  636 + },
  637 + inicia : function() {
  638 + $i("i3GEOFtabelaVinculos_corpo").innerHTML = i3GEOF.tabela.vinculos.html();
  639 + new YAHOO.widget.Button(
651 640 "i3GEOFTabelaVinculoBotaoCriar",
652 641 {
653 642 onclick : {
654 643 fn : function() {
655   - var t1 = $i("i3GEOFTabelaOpcoesAdicionaVinculoT1").value, t2 =
656   - $i("i3GEOFTabelaOpcoesAdicionaVinculoT2").value, c1 =
657   - $i("i3GEOFTabelaOpcoesAdicionaVinculoColunaT1").value, c2 =
658   - $i("i3GEOFTabelaOpcoesAdicionaVinculoColunaT1").value;
659   - if (t1 != "" && t2 != "" && c1 != "" && c2 != "") {
  644 + var t1 = $i("i3GEOFTabelaOpcoesAdicionaVinculoT1").value, t2 = $i("i3GEOFTabelaOpcoesAdicionaVinculoT2").value, c1 = $i("i3GEOFTabelaOpcoesAdicionaVinculoColunaT1").value, c2 = $i("i3GEOFTabelaOpcoesAdicionaVinculoColunaT1").value;
  645 + if (t1 != ""
  646 + && t2 != ""
  647 + && c1 != ""
  648 + && c2 != "") {
660 649 i3GEOF.tabela.vinculos.ligacoes.push({
661 650 "t1" : t1,
662 651 "t2" : t2,
... ... @@ -668,737 +657,930 @@ i3GEOF.tabela =
668 657 }
669 658 }
670 659 });
671   - i3GEOF.tabela.vinculos.lista();
672   - },
673   - comboColunasT1 : function() {
674   - var colunas = i3GEOF.tabela.comboColunas(
  660 + i3GEOF.tabela.vinculos.lista();
  661 + },
  662 + comboColunasT1 : function() {
  663 + var colunas = i3GEOF.tabela.comboColunas(
675 664 $i("i3GEOFTabelaOpcoesAdicionaVinculoT1").value,
676 665 "i3GEOFTabelaOpcoesAdicionaVinculoColunaT1"), ins = "";
677   - ins = " <p class=paragrafo >" + $trad(
678   - 48,
679   - i3GEOF.tabela.dicionario) + "<br>" + colunas;
680   - $i("i3GEOFTabelaVinculoT1Colunas").innerHTML = ins;
681   - },
682   - comboColunasT2 : function() {
683   - var colunas = i3GEOF.tabela.comboColunas(
  666 + ins = " <p class=paragrafo >"
  667 + + $trad(
  668 + 48,
  669 + i3GEOF.tabela.dicionario)
  670 + + "<br>"
  671 + + colunas;
  672 + $i("i3GEOFTabelaVinculoT1Colunas").innerHTML = ins;
  673 + },
  674 + comboColunasT2 : function() {
  675 + var colunas = i3GEOF.tabela.comboColunas(
684 676 $i("i3GEOFTabelaOpcoesAdicionaVinculoT2").value,
685 677 "i3GEOFTabelaOpcoesAdicionaVinculoColunaT2"), ins = "";
686   - ins = " <p class=paragrafo >" + $trad(
687   - 48,
688   - i3GEOF.tabela.dicionario) + "<br>" + colunas;
689   - $i("i3GEOFTabelaVinculoT2Colunas").innerHTML = ins;
690   - },
691   - lista : function() {
692   - var v = i3GEOF.tabela.vinculos.ligacoes, n = v.length, ins = "<p class=paragrafo ><b>" + $trad(
693   - 44,
694   - i3GEOF.tabela.dicionario) + "</b></p>", i;
695   - for (i = 0; i < n; i++) {
696   - ins +=
697   - "<p class=paragrafo ><img style='cursor:pointer;float:left;' src='" + i3GEO.configura.locaplic +
698   - "/imagens/oxygen/16x16/edit-delete.png' title='excluir' onclick='i3GEOF.tabela.vinculos.excluir(\"" + i +
699   - "\")' />" + v[i].t1 + " " + v[i].c1 + " -> " + v[i].t2 + " " + v[i].c2 + "<p>";
700   - }
701   - $i("i3GEOFtabelaVinculosLista").innerHTML = ins;
702   - },
703   - excluir : function(i) {
704   - i3GEOF.tabela.vinculos.ligacoes.splice(
  678 + ins = " <p class=paragrafo >"
  679 + + $trad(
  680 + 48,
  681 + i3GEOF.tabela.dicionario)
  682 + + "<br>"
  683 + + colunas;
  684 + $i("i3GEOFTabelaVinculoT2Colunas").innerHTML = ins;
  685 + },
  686 + lista : function() {
  687 + var v = i3GEOF.tabela.vinculos.ligacoes, n = v.length, ins = "<p class=paragrafo ><b>"
  688 + + $trad(
  689 + 44,
  690 + i3GEOF.tabela.dicionario)
  691 + + "</b></p>", i;
  692 + for (i = 0; i < n; i++) {
  693 + ins += "<p class=paragrafo ><img style='cursor:pointer;float:left;' src='"
  694 + + i3GEO.configura.locaplic
  695 + + "/imagens/oxygen/16x16/edit-delete.png' title='excluir' onclick='i3GEOF.tabela.vinculos.excluir(\""
  696 + + i
  697 + + "\")' />"
  698 + + v[i].t1
  699 + + " "
  700 + + v[i].c1
  701 + + " -> "
  702 + + v[i].t2
  703 + + " "
  704 + + v[i].c2
  705 + + "<p>";
  706 + }
  707 + $i("i3GEOFtabelaVinculosLista").innerHTML = ins;
  708 + },
  709 + excluir : function(i) {
  710 + i3GEOF.tabela.vinculos.ligacoes.splice(
705 711 parseInt(
706   - i,
707   - 10),
  712 + i,
  713 + 10),
708 714 1);
709   - i3GEOF.tabela.vinculos.lista();
710   - },
711   - atualizaVinculos : function(tabelaOrigem, registro, marcado) {
712   - var v = i3GEOF.tabela.vinculos.ligacoes, n = v.length, i, valor;
713   - if (n > 0) {
714   - for (i = 0; i < n; i++) {
715   - // verifica se o vinculo existe
716   - if (v[i].t1 === tabelaOrigem) {
717   - // pega o valor do registro na tabela origem
718   - valor = i3GEOF.tabela.vinculos.pegaValorRegistro(
  715 + i3GEOF.tabela.vinculos.lista();
  716 + },
  717 + atualizaVinculos : function(tabelaOrigem, registro, marcado) {
  718 + var v = i3GEOF.tabela.vinculos.ligacoes, n = v.length, i, valor;
  719 + if (n > 0) {
  720 + for (i = 0; i < n; i++) {
  721 + // verifica se o vinculo existe
  722 + if (v[i].t1 === tabelaOrigem) {
  723 + // pega o valor do registro na tabela origem
  724 + valor = i3GEOF.tabela.vinculos.pegaValorRegistro(
719 725 v[i].t1,
720 726 v[i].c1,
721 727 registro);
722   - // marca o registro na tabela destino
723   - i3GEOF.tabela.vinculos.registro(
  728 + // marca o registro na tabela destino
  729 + i3GEOF.tabela.vinculos.registro(
724 730 v[i].t2,
725 731 v[i].c2,
726 732 valor,
727 733 marcado);
728   - }
729   - if (v[i].t2 === tabelaOrigem) {
730   - // pega o valor do registro na tabela origem
731   - valor = i3GEOF.tabela.vinculos.pegaValorRegistro(
  734 + }
  735 + if (v[i].t2 === tabelaOrigem) {
  736 + // pega o valor do registro na tabela origem
  737 + valor = i3GEOF.tabela.vinculos.pegaValorRegistro(
732 738 v[i].t2,
733 739 v[i].c2,
734 740 registro);
735   - // marca o registro na tabela destino
736   - i3GEOF.tabela.vinculos.registro(
  741 + // marca o registro na tabela destino
  742 + i3GEOF.tabela.vinculos.registro(
737 743 v[i].t1,
738 744 v[i].c1,
739 745 valor,
740 746 marcado);
741   - }
742   - }
743   - }
744   - },
745   - // verifica qtas colunas devem ser puladas em cada linha
746   - colunasVazias : function(idjanela) {
747   - var tabela = $i(idjanela + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), pular = 0, colunas, n, i;
748   - colunas = linhas[0].getElementsByTagName("td");
749   - n = colunas.length;
750   - for (i = 0; i < n; i++) {
751   - if (colunas[i].innerHTML == "") {
752   - pular++;
753   - }
754   - }
755   - return pular;
756   - },
757   - // pega o indice de uma coluna em uma tabela buscando no cabecalho
758   - // no valor de title em cada celula
759   - indiceColuna : function(idjanela, t) {
760   - var tabela = $i(idjanela + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), linha = linhas[0], colunas =
761   - linha.getElementsByTagName("td"), indice = 0, n = colunas.length, i, s;
762   - for (i = 0; i < n; i++) {
763   - s = colunas[i].getElementsByTagName("span");
764   - if (s && s[0] && s[0].title && s[0].title == t) {
765   - return i;
766   - }
767   - }
768   - return indice;
769   - },
770   - // retorna o indice de uma coluna que contem a tag input na tabela
771   - // com a lista de valores
772   - indiceColunaInput : function(idjanela) {
773   - var tabela = $i(idjanela + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), linha = linhas[1], colunas =
774   - linha.getElementsByTagName("td"), indice = 0, n = colunas.length, i;
775   - for (i = 0; i < n; i++) {
776   - if (colunas[i].getElementsByTagName("input").length > 0) {
777   - return i;
778   - }
779   - }
780   - return indice;
781   - },
782   - // pega o valor da coluna em uma tabela com a lista de valores com
783   - // base no codigo do registro
784   - pegaValorRegistro : function(idjanela, coluna, registro) {
785   - var tabela = $i(idjanela + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), n = linhas.length, indiceColuna =
786   - i3GEOF.tabela.vinculos.indiceColuna(
787   - idjanela,
788   - coluna), indiceColunaInput = i3GEOF.tabela.vinculos.indiceColunaInput(idjanela), i, linha, colunas;
789   - for (i = 1; i < n; i++) {
790   - linha = linhas[i];
791   - colunas = linha.getElementsByTagName("td");
792   - if (colunas[indiceColunaInput].getElementsByTagName("input")[0].name == registro) {
793   - return colunas[indiceColuna].innerHTML;
794 747 }
795 748 }
796   - return "";
797   - },
798   - registro : function(idjanela, coluna, valor, marcado) {
799   - var tabela = $i(idjanela + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), n = linhas.length, indiceColuna =
800   - i3GEOF.tabela.vinculos.indiceColuna(
801   - idjanela,
802   - coluna), indiceColunaInput = i3GEOF.tabela.vinculos.indiceColunaInput(idjanela), i, linha, colunas, reg;
803   - for (i = 1; i < n; i++) {
804   - linha = linhas[i];
805   - colunas = linha.getElementsByTagName("td");
806   - if (colunas[indiceColuna].innerHTML == valor) {
807   - reg = colunas[indiceColunaInput].getElementsByTagName("input")[0];
808   - reg.checked = marcado;
809   - i3GEOF.tabela.propJanelas[idjanela].registros[reg.name] = marcado;
810   - }
811   - }
812   - },
813   - },
814   - comboJanelas : function(idcombo, funcao, w) {
815   - var i, n = i3GEOF.tabela.janelas.length;
816   - if (!funcao) {
817   - funcao = "";
818 749 }
819   - if (!w) {
820   - w = 260;
821   - }
822   - ins =
823   - "" + " <select style='width:" + w + "px;' id='" + idcombo + "' onchange='" + funcao + "'>" +
824   - " <option value='' >---</option>";
  750 + },
  751 + // verifica qtas colunas devem ser puladas em cada linha
  752 + colunasVazias : function(idjanela) {
  753 + var tabela = $i(idjanela
  754 + + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), pular = 0, colunas, n, i;
  755 + colunas = linhas[0].getElementsByTagName("td");
  756 + n = colunas.length;
825 757 for (i = 0; i < n; i++) {
826   - ins += "<option value='" + i3GEOF.tabela.janelas[i] + "' >" + i3GEOF.tabela.janelas[i] + "</option>";
  758 + if (colunas[i].innerHTML == "") {
  759 + pular++;
  760 + }
827 761 }
828   - ins += "</select>";
829   - return ins;
  762 + return pular;
830 763 },
831   - comboColunas : function(idJanela, idcombo, funcao, w) {
832   - var i, c = i3GEOF.tabela.propJanelas[idJanela].colunas, n = c.itens.length;
833   - if (!funcao) {
834   - funcao = "";
835   - }
836   - if (!w) {
837   - w = 250;
838   - }
839   - ins =
840   - "" + " <select style='width:" + w + "px;' id='" + idcombo + "' onchange='" + funcao + "'>" +
841   - " <option value='' >---</option>";
  764 + // pega o indice de uma coluna em uma tabela buscando no cabecalho
  765 + // no valor de title em cada celula
  766 + indiceColuna : function(idjanela, t) {
  767 + var tabela = $i(idjanela
  768 + + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), linha = linhas[0], colunas = linha.getElementsByTagName("td"), indice = 0, n = colunas.length, i, s;
842 769 for (i = 0; i < n; i++) {
843   - ins += "<option value='" + c.itens[i] + "' >" + c.alias[i] + "</option>";
  770 + s = colunas[i].getElementsByTagName("span");
  771 + if (s
  772 + && s[0]
  773 + && s[0].title
  774 + && s[0].title == t) {
  775 + return i;
  776 + }
844 777 }
845   - ins += "</select>";
846   - return ins;
  778 + return indice;
847 779 },
848   - /*
849   - * Function: ativaAutoAtualiza
850   - *
851   - * Ativa ou desativa a atualiza&ccedil;&atilde;o autom&aacute;tica da tabela quando o usu&aacute;rio navega no mapa
852   - */
853   - atualizaListaDeRegistros : function() {
854   - var i, janelas = i3GEOF.tabela.janelas, propJanelas = i3GEOF.tabela.propJanelas, n = janelas.length;
  780 + // retorna o indice de uma coluna que contem a tag input na tabela
  781 + // com a lista de valores
  782 + indiceColunaInput : function(idjanela) {
  783 + var tabela = $i(idjanela
  784 + + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), linha = linhas[1], colunas = linha.getElementsByTagName("td"), indice = 0, n = colunas.length, i;
855 785 for (i = 0; i < n; i++) {
856   - if (propJanelas[janelas[i]].atualiza === true) {
857   - i3GEOF.tabela.pegaRegistros(janelas[i]);
  786 + if (colunas[i].getElementsByTagName("input").length > 0) {
  787 + return i;
858 788 }
859 789 }
  790 + return indice;
860 791 },
861   - /*
862   - * Function: pegaRegistros
863   - *
864   - * Pega os registros da tabela de atributos do tema
865   - *
866   - * Veja:
867   - *
868   - * <LISTAREGISTROS>
869   - */
870   - pegaRegistros : function(idjanela, tipolista, dadosDaClasse, inicio, fim, funcao) {
871   - if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
872   - return;
873   - }
874   - if (!idjanela) {
875   - idjanela = "";
876   - }
877   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
878   - $i(idjanela + "i3GEOtabelaregistros").innerHTML = "";
879   - var p, ext, tiporeg = "brasil", cp = new cpaint();
880   - // verifica se esta no modo de atualizacao automatica
881   - if (i3GEOF.tabela.propJanelas[idjanela].atualiza === true) {
882   - tiporeg = "mapa";
883   - }
884   - if (!tipolista) {
885   - if ($i(idjanela + "i3GEOtabelatipolista").checked) {
886   - tipolista = "selecionados";
887   - } else {
888   - tipolista = "tudo";
  792 + // pega o valor da coluna em uma tabela com a lista de valores com
  793 + // base no codigo do registro
  794 + pegaValorRegistro : function(idjanela, coluna, registro) {
  795 + var tabela = $i(idjanela
  796 + + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), n = linhas.length, indiceColuna = i3GEOF.tabela.vinculos.indiceColuna(
  797 + idjanela,
  798 + coluna), indiceColunaInput = i3GEOF.tabela.vinculos.indiceColunaInput(idjanela), i, linha, colunas;
  799 + for (i = 1; i < n; i++) {
  800 + linha = linhas[i];
  801 + colunas = linha.getElementsByTagName("td");
  802 + if (colunas[indiceColunaInput].getElementsByTagName("input")[0].name == registro) {
  803 + return colunas[indiceColuna].innerHTML;
889 804 }
890 805 }
891   - if (!dadosDaClasse) {
892   - if ($i(idjanela + "i3GEOtabelalegenda").checked) {
893   - dadosDaClasse = "sim";
894   - } else {
895   - dadosDaClasse = "nao";
  806 + return "";
  807 + },
  808 + registro : function(idjanela, coluna, valor, marcado) {
  809 + var tabela = $i(idjanela
  810 + + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), n = linhas.length, indiceColuna = i3GEOF.tabela.vinculos.indiceColuna(
  811 + idjanela,
  812 + coluna), indiceColunaInput = i3GEOF.tabela.vinculos.indiceColunaInput(idjanela), i, linha, colunas, reg;
  813 + for (i = 1; i < n; i++) {
  814 + linha = linhas[i];
  815 + colunas = linha.getElementsByTagName("td");
  816 + if (colunas[indiceColuna].innerHTML == valor) {
  817 + reg = colunas[indiceColunaInput].getElementsByTagName("input")[0];
  818 + reg.checked = marcado;
  819 + i3GEOF.tabela.propJanelas[idjanela].registros[reg.name] = marcado;
896 820 }
897 821 }
898   - if (!inicio) {
899   - inicio = $i(idjanela + "i3GEOtabelainicio").value - 1;
  822 + },
  823 + },
  824 + comboJanelas : function(idcombo, funcao, w) {
  825 + var i, n = i3GEOF.tabela.janelas.length;
  826 + if (!funcao) {
  827 + funcao = "";
  828 + }
  829 + if (!w) {
  830 + w = 260;
  831 + }
  832 + ins = ""
  833 + + " <select style='width:"
  834 + + w
  835 + + "px;' id='"
  836 + + idcombo
  837 + + "' onchange='"
  838 + + funcao
  839 + + "'>"
  840 + + " <option value='' >---</option>";
  841 + for (i = 0; i < n; i++) {
  842 + ins += "<option value='"
  843 + + i3GEOF.tabela.janelas[i]
  844 + + "' >"
  845 + + i3GEOF.tabela.janelas[i]
  846 + + "</option>";
  847 + }
  848 + ins += "</select>";
  849 + return ins;
  850 + },
  851 + comboColunas : function(idJanela, idcombo, funcao, w) {
  852 + var i, c = i3GEOF.tabela.propJanelas[idJanela].colunas, n = c.itens.length;
  853 + if (!funcao) {
  854 + funcao = "";
  855 + }
  856 + if (!w) {
  857 + w = 250;
  858 + }
  859 + ins = ""
  860 + + " <select style='width:"
  861 + + w
  862 + + "px;' id='"
  863 + + idcombo
  864 + + "' onchange='"
  865 + + funcao
  866 + + "'>"
  867 + + " <option value='' >---</option>";
  868 + for (i = 0; i < n; i++) {
  869 + ins += "<option value='"
  870 + + c.itens[i]
  871 + + "' >"
  872 + + c.alias[i]
  873 + + "</option>";
  874 + }
  875 + ins += "</select>";
  876 + return ins;
  877 + },
  878 + /*
  879 + * Function: ativaAutoAtualiza
  880 + *
  881 + * Ativa ou desativa a atualiza&ccedil;&atilde;o autom&aacute;tica da tabela
  882 + * quando o usu&aacute;rio navega no mapa
  883 + */
  884 + atualizaListaDeRegistros : function() {
  885 + var i, janelas = i3GEOF.tabela.janelas, propJanelas = i3GEOF.tabela.propJanelas, n = janelas.length;
  886 + for (i = 0; i < n; i++) {
  887 + if (propJanelas[janelas[i]].atualiza === true) {
  888 + i3GEOF.tabela.pegaRegistros(janelas[i]);
  889 + }
  890 + }
  891 + },
  892 + /*
  893 + * Function: pegaRegistros
  894 + *
  895 + * Pega os registros da tabela de atributos do tema
  896 + *
  897 + * Veja:
  898 + *
  899 + * <LISTAREGISTROS>
  900 + */
  901 + pegaRegistros : function(idjanela, tipolista, dadosDaClasse, inicio, fim, funcao) {
  902 + if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
  903 + return;
  904 + }
  905 + if (!idjanela) {
  906 + idjanela = "";
  907 + }
  908 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
  909 + $i(idjanela
  910 + + "i3GEOtabelaregistros").innerHTML = "";
  911 + var p, ext, tiporeg = "brasil", cp = new cpaint();
  912 + // verifica se esta no modo de atualizacao automatica
  913 + if (i3GEOF.tabela.propJanelas[idjanela].atualiza === true) {
  914 + tiporeg = "mapa";
  915 + }
  916 + if (!tipolista) {
  917 + if ($i(idjanela
  918 + + "i3GEOtabelatipolista").checked) {
  919 + tipolista = "selecionados";
900 920 } else {
901   - inicio = "";
  921 + tipolista = "tudo";
902 922 }
903   - if (!fim) {
904   - fim = $i(idjanela + "i3GEOtabelafim").value - 1;
  923 + }
  924 + if (!dadosDaClasse) {
  925 + if ($i(idjanela
  926 + + "i3GEOtabelalegenda").checked) {
  927 + dadosDaClasse = "sim";
905 928 } else {
906   - fim = "";
  929 + dadosDaClasse = "nao";
907 930 }
908   - if (!funcao) {
909   - funcao = function(retorno) {
910   - i3GEOF.tabela.propJanelas[idjanela].registros = [];
911   - i3GEOF.tabela.montaTabela(
  931 + }
  932 + if (!inicio) {
  933 + inicio = $i(idjanela
  934 + + "i3GEOtabelainicio").value - 1;
  935 + } else {
  936 + inicio = "";
  937 + }
  938 + if (!fim) {
  939 + fim = $i(idjanela
  940 + + "i3GEOtabelafim").value - 1;
  941 + } else {
  942 + fim = "";
  943 + }
  944 + if (!funcao) {
  945 + funcao = function(retorno) {
  946 + i3GEOF.tabela.propJanelas[idjanela].registros = [];
  947 + i3GEOF.tabela.montaTabela(
912 948 retorno,
913 949 idjanela);
914   - };
915   - }
916   - ext = i3GEO.parametros.mapexten;
917   - ext = i3GEO.util.extOSM2Geo(ext);
918   - p =
919   - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid + "&funcao=listaregistros" +
920   - "&inicio=" + inicio + "&fim=" + fim + "&tema=" + i3GEOF.tabela.propJanelas[idjanela].tema + "&tipo=" + tiporeg +
921   - "&tipolista=" + tipolista + "&ext=" + ext + "&dadosDaClasse=" + dadosDaClasse;
922   - cp.set_response_type("JSON");
923   - cp.call(
  950 + };
  951 + }
  952 + ext = i3GEO.parametros.mapexten;
  953 + ext = i3GEO.util.extOSM2Geo(ext);
  954 + p = i3GEO.configura.locaplic
  955 + + "/classesphp/mapa_controle.php?g_sid="
  956 + + i3GEO.configura.sid
  957 + + "&funcao=listaregistros"
  958 + + "&inicio="
  959 + + inicio
  960 + + "&fim="
  961 + + fim
  962 + + "&tema="
  963 + + i3GEOF.tabela.propJanelas[idjanela].tema
  964 + + "&tipo="
  965 + + tiporeg
  966 + + "&tipolista="
  967 + + tipolista
  968 + + "&ext="
  969 + + ext
  970 + + "&dadosDaClasse="
  971 + + dadosDaClasse;
  972 + cp.set_response_type("JSON");
  973 + cp.call(
924 974 p,
925 975 "listaRegistros",
926 976 funcao);
927   - },
928   - /*
929   - * Function: montaTabela
930   - *
931   - * Monta a visualiza&ccedil;&atilde;o da tabela de atributos
932   - */
933   - montaTabela : function(retorno, idjanela) {
934   - if (retorno.data !== undefined) {
935   - var ins, i, vals, cor, j, n, stat, imagem, registros = i3GEOF.tabela.propJanelas[idjanela].registros, i3GEOtabelalegenda =
936   - $i(idjanela + "i3GEOtabelalegenda").checked;
937   - // cabecalho da tabela
938   - ins = "<table id=" + idjanela + "i3GEOtabelatabelai class=lista8 >";
939   - ins +=
940   - "<tr><td style='background-color:yellow'></td><td style='background-color:yellow'></td><td style='background-color:yellow'></td><td style='background-color:yellow'></td>";
941   - i3GEOF.tabela.propJanelas[idjanela].colunas = {
942   - "itens" : retorno.data[0].itens,
943   - "alias" : retorno.data[0].alias
944   - };
945   - n = retorno.data[0].itens.length;
946   - for (i = 0; i < n; i++) {
947   - ins +=
948   - "<td accessKey='" + (i * 1 + 4) + "' style='background-color:yellow' >" +
949   - "<img style=cursor:pointer onclick='i3GEOF.tabela.excluiColuna(this," + (i * 1 + 4) + ",\"" + idjanela +
950   - "\")' src='" + i3GEO.configura.locaplic + "/imagens/x.gif' title='" + $trad("t12") + "' />&nbsp;" +
951   - "<img style=cursor:pointer onclick='i3GEOF.tabela.ordenaColuna(this," + (i * 1 + 4) + ",\"" + idjanela +
952   - "\")' src='" + i3GEO.configura.locaplic + "/imagens/ordena1.gif' title='" + $trad(
  977 + },
  978 + /*
  979 + * Function: montaTabela
  980 + *
  981 + * Monta a visualiza&ccedil;&atilde;o da tabela de atributos
  982 + */
  983 + montaTabela : function(retorno, idjanela) {
  984 + if (retorno.data !== undefined) {
  985 + var ins, i, vals, cor, j, n, stat, imagem, registros = i3GEOF.tabela.propJanelas[idjanela].registros, i3GEOtabelalegenda = $i(idjanela
  986 + + "i3GEOtabelalegenda").checked;
  987 + // cabecalho da tabela
  988 + ins = "<table id="
  989 + + idjanela
  990 + + "i3GEOtabelatabelai class=lista8 >";
  991 + ins += "<tr><td style='background-color:yellow'></td><td style='background-color:yellow'></td><td style='background-color:yellow'></td><td style='background-color:yellow'></td>";
  992 + i3GEOF.tabela.propJanelas[idjanela].colunas = {
  993 + "itens" : retorno.data[0].itens,
  994 + "alias" : retorno.data[0].alias
  995 + };
  996 + n = retorno.data[0].itens.length;
  997 + for (i = 0; i < n; i++) {
  998 + ins += "<td accessKey='"
  999 + + (i * 1 + 4)
  1000 + + "' style='background-color:yellow' >"
  1001 + + "<img style=cursor:pointer onclick='i3GEOF.tabela.excluiColuna(this,"
  1002 + + (i * 1 + 4)
  1003 + + ",\""
  1004 + + idjanela
  1005 + + "\")' src='"
  1006 + + i3GEO.configura.locaplic
  1007 + + "/imagens/x.gif' title='"
  1008 + + $trad("t12")
  1009 + + "' />&nbsp;"
  1010 + + "<img style=cursor:pointer onclick='i3GEOF.tabela.ordenaColuna(this,"
  1011 + + (i * 1 + 4)
  1012 + + ",\""
  1013 + + idjanela
  1014 + + "\")' src='"
  1015 + + i3GEO.configura.locaplic
  1016 + + "/imagens/ordena1.gif' title='"
  1017 + + $trad(
953 1018 31,
954   - i3GEOF.tabela.dicionario) + "' /><br><span title='" + retorno.data[0].itens[i] + "'> <b>" +
955   - retorno.data[0].alias[i] + "</b></span></td>";
  1019 + i3GEOF.tabela.dicionario)
  1020 + + "' /><br><span title='"
  1021 + + retorno.data[0].itens[i]
  1022 + + "'> <b>"
  1023 + + retorno.data[0].alias[i]
  1024 + + "</b></span></td>";
  1025 + }
  1026 + ins += "</tr>";
  1027 + cor = "linha";
  1028 + n = retorno.data[1].registros.length;
  1029 + if ($i(idjanela
  1030 + + "i3GEOtabelafim").value === "") {
  1031 + $i(idjanela
  1032 + + "i3GEOtabelafim").value = n - 1;
  1033 + }
  1034 + for (i = 0; i < n; i++) {
  1035 + ins += "<tr><td><img style=cursor:pointer onclick='i3GEOF.tabela.excluiLinha(this,\""
  1036 + + idjanela
  1037 + + "\")' src='"
  1038 + + i3GEO.configura.locaplic
  1039 + + "/imagens/x.gif' title='"
  1040 + + $trad("t12")
  1041 + + "' /></td>";
  1042 + ins += "<td>";
  1043 + if (retorno.data[1].registros[i].ext
  1044 + && retorno.data[1].registros[i].ext != "") {
  1045 + ins += "<img style=cursor:pointer onclick='i3GEOF.tabela.zoomExt(\""
  1046 + + retorno.data[1].registros[i].ext
  1047 + + "\",\""
  1048 + + idjanela
  1049 + + "\")' src='"
  1050 + + i3GEO.configura.locaplic
  1051 + + "/imagens/o.gif' title='zoom' ids="
  1052 + + retorno.data[1].registros[i].indice
  1053 + + " />";
956 1054 }
957   - ins += "</tr>";
958   - cor = "linha";
959   - n = retorno.data[1].registros.length;
960   - if ($i(idjanela + "i3GEOtabelafim").value === "") {
961   - $i(idjanela + "i3GEOtabelafim").value = n - 1;
  1055 + ins += "</td>";
  1056 + stat = "";
  1057 + if (retorno.data[1].registros[i].status === "CHECKED") {
  1058 + stat = "CHECKED";
962 1059 }
963   - for (i = 0; i < n; i++) {
964   - ins +=
965   - "<tr><td><img style=cursor:pointer onclick='i3GEOF.tabela.excluiLinha(this,\"" + idjanela + "\")' src='" +
966   - i3GEO.configura.locaplic + "/imagens/x.gif' title='" + $trad("t12") + "' /></td>";
967   - ins += "<td>";
968   - if (retorno.data[1].registros[i].ext && retorno.data[1].registros[i].ext != "") {
969   - ins +=
970   - "<img style=cursor:pointer onclick='i3GEOF.tabela.zoomExt(\"" + retorno.data[1].registros[i].ext + "\",\"" +
971   - idjanela + "\")' src='" + i3GEO.configura.locaplic + "/imagens/o.gif' title='zoom' ids=" +
972   - retorno.data[1].registros[i].indice + " />";
973   - }
974   - ins += "</td>";
975   - stat = "";
976   - if (retorno.data[1].registros[i].status === "CHECKED") {
  1060 + if (registros[retorno.data[1].registros[i].indice]) {
  1061 + if (registros[retorno.data[1].registros[i].indice] === true) {
977 1062 stat = "CHECKED";
978   - }
979   - if (registros[retorno.data[1].registros[i].indice]) {
980   - if (registros[retorno.data[1].registros[i].indice] === true) {
981   - stat = "CHECKED";
982   - } else {
983   - stat = "";
984   - }
985   - }
986   - ins +=
987   - "<td><input title='marca' onclick='i3GEOF.tabela.registraLinha(this,\"" + idjanela +
988   - "\")' style='cursor:pointer;border:0px solid white;' type='checkbox' " + stat + " name=" +
989   - retorno.data[1].registros[i].indice + " /></td>";
990   - if (i3GEOtabelalegenda == true) {
991   - imagem = retorno.data.legenda[retorno.data[1].registros[i].classe["indice"]];
992   - ins += "<td><img title='" + retorno.data[1].registros[i].classe["nome"] + "' src='" + imagem + "' /></td>";
993 1063 } else {
994   - ins += "<td></td>";
995   - }
996   - if (stat === "CHECKED") {
997   - registros[retorno.data[1].registros[i].indice] = true;
998   - }
999   - vals = retorno.data[1].registros[i].valores;
1000   - for (j = 0; j < vals.length; j++) {
1001   - ins += "<td class='" + cor + "'>" + vals[j].valor + "</td>";
1002   - }
1003   - if (cor === "linha") {
1004   - cor = "linha1";
1005   - } else {
1006   - cor = "linha";
  1064 + stat = "";
1007 1065 }
1008 1066 }
1009   - $i(idjanela + "i3GEOtabelaregistros").innerHTML = ins;
1010   - }
1011   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
1012   - },
1013   - /*
1014   - * Function: mais
1015   - *
1016   - * Avan&ccedil;a o contador de registros para a listagem
1017   - */
1018   - mais : function(idjanela) {
1019   - if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
1020   - return;
1021   - }
1022   - var i = $i(idjanela + "i3GEOtabelainicio").value * 1, f = $i(idjanela + "i3GEOtabelafim").value * 1, d = f - i;
1023   - $i(idjanela + "i3GEOtabelainicio").value = f + 1;
1024   - $i(idjanela + "i3GEOtabelafim").value = f + d + 1;
1025   - i3GEOF.tabela.pegaRegistros(idjanela);
1026   - },
1027   - /*
1028   - * Function: todos
1029   - *
1030   - * Avan&ccedil;a o contador de registros para o fim da listagem
1031   - */
1032   - todos : function(idjanela) {
1033   - if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
1034   - return;
  1067 + ins += "<td><input title='marca' onclick='i3GEOF.tabela.registraLinha(this,\""
  1068 + + idjanela
  1069 + + "\")' style='cursor:pointer;border:0px solid white;' type='checkbox' "
  1070 + + stat
  1071 + + " name="
  1072 + + retorno.data[1].registros[i].indice
  1073 + + " /></td>";
  1074 + if (i3GEOtabelalegenda == true) {
  1075 + imagem = retorno.data.legenda[retorno.data[1].registros[i].classe["indice"]];
  1076 + ins += "<td><img title='"
  1077 + + retorno.data[1].registros[i].classe["nome"]
  1078 + + "' src='"
  1079 + + imagem
  1080 + + "' /></td>";
  1081 + } else {
  1082 + ins += "<td></td>";
  1083 + }
  1084 + if (stat === "CHECKED") {
  1085 + registros[retorno.data[1].registros[i].indice] = true;
  1086 + }
  1087 + vals = retorno.data[1].registros[i].valores;
  1088 + for (j = 0; j < vals.length; j++) {
  1089 + ins += "<td class='"
  1090 + + cor
  1091 + + "'>"
  1092 + + vals[j].valor
  1093 + + "</td>";
  1094 + }
  1095 + if (cor === "linha") {
  1096 + cor = "linha1";
  1097 + } else {
  1098 + cor = "linha";
  1099 + }
1035 1100 }
1036   - $i(idjanela + "i3GEOtabelainicio").value = 1;
1037   - $i(idjanela + "i3GEOtabelafim").value = "";
1038   - i3GEOF.tabela.pegaRegistros(
  1101 + $i(idjanela
  1102 + + "i3GEOtabelaregistros").innerHTML = ins;
  1103 + }
  1104 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
  1105 + },
  1106 + /*
  1107 + * Function: mais
  1108 + *
  1109 + * Avan&ccedil;a o contador de registros para a listagem
  1110 + */
  1111 + mais : function(idjanela) {
  1112 + if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
  1113 + return;
  1114 + }
  1115 + var i = $i(idjanela
  1116 + + "i3GEOtabelainicio").value * 1, f = $i(idjanela
  1117 + + "i3GEOtabelafim").value * 1, d = f
  1118 + - i;
  1119 + $i(idjanela
  1120 + + "i3GEOtabelainicio").value = f + 1;
  1121 + $i(idjanela
  1122 + + "i3GEOtabelafim").value = f
  1123 + + d
  1124 + + 1;
  1125 + i3GEOF.tabela.pegaRegistros(idjanela);
  1126 + },
  1127 + /*
  1128 + * Function: todos
  1129 + *
  1130 + * Avan&ccedil;a o contador de registros para o fim da listagem
  1131 + */
  1132 + todos : function(idjanela) {
  1133 + if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
  1134 + return;
  1135 + }
  1136 + $i(idjanela
  1137 + + "i3GEOtabelainicio").value = 1;
  1138 + $i(idjanela
  1139 + + "i3GEOtabelafim").value = "";
  1140 + i3GEOF.tabela.pegaRegistros(
1039 1141 idjanela,
1040 1142 false,
1041 1143 false,
1042 1144 false,
1043 1145 1,
1044 1146 true);
1045   - },
1046   - /*
1047   - * Function: menos
1048   - *
1049   - * Retrocede o contador de registros para a listagem
1050   - */
1051   - menos : function(idjanela) {
1052   - if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
1053   - return;
1054   - }
1055   - var i = $i(idjanela + "i3GEOtabelainicio").value * 1, f = $i(idjanela + "i3GEOtabelafim").value * 1, d = f - i;
1056   - $i(idjanela + "i3GEOtabelainicio").value = i - d - 1;
1057   - $i(idjanela + "i3GEOtabelafim").value = i - 1;
1058   - if ($i(idjanela + "i3GEOtabelainicio").value < 1) {
1059   - $i(idjanela + "i3GEOtabelainicio").value = 1;
1060   - $i(idjanela + "i3GEOtabelafim").value = 1 + d;
1061   - }
1062   - i3GEOF.tabela.pegaRegistros(idjanela);
1063   - },
1064   - /*
1065   - * Function: excluiColuna
1066   - *
1067   - * Exclui uma coluna da visualiza&ccedil;&atilde;o da tabela
1068   - */
1069   - excluiColuna : function(coluna, cid, idjanela) {
1070   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
1071   - try {
1072   - var tabela = $i(idjanela + "i3GEOtabelatabelai"), trs, tds, i, t, nt, ni;
1073   - // pega o indice correto
1074   - tds = coluna.parentNode.parentNode.getElementsByTagName("td");
1075   - nt = tds.length;
1076   - for (t = 0; t < nt; t++) {
1077   - if (tds[t].accessKey == cid) {
1078   - cid = t;
1079   - break;
1080   - }
1081   - }
1082   - trs = tabela.getElementsByTagName("tr");
1083   - nt = trs.length;
1084   - for (t = 0; t < nt; t++) {
1085   - i = trs[t];
1086   - if (i.getElementsByTagName("td")[cid]) {
1087   - ni = i.getElementsByTagName("td")[cid];
1088   - i.removeChild(ni);
1089   - }
  1147 + },
  1148 + /*
  1149 + * Function: menos
  1150 + *
  1151 + * Retrocede o contador de registros para a listagem
  1152 + */
  1153 + menos : function(idjanela) {
  1154 + if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
  1155 + return;
  1156 + }
  1157 + var i = $i(idjanela
  1158 + + "i3GEOtabelainicio").value * 1, f = $i(idjanela
  1159 + + "i3GEOtabelafim").value * 1, d = f
  1160 + - i;
  1161 + $i(idjanela
  1162 + + "i3GEOtabelainicio").value = i
  1163 + - d
  1164 + - 1;
  1165 + $i(idjanela
  1166 + + "i3GEOtabelafim").value = i - 1;
  1167 + if ($i(idjanela
  1168 + + "i3GEOtabelainicio").value < 1) {
  1169 + $i(idjanela
  1170 + + "i3GEOtabelainicio").value = 1;
  1171 + $i(idjanela
  1172 + + "i3GEOtabelafim").value = 1 + d;
  1173 + }
  1174 + i3GEOF.tabela.pegaRegistros(idjanela);
  1175 + },
  1176 + /*
  1177 + * Function: excluiColuna
  1178 + *
  1179 + * Exclui uma coluna da visualiza&ccedil;&atilde;o da tabela
  1180 + */
  1181 + excluiColuna : function(coluna, cid, idjanela) {
  1182 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
  1183 + try {
  1184 + var tabela = $i(idjanela
  1185 + + "i3GEOtabelatabelai"), trs, tds, i, t, nt, ni;
  1186 + // pega o indice correto
  1187 + tds = coluna.parentNode.parentNode.getElementsByTagName("td");
  1188 + nt = tds.length;
  1189 + for (t = 0; t < nt; t++) {
  1190 + if (tds[t].accessKey == cid) {
  1191 + cid = t;
  1192 + break;
1090 1193 }
1091   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
1092   - } catch (e) {
1093   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
1094   - if (typeof (console) !== 'undefined') {
1095   - console.error(e);
  1194 + }
  1195 + trs = tabela.getElementsByTagName("tr");
  1196 + nt = trs.length;
  1197 + for (t = 0; t < nt; t++) {
  1198 + i = trs[t];
  1199 + if (i.getElementsByTagName("td")[cid]) {
  1200 + ni = i.getElementsByTagName("td")[cid];
  1201 + i.removeChild(ni);
1096 1202 }
1097 1203 }
1098   - },
1099   - /*
1100   - * Function: ordenaColuna
1101   - *
1102   - * Ordena uma coluna da tabela
1103   - */
1104   - ordenaColuna : function(coluna, cid, idjanela) {
1105   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
1106   - try {
1107   - var tabela = $i(idjanela + "i3GEOtabelatabelai"), trs = tabela.getElementsByTagName("tr"), ntrs = trs.length, tds, nt, conta =
1108   - 0, psort = [], t, psortfim, npsortfim, ins, p, e;
1109   - // pega o indice correto
1110   - tds = coluna.parentNode.parentNode.getElementsByTagName("td");
1111   - nt = tds.length;
1112   - for (t = 0; t < nt; t++) {
1113   - if (tds[t].accessKey == cid) {
1114   - cid = t;
1115   - break;
1116   - }
  1204 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
  1205 + } catch (e) {
  1206 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
  1207 + if (typeof (console) !== 'undefined') {
  1208 + console.error(e);
  1209 + }
  1210 + }
  1211 + },
  1212 + /*
  1213 + * Function: ordenaColuna
  1214 + *
  1215 + * Ordena uma coluna da tabela
  1216 + */
  1217 + ordenaColuna : function(coluna, cid, idjanela) {
  1218 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
  1219 + try {
  1220 + var tabela = $i(idjanela
  1221 + + "i3GEOtabelatabelai"), trs = tabela.getElementsByTagName("tr"), ntrs = trs.length, tds, nt, conta = 0, psort = [], t, psortfim, npsortfim, ins, p, e;
  1222 + // pega o indice correto
  1223 + tds = coluna.parentNode.parentNode.getElementsByTagName("td");
  1224 + nt = tds.length;
  1225 + for (t = 0; t < nt; t++) {
  1226 + if (tds[t].accessKey == cid) {
  1227 + cid = t;
  1228 + break;
1117 1229 }
1118   - for (t = 0; t < ntrs; t++) {
1119   - if (t < ntrs) {
1120   - if (trs[t].childNodes[cid].innerHTML) {
1121   - if (trs[t].childNodes[cid].innerHTML !== "undefined") {
1122   - psort[conta] = trs[t].childNodes[cid].innerHTML + "+" + conta;
1123   - conta = conta + 1;
1124   - }
  1230 + }
  1231 + for (t = 0; t < ntrs; t++) {
  1232 + if (t < ntrs) {
  1233 + if (trs[t].childNodes[cid].innerHTML) {
  1234 + if (trs[t].childNodes[cid].innerHTML !== "undefined") {
  1235 + psort[conta] = trs[t].childNodes[cid].innerHTML
  1236 + + "+"
  1237 + + conta;
  1238 + conta = conta + 1;
1125 1239 }
1126 1240 }
1127 1241 }
1128   - // recosntroi a tabela
1129   - psortfim = psort.sort();
1130   - ins = "<table id=" + idjanela + "i3GEOtabelatabelai class=lista8 >";
1131   - npsortfim = psortfim.length;
1132   - for (p = 0; p < npsortfim; p++) {
1133   - e = psortfim[p].split("+")[1] * 1;
1134   - if (trs[e] !== undefined) {
1135   - ins += "<tr>" + trs[e].innerHTML + "</tr>";
1136   - }
1137   - }
1138   - $i(idjanela + "i3GEOtabelaregistros").innerHTML = ins + "</table>";
1139   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
1140   - } catch (e) {
1141   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
1142   - if (typeof (console) !== 'undefined') {
1143   - console.error(e);
  1242 + }
  1243 + // recosntroi a tabela
  1244 + psortfim = psort.sort();
  1245 + ins = "<table id="
  1246 + + idjanela
  1247 + + "i3GEOtabelatabelai class=lista8 >";
  1248 + npsortfim = psortfim.length;
  1249 + for (p = 0; p < npsortfim; p++) {
  1250 + e = psortfim[p].split("+")[1] * 1;
  1251 + if (trs[e] !== undefined) {
  1252 + ins += "<tr>"
  1253 + + trs[e].innerHTML
  1254 + + "</tr>";
1144 1255 }
1145 1256 }
1146   - },
1147   - excluiLinha : function(celula) {
1148   - var p = celula.parentNode.parentNode;
1149   - do {
1150   - p.removeChild(p.childNodes[0]);
1151   - } while (p.childNodes.length > 0);
1152   - p.parentNode.removeChild(p);
1153   - },
1154   - zoomExt : function(ext, idjanela) {
1155   - if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
1156   - return;
  1257 + $i(idjanela
  1258 + + "i3GEOtabelaregistros").innerHTML = ins
  1259 + + "</table>";
  1260 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
  1261 + } catch (e) {
  1262 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
  1263 + if (typeof (console) !== 'undefined') {
  1264 + console.error(e);
1157 1265 }
1158   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
1159   - var funcao = function() {
1160   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
1161   - i3GEOF.tabela.pegaRegistros(idjanela);
1162   - i3GEO.atualiza();
1163   - };
1164   - i3GEO.php.mudaext(
  1266 + }
  1267 + },
  1268 + excluiLinha : function(celula) {
  1269 + var p = celula.parentNode.parentNode;
  1270 + do {
  1271 + p.removeChild(p.childNodes[0]);
  1272 + } while (p.childNodes.length > 0);
  1273 + p.parentNode.removeChild(p);
  1274 + },
  1275 + zoomExt : function(ext, idjanela) {
  1276 + if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
  1277 + return;
  1278 + }
  1279 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
  1280 + var funcao = function() {
  1281 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
  1282 + i3GEOF.tabela.pegaRegistros(idjanela);
  1283 + i3GEO.atualiza();
  1284 + };
  1285 + i3GEO.php.mudaext(
1165 1286 funcao,
1166 1287 "nenhum",
1167 1288 ext);
1168   - },
1169   - registraLinha : function(linha, idjanela) {
1170   - i3GEOF.tabela.propJanelas[idjanela].registros[linha.name] = linha.checked;
1171   - i3GEOF.tabela.vinculos.atualizaVinculos(
  1289 + },
  1290 + registraLinha : function(linha, idjanela) {
  1291 + i3GEOF.tabela.propJanelas[idjanela].registros[linha.name] = linha.checked;
  1292 + i3GEOF.tabela.vinculos.atualizaVinculos(
1172 1293 idjanela,
1173 1294 linha.name,
1174 1295 linha.checked);
1175   - },
1176   - /*
1177   - * Function: listaMarcados
1178   - *
1179   - * Retorna um array com os &iacute;ndices dos registros que est&atilde;o marcados.
1180   - */
1181   - listaMarcados : function(idjanela) {
1182   - var lista = [], registros = i3GEOF.tabela.propJanelas[idjanela].registros, i, n = registros.length;
1183   - for (i = 0; i < n; i++) {
1184   - if (registros[i] === true) {
1185   - lista.push(i);
1186   - }
  1296 + },
  1297 + /*
  1298 + * Function: listaMarcados
  1299 + *
  1300 + * Retorna um array com os &iacute;ndices dos registros que est&atilde;o
  1301 + * marcados.
  1302 + */
  1303 + listaMarcados : function(idjanela) {
  1304 + var lista = [], registros = i3GEOF.tabela.propJanelas[idjanela].registros, i, n = registros.length;
  1305 + for (i = 0; i < n; i++) {
  1306 + if (registros[i] === true) {
  1307 + lista.push(i);
1187 1308 }
1188   - return lista;
1189   - },
1190   - /*
1191   - * Function: ativaSelecao
1192   - *
1193   - * Seleciona no mapa os elementos que estiverem marcados na guia 2
1194   - *
1195   - * Veja:
1196   - *
1197   - * <INCLUISEL>
1198   - */
1199   - ativaSelecao : function(idjanela) {
1200   - if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
1201   - return;
1202   - }
1203   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
1204   - var lista = i3GEOF.tabela.listaMarcados(idjanela), p, cp, temp = function(retorno) {
1205   - if (retorno) {
1206   - i3GEO.Interface.atualizaTema(
  1309 + }
  1310 + return lista;
  1311 + },
  1312 + /*
  1313 + * Function: ativaSelecao
  1314 + *
  1315 + * Seleciona no mapa os elementos que estiverem marcados na guia 2
  1316 + *
  1317 + * Veja:
  1318 + *
  1319 + * <INCLUISEL>
  1320 + */
  1321 + ativaSelecao : function(idjanela) {
  1322 + if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
  1323 + return;
  1324 + }
  1325 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
  1326 + var lista = i3GEOF.tabela.listaMarcados(idjanela), p, cp, temp = function(retorno) {
  1327 + if (retorno) {
  1328 + i3GEO.Interface.atualizaTema(
1207 1329 retorno,
1208 1330 i3GEOF.tabela.propJanelas[idjanela].tema);
1209   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
1210   - }
1211   - };
1212   - p =
1213   - i3GEO.configura.locaplic + "/ferramentas/tabela/exec.php?g_sid=" + i3GEO.configura.sid + "&funcao=incluisel&tema=" +
1214   - i3GEOF.tabela.propJanelas[idjanela].tema + "&ids=" + lista.toString();
1215   - cp = new cpaint();
1216   - cp.set_response_type("JSON");
1217   - cp.call(
  1331 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
  1332 + }
  1333 + };
  1334 + p = i3GEO.configura.locaplic
  1335 + + "/ferramentas/tabela/exec.php?g_sid="
  1336 + + i3GEO.configura.sid
  1337 + + "&funcao=incluisel&tema="
  1338 + + i3GEOF.tabela.propJanelas[idjanela].tema
  1339 + + "&ids="
  1340 + + lista.toString();
  1341 + cp = new cpaint();
  1342 + cp.set_response_type("JSON");
  1343 + cp.call(
1218 1344 p,
1219 1345 "incluiSel",
1220 1346 temp);
1221   - },
1222   - /*
1223   - * Function: limpaSelecao
1224   - *
1225   - * Limpa a sele&ccedil;&atilde;o do tema da tabela
1226   - */
1227   - limpaSelecao : function(idjanela) {
1228   - if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
1229   - return;
1230   - }
1231   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
1232   - i3GEO.tema.limpasel(i3GEOF.tabela.propJanelas[idjanela].tema);
1233   - i3GEOF.tabela.propJanelas[idjanela].registros = [];
1234   - var lista = $i(
1235   - idjanela + "i3GEOtabelatabelai").getElementsByTagName(
  1347 + },
  1348 + /*
  1349 + * Function: limpaSelecao
  1350 + *
  1351 + * Limpa a sele&ccedil;&atilde;o do tema da tabela
  1352 + */
  1353 + limpaSelecao : function(idjanela) {
  1354 + if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
  1355 + return;
  1356 + }
  1357 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
  1358 + i3GEO.tema.limpasel(i3GEOF.tabela.propJanelas[idjanela].tema);
  1359 + i3GEOF.tabela.propJanelas[idjanela].registros = [];
  1360 + var lista = $i(
  1361 + idjanela
  1362 + + "i3GEOtabelatabelai").getElementsByTagName(
1236 1363 "input"), n = lista.length, i;
1237   - for (i = 0; i < n; i++) {
1238   - lista[i].checked = false;
1239   - }
  1364 + for (i = 0; i < n; i++) {
  1365 + lista[i].checked = false;
  1366 + }
  1367 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
  1368 + },
  1369 + /*
  1370 + * Function: criaNovoTema
  1371 + *
  1372 + * Cria um novo tema contendo a sele&ccedil;&atilde;o existente
  1373 + */
  1374 + criaNovoTema : function(idjanela) {
  1375 + if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
  1376 + return;
  1377 + }
  1378 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
  1379 + var temp = function(retorno) {
1240 1380 i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
1241   - },
1242   - /*
1243   - * Function: criaNovoTema
1244   - *
1245   - * Cria um novo tema contendo a sele&ccedil;&atilde;o existente
1246   - */
1247   - criaNovoTema : function(idjanela) {
1248   - if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
1249   - return;
1250   - }
1251   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
1252   - var temp = function(retorno) {
1253   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
1254   - i3GEO.atualiza(retorno);
1255   - };
1256   - i3GEO.php.criatemaSel(
  1381 + i3GEO.atualiza(retorno);
  1382 + };
  1383 + i3GEO.php.criatemaSel(
1257 1384 temp,
1258 1385 i3GEOF.tabela.propJanelas[idjanela].tema);
1259   - },
1260   - /*
1261   - * Function: comboItens
1262   - *
1263   - * Cria um combo para selecionar um item do tema escolhido
1264   - */
1265   - comboItensEstat : function(idjanela) {
1266   - var tema = i3GEOF.tabela.propJanelas[idjanela].tema;
1267   - i3GEO.util.comboItens(
1268   - idjanela + "i3GEOtabelaComboItensGuia3",
  1386 + },
  1387 + /*
  1388 + * Function: comboItens
  1389 + *
  1390 + * Cria um combo para selecionar um item do tema escolhido
  1391 + */
  1392 + comboItensEstat : function(idjanela) {
  1393 + var tema = i3GEOF.tabela.propJanelas[idjanela].tema;
  1394 + i3GEO.util.comboItens(
  1395 + idjanela
  1396 + + "i3GEOtabelaComboItensGuia3",
1269 1397 tema,
1270 1398 function(retorno) {
1271 1399 if (retorno.tipo === "erro") {
1272   - $i(idjanela + "i3GEOtabelaitensGuia3").innerHTML = "<br><br><span style='color:red'>" + $trad(
1273   - 32,
1274   - i3GEOF.tabela.dicionario) + "</span><br><br>";
  1400 + $i(idjanela
  1401 + + "i3GEOtabelaitensGuia3").innerHTML = "<br><br><span style='color:red'>"
  1402 + + $trad(
  1403 + 32,
  1404 + i3GEOF.tabela.dicionario)
  1405 + + "</span><br><br>";
1275 1406 } else {
1276   - $i(idjanela + "i3GEOtabelaitensGuia3").innerHTML = retorno.dados;
  1407 + $i(idjanela
  1408 + + "i3GEOtabelaitensGuia3").innerHTML = retorno.dados;
1277 1409 }
1278 1410 },
1279   - idjanela + "i3GEOtabelaitensGuia3",
  1411 + idjanela
  1412 + + "i3GEOtabelaitensGuia3",
1280 1413 "");
1281   - },
1282   - estatistica : function(idjanela) {
1283   - if ($i(idjanela + "i3GEOtabelaComboItensGuia3").value === "") {
1284   - i3GEO.janela.tempoMsg("Escolha um item!");
1285   - return;
1286   - }
1287   - if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
1288   - return;
1289   - }
1290   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
1291   - try {
1292   - var monta = function(retorno) {
1293   - var ins = "", nome, valor, i, n;
1294   - if (retorno.data.indices !== undefined) {
1295   - if (retorno.data.indices) {
1296   - n = retorno.data.indices.length;
1297   - for (i = 0; i < n; i++) {
1298   - nome = eval("retorno.data.variaveis." + retorno.data.indices[i]);
1299   - valor = eval("retorno.data.valores." + retorno.data.indices[i]);
1300   - ins += "<p style='text-align:left'> <span style='color:gray'>" + nome + ": </span>" + valor + "</p>";
1301   - }
  1414 + },
  1415 + estatistica : function(idjanela) {
  1416 + if ($i(idjanela
  1417 + + "i3GEOtabelaComboItensGuia3").value === "") {
  1418 + i3GEO.janela.tempoMsg("Escolha um item!");
  1419 + return;
  1420 + }
  1421 + if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
  1422 + return;
  1423 + }
  1424 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
  1425 + try {
  1426 + var monta = function(retorno) {
  1427 + var ins = "", nome, valor, i, n;
  1428 + if (retorno.data.indices !== undefined) {
  1429 + if (retorno.data.indices) {
  1430 + n = retorno.data.indices.length;
  1431 + for (i = 0; i < n; i++) {
  1432 + nome = eval("retorno.data.variaveis."
  1433 + + retorno.data.indices[i]);
  1434 + valor = eval("retorno.data.valores."
  1435 + + retorno.data.indices[i]);
  1436 + ins += "<p style='text-align:left'> <span style='color:gray'>"
  1437 + + nome
  1438 + + ": </span>"
  1439 + + valor
  1440 + + "</p>";
1302 1441 }
1303   - } else {
1304   - ins = retorno.data;
1305 1442 }
1306   - $i(idjanela + "i3GEOtabelaoperacoes").innerHTML = ins + "<br>";
1307   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
1308   - }, exclui = "", cp = new cpaint(), p;
1309   - if ($i(idjanela + "i3GEOtabelafiltro1").value !== "") {
1310   - exclui = $i("i3GEOtabelafiltro1").value;
  1443 + } else {
  1444 + ins = retorno.data;
1311 1445 }
1312   - p =
1313   - i3GEO.configura.locaplic + "/ferramentas/tabela/exec.php?g_sid=" + i3GEO.configura.sid + "&funcao=estatistica&item=" +
1314   - $i(idjanela + "i3GEOtabelaComboItensGuia3").value + "&tema=" + i3GEOF.tabela.propJanelas[idjanela].tema +
1315   - "&exclui=" + exclui + "&ext=" + i3GEO.parametros.mapexten;
1316   - cp.set_response_type("JSON");
1317   - cp.call(
  1446 + $i(idjanela
  1447 + + "i3GEOtabelaoperacoes").innerHTML = ins
  1448 + + "<br>";
  1449 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
  1450 + }, exclui = "", cp = new cpaint(), p;
  1451 + if ($i(idjanela
  1452 + + "i3GEOtabelafiltro1").value !== "") {
  1453 + exclui = $i("i3GEOtabelafiltro1").value;
  1454 + }
  1455 + p = i3GEO.configura.locaplic
  1456 + + "/ferramentas/tabela/exec.php?g_sid="
  1457 + + i3GEO.configura.sid
  1458 + + "&funcao=estatistica&item="
  1459 + + $i(idjanela
  1460 + + "i3GEOtabelaComboItensGuia3").value
  1461 + + "&tema="
  1462 + + i3GEOF.tabela.propJanelas[idjanela].tema
  1463 + + "&exclui="
  1464 + + exclui
  1465 + + "&ext="
  1466 + + i3GEO.parametros.mapexten;
  1467 + cp.set_response_type("JSON");
  1468 + cp.call(
1318 1469 p,
1319 1470 "estatDescritivas",
1320 1471 monta);
1321   - } catch (e) {
1322   - i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
1323   - $i("operacoes").innerHTML = "Ocorreu um erro: " + e;
1324   - }
1325   - },
1326   - tabelaTexto : function() {
1327   - },
1328   - /*
1329   - * Function: relatorioTabela
1330   - *
1331   - * Monta o relat&oacute;rio padr&atilde;o em uma nova janela
1332   - */
1333   - relatorioTabela : function(idjanela) {
1334   - try {
1335   - $i(idjanela + "i3GEOtabelatiporelh").value = "";
1336   - $i(idjanela + "i3GEOtabelaarearelh").value = $i(idjanela + "i3GEOtabelacalculaarea").checked;
1337   - $i(idjanela + "i3GEOtabelastatrelh").value = $i(idjanela + "i3GEOtabelacalculaestat").checked;
1338   - $i(idjanela + "i3GEOtabelaexcluirvalorh").value = $i(idjanela + "i3GEOtabelaexcestat").value;
1339   - $i(idjanela + "i3GEOtabelatemarelh").value = i3GEOF.tabela.propJanelas[idjanela].tema;
1340   - $i(idjanela + "i3GEOtabelag_sidh").value = i3GEO.configura.sid;
1341   - $i(idjanela + "i3GEOtabelaitemagruparelh").value = $i(idjanela + "i3GEOtabelaagrupaItem").value;
1342   - var inputs = $i(
1343   - idjanela + "i3GEOtabelaitensrelatorio").getElementsByTagName(
  1472 + } catch (e) {
  1473 + i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
  1474 + $i("operacoes").innerHTML = "Ocorreu um erro: "
  1475 + + e;
  1476 + }
  1477 + },
  1478 + tabelaTexto : function() {
  1479 + },
  1480 + /*
  1481 + * Function: relatorioTabela
  1482 + *
  1483 + * Monta o relat&oacute;rio padr&atilde;o em uma nova janela
  1484 + */
  1485 + relatorioTabela : function(idjanela) {
  1486 + try {
  1487 + $i(idjanela
  1488 + + "i3GEOtabelatiporelh").value = "";
  1489 + $i(idjanela
  1490 + + "i3GEOtabelaarearelh").value = $i(idjanela
  1491 + + "i3GEOtabelacalculaarea").checked;
  1492 + $i(idjanela
  1493 + + "i3GEOtabelastatrelh").value = $i(idjanela
  1494 + + "i3GEOtabelacalculaestat").checked;
  1495 + $i(idjanela
  1496 + + "i3GEOtabelaexcluirvalorh").value = $i(idjanela
  1497 + + "i3GEOtabelaexcestat").value;
  1498 + $i(idjanela
  1499 + + "i3GEOtabelatemarelh").value = i3GEOF.tabela.propJanelas[idjanela].tema;
  1500 + $i(idjanela
  1501 + + "i3GEOtabelag_sidh").value = i3GEO.configura.sid;
  1502 + $i(idjanela
  1503 + + "i3GEOtabelaitemagruparelh").value = $i(idjanela
  1504 + + "i3GEOtabelaagrupaItem").value;
  1505 + var inputs = $i(
  1506 + idjanela
  1507 + + "i3GEOtabelaitensrelatorio").getElementsByTagName(
1344 1508 "input"), listai = [], listaordem = [], listanomes = [], nome, ordem, i, temp, n = inputs.length;
1345   - for (i = 0; i < n; i++) {
1346   - if (inputs[i].type === "checkbox" && inputs[i].checked == true) {
1347   - listai.push(inputs[i].id + ";" + inputs[i].name);
1348   - nome = $i(inputs[i].id + inputs[i].name).value;
1349   - listanomes.push(nome);
1350   - ordem = $i("ordem_" + inputs[i].id + inputs[i].name).value;
1351   - if (ordem === "") {
1352   - ordem = 0;
1353   - }
1354   - listaordem.push(ordem);
  1509 + for (i = 0; i < n; i++) {
  1510 + if (inputs[i].type === "checkbox"
  1511 + && inputs[i].checked == true) {
  1512 + listai.push(inputs[i].id
  1513 + + ";"
  1514 + + inputs[i].name);
  1515 + nome = $i(inputs[i].id
  1516 + + inputs[i].name).value;
  1517 + listanomes.push(nome);
  1518 + ordem = $i("ordem_"
  1519 + + inputs[i].id
  1520 + + inputs[i].name).value;
  1521 + if (ordem === "") {
  1522 + ordem = 0;
1355 1523 }
  1524 + listaordem.push(ordem);
1356 1525 }
1357   - $i(idjanela + "i3GEOtabelaordemrel").value = listaordem;
1358   - $i(idjanela + "i3GEOtabelanomesrelh").value = listanomes;
1359   - $i(idjanela + "i3GEOtabelaitensrelh").value = listai;
1360   - temp = $i(idjanela + "i3GEOtabelarelatorio").action;
1361   - $i(idjanela + "i3GEOtabelarelatorio").action += "?ext=" + i3GEO.parametros.mapexten;
1362   - $i(
1363   - idjanela + "i3GEOtabelarelatorio").submit();
1364   - $i(idjanela + "i3GEOtabelarelatorio").action = temp;
1365   - } catch (e) {
1366   - i3GEO.janela.tempoMsg(e);
1367 1526 }
1368   - },
1369   - /*
1370   - * Function: relatorioTexto
1371   - *
1372   - * Gera o relat&oacute;rio no formato CSV
1373   - */
1374   - relatorioTexto : function() {
1375   - try {
1376   - $i("i3GEOtabelaarearelh").value = $i("i3GEOtabelacalculaarea").checked;
1377   - $i("i3GEOtabelastatrelh").value = $i("i3GEOtabelacalculaestat").checked;
1378   - $i("i3GEOtabelaexcluirvalorh").value = $i("i3GEOtabelaexcestat").value;
1379   - $i("i3GEOtabelatemarelh").value = i3GEOF.tabela.tema;
1380   - $i("i3GEOtabelag_sidh").value = i3GEO.configura.sid;
1381   - $i("i3GEOtabelaitemagruparelh").value = $i("i3GEOtabelaagrupaItem").value;
1382   - $i("i3GEOtabelatiporelh").value = "csv";
1383   - var inputs = $i(
  1527 + $i(idjanela
  1528 + + "i3GEOtabelaordemrel").value = listaordem;
  1529 + $i(idjanela
  1530 + + "i3GEOtabelanomesrelh").value = listanomes;
  1531 + $i(idjanela
  1532 + + "i3GEOtabelaitensrelh").value = listai;
  1533 + temp = $i(idjanela
  1534 + + "i3GEOtabelarelatorio").action;
  1535 + $i(idjanela
  1536 + + "i3GEOtabelarelatorio").action += "?ext="
  1537 + + i3GEO.parametros.mapexten;
  1538 + $i(
  1539 + idjanela
  1540 + + "i3GEOtabelarelatorio").submit();
  1541 + $i(idjanela
  1542 + + "i3GEOtabelarelatorio").action = temp;
  1543 + } catch (e) {
  1544 + i3GEO.janela.tempoMsg(e);
  1545 + }
  1546 + },
  1547 + /*
  1548 + * Function: relatorioTexto
  1549 + *
  1550 + * Gera o relat&oacute;rio no formato CSV
  1551 + */
  1552 + relatorioTexto : function() {
  1553 + try {
  1554 + $i("i3GEOtabelaarearelh").value = $i("i3GEOtabelacalculaarea").checked;
  1555 + $i("i3GEOtabelastatrelh").value = $i("i3GEOtabelacalculaestat").checked;
  1556 + $i("i3GEOtabelaexcluirvalorh").value = $i("i3GEOtabelaexcestat").value;
  1557 + $i("i3GEOtabelatemarelh").value = i3GEOF.tabela.tema;
  1558 + $i("i3GEOtabelag_sidh").value = i3GEO.configura.sid;
  1559 + $i("i3GEOtabelaitemagruparelh").value = $i("i3GEOtabelaagrupaItem").value;
  1560 + $i("i3GEOtabelatiporelh").value = "csv";
  1561 + var inputs = $i(
1384 1562 "i3GEOtabelaitensrelatorio").getElementsByTagName(
1385 1563 "input"), listai = [], listanomes = [], nome, i, temp, n = inputs.length;
1386   - for (i = 0; i < n; i++) {
1387   - if (inputs[i].checked === true) {
1388   - listai.push(inputs[i].id + ";" + inputs[i].name);
1389   - nome = $i(inputs[i].id + inputs[i].name).value;
1390   - listanomes.push(nome);
1391   - }
  1564 + for (i = 0; i < n; i++) {
  1565 + if (inputs[i].checked === true) {
  1566 + listai.push(inputs[i].id
  1567 + + ";"
  1568 + + inputs[i].name);
  1569 + nome = $i(inputs[i].id
  1570 + + inputs[i].name).value;
  1571 + listanomes.push(nome);
1392 1572 }
1393   - $i("i3GEOtabelanomesrelh").value = listanomes;
1394   - $i("i3GEOtabelaitensrelh").value = listai;
1395   - temp = $i("i3GEOtabelarelatorio").action;
1396   - $i("i3GEOtabelarelatorio").action += "?ext=" + i3GEO.parametros.mapexten;
1397   - $i(
1398   - "i3GEOtabelarelatorio").submit();
1399   - $i("i3GEOtabelarelatorio").action = temp;
1400   - } catch (e) {
1401   - i3GEO.janela.tempoMsg(e);
1402 1573 }
  1574 + $i("i3GEOtabelanomesrelh").value = listanomes;
  1575 + $i("i3GEOtabelaitensrelh").value = listai;
  1576 + temp = $i("i3GEOtabelarelatorio").action;
  1577 + $i("i3GEOtabelarelatorio").action += "?ext="
  1578 + + i3GEO.parametros.mapexten;
  1579 + $i(
  1580 + "i3GEOtabelarelatorio").submit();
  1581 + $i("i3GEOtabelarelatorio").action = temp;
  1582 + } catch (e) {
  1583 + i3GEO.janela.tempoMsg(e);
1403 1584 }
1404   - };
  1585 + }
  1586 +};
... ...
ferramentas/tabela/template_mst.html 0 → 100644
... ... @@ -0,0 +1,92 @@
  1 +<div id='{{{idjanela}}}' guiasYUI class='yui-navset' style='top: 0px; cursor: pointer; left: 0px;'>
  2 + <ul class='yui-nav' style='border-width: 0pt 0pt 0px; border-color: rgb(240, 240, 240); border-bottom-color: white;'>
  3 + <li><a><em><div id='{{{idjanela}}}i3GEOtabelaguia6' style='text-align: center; left: 0px;'>
  4 + <img class='ticPropriedades2' style='height: 14px' title='{{{propriedades}}}' src='{{{locaplic}}}/imagens/visual/default/branco.gif'>
  5 + </div></em></a></li>
  6 + <li><a><em><div id='{{{idjanela}}}i3GEOtabelaguia1' style='text-align: center; left: 0px;'>{{{registros}}}</div></em></a></li>
  7 + <li><a><em><div id='{{{idjanela}}}i3GEOtabelaguia3' style='text-align: center; left: 0px;'>{{{estatisticas}}}</div></em></a></li>
  8 + <li><a><em><div id='{{{idjanela}}}i3GEOtabelaguia5' style='text-align: center; left: 0px;'>{{{relat}}}</div></em></a></li>
  9 + </ul>
  10 +</div>
  11 +<br>
  12 +<div id='{{{idjanela}}}i3GEOtabelaresultadotab' style='background-color: #F2F2F2; position: relative; top: 5px; left: 0px'></div>
  13 +<div id='{{{idjanela}}}i3GEOtabelaguia6obj' style='width: 99%'>
  14 + <table summary='' class=lista2>
  15 + <tr>
  16 + <td><input style='cursor: pointer; border: 0px solid white;' onclick='i3GEOF.tabela.pegaRegistros({{{idjanela}}})' type=checkbox id='{{{idjanela}}}
  17 + i3GEOtabelatipolista' /></td>
  18 + <td>{{{atuatab}}}</td>
  19 + </tr>
  20 + <tr>
  21 + <td><input style='cursor: pointer; border: 0px solid white;' onclick='i3GEOF.tabela.pegaRegistros({{{idjanela}}})' type=checkbox id='{{{idjanela}}}i3GEOtabelalegenda' /></td>
  22 + <td>{{{colleg}}}</td>
  23 + </tr>
  24 + </table>
  25 +</div>
  26 +
  27 +<div id='{{{idjanela}}}i3GEOtabelaguia1obj' style='width: 99%'>
  28 + <div id='{{{idjanela}}}i3GEOtabelacombot' style='position: relative; top: 5px; left: 0px; display: none;'></div>
  29 + <input title='{{{sellinhas}}}' id='{{{idjanela}}}i3GEOtabelabotao2' size=25 type=button value='{{{atvsel}}}' />
  30 + <input title='{{{limpselmap}}}' id='{{{idjanela}}}i3GEOtabelabotao3' size=25 type=button value='{{{limpsel}}}' />
  31 + <input title='{{{criatemasel}}}' id='{{{idjanela}}}i3GEOtabelabotao6' size=30 type=button value='{{{criatema}}}' />
  32 + <input id='{{{idjanela}}}i3GEOtabelaGraficoI' type=button value='{{{grafico}}}' />
  33 + <input title='{{{vinctab}}}' id='{{{idjanela}}}i3GEOtabelabotaoVinculos' size=30 type=button value='{{{vinculos}}}' />
  34 + <div id='{{{idjanela}}}i3GEOtabelacontador' style='background-color: rgb(240, 240, 240); width: 100%; position: relative; top: 15px; left: 0px; text-align: left; height: 25px;'>
  35 + {{{de}}}
  36 + <img style='cursor: pointer' onclick='i3GEOF.tabela.menos({{{idjanela}}})' src='
  37 + {{{locaplic}}}/imagens/minus.gif' />
  38 + {{{ini}}} {{{ate}}} &nbsp;
  39 + <img style='cursor: pointer' onclick='i3GEOF.tabela.mais({{{idjanela}}})' src='{{{locaplic}}}/imagens/plus.gif' />
  40 + {{{fim}}}
  41 + <img title='{{{vertodos}}}' style='cursor: pointer; position: relative;' onclick='i3GEOF.tabela.todos({{{idjanela}}})' src='{{{locaplic}}}/imagens/dot.gif' />
  42 + <input title='{{{atuareg}}}' id='{{{idjanela}}}i3GEOtabelabotaoLista' size=25 style='position: relative;' type=button value='{{{listar}}}' />
  43 + </div>
  44 + <div id='{{{idjanela}}}i3GEOtabelaregistros' style='position: relative; top: 20px; left: 0px; text-align: left;'></div>
  45 +</div>
  46 +
  47 +<div id='{{{idjanela}}}i3GEOtabelaguia3obj' style='display: none; width: 99%; left: 0px'>
  48 + <p class='paragrafo'>
  49 + <label>{{{itemcalc}}}:</label> <span id='{{{idjanela}}}i3GEOtabelaitensGuia3'></span>
  50 + <p class='paragrafo'>
  51 + <label>{{{excluicalc}}}:</label> {{{filtro}}}
  52 + <p class='paragrafo'>
  53 + <input id='{{{idjanela}}}i3GEOtabelabotao4' size=30 type=button value='{{{calc}}}' />
  54 + <div id='{{{idjanela}}}i3GEOtabelaoperacoes' style='font-size: 12px; text-align: left; position: relative; top: 15px; left: 0px;'></div>
  55 + <br>
  56 + <div id='{{{idjanela}}}i3GEOtabelamen1' style='position: relative; top: 25px; left: 0px; width: 100%'>
  57 + <p class='paragrafo'>{{{paraqueas}}}
  58 + </div>
  59 +</div>
  60 +<div id='{{{idjanela}}}i3GEOtabelaguia5obj' style='width: 99%; display: none'>
  61 + <p class='paragrafo'>{{{itensrel}}}:
  62 + <p class='paragrafo'>
  63 + <div id='{{{idjanela}}}i3GEOtabelaitensrelatorio' class=digitar style='text-align: left; overflow: auto; height: 100px'></div>
  64 + <br>
  65 + <p class='paragrafo'>{{{itensagr}}}:
  66 + <p class='paragrafo'>
  67 + <div id='{{{idjanela}}}i3GEOtabelaagrupamento' style='text-align: left;'></div>
  68 +
  69 + <p class='paragrafo'>
  70 + <br>
  71 + <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOtabelacalculaarea' />
  72 + {{{incarea}}}
  73 + <p class='paragrafo'>
  74 + <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOtabelacalculaestat' />
  75 + {{{incestat}}}
  76 + <p class='paragrafo'>{{{excvalor}}} : {{{excvalori}}}
  77 + <p class='paragrafo'>
  78 + <input id='{{{idjanela}}}i3GEOtabelabotao7' size=30 type=button value='{{{relat}}}' />
  79 + <input id='{{{idjanela}}}i3GEOtabelabotao5' size=25 type=button value='{{{relattext}}}' />
  80 + <form method=post style='display: none' id='{{{idjanela}}}i3GEOtabelarelatorio' action='{{{locaplic}}}/ferramentas/tabela/relatorio.php' target='_blank'>
  81 + <input type=hidden id='{{{idjanela}}}i3GEOtabelaarearelh' name=arearel value=nao />
  82 + <input type=hidden id='{{{idjanela}}}i3GEOtabelastatrelh' name=statrel value=nao />
  83 + <input type=hidden id='{{{idjanela}}}i3GEOtabelatemarelh' name=temarel value='' />
  84 + <input type=hidden id='{{{idjanela}}}i3GEOtabelag_sidh' name=g_sid value='' />
  85 + <input type=hidden id='{{{idjanela}}}i3GEOtabelaitemagruparelh' name=itemagruparel value='' />
  86 + <input type=hidden id='{{{idjanela}}}i3GEOtabelaitensrelh' name=itensrel value='' />
  87 + <input type=hidden id='{{{idjanela}}}i3GEOtabelanomesrelh' name=nomesrel value='' />
  88 + <input type=hidden id='{{{idjanela}}}i3GEOtabelaordemrel' name=ordemrel value='' />
  89 + <input type=hidden id='{{{idjanela}}}i3GEOtabelaexcluirvalorh' name=excluirvalor value='' />
  90 + <input type=hidden id='{{{idjanela}}}i3GEOtabelatiporelh' name=tiporel value='' />
  91 + </form>
  92 +</div>
... ...