Commit 86d67fd859d08afeb335271c5a086e72b319de8c
1 parent
6cb418e3
Exists in
master
and in
7 other branches
--no commit message
Showing
15 changed files
with
356 additions
and
35 deletions
Show diff stats
admin/html/i3geoadmin_arvore.html
... | ... | @@ -63,12 +63,13 @@ grupos = function(retorno){$grupos = retorno.data;} |
63 | 63 | subGrupos = function(retorno){$subGrupos = retorno.data;}; |
64 | 64 | temas = function(retorno){$temas = retorno.data;} |
65 | 65 | temasRaiz = function(retorno){$temasRaiz = retorno.data;} |
66 | - | |
66 | +listaPerfis = function(retorno){$perfis = retorno.data;} | |
67 | 67 | function pegaParametros() |
68 | 68 | { |
69 | 69 | var cp = new cpaint(); |
70 | 70 | //cp.set_async(false); |
71 | 71 | cp.set_response_type("JSON"); |
72 | + | |
72 | 73 | var p = "../php/menutemas.php?funcao=pegaGrupos"; |
73 | 74 | cp.call(p,"pegaMenus",grupos); |
74 | 75 | |
... | ... | @@ -80,6 +81,9 @@ function pegaParametros() |
80 | 81 | |
81 | 82 | var p = "../php/arvore.php?funcao=pegaTemasRaiz"; |
82 | 83 | cp.call(p,"pegaMenus",temasRaiz); |
84 | + | |
85 | + var p = "../php/menutemas.php?funcao=pegaPerfis"; | |
86 | + cp.call(p,"pegaMenus",listaPerfis); | |
83 | 87 | } |
84 | 88 | |
85 | 89 | document.getElementById("aguarde").style.display="none" | ... | ... |
admin/html/i3geoadmin_menus.html
... | ... | @@ -31,7 +31,17 @@ $parametros = { |
31 | 31 | "simples": [ |
32 | 32 | { mensagem: "Adicione, altere ou elimine menus cadastrados",cabeca: "Menus",variavel:"menus"} |
33 | 33 | ]}; |
34 | -iniciaAdmin() | |
35 | 34 | document.getElementById("aguarde").style.display="none" |
35 | +var cp = new cpaint(); | |
36 | +//cp.set_async(false); | |
37 | +cp.set_response_type("JSON"); | |
38 | +listaPerfis = function(retorno){$perfis = retorno.data;iniciaAdmin()} | |
39 | +var p = "../php/menutemas.php?funcao=pegaPerfis"; | |
40 | +cp.call(p,"pegaMenus",listaPerfis); | |
41 | +document.getElementById("aguarde").style.display="none" | |
42 | + | |
43 | + | |
44 | + | |
45 | + | |
36 | 46 | </script> |
37 | 47 | </html> |
38 | 48 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,34 @@ |
1 | +<html> | |
2 | +<head> | |
3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
7 | +<script src="../js/menutemas.js" type="text/javascript"></script> | |
8 | + | |
9 | +</head> | |
10 | +<body> | |
11 | +<div style=width:80%;text-align:center;> | |
12 | +<h1>Administração do i3geo - perfis</h1> | |
13 | +<p><a href="../index.html">Voltar</a></p> | |
14 | +<p>Este programa permite editar a lista de perfis</p> | |
15 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
16 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
17 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
18 | +</div> | |
19 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
20 | +</body> | |
21 | +<script> | |
22 | +/* | |
23 | +Title: Administração da lista de perfis | |
24 | + | |
25 | +File: i3geo/admin/i3geoadmin_perfis.htm | |
26 | +*/ | |
27 | +$parametros = { | |
28 | + "simples": [ | |
29 | + { mensagem: "Adicione, altere ou elimine perfis cadastrados",cabeca: "Perfis",variavel:"perfis"} | |
30 | + ]}; | |
31 | +iniciaAdmin() | |
32 | +document.getElementById("aguarde").style.display="none" | |
33 | +</script> | |
34 | +</html> | |
0 | 35 | \ No newline at end of file | ... | ... |
admin/html/mapas.html
... | ... | @@ -32,12 +32,28 @@ Title: Administração da lista de mapas |
32 | 32 | |
33 | 33 | File: i3geo/admin/mapas.htm |
34 | 34 | */ |
35 | -var cp = new cpaint(); | |
36 | -//cp.set_async(false); | |
37 | -cp.set_response_type("JSON"); | |
35 | +var iniciaM = function(retorno) | |
36 | +{ | |
37 | + pegaParametros() | |
38 | + iniciaAdmin() | |
39 | + document.getElementById("aguarde").style.display="none" | |
40 | +} | |
41 | + | |
38 | 42 | temas = function(retorno){$temas = retorno.data;iniciaAdmin()} |
39 | -var p = "../php/menutemas.php?funcao=pegaTemas"; | |
40 | -cp.call(p,"pegaMenus",temas); | |
41 | -document.getElementById("aguarde").style.display="none" | |
43 | +listaPerfis = function(retorno){$perfis = retorno.data} | |
44 | + | |
45 | +function pegaParametros() | |
46 | +{ | |
47 | + var cp = new cpaint(); | |
48 | + //cp.set_async(false); | |
49 | + cp.set_response_type("JSON"); | |
50 | + | |
51 | + var p = "../php/menutemas.php?funcao=pegaTemas"; | |
52 | + cp.call(p,"pegaMenus",temas); | |
53 | + var p = "../php/menutemas.php?funcao=pegaPerfis"; | |
54 | + cp.call(p,"pegaMenus",listaPerfis); | |
55 | +} | |
56 | +iniciaM() | |
57 | + | |
42 | 58 | </script> |
43 | 59 | </html> |
44 | 60 | \ No newline at end of file | ... | ... |
admin/html/sistemas.html
... | ... | @@ -27,7 +27,12 @@ Title: Administração do cadastro de sistemas especiais |
27 | 27 | |
28 | 28 | File: i3geo/admin/sistemas.htm |
29 | 29 | */ |
30 | -iniciaAdmin() | |
30 | +var cp = new cpaint(); | |
31 | +//cp.set_async(false); | |
32 | +cp.set_response_type("JSON"); | |
33 | +listaPerfis = function(retorno){$perfis = retorno.data;iniciaAdmin()} | |
34 | +var p = "../php/menutemas.php?funcao=pegaPerfis"; | |
35 | +cp.call(p,"pegaMenus",listaPerfis); | |
31 | 36 | document.getElementById("aguarde").style.display="none" |
32 | 37 | </script> |
33 | 38 | </html> |
34 | 39 | \ No newline at end of file | ... | ... |
admin/index.html
... | ... | @@ -83,6 +83,7 @@ que por sua vez contém temas.</p> |
83 | 83 | </div> |
84 | 84 | <table class=lista1 > |
85 | 85 | <tr onclick="ajuda('a2',this)"><td><div class=ajuda ></div></td><td>Ajuda</td></tr> |
86 | +<tr onclick="abre('html/i3geoadmin_perfis.html')"><td><div class=aplicar ></div></td><td>Editar a lista de perfis</td></tr> | |
86 | 87 | <tr onclick="abre('html/i3geoadmin_tags.html')"><td><div class=aplicar ></div></td><td>Editar a lista de tags (palavras-chave)</td></tr> |
87 | 88 | <tr onclick="abre('html/i3geoadmin_menus.html')"><td><div class=aplicar ></div></td><td>Editar a lista de menus</td></tr> |
88 | 89 | <tr onclick="abre('html/i3geoadmin_grupos.html')"><td><div class=aplicar ></div></td><td>Editar a lista de grupos</td></tr> | ... | ... |
admin/js/admin.js
... | ... | @@ -261,4 +261,12 @@ function geraLinhas2(dados,param,funcao) |
261 | 261 | } |
262 | 262 | while(contaParam < nparam) |
263 | 263 | return(resultado) |
264 | +} | |
265 | +function registraPerfil(id,perfil) | |
266 | +{ | |
267 | + var perfis = $i(id).value | |
268 | + if(perfil == "") | |
269 | + $i(id).value = perfil | |
270 | + else | |
271 | + $i(id).value = $i(id).value+" "+perfil | |
264 | 272 | } |
265 | 273 | \ No newline at end of file | ... | ... |
admin/js/arvore.js
... | ... | @@ -79,7 +79,7 @@ function pegaTemasRaiz(nivel,id_nivel,onde) |
79 | 79 | { |
80 | 80 | if (nivel == $temasRaiz[i].nivel && id_nivel == $temasRaiz[i].id_nivel && $i("menusel").value == $temasRaiz[i].id_menu) |
81 | 81 | { |
82 | - ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td></tr>"; | |
82 | + ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td><td></td></tr>"; | |
83 | 83 | ins += "<tr>" |
84 | 84 | ins += "<td><div class=excluir title='Excluir' onclick='excluirRaiz(\""+nivel+"\",\""+id_nivel+"\",\""+$temasRaiz[i].id_raiz+"\",\""+onde+"\")'/></td>" |
85 | 85 | ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarRaiz(\""+$temasRaiz[i].id_raiz+"\",\""+nivel+"\",\""+id_nivel+"\",\""+onde+"\")'/></td>" |
... | ... | @@ -87,7 +87,12 @@ function pegaTemasRaiz(nivel,id_nivel,onde) |
87 | 87 | ins += comboObjeto($temas,"id_tema","nome_tema",$temasRaiz[i].id_tema) |
88 | 88 | ins += "</select>" |
89 | 89 | ins += "</td>" |
90 | - ins += "<td><input onchange=this.style.color='blue' id='raizPerfil_"+$temasRaiz[i].id_raiz+"' type=text size=35 value='"+$temasRaiz[i].perfil+"' /></td></tr>" | |
90 | + ins += "<td><input onchange=this.style.color='blue' id='raizPerfil_"+$temasRaiz[i].id_raiz+"' type=text size=35 value='"+$temasRaiz[i].perfil+"' /></td>" | |
91 | + var idtemp = 'raizPerfil_'+$temasRaiz[i].id_raiz | |
92 | + ins += "<td><select onchange=\"registraPerfil('"+idtemp+"',this.value);this.style.color='blue'\" >" | |
93 | + ins += comboObjeto($perfis,"perfil","perfil","") | |
94 | + ins += "</select></td></tr>" | |
95 | + | |
91 | 96 | ins += "</table>" |
92 | 97 | } |
93 | 98 | } |
... | ... | @@ -95,6 +100,7 @@ function pegaTemasRaiz(nivel,id_nivel,onde) |
95 | 100 | } |
96 | 101 | $i(onde).innerHTML = ins; |
97 | 102 | } |
103 | + | |
98 | 104 | function pegaNosRaiz() |
99 | 105 | { |
100 | 106 | $i("nivel1").innerHTML = $mensagemAguarde |
... | ... | @@ -108,7 +114,7 @@ function pegaNosRaiz() |
108 | 114 | { |
109 | 115 | ins += "<div id=n1_"+r[i].id_n1+" ><fieldset style='border:1px solid black;background-color:white' ><legend style='background-color:white;'><b>+- grupo "+r[i].id_n1+"</b></legend>" |
110 | 116 | ins += "<div style=display:none >" |
111 | - ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td></tr>"; | |
117 | + ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td><td></td></tr>"; | |
112 | 118 | ins += "<tr>" |
113 | 119 | ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"n1\",\""+r[i].id_n1+"\",\"id_n1\",\""+r[i].id_n1+"\")'/></td>" |
114 | 120 | ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarGrupo(\""+r[i].id_n1+"\")'/></td>" |
... | ... | @@ -116,7 +122,11 @@ function pegaNosRaiz() |
116 | 122 | ins += comboObjeto($grupos,"id_grupo","nome_grupo",r[i].id_grupo) |
117 | 123 | ins += "</select>" |
118 | 124 | ins += "</td>" |
119 | - ins += "<td><input onchange=this.style.color='blue' id='perfiln1_"+r[i].id_n1+"' type=text size=35 value='"+r[i].n1_perfil+"' /></td></tr>" | |
125 | + ins += "<td><input onchange=this.style.color='blue' id='perfiln1_"+r[i].id_n1+"' type=text size=35 value='"+r[i].n1_perfil+"' /></td>" | |
126 | + var idtemp = 'perfiln1_'+r[i].id_n1 | |
127 | + ins += "<td><select onchange=\"registraPerfil('"+idtemp+"',this.value);this.style.color='blue'\" >" | |
128 | + ins += comboObjeto($perfis,"perfil","perfil","") | |
129 | + ins += "</select></td></tr>" | |
120 | 130 | ins += "</table>" |
121 | 131 | ins += "<table><tr><td><input style=font-size:10px onclick='alterarRaiz(\"\",\"1\",\""+r[i].id_n1+"\",\"raizn1_"+r[i].id_n1+"\")' type=button value='Adicionar tema na raiz desse nível' /></td>" |
122 | 132 | ins += "<td><input style=font-size:10px; type=button value='Adicionar sub-grupo' onclick='alterarSubGrupo(\""+r[i].id_n1+"\",\"\")'/></td>" |
... | ... | @@ -144,7 +154,7 @@ function pegaNosGrupo(idn1) |
144 | 154 | for (i=0;i<r.length;i++) |
145 | 155 | { |
146 | 156 | ins += "<div id=n2x_"+r[i].id_n2+" ><fieldset><legend style='background-color:white;'><b>subgrupo "+r[i].id_n2+"</b></legend>" |
147 | - ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td></tr>"; | |
157 | + ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td><td></td></tr>"; | |
148 | 158 | ins += "<tr>" |
149 | 159 | ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"n2\",\""+r[i].id_n2+"\",\"id_n2\",\""+idn1+"\")'/></td>" |
150 | 160 | ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarSubGrupo(\""+r[i].id_n2+"\",\""+idn1+"\")'/></td>" |
... | ... | @@ -152,7 +162,12 @@ function pegaNosGrupo(idn1) |
152 | 162 | ins += comboObjeto($subGrupos,"id_subgrupo","nome_subgrupo",r[i].id_subgrupo) |
153 | 163 | ins += "</select>" |
154 | 164 | ins += "</td>" |
155 | - ins += "<td><input onchange=this.style.color='blue' id='perfiln2_"+r[i].id_n2+"' type=text size=35 value='"+r[i].n2_perfil+"' /></td></tr>" | |
165 | + ins += "<td><input onchange=this.style.color='blue' id='perfiln2_"+r[i].id_n2+"' type=text size=35 value='"+r[i].n2_perfil+"' /></td>" | |
166 | + var idtemp = 'perfiln2_'+r[i].id_n2 | |
167 | + ins += "<td><select onchange=\"registraPerfil('"+idtemp+"',this.value);this.style.color='blue'\" >" | |
168 | + ins += comboObjeto($perfis,"perfil","perfil","") | |
169 | + ins += "</select></td></tr>" | |
170 | + | |
156 | 171 | ins += "</table>" |
157 | 172 | ins += "<table><tr>" |
158 | 173 | ins += "<td></td>" |
... | ... | @@ -180,7 +195,7 @@ function pegaNosSubGrupo(idn2) |
180 | 195 | for (i=0;i<r.length;i++) |
181 | 196 | { |
182 | 197 | ins += "<div ><fieldset><legend style='background-color:white;'><b>tema "+r[i].id_n3+"</b></legend>" |
183 | - ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td></tr>"; | |
198 | + ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td><td></td></tr>"; | |
184 | 199 | ins += "<tr>" |
185 | 200 | ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"n3\",\""+r[i].id_n3+"\",\"id_n3\",\""+idn2+"\")'/></td>" |
186 | 201 | ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarTema(\""+r[i].id_n3+"\",\""+idn2+"\")'/></td>" |
... | ... | @@ -188,7 +203,12 @@ function pegaNosSubGrupo(idn2) |
188 | 203 | ins += comboObjeto($temas,"id_tema","nome_tema",r[i].id_tema) |
189 | 204 | ins += "</select>" |
190 | 205 | ins += "</td>" |
191 | - ins += "<td><input onchange=this.style.color='blue' id='perfiln3_"+r[i].id_n3+"' type=text size=35 value='"+r[i].n3_perfil+"' /></td></tr>" | |
206 | + ins += "<td><input onchange=this.style.color='blue' id='perfiln3_"+r[i].id_n3+"' type=text size=35 value='"+r[i].n3_perfil+"' /></td>" | |
207 | + var idtemp = 'perfiln3_'+r[i].id_n3 | |
208 | + ins += "<td><select onchange=\"registraPerfil('"+idtemp+"',this.value);this.style.color='blue'\" >" | |
209 | + ins += comboObjeto($perfis,"perfil","perfil","") | |
210 | + ins += "</select></td></tr>" | |
211 | + | |
192 | 212 | ins += "</table>" |
193 | 213 | //ins += "<div id=n3_"+r[i].id_n2+" ></div>" |
194 | 214 | ins += "</fieldset></div>" | ... | ... |
admin/js/mapas.js
... | ... | @@ -70,7 +70,6 @@ function montaMapa(retorno,onde) |
70 | 70 | "linhas":[ |
71 | 71 | {titulo:"Nome",prefixoid:"nome_",id:"id_mapa",valor:"nome_mapa"}, |
72 | 72 | {titulo:"Descrição",prefixoid:"desc_",id:"id_mapa",valor:"desc_mapa"}, |
73 | - {titulo:"Perfis",prefixoid:"perfil_",id:"id_mapa",valor:"perfil_mapa"}, | |
74 | 73 | {titulo:"Extensão",prefixoid:"ext_",id:"id_mapa",valor:"ext_mapa"}, |
75 | 74 | {titulo:"Imagem",prefixoid:"imagem_",id:"id_mapa",valor:"imagem_mapa"}, |
76 | 75 | {titulo:"Outros",prefixoid:"outros_",id:"id_mapa",valor:"outros_mapa"}, |
... | ... | @@ -86,6 +85,21 @@ function montaMapa(retorno,onde) |
86 | 85 | ins += "</select>" |
87 | 86 | ins += "</td>" |
88 | 87 | ins += "</tr>" |
88 | + | |
89 | + ins += "<tr>" | |
90 | + ins += "<td>Perfis: </td>" | |
91 | + ins += "<td><input size=30 onchange='this.style.color=\"blue\"' type=text id='perfis_"+d[i].id_mapa+"' value='"+d[i].perfil_mapa+"' /></td>" | |
92 | + var idtemp = "perfis_"+d[i].id_mapa | |
93 | + ins += "<td><select onchange=\"registraPerfil('"+idtemp+"',this.value);this.style.color='blue'\" >" | |
94 | + ins += comboObjeto($perfis,"perfil","perfil","") | |
95 | + ins += "</select></td></tr>" | |
96 | + | |
97 | + ins += "</select>" | |
98 | + ins += "</td>" | |
99 | + ins += "</tr>" | |
100 | + | |
101 | + | |
102 | + | |
89 | 103 | ins += "<tr>" |
90 | 104 | ins += "<td>Ligados: </td>" |
91 | 105 | ins += "<td><input size=30 onchange='this.style.color=\"blue\"' type=text id='ligados_"+d[i].id_mapa+"' value='"+d[i].ligados_mapa+"' /></td>" | ... | ... |
admin/js/menutemas.js
... | ... | @@ -81,6 +81,28 @@ Pega os parâmetros do mapfiles.php |
81 | 81 | */ |
82 | 82 | function pegaParametros(tipo) |
83 | 83 | { |
84 | + if(tipo == "perfis" || arguments.length == 0 && $i("perfis")) | |
85 | + { | |
86 | + var retornaPerfis = function(retorno) | |
87 | + { | |
88 | + var r = retorno.data | |
89 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td></td><td></td></tr>"; | |
90 | + for (i=0;i<r.length;i++) | |
91 | + { | |
92 | + ins += "<tr>" | |
93 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"perfis\",\""+r[i].id_perfil+"\")'/></td>" | |
94 | + ins += "<td>" | |
95 | + ins += "<div class=aplicar title='Aplicar' onclick='alterar(\"perfis\",\""+r[i].id_perfil+"\")'/>" | |
96 | + ins += "</td>" | |
97 | + ins += "<td><input onchange=this.style.color='blue' id='nomeperfil_"+r[i].id_perfil+"' type=text size=40 value='"+r[i].perfil+"'/></td>" | |
98 | + ins += "</tr>" | |
99 | + } | |
100 | + ins += "</table>" | |
101 | + $i("perfis").innerHTML = ins; | |
102 | + } | |
103 | + var p = "../php/menutemas.php?funcao=pegaPerfis"; | |
104 | + cPaint.call(p,"pegaPerfis",retornaPerfis); | |
105 | + } | |
84 | 106 | if(tipo == "tags" || arguments.length == 0 && $i("tags")) |
85 | 107 | { |
86 | 108 | var retornaTags = function(retorno) |
... | ... | @@ -108,7 +130,7 @@ function pegaParametros(tipo) |
108 | 130 | var retornaMenus = function(retorno) |
109 | 131 | { |
110 | 132 | var r = retorno.data |
111 | - var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Descrição</td><td><b>Aberto</td><td>Perfil</td></tr>"; | |
133 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Descrição</td><td><b>Aberto</td><td>Perfil</td><td></td></tr>"; | |
112 | 134 | for (i=0;i<r.length;i++) |
113 | 135 | { |
114 | 136 | ins += "<tr>" |
... | ... | @@ -120,6 +142,12 @@ function pegaParametros(tipo) |
120 | 142 | ins += combosimnao(r[i].aberto) |
121 | 143 | ins += "</td>" |
122 | 144 | ins += "<td><input onchange=this.style.color='blue' id='perfilmenu_"+r[i].id_menu+"' type=text size=20 value='"+r[i].perfil_menu+"' /></td>" |
145 | + var idtemp = 'perfilmenu_'+r[i].id_menu | |
146 | + ins += "<td><select onchange=\"registraPerfil('"+idtemp+"',this.value);this.style.color='blue'\" id='escolhePerfilMenu_"+r[i].id_menu+"' >" | |
147 | + ins += comboObjeto($perfis,"perfil","perfil","") | |
148 | + ins += "</select>" | |
149 | + ins += "</td>" | |
150 | + | |
123 | 151 | ins += "</tr>" |
124 | 152 | } |
125 | 153 | ins += "</table>" |
... | ... | @@ -285,6 +313,7 @@ function registraTag(id,tag) |
285 | 313 | else |
286 | 314 | $i(id).value = $i(id).value+" "+tag |
287 | 315 | } |
316 | + | |
288 | 317 | /* |
289 | 318 | Function: alterar |
290 | 319 | |
... | ... | @@ -296,6 +325,19 @@ function alterar(prefixo,id) |
296 | 325 | //{ |
297 | 326 | var retorna = function() |
298 | 327 | {pegaParametros(prefixo);} |
328 | + if(prefixo == "perfis") | |
329 | + { | |
330 | + if (id != "") | |
331 | + { | |
332 | + var nome = $i("nomeperfil_"+id).value | |
333 | + } | |
334 | + else | |
335 | + { | |
336 | + var nome = ""; | |
337 | + } | |
338 | + $i(prefixo).innerHTML =$mensagemAguarde | |
339 | + var p = "../php/menutemas.php?funcao=alteraPerfis&perfil="+nome+"&id="+id; | |
340 | + } | |
299 | 341 | if(prefixo == "tags") |
300 | 342 | { |
301 | 343 | if (id != "") |
... | ... | @@ -308,8 +350,7 @@ function alterar(prefixo,id) |
308 | 350 | } |
309 | 351 | $i(prefixo).innerHTML =$mensagemAguarde |
310 | 352 | var p = "../php/menutemas.php?funcao=alteraTags&nome="+nome+"&id="+id; |
311 | - //window.open(p) | |
312 | - | |
353 | + //window.open(p) | |
313 | 354 | } |
314 | 355 | if(prefixo == "menus") |
315 | 356 | { | ... | ... |
admin/js/sistemas.js
... | ... | @@ -63,18 +63,27 @@ function montaSistemas(retorno,onde) |
63 | 63 | if(!$i(d[i].id_sistema)) |
64 | 64 | {ins += "<div id="+d[i].id_sistema+" >"} |
65 | 65 | ins += "<fieldset><legend style='background-color:white;'><b>+- "+d[i].nome_sistema+"</b></legend>" |
66 | - ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td></tr>"; | |
66 | + ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td><td></td></tr>"; | |
67 | 67 | var param = { |
68 | 68 | "linhas":[ |
69 | 69 | {titulo:"Nome",prefixoid:"nome_",id:"id_sistema",valor:"nome_sistema"}, |
70 | - {titulo:"Perfil",prefixoid:"perfil_",id:"id_sistema",valor:"perfil_sistema"} | |
71 | 70 | ] |
72 | 71 | } |
73 | - ins += (geraLinhas(d[i],param,2)); | |
74 | - ins += "</table>" | |
72 | + ins += (geraLinhas(d[i],param,3)); | |
73 | + ins += "<tr>" | |
74 | + ins += "<td>Perfis: </td>" | |
75 | + ins += "<td><input size=30 onchange='this.style.color=\"blue\"' type=text id='perfil_"+d[i].id_sistema+"' value='"+d[i].perfil_sistema+"' /></td>" | |
76 | + | |
77 | + var idtemp = "perfil_"+d[i].id_sistema | |
78 | + ins += "<td><select onchange=\"registraPerfil('"+idtemp+"',this.value);this.style.color='blue'\" >" | |
79 | + ins += comboObjeto($perfis,"perfil","perfil","") | |
80 | + ins += "</select></td></tr></table>" | |
81 | + | |
75 | 82 | ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluir(\""+d[i].id_sistema+"\")'/></td>" |
76 | 83 | ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarSistemas(\""+d[i].id_sistema+"\",\""+d[i].id_sistema+"\")'/></td>" |
77 | - ins += "</tr></table>" | |
84 | + ins += "<td></td></tr></table>" | |
85 | + | |
86 | + | |
78 | 87 | |
79 | 88 | ins += "<fieldset><legend>+- Funções</legend>" |
80 | 89 | ins += "<div style=display:none ><p><input style=font-size:10px onclick='alterarFuncoes(\"\",\""+d[i].id_sistema+"\")' type=button value='Adicionar uma nova função' /></p>" |
... | ... | @@ -83,17 +92,26 @@ function montaSistemas(retorno,onde) |
83 | 92 | { |
84 | 93 | ins += "<fieldset><legend>+- "+d[i].funcoes[j].nome_funcao+"</legend>" |
85 | 94 | var func = d[i].funcoes[j] |
86 | - ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td></tr>"; | |
95 | + ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td><td></td></tr>"; | |
87 | 96 | var param = { |
88 | 97 | "linhas":[ |
89 | 98 | {titulo:"Nome da função",prefixoid:"nomefuncao_",id:"id_funcao",valor:"nome_funcao"}, |
90 | - {titulo:"Perfil",prefixoid:"perfilfuncao_",id:"id_funcao",valor:"perfil_funcao"}, | |
91 | 99 | {titulo:"Abrir programa",prefixoid:"abrir_",id:"id_funcao",valor:"abrir_funcao"}, |
92 | 100 | {titulo:"Largura da janela",prefixoid:"w_",id:"id_funcao",valor:"w_funcao"}, |
93 | 101 | {titulo:"Altura",prefixoid:"h_",id:"id_funcao",valor:"h_funcao"} |
94 | 102 | ] |
95 | 103 | } |
96 | - ins += (geraLinhas(func,param,2)); | |
104 | + ins += (geraLinhas(func,param,3)); | |
105 | + | |
106 | + ins += "<tr>" | |
107 | + ins += "<td>Perfis: </td>" | |
108 | + ins += "<td><input size=30 onchange='this.style.color=\"blue\"' type=text id='perfilfuncao_"+d[i].funcoes[j].id_funcao+"' value='"+d[i].funcoes[j].perfil_funcao+"' /></td>" | |
109 | + var idtemp = "perfilfuncao_"+d[i].funcoes[j].id_funcao | |
110 | + ins += "<td><select onchange=\"registraPerfil('"+idtemp+"',this.value);this.style.color='blue'\" >" | |
111 | + ins += comboObjeto($perfis,"perfil","perfil","") | |
112 | + ins += "</select></td></tr>" | |
113 | + | |
114 | + | |
97 | 115 | ins += "</table>" |
98 | 116 | ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluirFuncoes(\""+d[i].funcoes[j].id_funcao+"\")'/></td>" |
99 | 117 | ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarFuncoes(\""+d[i].funcoes[j].id_funcao+"\",\""+d[i].id_sistema+"\")'/></td>" | ... | ... |
admin/php/atlas.php
... | ... | @@ -257,16 +257,16 @@ function importarXmlAtlas() |
257 | 257 | $template = ixml($atlas,"TEMPLATEHTML"); |
258 | 258 | $w = ixml($atlas,"WABERTURA"); |
259 | 259 | $h = ixml($atlas,"HABERTURA"); |
260 | + if($w == ""){$w = 'null';} | |
261 | + if($h == ""){$h = 'null';} | |
260 | 262 | $pranchadefault = ixml($atlas,"PRANCHADEFAULT"); |
261 | 263 | $tipoguias = ixml($atlas,"TIPOGUIAS"); |
262 | 264 | if(!isset($atlasExistentes[$titulo])) |
263 | - $dbhw->query("INSERT INTO i3geoadmin_atlas (desc_atlas,h_atlas,w_atlas,icone_atlas,link_atlas,pranchadefault_atlas,template_atlas,tipoguias_atlas,titulo_atlas) VALUES ('$desc','$h','$w','$icone','$link','$pranchadefault','$template','$tipoguias','$titulo')"); | |
264 | - $atlasExistentes[$titulo] = 0; | |
265 | - | |
265 | + $dbhw->query("INSERT INTO i3geoadmin_atlas (desc_atlas,h_atlas,w_atlas,icone_atlas,link_atlas,pranchadefault_atlas,template_atlas,tipoguias_atlas,titulo_atlas) VALUES ('$desc',$h,$w,'$icone','$link','$pranchadefault','$template','$tipoguias','$titulo')"); | |
266 | + $atlasExistentes[$titulo] = 0; | |
266 | 267 | $id_atlas = $dbhw->query("SELECT id_atlas FROM i3geoadmin_atlas"); |
267 | 268 | $id_atlas = $id_atlas->fetchAll(); |
268 | 269 | $id_atlas = intval($id_atlas[count($id_atlas)-1]['id_atlas']); |
269 | - | |
270 | 270 | foreach ($atlas->PRANCHAS->PRANCHA as $prancha) |
271 | 271 | { |
272 | 272 | $titulo = ixml($prancha,"TITULO"); |
... | ... | @@ -279,11 +279,9 @@ function importarXmlAtlas() |
279 | 279 | if($h == ""){$h = 'null';} |
280 | 280 | $mapext = ixml($prancha,"MAPEXT"); |
281 | 281 | $dbhw->query("INSERT INTO i3geoadmin_atlasp (id_atlas,desc_prancha,h_prancha,w_prancha,icone_prancha,link_prancha,titulo_prancha,mapext_prancha) VALUES ('$id_atlas','$desc',$h,$w,'$icone','$link','$titulo','$mapext')"); |
282 | - | |
283 | 282 | $id_prancha = $dbhw->query("SELECT id_prancha FROM i3geoadmin_atlasp"); |
284 | 283 | $id_prancha = $id_prancha->fetchAll(); |
285 | 284 | $id_prancha = intval($id_prancha[count($id_prancha)-1]['id_prancha']); |
286 | - | |
287 | 285 | foreach ($prancha->TEMAS->TEMA as $tema) |
288 | 286 | { |
289 | 287 | $codigo = ixml($tema,"CODIGO"); | ... | ... |
admin/php/menutemas.php
... | ... | @@ -51,6 +51,11 @@ switch ($funcao) |
51 | 51 | case "pegaTags": |
52 | 52 | $cp->set_data(pegaDados('SELECT * from i3geoadmin_tags order by nome')); |
53 | 53 | $cp->return_data(); |
54 | + break; | |
55 | + | |
56 | + case "pegaPerfis": | |
57 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_perfis order by perfil')); | |
58 | + $cp->return_data(); | |
54 | 59 | break; |
55 | 60 | |
56 | 61 | case "alteraMenus": |
... | ... | @@ -92,6 +97,11 @@ switch ($funcao) |
92 | 97 | $cp->set_data(alteraTags()); |
93 | 98 | $cp->return_data(); |
94 | 99 | break; |
100 | + | |
101 | + case "alteraPerfis": | |
102 | + $cp->set_data(alteraPerfis()); | |
103 | + $cp->return_data(); | |
104 | + break; | |
95 | 105 | |
96 | 106 | case "pegaSubXGrupos": |
97 | 107 | $cp->set_data(pegaSubXGrupos()); |
... | ... | @@ -103,6 +113,8 @@ switch ($funcao) |
103 | 113 | {$tabela = "i3geoadmin_grupos";$coluna = "id_grupo";} |
104 | 114 | if($tabela == "tags") |
105 | 115 | {excluiTagTemas($id);$tabela = "i3geoadmin_tags";$coluna = "id_tag";} |
116 | + if($tabela == "perfis") | |
117 | + {excluiPerfil($perfil);$tabela = "i3geoadmin_perfis";$coluna = "perfil";} | |
106 | 118 | if($tabela == "subgrupos") |
107 | 119 | {$tabela = "i3geoadmin_subgrupos";$coluna = "id_subgrupo";} |
108 | 120 | if($tabela == "temas") |
... | ... | @@ -118,6 +130,61 @@ switch ($funcao) |
118 | 130 | $cp->return_data(); |
119 | 131 | break; |
120 | 132 | } |
133 | +function excluiPerfil($id) | |
134 | +{ | |
135 | + require_once("conexao.php"); | |
136 | + foreach($dbh->query("select * from i3geoadmin_perfis where perfil = $id") as $row) | |
137 | + {$perfil = $row["perfil"];} | |
138 | + foreach($dbh->query("select * from i3geoadmin_mapas") as $row) | |
139 | + { | |
140 | + $ts = $row['perfil_mapa']; | |
141 | + $i = $row['id_mapa']; | |
142 | + $ts = str_replace($perfil,"",$ts); | |
143 | + $dbhw->query("UPDATE i3geoadmin_mapas SET perfil_mapa = '$ts' WHERE id_mapa = $i"); | |
144 | + } | |
145 | + foreach($dbh->query("select * from i3geoadmin_menus") as $row) | |
146 | + { | |
147 | + $ts = $row['perfil_menu']; | |
148 | + $i = $row['id_menu']; | |
149 | + $ts = str_replace($perfil,"",$ts); | |
150 | + $dbhw->query("UPDATE i3geoadmin_menus SET perfil_menu = '$ts' WHERE id_menu = $i"); | |
151 | + } | |
152 | + foreach($dbh->query("select * from i3geoadmin_n1") as $row) | |
153 | + { | |
154 | + $ts = $row['perfil_n1']; | |
155 | + $i = $row['id_n1']; | |
156 | + $ts = str_replace($perfil,"",$ts); | |
157 | + $dbhw->query("UPDATE i3geoadmin_n1 SET perfil_n1 = '$ts' WHERE id_n1 = $i"); | |
158 | + } | |
159 | + foreach($dbh->query("select * from i3geoadmin_n2") as $row) | |
160 | + { | |
161 | + $ts = $row['perfil_n2']; | |
162 | + $i = $row['id_n2']; | |
163 | + $ts = str_replace($perfil,"",$ts); | |
164 | + $dbhw->query("UPDATE i3geoadmin_n2 SET perfil_n2 = '$ts' WHERE id_n2 = $i"); | |
165 | + } | |
166 | + foreach($dbh->query("select * from i3geoadmin_n3") as $row) | |
167 | + { | |
168 | + $ts = $row['perfil_n3']; | |
169 | + $i = $row['id_n3']; | |
170 | + $ts = str_replace($perfil,"",$ts); | |
171 | + $dbhw->query("UPDATE i3geoadmin_n3 SET perfil_n3 = '$ts' WHERE id_n3 = $i"); | |
172 | + } | |
173 | + foreach($dbh->query("select * from i3geoadmin_raiz") as $row) | |
174 | + { | |
175 | + $ts = $row['perfil']; | |
176 | + $i = $row['id_raiz']; | |
177 | + $ts = str_replace($perfil,"",$ts); | |
178 | + $dbhw->query("UPDATE i3geoadmin_raiz SET perfil = '$ts' WHERE id_raiz = $i"); | |
179 | + } | |
180 | + foreach($dbh->query("select * from i3geoadmin_sistemasf") as $row) | |
181 | + { | |
182 | + $ts = $row['perfil_funcao']; | |
183 | + $i = $row['id_funcao']; | |
184 | + $ts = str_replace($perfil,"",$ts); | |
185 | + $dbhw->query("UPDATE i3geoadmin_sistemasf SET perfil_funcao = '$ts' WHERE id_funcao = $i"); | |
186 | + } | |
187 | +} | |
121 | 188 | function excluiTagTemas($id) |
122 | 189 | { |
123 | 190 | require_once("conexao.php"); |
... | ... | @@ -233,6 +300,90 @@ function alteraMenus() |
233 | 300 | return "Error!: " . $e->getMessage(); |
234 | 301 | } |
235 | 302 | } |
303 | +function alteraPerfis() | |
304 | +{ | |
305 | + global $perfil,$id; | |
306 | + try | |
307 | + { | |
308 | + $dbh = ""; | |
309 | + include("conexao.php"); | |
310 | + if($id != "") | |
311 | + { | |
312 | + $original = ""; | |
313 | + foreach($dbh->query("select * from i3geoadmin_perfis where id_perfil = $id") as $row) | |
314 | + {$original = $row["perfil"];} | |
315 | + $dbhw->query("UPDATE i3geoadmin_perfis SET perfil = '$perfil' WHERE id_perfil = $id"); | |
316 | + if($original != "") | |
317 | + { | |
318 | + foreach($dbh->query("select * from i3geoadmin_mapas") as $row) | |
319 | + { | |
320 | + $ts = $row['perfil_mapa']; | |
321 | + $i = $row['id_mapa']; | |
322 | + $ts = str_replace($original,$perfil,$ts); | |
323 | + $dbhw->query("UPDATE i3geoadmin_mapas SET perfil_mapa = '$ts' WHERE id_mapa = $i"); | |
324 | + } | |
325 | + foreach($dbh->query("select * from i3geoadmin_menus") as $row) | |
326 | + { | |
327 | + $ts = $row['perfil_menu']; | |
328 | + $i = $row['id_menu']; | |
329 | + $ts = str_replace($original,$perfil,$ts); | |
330 | + $dbhw->query("UPDATE i3geoadmin_menus SET perfil_menu = '$ts' WHERE id_menu = $i"); | |
331 | + } | |
332 | + foreach($dbh->query("select * from i3geoadmin_n1") as $row) | |
333 | + { | |
334 | + $ts = $row['perfil_n1']; | |
335 | + $i = $row['id_n1']; | |
336 | + $ts = str_replace($original,$perfil,$ts); | |
337 | + $dbhw->query("UPDATE i3geoadmin_n1 SET perfil_n1 = '$ts' WHERE id_n1 = $i"); | |
338 | + } | |
339 | + foreach($dbh->query("select * from i3geoadmin_n2") as $row) | |
340 | + { | |
341 | + $ts = $row['perfil_n2']; | |
342 | + $i = $row['id_n2']; | |
343 | + $ts = str_replace($original,$perfil,$ts); | |
344 | + $dbhw->query("UPDATE i3geoadmin_n2 SET perfil_n2 = '$ts' WHERE id_n2 = $i"); | |
345 | + } | |
346 | + foreach($dbh->query("select * from i3geoadmin_n3") as $row) | |
347 | + { | |
348 | + $ts = $row['perfil_n3']; | |
349 | + $i = $row['id_n3']; | |
350 | + $ts = str_replace($original,$perfil,$ts); | |
351 | + $dbhw->query("UPDATE i3geoadmin_n3 SET perfil_n3 = '$ts' WHERE id_n3 = $i"); | |
352 | + } | |
353 | + foreach($dbh->query("select * from i3geoadmin_raiz") as $row) | |
354 | + { | |
355 | + $ts = $row['perfil']; | |
356 | + $i = $row['id_raiz']; | |
357 | + $ts = str_replace($original,$perfil,$ts); | |
358 | + $dbhw->query("UPDATE i3geoadmin_raiz SET perfil = '$ts' WHERE id_raiz = $i"); | |
359 | + } | |
360 | + foreach($dbh->query("select * from i3geoadmin_sistemas") as $row) | |
361 | + { | |
362 | + $ts = $row['perfil_sistema']; | |
363 | + $i = $row['id_sistema']; | |
364 | + $ts = str_replace($original,$perfil,$ts); | |
365 | + $dbhw->query("UPDATE i3geoadmin_sistemas SET perfil_sistema = '$ts' WHERE id_sistema = $i"); | |
366 | + } | |
367 | + foreach($dbh->query("select * from i3geoadmin_sistemasf") as $row) | |
368 | + { | |
369 | + $ts = $row['perfil_funcao']; | |
370 | + $i = $row['id_funcao']; | |
371 | + $ts = str_replace($original,$perfil,$ts); | |
372 | + $dbhw->query("UPDATE i3geoadmin_sistemasf SET perfil_funcao = '$ts' WHERE id_funcao = $i"); | |
373 | + } | |
374 | + } | |
375 | + } | |
376 | + else | |
377 | + $dbhw->query("INSERT INTO i3geoadmin_perfis (perfil) VALUES ('$perfil')"); | |
378 | + $dbhw = null; | |
379 | + $dbh = null; | |
380 | + return "ok"; | |
381 | + } | |
382 | + catch (PDOException $e) | |
383 | + { | |
384 | + return "Error!: " . $e->getMessage(); | |
385 | + } | |
386 | +} | |
236 | 387 | function alteraTags() |
237 | 388 | { |
238 | 389 | global $nome,$id; | ... | ... |
classesphp/atlas_controle.php
... | ... | @@ -164,6 +164,7 @@ Esse programa é chamado diretamente, por exemplo, i3geo/classesphp/atlas_control |
164 | 164 | // a função gravaId será executada no final do processo de geração do mapa (ver ms_criamapa.php) |
165 | 165 | // |
166 | 166 | $executa = "gravaId"; |
167 | + $temasa = ""; | |
167 | 168 | include_once("../ms_criamapa.php"); |
168 | 169 | exit; |
169 | 170 | break; | ... | ... |
menutemas/admin.db
No preview for this file type