From e7466624790ba8bd3eaf088c10c02139eb794a6f Mon Sep 17 00:00:00 2001
From: Edmar Moretti '+$trad("x33")+'
- ins += '
" + $trad(
- 2,
- i3GEOF.tabela.dicionario) + "
";
+ $i(idjanela
+ + "i3GEOtabelaagrupamento").innerHTML = "
"
+ + $trad(
+ 2,
+ i3GEOF.tabela.dicionario)
+ + "
";
} else {
- $i(idjanela + "i3GEOtabelaagrupamento").innerHTML = retorno.dados;
+ $i(idjanela
+ + "i3GEOtabelaagrupamento").innerHTML = retorno.dados;
}
},
- idjanela + "i3GEOtabelaagrupamento",
+ idjanela
+ + "i3GEOtabelaagrupamento",
"");
- };
- new YAHOO.widget.Button(
- idjanela + "i3GEOtabelabotao2",
- {
- onclick : {
- fn : function() {
- i3GEOF.tabela.ativaSelecao(idjanela);
- }
- }
- });
- new YAHOO.widget.Button(
- idjanela + "i3GEOtabelabotao3",
- {
- onclick : {
- fn : function() {
- i3GEOF.tabela.limpaSelecao(idjanela);
- }
- }
- });
- new YAHOO.widget.Button(
- idjanela + "i3GEOtabelabotao6",
- {
- onclick : {
- fn : function() {
- i3GEOF.tabela.criaNovoTema(idjanela);
- }
- }
- });
- new YAHOO.widget.Button(
- idjanela + "i3GEOtabelabotaoLista",
- {
- onclick : {
- fn : function() {
- i3GEOF.tabela.pegaRegistros(idjanela);
- }
- }
- });
- new YAHOO.widget.Button(
- idjanela + "i3GEOtabelaGraficoI",
- {
- onclick : {
- fn : function() {
- i3GEO.mapa.ativaTema(i3GEOF.tabela.propJanelas[idjanela].tema);
- i3GEO.analise.dialogo.graficoInterativo1();
- }
- }
- });
- $i(idjanela + "i3GEOtabelabotaoLista-button").style.minHeight = "1em";
- $i(idjanela + "i3GEOtabelabotaoLista-button").style.padding = "0px 15px";
- $i(idjanela + "i3GEOtabelabotaoLista-button").style.lineHeight = "1.3";
- $i(idjanela + "i3GEOtabelabotaoLista").style.position = "relative";
- $i(idjanela + "i3GEOtabelabotaoLista").style.top = "2px";
-
- new YAHOO.widget.Button(
- idjanela + "i3GEOtabelabotao4",
- {
- onclick : {
- fn : function() {
- i3GEOF.tabela.estatistica(idjanela);
- }
- }
- });
-
- new YAHOO.widget.Button(
- idjanela + "i3GEOtabelabotao7",
- {
- onclick : {
- fn : function() {
- i3GEOF.tabela.relatorioTabela(idjanela);
- }
- }
- });
- new YAHOO.widget.Button(
- idjanela + "i3GEOtabelabotao5",
- {
- onclick : {
- fn : function() {
- i3GEOF.tabela.relatorioTexto(idjanela);
- }
- }
- });
- new YAHOO.widget.Button(
- idjanela + "i3GEOtabelabotaoVinculos",
- {
- onclick : {
- fn : function() {
- i3GEOF.tabela.vinculos.iniciaJanelaFlutuante();
- }
- }
- });
- i3GEO.util.mensagemAjuda(
- idjanela + "i3GEOtabelamen1",
- $i(idjanela + "i3GEOtabelamen1").innerHTML);
-
- if (i3GEO.parametros.r.toLowerCase() !== "sim") {
- $i(idjanela + "i3GEOtabelaguia4obj").innerHTML = $trad("x22");
+ };
+ new YAHOO.widget.Button(idjanela
+ + "i3GEOtabelabotao2", {
+ onclick : {
+ fn : function() {
+ i3GEOF.tabela.ativaSelecao(idjanela);
+ }
}
- i3GEOF.tabela.pegaRegistros(idjanela);
- } catch (erro) {
- i3GEO.janela.tempoMsg(erro);
- }
- },
- /*
- * Function: html
- *
- * Gera o código html para apresentação das opções da ferramenta
- *
- * Retorno:
- *
- * String com o código html
- */
- html : function(idjanela) {
- var ins = '';// ';
- ins +=
- '
';
- ins += '
';
- ins +=
- ' ';
- // propriedades
- ins += ' ';
- ins += '
';
- ins += ' ';
- ins +=
- ' ';
- ins += ' ';
- ins += ' ' + $trad(
- 8,
- i3GEOF.tabela.dicionario) + ' ';
- ins += ' ';
- ins +=
- ' ';
- ins += ' ';
- ins += ' ' + $trad(
- 9,
- i3GEOF.tabela.dicionario) + ' ';
- ins += ' ';
- ins += $inputText(
- "",
- "",
- idjanela + "i3GEOtabelainicio",
- "",
- 5,
- "1");
- ins += ' ' + $trad(
- 17,
- i3GEOF.tabela.dicionario) + " ";
- ins +=
- '
';
- ins += $inputText(
- "",
- "",
- idjanela + "i3GEOtabelafim",
- "",
- 5,
- "20");
- ins +=
- '
';
- ins +=
- ' ';
- // ins += ' '+$trad(36,i3GEOF.tabela.dicionario)+'';
- ins += '
" + $trad(
- 48,
- i3GEOF.tabela.dicionario) + "
" + colunas;
- $i("i3GEOFTabelaVinculoT1Colunas").innerHTML = ins;
- },
- comboColunasT2 : function() {
- var colunas = i3GEOF.tabela.comboColunas(
+ ins = "
"
+ + $trad(
+ 48,
+ i3GEOF.tabela.dicionario)
+ + "
"
+ + colunas;
+ $i("i3GEOFTabelaVinculoT1Colunas").innerHTML = ins;
+ },
+ comboColunasT2 : function() {
+ var colunas = i3GEOF.tabela.comboColunas(
$i("i3GEOFTabelaOpcoesAdicionaVinculoT2").value,
"i3GEOFTabelaOpcoesAdicionaVinculoColunaT2"), ins = "";
- ins = "
" + $trad(
- 48,
- i3GEOF.tabela.dicionario) + "
" + colunas;
- $i("i3GEOFTabelaVinculoT2Colunas").innerHTML = ins;
- },
- lista : function() {
- var v = i3GEOF.tabela.vinculos.ligacoes, n = v.length, ins = "
" + $trad( - 44, - i3GEOF.tabela.dicionario) + "
", i; - for (i = 0; i < n; i++) { - ins += - "" + v[i].t1 + " " + v[i].c1 + " -> " + v[i].t2 + " " + v[i].c2 + "
"; - } - $i("i3GEOFtabelaVinculosLista").innerHTML = ins; - }, - excluir : function(i) { - i3GEOF.tabela.vinculos.ligacoes.splice( + ins = "
"
+ + $trad(
+ 48,
+ i3GEOF.tabela.dicionario)
+ + "
"
+ + colunas;
+ $i("i3GEOFTabelaVinculoT2Colunas").innerHTML = ins;
+ },
+ lista : function() {
+ var v = i3GEOF.tabela.vinculos.ligacoes, n = v.length, ins = "
" + + $trad( + 44, + i3GEOF.tabela.dicionario) + + "
", i; + for (i = 0; i < n; i++) { + ins += ""
+ + v[i].t1
+ + " "
+ + v[i].c1
+ + " -> "
+ + v[i].t2
+ + " "
+ + v[i].c2
+ + "
";
+ }
+ $i("i3GEOFtabelaVinculosLista").innerHTML = ins;
+ },
+ excluir : function(i) {
+ i3GEOF.tabela.vinculos.ligacoes.splice(
parseInt(
- i,
- 10),
+ i,
+ 10),
1);
- i3GEOF.tabela.vinculos.lista();
- },
- atualizaVinculos : function(tabelaOrigem, registro, marcado) {
- var v = i3GEOF.tabela.vinculos.ligacoes, n = v.length, i, valor;
- if (n > 0) {
- for (i = 0; i < n; i++) {
- // verifica se o vinculo existe
- if (v[i].t1 === tabelaOrigem) {
- // pega o valor do registro na tabela origem
- valor = i3GEOF.tabela.vinculos.pegaValorRegistro(
+ i3GEOF.tabela.vinculos.lista();
+ },
+ atualizaVinculos : function(tabelaOrigem, registro, marcado) {
+ var v = i3GEOF.tabela.vinculos.ligacoes, n = v.length, i, valor;
+ if (n > 0) {
+ for (i = 0; i < n; i++) {
+ // verifica se o vinculo existe
+ if (v[i].t1 === tabelaOrigem) {
+ // pega o valor do registro na tabela origem
+ valor = i3GEOF.tabela.vinculos.pegaValorRegistro(
v[i].t1,
v[i].c1,
registro);
- // marca o registro na tabela destino
- i3GEOF.tabela.vinculos.registro(
+ // marca o registro na tabela destino
+ i3GEOF.tabela.vinculos.registro(
v[i].t2,
v[i].c2,
valor,
marcado);
- }
- if (v[i].t2 === tabelaOrigem) {
- // pega o valor do registro na tabela origem
- valor = i3GEOF.tabela.vinculos.pegaValorRegistro(
+ }
+ if (v[i].t2 === tabelaOrigem) {
+ // pega o valor do registro na tabela origem
+ valor = i3GEOF.tabela.vinculos.pegaValorRegistro(
v[i].t2,
v[i].c2,
registro);
- // marca o registro na tabela destino
- i3GEOF.tabela.vinculos.registro(
+ // marca o registro na tabela destino
+ i3GEOF.tabela.vinculos.registro(
v[i].t1,
v[i].c1,
valor,
marcado);
- }
- }
- }
- },
- // verifica qtas colunas devem ser puladas em cada linha
- colunasVazias : function(idjanela) {
- var tabela = $i(idjanela + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), pular = 0, colunas, n, i;
- colunas = linhas[0].getElementsByTagName("td");
- n = colunas.length;
- for (i = 0; i < n; i++) {
- if (colunas[i].innerHTML == "") {
- pular++;
- }
- }
- return pular;
- },
- // pega o indice de uma coluna em uma tabela buscando no cabecalho
- // no valor de title em cada celula
- indiceColuna : function(idjanela, t) {
- var tabela = $i(idjanela + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), linha = linhas[0], colunas =
- linha.getElementsByTagName("td"), indice = 0, n = colunas.length, i, s;
- for (i = 0; i < n; i++) {
- s = colunas[i].getElementsByTagName("span");
- if (s && s[0] && s[0].title && s[0].title == t) {
- return i;
- }
- }
- return indice;
- },
- // retorna o indice de uma coluna que contem a tag input na tabela
- // com a lista de valores
- indiceColunaInput : function(idjanela) {
- var tabela = $i(idjanela + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), linha = linhas[1], colunas =
- linha.getElementsByTagName("td"), indice = 0, n = colunas.length, i;
- for (i = 0; i < n; i++) {
- if (colunas[i].getElementsByTagName("input").length > 0) {
- return i;
- }
- }
- return indice;
- },
- // pega o valor da coluna em uma tabela com a lista de valores com
- // base no codigo do registro
- pegaValorRegistro : function(idjanela, coluna, registro) {
- var tabela = $i(idjanela + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), n = linhas.length, indiceColuna =
- i3GEOF.tabela.vinculos.indiceColuna(
- idjanela,
- coluna), indiceColunaInput = i3GEOF.tabela.vinculos.indiceColunaInput(idjanela), i, linha, colunas;
- for (i = 1; i < n; i++) {
- linha = linhas[i];
- colunas = linha.getElementsByTagName("td");
- if (colunas[indiceColunaInput].getElementsByTagName("input")[0].name == registro) {
- return colunas[indiceColuna].innerHTML;
}
}
- return "";
- },
- registro : function(idjanela, coluna, valor, marcado) {
- var tabela = $i(idjanela + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), n = linhas.length, indiceColuna =
- i3GEOF.tabela.vinculos.indiceColuna(
- idjanela,
- coluna), indiceColunaInput = i3GEOF.tabela.vinculos.indiceColunaInput(idjanela), i, linha, colunas, reg;
- for (i = 1; i < n; i++) {
- linha = linhas[i];
- colunas = linha.getElementsByTagName("td");
- if (colunas[indiceColuna].innerHTML == valor) {
- reg = colunas[indiceColunaInput].getElementsByTagName("input")[0];
- reg.checked = marcado;
- i3GEOF.tabela.propJanelas[idjanela].registros[reg.name] = marcado;
- }
- }
- },
- },
- comboJanelas : function(idcombo, funcao, w) {
- var i, n = i3GEOF.tabela.janelas.length;
- if (!funcao) {
- funcao = "";
}
- if (!w) {
- w = 260;
- }
- ins =
- "" + " ";
- return ins;
+ return pular;
},
- comboColunas : function(idJanela, idcombo, funcao, w) {
- var i, c = i3GEOF.tabela.propJanelas[idJanela].colunas, n = c.itens.length;
- if (!funcao) {
- funcao = "";
- }
- if (!w) {
- w = 250;
- }
- ins =
- "" + " ";
- return ins;
+ return indice;
},
- /*
- * Function: ativaAutoAtualiza
- *
- * Ativa ou desativa a atualização automática da tabela quando o usuário navega no mapa
- */
- atualizaListaDeRegistros : function() {
- var i, janelas = i3GEOF.tabela.janelas, propJanelas = i3GEOF.tabela.propJanelas, n = janelas.length;
+ // retorna o indice de uma coluna que contem a tag input na tabela
+ // com a lista de valores
+ indiceColunaInput : function(idjanela) {
+ var tabela = $i(idjanela
+ + "i3GEOtabelatabelai"), linhas = tabela.getElementsByTagName("tr"), linha = linhas[1], colunas = linha.getElementsByTagName("td"), indice = 0, n = colunas.length, i;
for (i = 0; i < n; i++) {
- if (propJanelas[janelas[i]].atualiza === true) {
- i3GEOF.tabela.pegaRegistros(janelas[i]);
+ if (colunas[i].getElementsByTagName("input").length > 0) {
+ return i;
}
}
+ return indice;
},
- /*
- * Function: pegaRegistros
- *
- * Pega os registros da tabela de atributos do tema
- *
- * Veja:
- *
- * " + nome + ": " + valor + " "
+ + nome
+ + ": "
+ + valor
+ + "";
- ins +=
- "
";
+ cor = "linha";
+ n = retorno.data[1].registros.length;
+ if ($i(idjanela
+ + "i3GEOtabelafim").value === "") {
+ $i(idjanela
+ + "i3GEOtabelafim").value = n - 1;
+ }
+ for (i = 0; i < n; i++) {
+ ins += "";
- i3GEOF.tabela.propJanelas[idjanela].colunas = {
- "itens" : retorno.data[0].itens,
- "alias" : retorno.data[0].alias
- };
- n = retorno.data[0].itens.length;
- for (i = 0; i < n; i++) {
- ins +=
- " " +
- " " +
- "
";
+ i3GEOF.tabela.propJanelas[idjanela].colunas = {
+ "itens" : retorno.data[0].itens,
+ "alias" : retorno.data[0].alias
+ };
+ n = retorno.data[0].itens.length;
+ for (i = 0; i < n; i++) {
+ ins += " "
+ + " ";
+ i3GEOF.tabela.dicionario)
+ + "' /> "
+ + "
" +
- retorno.data[0].alias[i] + "
"
+ + retorno.data[0].alias[i]
+ + "";
+ }
+ ins += " ";
- cor = "linha";
- n = retorno.data[1].registros.length;
- if ($i(idjanela + "i3GEOtabelafim").value === "") {
- $i(idjanela + "i3GEOtabelafim").value = n - 1;
+ ins += "";
+ stat = "";
+ if (retorno.data[1].registros[i].status === "CHECKED") {
+ stat = "CHECKED";
}
- for (i = 0; i < n; i++) {
- ins +=
- " ";
+ ins += "";
+ if (retorno.data[1].registros[i].ext
+ && retorno.data[1].registros[i].ext != "") {
+ ins += " ";
}
- ins += "
";
- ins += "";
- if (retorno.data[1].registros[i].ext && retorno.data[1].registros[i].ext != "") {
- ins +=
- " ";
- stat = "";
- if (retorno.data[1].registros[i].status === "CHECKED") {
+ if (registros[retorno.data[1].registros[i].indice]) {
+ if (registros[retorno.data[1].registros[i].indice] === true) {
stat = "CHECKED";
- }
- if (registros[retorno.data[1].registros[i].indice]) {
- if (registros[retorno.data[1].registros[i].indice] === true) {
- stat = "CHECKED";
- } else {
- stat = "";
- }
- }
- ins +=
- "";
- }
- ins += "
";
- if (i3GEOtabelalegenda == true) {
- imagem = retorno.data.legenda[retorno.data[1].registros[i].classe["indice"]];
- ins += " ";
} else {
- ins += "";
- }
- if (stat === "CHECKED") {
- registros[retorno.data[1].registros[i].indice] = true;
- }
- vals = retorno.data[1].registros[i].valores;
- for (j = 0; j < vals.length; j++) {
- ins += " " + vals[j].valor + " ";
- }
- if (cor === "linha") {
- cor = "linha1";
- } else {
- cor = "linha";
+ stat = "";
}
}
- $i(idjanela + "i3GEOtabelaregistros").innerHTML = ins;
- }
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
- },
- /*
- * Function: mais
- *
- * Avança o contador de registros para a listagem
- */
- mais : function(idjanela) {
- if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
- return;
- }
- var i = $i(idjanela + "i3GEOtabelainicio").value * 1, f = $i(idjanela + "i3GEOtabelafim").value * 1, d = f - i;
- $i(idjanela + "i3GEOtabelainicio").value = f + 1;
- $i(idjanela + "i3GEOtabelafim").value = f + d + 1;
- i3GEOF.tabela.pegaRegistros(idjanela);
- },
- /*
- * Function: todos
- *
- * Avança o contador de registros para o fim da listagem
- */
- todos : function(idjanela) {
- if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
- return;
+ ins += "";
+ if (i3GEOtabelalegenda == true) {
+ imagem = retorno.data.legenda[retorno.data[1].registros[i].classe["indice"]];
+ ins += " ";
+ } else {
+ ins += "";
+ }
+ if (stat === "CHECKED") {
+ registros[retorno.data[1].registros[i].indice] = true;
+ }
+ vals = retorno.data[1].registros[i].valores;
+ for (j = 0; j < vals.length; j++) {
+ ins += " "
+ + vals[j].valor
+ + " ";
+ }
+ if (cor === "linha") {
+ cor = "linha1";
+ } else {
+ cor = "linha";
+ }
}
- $i(idjanela + "i3GEOtabelainicio").value = 1;
- $i(idjanela + "i3GEOtabelafim").value = "";
- i3GEOF.tabela.pegaRegistros(
+ $i(idjanela
+ + "i3GEOtabelaregistros").innerHTML = ins;
+ }
+ i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
+ },
+ /*
+ * Function: mais
+ *
+ * Avança o contador de registros para a listagem
+ */
+ mais : function(idjanela) {
+ if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
+ return;
+ }
+ var i = $i(idjanela
+ + "i3GEOtabelainicio").value * 1, f = $i(idjanela
+ + "i3GEOtabelafim").value * 1, d = f
+ - i;
+ $i(idjanela
+ + "i3GEOtabelainicio").value = f + 1;
+ $i(idjanela
+ + "i3GEOtabelafim").value = f
+ + d
+ + 1;
+ i3GEOF.tabela.pegaRegistros(idjanela);
+ },
+ /*
+ * Function: todos
+ *
+ * Avança o contador de registros para o fim da listagem
+ */
+ todos : function(idjanela) {
+ if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
+ return;
+ }
+ $i(idjanela
+ + "i3GEOtabelainicio").value = 1;
+ $i(idjanela
+ + "i3GEOtabelafim").value = "";
+ i3GEOF.tabela.pegaRegistros(
idjanela,
false,
false,
false,
1,
true);
- },
- /*
- * Function: menos
- *
- * Retrocede o contador de registros para a listagem
- */
- menos : function(idjanela) {
- if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
- return;
- }
- var i = $i(idjanela + "i3GEOtabelainicio").value * 1, f = $i(idjanela + "i3GEOtabelafim").value * 1, d = f - i;
- $i(idjanela + "i3GEOtabelainicio").value = i - d - 1;
- $i(idjanela + "i3GEOtabelafim").value = i - 1;
- if ($i(idjanela + "i3GEOtabelainicio").value < 1) {
- $i(idjanela + "i3GEOtabelainicio").value = 1;
- $i(idjanela + "i3GEOtabelafim").value = 1 + d;
- }
- i3GEOF.tabela.pegaRegistros(idjanela);
- },
- /*
- * Function: excluiColuna
- *
- * Exclui uma coluna da visualização da tabela
- */
- excluiColuna : function(coluna, cid, idjanela) {
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
- try {
- var tabela = $i(idjanela + "i3GEOtabelatabelai"), trs, tds, i, t, nt, ni;
- // pega o indice correto
- tds = coluna.parentNode.parentNode.getElementsByTagName("td");
- nt = tds.length;
- for (t = 0; t < nt; t++) {
- if (tds[t].accessKey == cid) {
- cid = t;
- break;
- }
- }
- trs = tabela.getElementsByTagName("tr");
- nt = trs.length;
- for (t = 0; t < nt; t++) {
- i = trs[t];
- if (i.getElementsByTagName("td")[cid]) {
- ni = i.getElementsByTagName("td")[cid];
- i.removeChild(ni);
- }
+ },
+ /*
+ * Function: menos
+ *
+ * Retrocede o contador de registros para a listagem
+ */
+ menos : function(idjanela) {
+ if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
+ return;
+ }
+ var i = $i(idjanela
+ + "i3GEOtabelainicio").value * 1, f = $i(idjanela
+ + "i3GEOtabelafim").value * 1, d = f
+ - i;
+ $i(idjanela
+ + "i3GEOtabelainicio").value = i
+ - d
+ - 1;
+ $i(idjanela
+ + "i3GEOtabelafim").value = i - 1;
+ if ($i(idjanela
+ + "i3GEOtabelainicio").value < 1) {
+ $i(idjanela
+ + "i3GEOtabelainicio").value = 1;
+ $i(idjanela
+ + "i3GEOtabelafim").value = 1 + d;
+ }
+ i3GEOF.tabela.pegaRegistros(idjanela);
+ },
+ /*
+ * Function: excluiColuna
+ *
+ * Exclui uma coluna da visualização da tabela
+ */
+ excluiColuna : function(coluna, cid, idjanela) {
+ i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
+ try {
+ var tabela = $i(idjanela
+ + "i3GEOtabelatabelai"), trs, tds, i, t, nt, ni;
+ // pega o indice correto
+ tds = coluna.parentNode.parentNode.getElementsByTagName("td");
+ nt = tds.length;
+ for (t = 0; t < nt; t++) {
+ if (tds[t].accessKey == cid) {
+ cid = t;
+ break;
}
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
- } catch (e) {
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
- if (typeof (console) !== 'undefined') {
- console.error(e);
+ }
+ trs = tabela.getElementsByTagName("tr");
+ nt = trs.length;
+ for (t = 0; t < nt; t++) {
+ i = trs[t];
+ if (i.getElementsByTagName("td")[cid]) {
+ ni = i.getElementsByTagName("td")[cid];
+ i.removeChild(ni);
}
}
- },
- /*
- * Function: ordenaColuna
- *
- * Ordena uma coluna da tabela
- */
- ordenaColuna : function(coluna, cid, idjanela) {
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
- try {
- var tabela = $i(idjanela + "i3GEOtabelatabelai"), trs = tabela.getElementsByTagName("tr"), ntrs = trs.length, tds, nt, conta =
- 0, psort = [], t, psortfim, npsortfim, ins, p, e;
- // pega o indice correto
- tds = coluna.parentNode.parentNode.getElementsByTagName("td");
- nt = tds.length;
- for (t = 0; t < nt; t++) {
- if (tds[t].accessKey == cid) {
- cid = t;
- break;
- }
+ i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
+ } catch (e) {
+ i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
+ if (typeof (console) !== 'undefined') {
+ console.error(e);
+ }
+ }
+ },
+ /*
+ * Function: ordenaColuna
+ *
+ * Ordena uma coluna da tabela
+ */
+ ordenaColuna : function(coluna, cid, idjanela) {
+ i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
+ try {
+ var tabela = $i(idjanela
+ + "i3GEOtabelatabelai"), trs = tabela.getElementsByTagName("tr"), ntrs = trs.length, tds, nt, conta = 0, psort = [], t, psortfim, npsortfim, ins, p, e;
+ // pega o indice correto
+ tds = coluna.parentNode.parentNode.getElementsByTagName("td");
+ nt = tds.length;
+ for (t = 0; t < nt; t++) {
+ if (tds[t].accessKey == cid) {
+ cid = t;
+ break;
}
- for (t = 0; t < ntrs; t++) {
- if (t < ntrs) {
- if (trs[t].childNodes[cid].innerHTML) {
- if (trs[t].childNodes[cid].innerHTML !== "undefined") {
- psort[conta] = trs[t].childNodes[cid].innerHTML + "+" + conta;
- conta = conta + 1;
- }
+ }
+ for (t = 0; t < ntrs; t++) {
+ if (t < ntrs) {
+ if (trs[t].childNodes[cid].innerHTML) {
+ if (trs[t].childNodes[cid].innerHTML !== "undefined") {
+ psort[conta] = trs[t].childNodes[cid].innerHTML
+ + "+"
+ + conta;
+ conta = conta + 1;
}
}
}
- // recosntroi a tabela
- psortfim = psort.sort();
- ins = "";
- npsortfim = psortfim.length;
- for (p = 0; p < npsortfim; p++) {
- e = psortfim[p].split("+")[1] * 1;
- if (trs[e] !== undefined) {
- ins += "
";
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
- } catch (e) {
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
- if (typeof (console) !== 'undefined') {
- console.error(e);
+ }
+ // recosntroi a tabela
+ psortfim = psort.sort();
+ ins = "" + trs[e].innerHTML + " ";
- }
- }
- $i(idjanela + "i3GEOtabelaregistros").innerHTML = ins + "";
+ npsortfim = psortfim.length;
+ for (p = 0; p < npsortfim; p++) {
+ e = psortfim[p].split("+")[1] * 1;
+ if (trs[e] !== undefined) {
+ ins += "
";
+ i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
+ } catch (e) {
+ i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
+ if (typeof (console) !== 'undefined') {
+ console.error(e);
}
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
- var funcao = function() {
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
- i3GEOF.tabela.pegaRegistros(idjanela);
- i3GEO.atualiza();
- };
- i3GEO.php.mudaext(
+ }
+ },
+ excluiLinha : function(celula) {
+ var p = celula.parentNode.parentNode;
+ do {
+ p.removeChild(p.childNodes[0]);
+ } while (p.childNodes.length > 0);
+ p.parentNode.removeChild(p);
+ },
+ zoomExt : function(ext, idjanela) {
+ if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
+ return;
+ }
+ i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
+ var funcao = function() {
+ i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
+ i3GEOF.tabela.pegaRegistros(idjanela);
+ i3GEO.atualiza();
+ };
+ i3GEO.php.mudaext(
funcao,
"nenhum",
ext);
- },
- registraLinha : function(linha, idjanela) {
- i3GEOF.tabela.propJanelas[idjanela].registros[linha.name] = linha.checked;
- i3GEOF.tabela.vinculos.atualizaVinculos(
+ },
+ registraLinha : function(linha, idjanela) {
+ i3GEOF.tabela.propJanelas[idjanela].registros[linha.name] = linha.checked;
+ i3GEOF.tabela.vinculos.atualizaVinculos(
idjanela,
linha.name,
linha.checked);
- },
- /*
- * Function: listaMarcados
- *
- * Retorna um array com os índices dos registros que estão marcados.
- */
- listaMarcados : function(idjanela) {
- var lista = [], registros = i3GEOF.tabela.propJanelas[idjanela].registros, i, n = registros.length;
- for (i = 0; i < n; i++) {
- if (registros[i] === true) {
- lista.push(i);
- }
+ },
+ /*
+ * Function: listaMarcados
+ *
+ * Retorna um array com os índices dos registros que estão
+ * marcados.
+ */
+ listaMarcados : function(idjanela) {
+ var lista = [], registros = i3GEOF.tabela.propJanelas[idjanela].registros, i, n = registros.length;
+ for (i = 0; i < n; i++) {
+ if (registros[i] === true) {
+ lista.push(i);
}
- return lista;
- },
- /*
- * Function: ativaSelecao
- *
- * Seleciona no mapa os elementos que estiverem marcados na guia 2
- *
- * Veja:
- *
- * "
+ + trs[e].innerHTML
+ + " ";
}
}
- },
- excluiLinha : function(celula) {
- var p = celula.parentNode.parentNode;
- do {
- p.removeChild(p.childNodes[0]);
- } while (p.childNodes.length > 0);
- p.parentNode.removeChild(p);
- },
- zoomExt : function(ext, idjanela) {
- if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
- return;
+ $i(idjanela
+ + "i3GEOtabelaregistros").innerHTML = ins
+ + "
" + $trad(
- 32,
- i3GEOF.tabela.dicionario) + "
";
+ $i(idjanela
+ + "i3GEOtabelaitensGuia3").innerHTML = "
"
+ + $trad(
+ 32,
+ i3GEOF.tabela.dicionario)
+ + "
";
} else {
- $i(idjanela + "i3GEOtabelaitensGuia3").innerHTML = retorno.dados;
+ $i(idjanela
+ + "i3GEOtabelaitensGuia3").innerHTML = retorno.dados;
}
},
- idjanela + "i3GEOtabelaitensGuia3",
+ idjanela
+ + "i3GEOtabelaitensGuia3",
"");
- },
- estatistica : function(idjanela) {
- if ($i(idjanela + "i3GEOtabelaComboItensGuia3").value === "") {
- i3GEO.janela.tempoMsg("Escolha um item!");
- return;
- }
- if (i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility === "visible") {
- return;
- }
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "visible";
- try {
- var monta = function(retorno) {
- var ins = "", nome, valor, i, n;
- if (retorno.data.indices !== undefined) {
- if (retorno.data.indices) {
- n = retorno.data.indices.length;
- for (i = 0; i < n; i++) {
- nome = eval("retorno.data.variaveis." + retorno.data.indices[i]);
- valor = eval("retorno.data.valores." + retorno.data.indices[i]);
- ins += "
";
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
- }, exclui = "", cp = new cpaint(), p;
- if ($i(idjanela + "i3GEOtabelafiltro1").value !== "") {
- exclui = $i("i3GEOtabelafiltro1").value;
+ } else {
+ ins = retorno.data;
}
- p =
- i3GEO.configura.locaplic + "/ferramentas/tabela/exec.php?g_sid=" + i3GEO.configura.sid + "&funcao=estatistica&item=" +
- $i(idjanela + "i3GEOtabelaComboItensGuia3").value + "&tema=" + i3GEOF.tabela.propJanelas[idjanela].tema +
- "&exclui=" + exclui + "&ext=" + i3GEO.parametros.mapexten;
- cp.set_response_type("JSON");
- cp.call(
+ $i(idjanela
+ + "i3GEOtabelaoperacoes").innerHTML = ins
+ + "
";
+ i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
+ }, exclui = "", cp = new cpaint(), p;
+ if ($i(idjanela
+ + "i3GEOtabelafiltro1").value !== "") {
+ exclui = $i("i3GEOtabelafiltro1").value;
+ }
+ p = i3GEO.configura.locaplic
+ + "/ferramentas/tabela/exec.php?g_sid="
+ + i3GEO.configura.sid
+ + "&funcao=estatistica&item="
+ + $i(idjanela
+ + "i3GEOtabelaComboItensGuia3").value
+ + "&tema="
+ + i3GEOF.tabela.propJanelas[idjanela].tema
+ + "&exclui="
+ + exclui
+ + "&ext="
+ + i3GEO.parametros.mapexten;
+ cp.set_response_type("JSON");
+ cp.call(
p,
"estatDescritivas",
monta);
- } catch (e) {
- i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
- $i("operacoes").innerHTML = "Ocorreu um erro: " + e;
- }
- },
- tabelaTexto : function() {
- },
- /*
- * Function: relatorioTabela
- *
- * Monta o relatório padrão em uma nova janela
- */
- relatorioTabela : function(idjanela) {
- try {
- $i(idjanela + "i3GEOtabelatiporelh").value = "";
- $i(idjanela + "i3GEOtabelaarearelh").value = $i(idjanela + "i3GEOtabelacalculaarea").checked;
- $i(idjanela + "i3GEOtabelastatrelh").value = $i(idjanela + "i3GEOtabelacalculaestat").checked;
- $i(idjanela + "i3GEOtabelaexcluirvalorh").value = $i(idjanela + "i3GEOtabelaexcestat").value;
- $i(idjanela + "i3GEOtabelatemarelh").value = i3GEOF.tabela.propJanelas[idjanela].tema;
- $i(idjanela + "i3GEOtabelag_sidh").value = i3GEO.configura.sid;
- $i(idjanela + "i3GEOtabelaitemagruparelh").value = $i(idjanela + "i3GEOtabelaagrupaItem").value;
- var inputs = $i(
- idjanela + "i3GEOtabelaitensrelatorio").getElementsByTagName(
+ } catch (e) {
+ i3GEOF.tabela.propJanelas[idjanela].aguarde.visibility = "hidden";
+ $i("operacoes").innerHTML = "Ocorreu um erro: "
+ + e;
+ }
+ },
+ tabelaTexto : function() {
+ },
+ /*
+ * Function: relatorioTabela
+ *
+ * Monta o relatório padrão em uma nova janela
+ */
+ relatorioTabela : function(idjanela) {
+ try {
+ $i(idjanela
+ + "i3GEOtabelatiporelh").value = "";
+ $i(idjanela
+ + "i3GEOtabelaarearelh").value = $i(idjanela
+ + "i3GEOtabelacalculaarea").checked;
+ $i(idjanela
+ + "i3GEOtabelastatrelh").value = $i(idjanela
+ + "i3GEOtabelacalculaestat").checked;
+ $i(idjanela
+ + "i3GEOtabelaexcluirvalorh").value = $i(idjanela
+ + "i3GEOtabelaexcestat").value;
+ $i(idjanela
+ + "i3GEOtabelatemarelh").value = i3GEOF.tabela.propJanelas[idjanela].tema;
+ $i(idjanela
+ + "i3GEOtabelag_sidh").value = i3GEO.configura.sid;
+ $i(idjanela
+ + "i3GEOtabelaitemagruparelh").value = $i(idjanela
+ + "i3GEOtabelaagrupaItem").value;
+ var inputs = $i(
+ idjanela
+ + "i3GEOtabelaitensrelatorio").getElementsByTagName(
"input"), listai = [], listaordem = [], listanomes = [], nome, ordem, i, temp, n = inputs.length;
- for (i = 0; i < n; i++) {
- if (inputs[i].type === "checkbox" && inputs[i].checked == true) {
- listai.push(inputs[i].id + ";" + inputs[i].name);
- nome = $i(inputs[i].id + inputs[i].name).value;
- listanomes.push(nome);
- ordem = $i("ordem_" + inputs[i].id + inputs[i].name).value;
- if (ordem === "") {
- ordem = 0;
- }
- listaordem.push(ordem);
+ for (i = 0; i < n; i++) {
+ if (inputs[i].type === "checkbox"
+ && inputs[i].checked == true) {
+ listai.push(inputs[i].id
+ + ";"
+ + inputs[i].name);
+ nome = $i(inputs[i].id
+ + inputs[i].name).value;
+ listanomes.push(nome);
+ ordem = $i("ordem_"
+ + inputs[i].id
+ + inputs[i].name).value;
+ if (ordem === "") {
+ ordem = 0;
}
+ listaordem.push(ordem);
}
- $i(idjanela + "i3GEOtabelaordemrel").value = listaordem;
- $i(idjanela + "i3GEOtabelanomesrelh").value = listanomes;
- $i(idjanela + "i3GEOtabelaitensrelh").value = listai;
- temp = $i(idjanela + "i3GEOtabelarelatorio").action;
- $i(idjanela + "i3GEOtabelarelatorio").action += "?ext=" + i3GEO.parametros.mapexten;
- $i(
- idjanela + "i3GEOtabelarelatorio").submit();
- $i(idjanela + "i3GEOtabelarelatorio").action = temp;
- } catch (e) {
- i3GEO.janela.tempoMsg(e);
}
- },
- /*
- * Function: relatorioTexto
- *
- * Gera o relatório no formato CSV
- */
- relatorioTexto : function() {
- try {
- $i("i3GEOtabelaarearelh").value = $i("i3GEOtabelacalculaarea").checked;
- $i("i3GEOtabelastatrelh").value = $i("i3GEOtabelacalculaestat").checked;
- $i("i3GEOtabelaexcluirvalorh").value = $i("i3GEOtabelaexcestat").value;
- $i("i3GEOtabelatemarelh").value = i3GEOF.tabela.tema;
- $i("i3GEOtabelag_sidh").value = i3GEO.configura.sid;
- $i("i3GEOtabelaitemagruparelh").value = $i("i3GEOtabelaagrupaItem").value;
- $i("i3GEOtabelatiporelh").value = "csv";
- var inputs = $i(
+ $i(idjanela
+ + "i3GEOtabelaordemrel").value = listaordem;
+ $i(idjanela
+ + "i3GEOtabelanomesrelh").value = listanomes;
+ $i(idjanela
+ + "i3GEOtabelaitensrelh").value = listai;
+ temp = $i(idjanela
+ + "i3GEOtabelarelatorio").action;
+ $i(idjanela
+ + "i3GEOtabelarelatorio").action += "?ext="
+ + i3GEO.parametros.mapexten;
+ $i(
+ idjanela
+ + "i3GEOtabelarelatorio").submit();
+ $i(idjanela
+ + "i3GEOtabelarelatorio").action = temp;
+ } catch (e) {
+ i3GEO.janela.tempoMsg(e);
+ }
+ },
+ /*
+ * Function: relatorioTexto
+ *
+ * Gera o relatório no formato CSV
+ */
+ relatorioTexto : function() {
+ try {
+ $i("i3GEOtabelaarearelh").value = $i("i3GEOtabelacalculaarea").checked;
+ $i("i3GEOtabelastatrelh").value = $i("i3GEOtabelacalculaestat").checked;
+ $i("i3GEOtabelaexcluirvalorh").value = $i("i3GEOtabelaexcestat").value;
+ $i("i3GEOtabelatemarelh").value = i3GEOF.tabela.tema;
+ $i("i3GEOtabelag_sidh").value = i3GEO.configura.sid;
+ $i("i3GEOtabelaitemagruparelh").value = $i("i3GEOtabelaagrupaItem").value;
+ $i("i3GEOtabelatiporelh").value = "csv";
+ var inputs = $i(
"i3GEOtabelaitensrelatorio").getElementsByTagName(
"input"), listai = [], listanomes = [], nome, i, temp, n = inputs.length;
- for (i = 0; i < n; i++) {
- if (inputs[i].checked === true) {
- listai.push(inputs[i].id + ";" + inputs[i].name);
- nome = $i(inputs[i].id + inputs[i].name).value;
- listanomes.push(nome);
- }
+ for (i = 0; i < n; i++) {
+ if (inputs[i].checked === true) {
+ listai.push(inputs[i].id
+ + ";"
+ + inputs[i].name);
+ nome = $i(inputs[i].id
+ + inputs[i].name).value;
+ listanomes.push(nome);
}
- $i("i3GEOtabelanomesrelh").value = listanomes;
- $i("i3GEOtabelaitensrelh").value = listai;
- temp = $i("i3GEOtabelarelatorio").action;
- $i("i3GEOtabelarelatorio").action += "?ext=" + i3GEO.parametros.mapexten;
- $i(
- "i3GEOtabelarelatorio").submit();
- $i("i3GEOtabelarelatorio").action = temp;
- } catch (e) {
- i3GEO.janela.tempoMsg(e);
}
+ $i("i3GEOtabelanomesrelh").value = listanomes;
+ $i("i3GEOtabelaitensrelh").value = listai;
+ temp = $i("i3GEOtabelarelatorio").action;
+ $i("i3GEOtabelarelatorio").action += "?ext="
+ + i3GEO.parametros.mapexten;
+ $i(
+ "i3GEOtabelarelatorio").submit();
+ $i("i3GEOtabelarelatorio").action = temp;
+ } catch (e) {
+ i3GEO.janela.tempoMsg(e);
}
- };
+ }
+};
diff --git a/ferramentas/tabela/template_mst.html b/ferramentas/tabela/template_mst.html
new file mode 100644
index 0000000..03b6807
--- /dev/null
+++ b/ferramentas/tabela/template_mst.html
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+ {{{atuatab}}}
+
+
+
+ {{{colleg}}}
+
+ {{{ini}}} {{{ate}}}
+
+ {{{fim}}}
+
+
+