Commit a3f950fed8dc839ac58719356776d165f710f09c
1 parent
1918bd40
Exists in
master
and in
7 other branches
Conclusão dos formulários de administração da árvore do catálogo de temas
Showing
20 changed files
with
655 additions
and
421 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin1/catalogo/menus/grupos/index.js
| @@ -59,6 +59,7 @@ i3GEOadmin.grupos = { | @@ -59,6 +59,7 @@ i3GEOadmin.grupos = { | ||
| 59 | i3GEOadmin.grupos.opcoesPerfil = opcoesPerfil; | 59 | i3GEOadmin.grupos.opcoesPerfil = opcoesPerfil; |
| 60 | i3GEOadmin.grupos.listaTemas = json["temas"]; | 60 | i3GEOadmin.grupos.listaTemas = json["temas"]; |
| 61 | i3GEOadmin.grupos.listaTiposGrupos = json["tiposGrupos"]; | 61 | i3GEOadmin.grupos.listaTiposGrupos = json["tiposGrupos"]; |
| 62 | + | ||
| 62 | i3GEOadmin.grupos.listaRaiz(json["raiz"]); | 63 | i3GEOadmin.grupos.listaRaiz(json["raiz"]); |
| 63 | i3GEOadmin.grupos.listaNos(json["grupos"]); | 64 | i3GEOadmin.grupos.listaNos(json["grupos"]); |
| 64 | //torna os paineis ordenavies | 65 | //torna os paineis ordenavies |
admin1/catalogo/menus/grupos/listadegrupos/index.php
| @@ -104,7 +104,6 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | @@ -104,7 +104,6 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | ||
| 104 | </div> | 104 | </div> |
| 105 | <div class="list-group-separator"></div> | 105 | <div class="list-group-separator"></div> |
| 106 | </div> | 106 | </div> |
| 107 | - | ||
| 108 | </script> | 107 | </script> |
| 109 | 108 | ||
| 110 | <script type="text/javascript" src="index.js"></script> | 109 | <script type="text/javascript" src="index.js"></script> |
admin1/catalogo/menus/grupos/subgrupos/exec.php
| @@ -35,7 +35,9 @@ $funcoesEdicao = array ( | @@ -35,7 +35,9 @@ $funcoesEdicao = array ( | ||
| 35 | "ADICIONAR", | 35 | "ADICIONAR", |
| 36 | "ALTERAR", | 36 | "ALTERAR", |
| 37 | "EXCLUIR", | 37 | "EXCLUIR", |
| 38 | - "ORDENA" | 38 | + "ORDENA", |
| 39 | + "LISTA", | ||
| 40 | + "LISTAUNICO" | ||
| 39 | ); | 41 | ); |
| 40 | if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { | 42 | if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { |
| 41 | if (verificaOperacaoSessao ( "admin/html/arvore" ) === false) { | 43 | if (verificaOperacaoSessao ( "admin/html/arvore" ) === false) { |
| @@ -54,7 +56,7 @@ testaSafeNumerico([$id_n1,$id_n2,$id_menu,$id_subgrupo]); | @@ -54,7 +56,7 @@ testaSafeNumerico([$id_n1,$id_n2,$id_menu,$id_subgrupo]); | ||
| 54 | $funcao = strtoupper ( $funcao ); | 56 | $funcao = strtoupper ( $funcao ); |
| 55 | switch ($funcao) { | 57 | switch ($funcao) { |
| 56 | case "ORDENA" : | 58 | case "ORDENA" : |
| 57 | - $ordem = explode(" ",$_POST["ordem"]); | 59 | + $ordem = explode(" ",$_POST["novaordem"]); |
| 58 | //verifica se existe a mesma quantidade de registros no banco e na lista de ids | 60 | //verifica se existe a mesma quantidade de registros no banco e na lista de ids |
| 59 | $dados = pegaDados ( "SELECT ordem from ".$esquemaadmin."i3geoadmin_n2 WHERE id_n1 = $id_n1", $dbh, false ); | 61 | $dados = pegaDados ( "SELECT ordem from ".$esquemaadmin."i3geoadmin_n2 WHERE id_n1 = $id_n1", $dbh, false ); |
| 60 | if(count($dados) != count($ordem)){ | 62 | if(count($dados) != count($ordem)){ |
| @@ -103,6 +105,19 @@ switch ($funcao) { | @@ -103,6 +105,19 @@ switch ($funcao) { | ||
| 103 | retornaJSON ( $dados ); | 105 | retornaJSON ( $dados ); |
| 104 | exit (); | 106 | exit (); |
| 105 | break; | 107 | break; |
| 108 | + case "LISTAUNICO" : | ||
| 109 | + $dados = pegaDados("SELECT * from ".$esquemaadmin."i3geoadmin_n2 LEFT JOIN ".$esquemaadmin."i3geoadmin_subgrupos ON i3geoadmin_n2.id_subgrupo = i3geoadmin_subgrupos.id_subgrupo where id_n2 = $id_n2"); | ||
| 110 | + if ($dados === false) { | ||
| 111 | + $dbhw = null; | ||
| 112 | + $dbh = null; | ||
| 113 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
| 114 | + exit (); | ||
| 115 | + } | ||
| 116 | + $dbhw = null; | ||
| 117 | + $dbh = null; | ||
| 118 | + retornaJSON($dados[0]); | ||
| 119 | + break; | ||
| 120 | + | ||
| 106 | case "LISTA" : | 121 | case "LISTA" : |
| 107 | $perfis = pegaDados ( "SELECT id_perfil, perfil from ".$esquemaadmin."i3geoadmin_perfis order by lower(perfil)", $dbh, false ); | 122 | $perfis = pegaDados ( "SELECT id_perfil, perfil from ".$esquemaadmin."i3geoadmin_perfis order by lower(perfil)", $dbh, false ); |
| 108 | $dbhw = null; | 123 | $dbhw = null; |
admin1/catalogo/menus/grupos/subgrupos/execraiz.php
| @@ -35,7 +35,8 @@ $funcoesEdicao = array ( | @@ -35,7 +35,8 @@ $funcoesEdicao = array ( | ||
| 35 | "ADICIONAR", | 35 | "ADICIONAR", |
| 36 | "ALTERAR", | 36 | "ALTERAR", |
| 37 | "EXCLUIR", | 37 | "EXCLUIR", |
| 38 | - "ORDENA" | 38 | + "ORDENA", |
| 39 | + "LISTAUNICO" | ||
| 39 | ); | 40 | ); |
| 40 | if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { | 41 | if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { |
| 41 | if (verificaOperacaoSessao ( "admin/html/arvore" ) === false) { | 42 | if (verificaOperacaoSessao ( "admin/html/arvore" ) === false) { |
| @@ -55,7 +56,7 @@ testaSafeNumerico([$id_n1,$id_menu,$id_tema,$id_raiz]); | @@ -55,7 +56,7 @@ testaSafeNumerico([$id_n1,$id_menu,$id_tema,$id_raiz]); | ||
| 55 | $funcao = strtoupper ( $funcao ); | 56 | $funcao = strtoupper ( $funcao ); |
| 56 | switch ($funcao) { | 57 | switch ($funcao) { |
| 57 | case "ORDENA" : | 58 | case "ORDENA" : |
| 58 | - $ordem = explode(" ",$_POST["ordem"]); | 59 | + $ordem = explode(" ",$_POST["novaordem"]); |
| 59 | //verifica se existe a mesma quantidade de registros no banco e na lista de ids | 60 | //verifica se existe a mesma quantidade de registros no banco e na lista de ids |
| 60 | $dados = pegaDados ( "SELECT ordem from ".$esquemaadmin."i3geoadmin_raiz WHERE nivel = 1 AND id_nivel = $id_n1", $dbh, false ); | 61 | $dados = pegaDados ( "SELECT ordem from ".$esquemaadmin."i3geoadmin_raiz WHERE nivel = 1 AND id_nivel = $id_n1", $dbh, false ); |
| 61 | if(count($dados) != count($ordem)){ | 62 | if(count($dados) != count($ordem)){ |
| @@ -79,6 +80,18 @@ switch ($funcao) { | @@ -79,6 +80,18 @@ switch ($funcao) { | ||
| 79 | retornaJSON ( $retorna ); | 80 | retornaJSON ( $retorna ); |
| 80 | exit(); | 81 | exit(); |
| 81 | break; | 82 | break; |
| 83 | + case "LISTAUNICO" : | ||
| 84 | + $dados = pegaDados ( "SELECT id_raiz, id_tema, ordem, perfil from ".$esquemaadmin."i3geoadmin_raiz WHERE id_raiz = $id_raiz ", $dbh, false ); | ||
| 85 | + if ($dados === false) { | ||
| 86 | + $dbhw = null; | ||
| 87 | + $dbh = null; | ||
| 88 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
| 89 | + exit (); | ||
| 90 | + } | ||
| 91 | + $dbhw = null; | ||
| 92 | + $dbh = null; | ||
| 93 | + retornaJSON ( array("dados"=>$dados[0]) ); | ||
| 94 | + break; | ||
| 82 | case "ADICIONAR" : | 95 | case "ADICIONAR" : |
| 83 | if (empty ( $id_tema ) || empty ( $id_menu ) || empty ( $id_n1 )) { | 96 | if (empty ( $id_tema ) || empty ( $id_menu ) || empty ( $id_n1 )) { |
| 84 | header ( "HTTP/1.1 500 erro nos parametros" ); | 97 | header ( "HTTP/1.1 500 erro nos parametros" ); |
admin1/catalogo/menus/grupos/subgrupos/index.js
| @@ -32,6 +32,9 @@ i3GEOadmin.subgrupos = { | @@ -32,6 +32,9 @@ i3GEOadmin.subgrupos = { | ||
| 32 | //conteudo html do formulario de adicao na raiz | 32 | //conteudo html do formulario de adicao na raiz |
| 33 | formAdicionaRaiz: "", | 33 | formAdicionaRaiz: "", |
| 34 | formAdicionaNo: "", | 34 | formAdicionaNo: "", |
| 35 | + opcoesPerfil: "", | ||
| 36 | + listaTiposSubGrupos: "", | ||
| 37 | + listaTemas: "", | ||
| 35 | init: function(ondenos,onderaiz){ | 38 | init: function(ondenos,onderaiz){ |
| 36 | i3GEOadmin.subgrupos.ondeRaiz = onderaiz; | 39 | i3GEOadmin.subgrupos.ondeRaiz = onderaiz; |
| 37 | i3GEOadmin.subgrupos.ondeNos = ondenos; | 40 | i3GEOadmin.subgrupos.ondeNos = ondenos; |
| @@ -54,9 +57,12 @@ i3GEOadmin.subgrupos = { | @@ -54,9 +57,12 @@ i3GEOadmin.subgrupos = { | ||
| 54 | "{{#data}}" + $("#templateOpcoesPerfil").html() + "{{/data}}", | 57 | "{{#data}}" + $("#templateOpcoesPerfil").html() + "{{/data}}", |
| 55 | {"data":json["perfis"]} | 58 | {"data":json["perfis"]} |
| 56 | ); | 59 | ); |
| 57 | - i3GEOadmin.subgrupos.listaRaiz(json["raiz"],opcoesPerfil,json["temas"]); | ||
| 58 | - i3GEOadmin.subgrupos.listaNos(json["subgrupos"],opcoesPerfil,json["tiposSubGrupos"]); | 60 | + i3GEOadmin.subgrupos.opcoesPerfil = opcoesPerfil; |
| 61 | + i3GEOadmin.subgrupos.listaTemas = json["temas"]; | ||
| 62 | + i3GEOadmin.subgrupos.listaTiposSubGrupos = json["tiposSubGrupos"]; | ||
| 59 | 63 | ||
| 64 | + i3GEOadmin.subgrupos.listaRaiz(json["raiz"]); | ||
| 65 | + i3GEOadmin.subgrupos.listaNos(json["subgrupos"]); | ||
| 60 | //torna os paineis ordenavies | 66 | //torna os paineis ordenavies |
| 61 | i3GEOadmin.subgrupos.ondeNos.sortable({ | 67 | i3GEOadmin.subgrupos.ondeNos.sortable({ |
| 62 | update: function( event, ui ) { | 68 | update: function( event, ui ) { |
| @@ -72,7 +78,7 @@ i3GEOadmin.subgrupos = { | @@ -72,7 +78,7 @@ i3GEOadmin.subgrupos = { | ||
| 72 | }); | 78 | }); |
| 73 | 79 | ||
| 74 | //faz com que seja mostrado um icone de ordenamento no mouseover | 80 | //faz com que seja mostrado um icone de ordenamento no mouseover |
| 75 | - $('.panel').hover( | 81 | + $('.nomeitem').hover( |
| 76 | function(){ | 82 | function(){ |
| 77 | $(this).find('.move').fadeIn(400); | 83 | $(this).find('.move').fadeIn(400); |
| 78 | }, | 84 | }, |
| @@ -90,7 +96,7 @@ i3GEOadmin.subgrupos = { | @@ -90,7 +96,7 @@ i3GEOadmin.subgrupos = { | ||
| 90 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | 96 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); |
| 91 | }); | 97 | }); |
| 92 | }, | 98 | }, |
| 93 | - listaRaiz: function(dados,opcoesPerfil,temas){ | 99 | + listaRaiz: function(dados){ |
| 94 | var templateRaiz = $("#templateRaiz").html(); | 100 | var templateRaiz = $("#templateRaiz").html(); |
| 95 | var html = Mustache.to_html( | 101 | var html = Mustache.to_html( |
| 96 | "{{#data}}" + templateRaiz + "{{/data}}", | 102 | "{{#data}}" + templateRaiz + "{{/data}}", |
| @@ -99,32 +105,9 @@ i3GEOadmin.subgrupos = { | @@ -99,32 +105,9 @@ i3GEOadmin.subgrupos = { | ||
| 99 | i3GEOadmin.subgrupos.dicionario, | 105 | i3GEOadmin.subgrupos.dicionario, |
| 100 | { | 106 | { |
| 101 | "data": dados, | 107 | "data": dados, |
| 102 | - "opcoesPerfil": opcoesPerfil, | 108 | + "opcoesPerfil": i3GEOadmin.subgrupos.opcoesPerfil, |
| 103 | "onExcluir": "i3GEOadmin.subgrupos.excluirTemaDialogo",//funcao | 109 | "onExcluir": "i3GEOadmin.subgrupos.excluirTemaDialogo",//funcao |
| 104 | - "onSalvar": "i3GEOadmin.subgrupos.salvarTemaDialogo",//funcao | ||
| 105 | - "opcoesTema": function(){ | ||
| 106 | - var p = this.codigo_tema; | ||
| 107 | - var id = ""; | ||
| 108 | - //marca o selecionado | ||
| 109 | - $(temas).each( | ||
| 110 | - function(i,el){ | ||
| 111 | - if(el.codigo_tema == p){ | ||
| 112 | - temas[i]["selected"] = "selected"; | ||
| 113 | - id = i; | ||
| 114 | - } | ||
| 115 | - else{ | ||
| 116 | - temas[i]["selected"] = ""; | ||
| 117 | - } | ||
| 118 | - } | ||
| 119 | - ); | ||
| 120 | - var html = '<option value="">---</option>' + Mustache.to_html( | ||
| 121 | - "{{#data}}" + $("#templateOpcoesTema").html() + "{{/data}}", | ||
| 122 | - {"data":temas} | ||
| 123 | - ); | ||
| 124 | - //volta ao normal | ||
| 125 | - temas[id]["selected"] = ""; | ||
| 126 | - return html; | ||
| 127 | - } | 110 | + "onEditar": "i3GEOadmin.subgrupos.editarTemaDialogo" |
| 128 | } | 111 | } |
| 129 | ) | 112 | ) |
| 130 | ); | 113 | ); |
| @@ -133,21 +116,21 @@ i3GEOadmin.subgrupos = { | @@ -133,21 +116,21 @@ i3GEOadmin.subgrupos = { | ||
| 133 | //monta um template para o modal de inclusao de novo tema | 116 | //monta um template para o modal de inclusao de novo tema |
| 134 | if(i3GEOadmin.subgrupos.formAdicionaRaiz == ""){ | 117 | if(i3GEOadmin.subgrupos.formAdicionaRaiz == ""){ |
| 135 | html = Mustache.to_html( | 118 | html = Mustache.to_html( |
| 136 | - $("#templateRaiz").html(), | 119 | + $("#templateFormRaiz").html(), |
| 137 | $.extend( | 120 | $.extend( |
| 138 | {}, | 121 | {}, |
| 139 | i3GEOadmin.subgrupos.dicionario, | 122 | i3GEOadmin.subgrupos.dicionario, |
| 140 | { | 123 | { |
| 141 | "id_raiz": "modal", | 124 | "id_raiz": "modal", |
| 142 | - "escondido": "hidden", | ||
| 143 | - "opcoesPerfil": opcoesPerfil, | 125 | + "escondido": "", |
| 126 | + "opcoesPerfil": i3GEOadmin.subgrupos.opcoesPerfil, | ||
| 144 | "excluir": i3GEOadmin.subgrupos.dicionario.cancelar, | 127 | "excluir": i3GEOadmin.subgrupos.dicionario.cancelar, |
| 145 | "onExcluir": "i3GEOadmin.core.fechaModalGeral",//funcao | 128 | "onExcluir": "i3GEOadmin.core.fechaModalGeral",//funcao |
| 146 | "onSalvar": "i3GEOadmin.subgrupos.adicionaTemaRaiz",//funcao | 129 | "onSalvar": "i3GEOadmin.subgrupos.adicionaTemaRaiz",//funcao |
| 147 | "opcoesTema": function(){ | 130 | "opcoesTema": function(){ |
| 148 | var html = '<option value="">---</option>' + Mustache.to_html( | 131 | var html = '<option value="">---</option>' + Mustache.to_html( |
| 149 | "{{#data}}" + $("#templateOpcoesTema").html() + "{{/data}}", | 132 | "{{#data}}" + $("#templateOpcoesTema").html() + "{{/data}}", |
| 150 | - {"data":temas} | 133 | + {"data":i3GEOadmin.subgrupos.listaTemas} |
| 151 | ); | 134 | ); |
| 152 | return html; | 135 | return html; |
| 153 | } | 136 | } |
| @@ -157,112 +140,65 @@ i3GEOadmin.subgrupos = { | @@ -157,112 +140,65 @@ i3GEOadmin.subgrupos = { | ||
| 157 | i3GEOadmin.subgrupos.formAdicionaRaiz = html; | 140 | i3GEOadmin.subgrupos.formAdicionaRaiz = html; |
| 158 | } | 141 | } |
| 159 | }, | 142 | }, |
| 160 | - listaNos: function(dados,opcoesPerfil,subgrupos){ | ||
| 161 | - var templateNos = $("#templateNos").html(); | ||
| 162 | - var html = Mustache.to_html( | ||
| 163 | - "{{#data}}" + templateNos + "{{/data}}", | ||
| 164 | - $.extend( | ||
| 165 | - {}, | ||
| 166 | - i3GEOadmin.subgrupos.dicionario, | ||
| 167 | - { | ||
| 168 | - "data": dados, | ||
| 169 | - "opcoesPerfil": opcoesPerfil, | ||
| 170 | - "onExcluir": "i3GEOadmin.subgrupos.excluirNoDialogo",//funcao | ||
| 171 | - "onSalvar": "i3GEOadmin.subgrupos.salvarNoDialogo",//funcao | ||
| 172 | - "opcoesPublicado": function(){ | ||
| 173 | - var hash = {}; | ||
| 174 | - hash[this.publicado + "-sel"] = "selected"; | ||
| 175 | - hash["sim"] = i3GEOadmin.subgrupos.dicionario.sim; | ||
| 176 | - hash["nao"] = i3GEOadmin.subgrupos.dicionario.nao; | ||
| 177 | - return Mustache.to_html( | ||
| 178 | - $("#templateOpcoesPublicado").html(), | ||
| 179 | - hash | ||
| 180 | - ); | ||
| 181 | - }, | ||
| 182 | - "opcoesNo": function(){ | ||
| 183 | - var p = this.id_subgrupo; | ||
| 184 | - var id = ""; | ||
| 185 | - //marca o selecionado | ||
| 186 | - $(subgrupos).each( | ||
| 187 | - function(i,el){ | ||
| 188 | - if(el.id_subgrupo == p){ | ||
| 189 | - subgrupos[i]["selected"] = "selected"; | ||
| 190 | - id = i; | ||
| 191 | - } | ||
| 192 | - else{ | ||
| 193 | - subgrupos[i]["selected"] = ""; | 143 | + editarTemaDialogo: function(id){ |
| 144 | + i3GEOadmin.core.fechaModalGeral(); | ||
| 145 | + i3GEOadmin.core.modalAguarde(true); | ||
| 146 | + $.post( | ||
| 147 | + "execraiz.php?funcao=listaunico", | ||
| 148 | + "id_raiz=" + id | ||
| 149 | + ) | ||
| 150 | + .done( | ||
| 151 | + function(data, status){ | ||
| 152 | + var json = jQuery.parseJSON(data); | ||
| 153 | + var html = Mustache.to_html( | ||
| 154 | + "{{#data}}" + $("#templateFormRaiz").html() + "{{/data}}", | ||
| 155 | + $.extend( | ||
| 156 | + {}, | ||
| 157 | + i3GEOadmin.subgrupos.dicionario, | ||
| 158 | + { | ||
| 159 | + "data": json["dados"], | ||
| 160 | + "opcoesPerfil": i3GEOadmin.subgrupos.opcoesPerfil, | ||
| 161 | + "onExcluir": "i3GEOadmin.subgrupos.excluirTemaDialogo",//funcao | ||
| 162 | + "onSalvar": "i3GEOadmin.subgrupos.salvarTemaDialogo",//funcao | ||
| 163 | + "opcoesTema": function(){ | ||
| 164 | + var p = json["dados"].id_tema; | ||
| 165 | + //marca o selecionado | ||
| 166 | + var temas = i3GEOadmin.subgrupos.listaTemas; | ||
| 167 | + $(temas).each( | ||
| 168 | + function(i,el){ | ||
| 169 | + if(el.id_tema == p){ | ||
| 170 | + temas[i]["selected"] = "selected"; | ||
| 171 | + } | ||
| 172 | + else{ | ||
| 173 | + temas[i]["selected"] = ""; | ||
| 174 | + } | ||
| 175 | + } | ||
| 176 | + ); | ||
| 177 | + var html = '<option value="">---</option>' + Mustache.to_html( | ||
| 178 | + "{{#data}}" + $("#templateOpcoesTema").html() + "{{/data}}", | ||
| 179 | + {"data":temas} | ||
| 180 | + ); | ||
| 181 | + return html; | ||
| 194 | } | 182 | } |
| 195 | } | 183 | } |
| 196 | - ); | ||
| 197 | - var html = '<option value="">---</option>' + Mustache.to_html( | ||
| 198 | - "{{#data}}" + $("#templateOpcoesNo").html() + "{{/data}}", | ||
| 199 | - {"data":subgrupos} | ||
| 200 | - ); | ||
| 201 | - //volta ao normal | ||
| 202 | - subgrupos[id]["selected"] = ""; | ||
| 203 | - return html; | ||
| 204 | - } | ||
| 205 | - } | ||
| 206 | - ) | ||
| 207 | - ); | ||
| 208 | - i3GEOadmin.subgrupos.ondeNos.html(html); | ||
| 209 | - //valor do filtro atual | ||
| 210 | - var filtro = i3GEOadmin.core.valorFiltro(); | ||
| 211 | - //filtro | ||
| 212 | - html = Mustache.to_html( | ||
| 213 | - "{{#data}}" + $("#templateFiltro").html() + "{{/data}}", | ||
| 214 | - {"data":dados} | 184 | + ) |
| 185 | + ); | ||
| 186 | + i3GEOadmin.core.abreModalGeral(html); | ||
| 187 | + } | ||
| 188 | + ) | ||
| 189 | + .fail( | ||
| 190 | + function(data){ | ||
| 191 | + i3GEOadmin.core.modalAguarde(false); | ||
| 192 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
| 193 | + } | ||
| 215 | ); | 194 | ); |
| 216 | - $("#filtro").html("<option value='' >Todos</option>" + html); | ||
| 217 | - $("#filtro").combobox(); | ||
| 218 | - $(".ui-autocomplete-input").attr( "title", "Filtro" ); | ||
| 219 | - | ||
| 220 | - if(filtro != ""){ | ||
| 221 | - i3GEOadmin.core.defineFiltro(filtro); | ||
| 222 | - i3GEOadmin.core.filtra(i3GEOadmin.core.pegaFiltro()); | ||
| 223 | - } | ||
| 224 | - if(i3GEOadmin.subgrupos.formAdicionaNo == ""){ | ||
| 225 | - html = Mustache.to_html( | ||
| 226 | - templateNos, | ||
| 227 | - $.extend( | ||
| 228 | - {}, | ||
| 229 | - i3GEOadmin.subgrupos.dicionario, | ||
| 230 | - { | ||
| 231 | - "id_n2": "modal", | ||
| 232 | - "escondido": "hidden", | ||
| 233 | - "excluir": i3GEOadmin.subgrupos.dicionario.cancelar, | ||
| 234 | - "opcoesPerfil": opcoesPerfil, | ||
| 235 | - "onExcluir": "i3GEOadmin.core.fechaModalGeral",//funcao | ||
| 236 | - "onSalvar": "i3GEOadmin.subgrupos.adicionaNo",//funcao | ||
| 237 | - "opcoesPublicado": function(){ | ||
| 238 | - var hash = {}; | ||
| 239 | - hash["sim"] = i3GEOadmin.subgrupos.dicionario.sim; | ||
| 240 | - hash["nao"] = i3GEOadmin.subgrupos.dicionario.nao; | ||
| 241 | - return Mustache.to_html( | ||
| 242 | - $("#templateOpcoesPublicado").html(), | ||
| 243 | - hash | ||
| 244 | - ); | ||
| 245 | - }, | ||
| 246 | - "opcoesNo": function(){ | ||
| 247 | - var html = '<option value="">---</option>' + Mustache.to_html( | ||
| 248 | - "{{#data}}" + $("#templateOpcoesNo").html() + "{{/data}}", | ||
| 249 | - {"data":subgrupos} | ||
| 250 | - ); | ||
| 251 | - return html; | ||
| 252 | - } | ||
| 253 | - } | ||
| 254 | - ) | ||
| 255 | - ); | ||
| 256 | - i3GEOadmin.subgrupos.formAdicionaNo = html; | ||
| 257 | - } | ||
| 258 | }, | 195 | }, |
| 259 | adicionaTemaDialogo: function(){ | 196 | adicionaTemaDialogo: function(){ |
| 260 | i3GEOadmin.core.abreModalGeral(i3GEOadmin.subgrupos.formAdicionaRaiz); | 197 | i3GEOadmin.core.abreModalGeral(i3GEOadmin.subgrupos.formAdicionaRaiz); |
| 261 | - $("#body-formRaiz-modal").collapse('show'); | ||
| 262 | }, | 198 | }, |
| 263 | // os parametros sao obtidos do formulario aberto do modal | 199 | // os parametros sao obtidos do formulario aberto do modal |
| 264 | adicionaTemaRaiz: function(){ | 200 | adicionaTemaRaiz: function(){ |
| 265 | - var parametros = $("#formRaiz-modal form").serialize(); | 201 | + var parametros = $("#form-edicao-raiz-modal").serialize(); |
| 266 | i3GEOadmin.core.fechaModalGeral(); | 202 | i3GEOadmin.core.fechaModalGeral(); |
| 267 | i3GEOadmin.core.modalAguarde(true); | 203 | i3GEOadmin.core.modalAguarde(true); |
| 268 | $.post( | 204 | $.post( |
| @@ -314,17 +250,18 @@ i3GEOadmin.subgrupos = { | @@ -314,17 +250,18 @@ i3GEOadmin.subgrupos = { | ||
| 314 | ); | 250 | ); |
| 315 | }, | 251 | }, |
| 316 | salvarTemaDialogo: function(id){ | 252 | salvarTemaDialogo: function(id){ |
| 253 | + i3GEOadmin.subgrupos.parametrosSalvar = $("#form-edicao-raiz-" + id).serialize(); | ||
| 317 | var hash = { | 254 | var hash = { |
| 318 | "mensagem": i3GEOadmin.subgrupos.dicionario.confirma, | 255 | "mensagem": i3GEOadmin.subgrupos.dicionario.confirma, |
| 319 | "onBotao1": "i3GEOadmin.subgrupos.salvarTema('"+id+"')", | 256 | "onBotao1": "i3GEOadmin.subgrupos.salvarTema('"+id+"')", |
| 320 | "botao1": i3GEOadmin.subgrupos.dicionario.sim, | 257 | "botao1": i3GEOadmin.subgrupos.dicionario.sim, |
| 321 | - "onBotao2": "i3GEOadmin.core.fechaModalConfirma();", | 258 | + "onBotao2": "i3GEOadmin.subgrupos.parametrosSalvar = '';i3GEOadmin.core.fechaModalConfirma();", |
| 322 | "botao2": i3GEOadmin.subgrupos.dicionario.nao | 259 | "botao2": i3GEOadmin.subgrupos.dicionario.nao |
| 323 | }; | 260 | }; |
| 324 | i3GEOadmin.core.abreModalConfirma(hash); | 261 | i3GEOadmin.core.abreModalConfirma(hash); |
| 325 | }, | 262 | }, |
| 326 | salvarTema: function(id){ | 263 | salvarTema: function(id){ |
| 327 | - var parametros = $("#formRaiz-" + id + " form").serialize(); | 264 | + var parametros = i3GEOadmin.subgrupos.parametrosSalvar; |
| 328 | i3GEOadmin.core.fechaModalGeral(); | 265 | i3GEOadmin.core.fechaModalGeral(); |
| 329 | i3GEOadmin.core.modalAguarde(true); | 266 | i3GEOadmin.core.modalAguarde(true); |
| 330 | $.post( | 267 | $.post( |
| @@ -333,6 +270,7 @@ i3GEOadmin.subgrupos = { | @@ -333,6 +270,7 @@ i3GEOadmin.subgrupos = { | ||
| 333 | ) | 270 | ) |
| 334 | .done( | 271 | .done( |
| 335 | function(data, status){ | 272 | function(data, status){ |
| 273 | + i3GEOadmin.subgrupos.parametrosSalvar = ''; | ||
| 336 | i3GEOadmin.core.modalAguarde(false); | 274 | i3GEOadmin.core.modalAguarde(false); |
| 337 | i3GEOadmin.core.iconeAguarde(i3GEOadmin.subgrupos.ondeRaiz); | 275 | i3GEOadmin.core.iconeAguarde(i3GEOadmin.subgrupos.ondeRaiz); |
| 338 | i3GEOadmin.subgrupos.lista(); | 276 | i3GEOadmin.subgrupos.lista(); |
| @@ -340,6 +278,141 @@ i3GEOadmin.subgrupos = { | @@ -340,6 +278,141 @@ i3GEOadmin.subgrupos = { | ||
| 340 | ) | 278 | ) |
| 341 | .fail( | 279 | .fail( |
| 342 | function(data){ | 280 | function(data){ |
| 281 | + i3GEOadmin.subgrupos.parametrosSalvar = ''; | ||
| 282 | + i3GEOadmin.core.modalAguarde(false); | ||
| 283 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
| 284 | + } | ||
| 285 | + ); | ||
| 286 | + }, | ||
| 287 | + | ||
| 288 | + listaNos: function(dados){ | ||
| 289 | + var subgrupos = i3GEOadmin.subgrupos.listaTiposSubGrupos; | ||
| 290 | + var html = Mustache.to_html( | ||
| 291 | + "{{#data}}" + $("#templateNos").html() + "{{/data}}", | ||
| 292 | + $.extend( | ||
| 293 | + {}, | ||
| 294 | + i3GEOadmin.subgrupos.dicionario, | ||
| 295 | + { | ||
| 296 | + "data": dados, | ||
| 297 | + "opcoesPerfil": i3GEOadmin.subgrupos.opcoesPerfil, | ||
| 298 | + "onExcluir": "i3GEOadmin.subgrupos.excluirNoDialogo",//funcao | ||
| 299 | + "onEditar": "i3GEOadmin.subgrupos.editarNoDialogo" | ||
| 300 | + } | ||
| 301 | + ) | ||
| 302 | + ); | ||
| 303 | + i3GEOadmin.subgrupos.ondeNos.html(html); | ||
| 304 | + //valor do filtro atual | ||
| 305 | + var filtro = i3GEOadmin.core.valorFiltro(); | ||
| 306 | + //filtro | ||
| 307 | + html = Mustache.to_html( | ||
| 308 | + "{{#data}}" + $("#templateFiltro").html() + "{{/data}}", | ||
| 309 | + {"data":dados} | ||
| 310 | + ); | ||
| 311 | + $("#filtro").html("<option value='' >Todos</option>" + html); | ||
| 312 | + $("#filtro").combobox(); | ||
| 313 | + $(".ui-autocomplete-input").attr( "title", "Filtro" ); | ||
| 314 | + | ||
| 315 | + if(filtro != ""){ | ||
| 316 | + i3GEOadmin.core.defineFiltro(filtro); | ||
| 317 | + i3GEOadmin.core.filtra(i3GEOadmin.core.pegaFiltro()); | ||
| 318 | + } | ||
| 319 | + if(i3GEOadmin.subgrupos.formAdicionaNo == ""){ | ||
| 320 | + html = Mustache.to_html( | ||
| 321 | + $("#templateFormNos").html(), | ||
| 322 | + $.extend( | ||
| 323 | + {}, | ||
| 324 | + i3GEOadmin.subgrupos.dicionario, | ||
| 325 | + { | ||
| 326 | + "id_n2": "modal", | ||
| 327 | + "escondido": "hidden", | ||
| 328 | + "excluir": i3GEOadmin.subgrupos.dicionario.cancelar, | ||
| 329 | + "opcoesPerfil": i3GEOadmin.subgrupos.opcoesPerfil, | ||
| 330 | + "onExcluir": "i3GEOadmin.core.fechaModalGeral",//funcao | ||
| 331 | + "onSalvar": "i3GEOadmin.subgrupos.adicionaNo",//funcao | ||
| 332 | + "opcoesPublicado": function(){ | ||
| 333 | + var hash = {}; | ||
| 334 | + hash["sim"] = i3GEOadmin.subgrupos.dicionario.sim; | ||
| 335 | + hash["nao"] = i3GEOadmin.subgrupos.dicionario.nao; | ||
| 336 | + return Mustache.to_html( | ||
| 337 | + $("#templateOpcoesPublicado").html(), | ||
| 338 | + hash | ||
| 339 | + ); | ||
| 340 | + }, | ||
| 341 | + "opcoesNo": function(){ | ||
| 342 | + var html = '<option value="">---</option>' + Mustache.to_html( | ||
| 343 | + "{{#data}}" + $("#templateOpcoesNo").html() + "{{/data}}", | ||
| 344 | + {"data":subgrupos} | ||
| 345 | + ); | ||
| 346 | + return html; | ||
| 347 | + } | ||
| 348 | + } | ||
| 349 | + ) | ||
| 350 | + ); | ||
| 351 | + i3GEOadmin.subgrupos.formAdicionaNo = html; | ||
| 352 | + } | ||
| 353 | + }, | ||
| 354 | + editarNoDialogo: function(id){ | ||
| 355 | + i3GEOadmin.core.fechaModalGeral(); | ||
| 356 | + i3GEOadmin.core.modalAguarde(true); | ||
| 357 | + $.post( | ||
| 358 | + "exec.php?funcao=listaunico", | ||
| 359 | + "id_n2=" + id | ||
| 360 | + ) | ||
| 361 | + .done( | ||
| 362 | + function(data, status){ | ||
| 363 | + var json = jQuery.parseJSON(data); | ||
| 364 | + var html = Mustache.to_html( | ||
| 365 | + "{{#data}}" + $("#templateFormNos").html() + "{{/data}}", | ||
| 366 | + $.extend( | ||
| 367 | + {}, | ||
| 368 | + i3GEOadmin.subgrupos.dicionario, | ||
| 369 | + { | ||
| 370 | + "data": json, | ||
| 371 | + "opcoesPerfil": i3GEOadmin.subgrupos.opcoesPerfil, | ||
| 372 | + "onExcluir": "i3GEOadmin.subgrupos.excluirNoDialogo",//funcao | ||
| 373 | + "onSalvar": "i3GEOadmin.subgrupos.salvarNoDialogo",//funcao | ||
| 374 | + "opcoesPublicado": function(){ | ||
| 375 | + var hash = {}; | ||
| 376 | + hash[this.publicado + "-sel"] = "selected"; | ||
| 377 | + hash["sim"] = i3GEOadmin.subgrupos.dicionario.sim; | ||
| 378 | + hash["nao"] = i3GEOadmin.subgrupos.dicionario.nao; | ||
| 379 | + return Mustache.to_html( | ||
| 380 | + $("#templateOpcoesPublicado").html(), | ||
| 381 | + hash | ||
| 382 | + ); | ||
| 383 | + }, | ||
| 384 | + "opcoesNo": function(){ | ||
| 385 | + var p = this.id_subgrupo; | ||
| 386 | + var id = ""; | ||
| 387 | + //marca o selecionado | ||
| 388 | + var subgrupos = i3GEOadmin.subgrupos.listaTiposSubGrupos; | ||
| 389 | + $(subgrupos).each( | ||
| 390 | + function(i,el){ | ||
| 391 | + if(el.id_subgrupo == p){ | ||
| 392 | + subgrupos[i]["selected"] = "selected"; | ||
| 393 | + id = i; | ||
| 394 | + } | ||
| 395 | + else{ | ||
| 396 | + subgrupos[i]["selected"] = ""; | ||
| 397 | + } | ||
| 398 | + } | ||
| 399 | + ); | ||
| 400 | + var html = '<option value="">---</option>' + Mustache.to_html( | ||
| 401 | + "{{#data}}" + $("#templateOpcoesNo").html() + "{{/data}}", | ||
| 402 | + {"data":subgrupos} | ||
| 403 | + ); | ||
| 404 | + //volta ao normal | ||
| 405 | + subgrupos[id]["selected"] = ""; | ||
| 406 | + return html; | ||
| 407 | + } | ||
| 408 | + } | ||
| 409 | + ) | ||
| 410 | + ); | ||
| 411 | + i3GEOadmin.core.abreModalGeral(html); | ||
| 412 | + } | ||
| 413 | + ) | ||
| 414 | + .fail( | ||
| 415 | + function(data){ | ||
| 343 | i3GEOadmin.core.modalAguarde(false); | 416 | i3GEOadmin.core.modalAguarde(false); |
| 344 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | 417 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); |
| 345 | } | 418 | } |
| @@ -347,11 +420,10 @@ i3GEOadmin.subgrupos = { | @@ -347,11 +420,10 @@ i3GEOadmin.subgrupos = { | ||
| 347 | }, | 420 | }, |
| 348 | adicionaNoDialogo: function(){ | 421 | adicionaNoDialogo: function(){ |
| 349 | i3GEOadmin.core.abreModalGeral(i3GEOadmin.subgrupos.formAdicionaNo); | 422 | i3GEOadmin.core.abreModalGeral(i3GEOadmin.subgrupos.formAdicionaNo); |
| 350 | - $("#body-formNo-modal").collapse('show'); | ||
| 351 | }, | 423 | }, |
| 352 | // os parametros sao obtidos do formulario aberto do modal | 424 | // os parametros sao obtidos do formulario aberto do modal |
| 353 | adicionaNo: function(){ | 425 | adicionaNo: function(){ |
| 354 | - var parametros = $("#formNo-modal form").serialize(); | 426 | + var parametros = $("#form-edicao-no-modal").serialize(); |
| 355 | i3GEOadmin.core.fechaModalGeral(); | 427 | i3GEOadmin.core.fechaModalGeral(); |
| 356 | i3GEOadmin.core.modalAguarde(true); | 428 | i3GEOadmin.core.modalAguarde(true); |
| 357 | $.post( | 429 | $.post( |
| @@ -403,17 +475,18 @@ i3GEOadmin.subgrupos = { | @@ -403,17 +475,18 @@ i3GEOadmin.subgrupos = { | ||
| 403 | ); | 475 | ); |
| 404 | }, | 476 | }, |
| 405 | salvarNoDialogo: function(id){ | 477 | salvarNoDialogo: function(id){ |
| 478 | + i3GEOadmin.subgrupos.parametrosSalvar = $("#form-edicao-no-" + id).serialize(); | ||
| 406 | var hash = { | 479 | var hash = { |
| 407 | "mensagem": i3GEOadmin.subgrupos.dicionario.confirma, | 480 | "mensagem": i3GEOadmin.subgrupos.dicionario.confirma, |
| 408 | "onBotao1": "i3GEOadmin.subgrupos.salvarNo('"+id+"')", | 481 | "onBotao1": "i3GEOadmin.subgrupos.salvarNo('"+id+"')", |
| 409 | "botao1": i3GEOadmin.subgrupos.dicionario.sim, | 482 | "botao1": i3GEOadmin.subgrupos.dicionario.sim, |
| 410 | - "onBotao2": "i3GEOadmin.core.fechaModalConfirma();", | 483 | + "onBotao2": "i3GEOadmin.subgrupos.parametrosSalvar = '';i3GEOadmin.core.fechaModalConfirma();", |
| 411 | "botao2": i3GEOadmin.subgrupos.dicionario.nao | 484 | "botao2": i3GEOadmin.subgrupos.dicionario.nao |
| 412 | }; | 485 | }; |
| 413 | i3GEOadmin.core.abreModalConfirma(hash); | 486 | i3GEOadmin.core.abreModalConfirma(hash); |
| 414 | }, | 487 | }, |
| 415 | salvarNo: function(id){ | 488 | salvarNo: function(id){ |
| 416 | - var parametros = $("#formNo-" + id + " form").serialize(); | 489 | + var parametros = i3GEOadmin.subgrupos.parametrosSalvar; |
| 417 | i3GEOadmin.core.fechaModalGeral(); | 490 | i3GEOadmin.core.fechaModalGeral(); |
| 418 | i3GEOadmin.core.modalAguarde(true); | 491 | i3GEOadmin.core.modalAguarde(true); |
| 419 | $.post( | 492 | $.post( |
| @@ -422,6 +495,7 @@ i3GEOadmin.subgrupos = { | @@ -422,6 +495,7 @@ i3GEOadmin.subgrupos = { | ||
| 422 | ) | 495 | ) |
| 423 | .done( | 496 | .done( |
| 424 | function(data, status){ | 497 | function(data, status){ |
| 498 | + i3GEOadmin.subgrupos.parametrosSalvar = ''; | ||
| 425 | i3GEOadmin.core.modalAguarde(false); | 499 | i3GEOadmin.core.modalAguarde(false); |
| 426 | i3GEOadmin.core.iconeAguarde(i3GEOadmin.subgrupos.ondeNos); | 500 | i3GEOadmin.core.iconeAguarde(i3GEOadmin.subgrupos.ondeNos); |
| 427 | i3GEOadmin.subgrupos.lista(); | 501 | i3GEOadmin.subgrupos.lista(); |
| @@ -429,6 +503,7 @@ i3GEOadmin.subgrupos = { | @@ -429,6 +503,7 @@ i3GEOadmin.subgrupos = { | ||
| 429 | ) | 503 | ) |
| 430 | .fail( | 504 | .fail( |
| 431 | function(data){ | 505 | function(data){ |
| 506 | + i3GEOadmin.subgrupos.parametrosSalvar = ''; | ||
| 432 | i3GEOadmin.core.modalAguarde(false); | 507 | i3GEOadmin.core.modalAguarde(false); |
| 433 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | 508 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); |
| 434 | } | 509 | } |
| @@ -458,7 +533,7 @@ i3GEOadmin.subgrupos = { | @@ -458,7 +533,7 @@ i3GEOadmin.subgrupos = { | ||
| 458 | i3GEOadmin.core.modalAguarde(true); | 533 | i3GEOadmin.core.modalAguarde(true); |
| 459 | $.post( | 534 | $.post( |
| 460 | "execraiz.php?funcao=ordena", | 535 | "execraiz.php?funcao=ordena", |
| 461 | - "id_n1=" + i3GEOadmin.subgrupos.id_n1 + "&ordem=" + data.join(" ") | 536 | + "id_n1=" + i3GEOadmin.subgrupos.id_n1 + "&novaordem=" + data.join(" ") |
| 462 | ) | 537 | ) |
| 463 | .done( | 538 | .done( |
| 464 | function(data, status){ | 539 | function(data, status){ |
| @@ -474,7 +549,7 @@ i3GEOadmin.subgrupos = { | @@ -474,7 +549,7 @@ i3GEOadmin.subgrupos = { | ||
| 474 | } | 549 | } |
| 475 | ); | 550 | ); |
| 476 | }, | 551 | }, |
| 477 | - editarTemas: function(id,titulo){ | 552 | + editarTemasSubGrupo: function(id,titulo){ |
| 478 | //muda a url para que o usuario possa voltar pelo botao do navegador | 553 | //muda a url para que o usuario possa voltar pelo botao do navegador |
| 479 | var u = window.location.origin | 554 | var u = window.location.origin |
| 480 | + window.location.pathname | 555 | + window.location.pathname |
admin1/catalogo/menus/grupos/subgrupos/index.php
| @@ -33,7 +33,7 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | @@ -33,7 +33,7 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | ||
| 33 | class="btn btn-primary btn-fab btn-fab-mini pull-right"> | 33 | class="btn btn-primary btn-fab btn-fab-mini pull-right"> |
| 34 | <i class="material-icons">help</i> | 34 | <i class="material-icons">help</i> |
| 35 | </button> | 35 | </button> |
| 36 | - <h2><small>{{{txtTitulo}}}: <?php echo $nome_grupo; ?></small></h2> | 36 | + <h2><small>{{{txtTitulo}}}: <?php echo "$nome_menu -> $nome_grupo"; ?></small></h2> |
| 37 | <blockquote>{{{txtDesc}}}</blockquote> | 37 | <blockquote>{{{txtDesc}}}</blockquote> |
| 38 | <!-- aqui entra o filtro --> | 38 | <!-- aqui entra o filtro --> |
| 39 | <div class="form-group"> | 39 | <div class="form-group"> |
| @@ -63,7 +63,7 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | @@ -63,7 +63,7 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | ||
| 63 | <a onclick="i3GEOadmin.subgrupos.adicionaTemaDialogo();" href="javascript:void(0)" | 63 | <a onclick="i3GEOadmin.subgrupos.adicionaTemaDialogo();" href="javascript:void(0)" |
| 64 | class="btn btn-primary pull-right" role="button" style="color:#008579;">{{{adicionar}}}</a> | 64 | class="btn btn-primary pull-right" role="button" style="color:#008579;">{{{adicionar}}}</a> |
| 65 | <div class="clearfix"></div> | 65 | <div class="clearfix"></div> |
| 66 | - <div id="raiz" class="panel-body panel-collapse collapse"></div> | 66 | + <div id="raiz" class="panel-body"></div> |
| 67 | </div> | 67 | </div> |
| 68 | </div> | 68 | </div> |
| 69 | <div class="col-md-6"> | 69 | <div class="col-md-6"> |
| @@ -85,131 +85,140 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | @@ -85,131 +85,140 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | ||
| 85 | <option value="formNo-{{id_n2}}">{{{nome_subgrupo}}}</option> | 85 | <option value="formNo-{{id_n2}}">{{{nome_subgrupo}}}</option> |
| 86 | </script> | 86 | </script> |
| 87 | <script id="templateRaiz" type="x-tmpl-mustache"> | 87 | <script id="templateRaiz" type="x-tmpl-mustache"> |
| 88 | -<div class="panel panel-default" data-id="{{id_raiz}}" id="formRaiz-{{id_raiz}}"> | ||
| 89 | - <div class="panel-heading icon" role="tab"> | ||
| 90 | - <h3 class="panel-title" {{escondido}}> | ||
| 91 | - <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_raiz}}')" class="btn btn-danger btn-fab btn-fab-mini" role="button"> | ||
| 92 | - <i class="material-icons">delete_forever</i> | 88 | +<div class="list-group-item" data-id="{{id_raiz}}" id="formRaiz-{{id_raiz}}"> |
| 89 | + <div class="row-content"> | ||
| 90 | + <h3 class="list-group-item-heading {{escondido}}"> | ||
| 91 | + <span class="pull-right"> </span> | ||
| 92 | + <a href="javascript:void(0)" onclick="{{onEditar}}('{{id_raiz}}')" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
| 93 | + <i class="material-icons md-18">edit</i> | ||
| 93 | </a> | 94 | </a> |
| 94 | - | ||
| 95 | - <a class="collapsed in" role="button" data-toggle="collapse" href="#body-formRaiz-{{id_raiz}}" | ||
| 96 | - aria-expanded="false" aria-controls="#body-formRaiz-{{id_raiz}}"> {{{nome_tema}}} | ||
| 97 | - <i class="material-icons move" style="color: gray; display:none;">swap_vert</i> | 95 | + <span class="pull-right"> </span> |
| 96 | + <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_raiz}}')" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
| 97 | + <i class="material-icons md-18">delete_forever</i> | ||
| 98 | </a> | 98 | </a> |
| 99 | + <span class="nomeitem"> | ||
| 100 | + <i class="material-icons move" style="color: gray; display:none;position:absolute;left:-5px;">swap_vert</i> | ||
| 101 | + {{{nome_tema}}} | ||
| 102 | + </span> | ||
| 99 | </h3> | 103 | </h3> |
| 100 | </div> | 104 | </div> |
| 101 | - <div class="panel-body panel-collapse collapse" id="body-formRaiz-{{id_raiz}}"> | ||
| 102 | - <form style="" action="#" onsubmit="{{onSalvar}}('{{id_raiz}}');return false;" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" method="post" > | ||
| 103 | - <div class="row"> | ||
| 104 | - <div class="col-md-12"> | ||
| 105 | - <div class="form-group form-group-lg"> | ||
| 106 | - <label class="col-md-4 control-label" for="id_tema">{{{tema}}}</label> | ||
| 107 | - <div class="col-md-8"> | ||
| 108 | - <select title="{{{tema}}}" class="form-control" name="id_tema"> | ||
| 109 | - {{{opcoesTema}}} | ||
| 110 | - </select> | ||
| 111 | - </div> | ||
| 112 | - </div> | ||
| 113 | - <div class="form-group form-group-lg"> | ||
| 114 | - <label class="col-md-4 control-label" for="ordem">{{{ordemTxt}}}</label> | ||
| 115 | - <div class="col-md-8"> | ||
| 116 | - <input title="{{{ordemTxt}}}" type="text" value="{{{ordem}}}" class="form-control" name="ordem"> | ||
| 117 | - </div> | ||
| 118 | - </div> | ||
| 119 | - <div class="form-group form-group-lg"> | ||
| 120 | - <label class="col-md-4 control-label" for="perfil">{{{perfis}}}</label> | ||
| 121 | - <div class="col-md-4"> | ||
| 122 | - <input title="{{{perfis}}}" id="perfil_tema-{{id_raiz}}" type="text" value="{{{perfil}}}" class="form-control" name="perfil"> | ||
| 123 | - </div> | ||
| 124 | - <div class="col-md-4"> | ||
| 125 | - <select title="{{{perfis}}}" class="form-control" onchange="i3GEOadmin.subgrupos.addInput('perfil_tema-{{id_raiz}}',this.value)"> | ||
| 126 | - {{{opcoesPerfil}}} | ||
| 127 | - </select> | ||
| 128 | - </div> | ||
| 129 | - </div> | 105 | + <div class="list-group-separator"></div> |
| 106 | +</div> | ||
| 107 | +</script> | ||
| 108 | +<script id="templateFormRaiz" type="x-tmpl-mustache"> | ||
| 109 | +<form id="form-edicao-raiz-{{id_raiz}}" style="" action="#" onsubmit="{{onSalvar}}('{{id_raiz}}');return false;" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" method="post" > | ||
| 110 | + <div class="row"> | ||
| 111 | + <div class="col-md-12"> | ||
| 112 | + <div class="form-group form-group-lg"> | ||
| 113 | + <label class="col-md-4 control-label" for="id_tema">{{{tema}}}</label> | ||
| 114 | + <div class="col-md-8"> | ||
| 115 | + <select title="{{{tema}}}" class="form-control" name="id_tema"> | ||
| 116 | + {{{opcoesTema}}} | ||
| 117 | + </select> | ||
| 118 | + </div> | ||
| 119 | + </div> | ||
| 120 | + <div class="form-group form-group-lg"> | ||
| 121 | + <label class="col-md-4 control-label" for="ordem">{{{ordemTxt}}}</label> | ||
| 122 | + <div class="col-md-8"> | ||
| 123 | + <input title="{{{ordemTxt}}}" type="text" value="{{{ordem}}}" class="form-control" name="ordem"> | ||
| 124 | + </div> | ||
| 125 | + </div> | ||
| 126 | + <div class="form-group form-group-lg"> | ||
| 127 | + <label class="col-md-4 control-label" for="perfil">{{{perfis}}}</label> | ||
| 128 | + <div class="col-md-4"> | ||
| 129 | + <input title="{{{perfis}}}" id="perfil_tema-{{id_raiz}}" type="text" value="{{{perfil}}}" class="form-control" name="perfil"> | ||
| 130 | + </div> | ||
| 131 | + <div class="col-md-4"> | ||
| 132 | + <select title="{{{perfis}}}" class="form-control" onchange="i3GEOadmin.subgrupos.addInput('perfil_tema-{{id_raiz}}',this.value)"> | ||
| 133 | + {{{opcoesPerfil}}} | ||
| 134 | + </select> | ||
| 130 | </div> | 135 | </div> |
| 131 | </div> | 136 | </div> |
| 132 | - <div class="pull-right"> | ||
| 133 | - <button type="submit" class="btn btn-primary" role="button" style="color:#008579;">{{salvar}}</button> | ||
| 134 | </div> | 137 | </div> |
| 135 | - </form> | ||
| 136 | - | ||
| 137 | </div> | 138 | </div> |
| 138 | -</div> | 139 | + <div class="pull-right"> |
| 140 | + <button type="submit" class="btn btn-primary" role="button" style="color:#008579;">{{salvar}}</button> | ||
| 141 | + </div> | ||
| 142 | + <div class="clearfix"></div> | ||
| 143 | +</form> | ||
| 139 | </script> | 144 | </script> |
| 140 | <script id="templateNos" type="x-tmpl-mustache"> | 145 | <script id="templateNos" type="x-tmpl-mustache"> |
| 141 | -<div class="panel panel-default" data-id="{{id_n2}}" id="formNo-{{id_n2}}"> | ||
| 142 | - <div class="panel-heading icon" role="tab"> | ||
| 143 | - <h3 class="panel-title" {{escondido}}> | ||
| 144 | - <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_n2}}')" class="btn btn-danger btn-fab btn-fab-mini" role="button"> | ||
| 145 | - <i class="material-icons">delete_forever</i> | 146 | +<div class="list-group-item" data-id="{{id_n2}}" id="formNo-{{id_n2}}"> |
| 147 | + <div class="row-content"> | ||
| 148 | + <h3 class="list-group-item-heading {{escondido}}"> | ||
| 149 | + <div class="pull-right"> | ||
| 150 | + <a role="button" class="btn btn-danger btn-fab btn-fab-mini pull-left" onclick="i3GEOadmin.subgrupos.editarTemasSubGrupo('{{id_n2}}','{{{nome_subgrupo}}}')" href="javascript:void(0)"> | ||
| 151 | + <i class="material-icons md-18">folder_open</i> | ||
| 152 | + </a> | ||
| 153 | + <label class=pull-right><h6 style="margin-top: 5px; margin-bottom: 5px;"> {{{temas}}}</h6></label> | ||
| 154 | + </div> | ||
| 155 | + <span class="pull-right"> </span> | ||
| 156 | + <a href="javascript:void(0)" onclick="{{onEditar}}('{{id_n2}}')" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
| 157 | + <i class="material-icons md-18">edit</i> | ||
| 146 | </a> | 158 | </a> |
| 147 | - | ||
| 148 | - <a class="collapsed in" role="button" data-toggle="collapse" href="#body-formNo-{{id_n2}}" | ||
| 149 | - aria-expanded="false" aria-controls="#body-formNo-{{id_n2}}"> {{{nome_subgrupo}}} | ||
| 150 | - <i class="material-icons move" style="color: gray; display:none;">swap_vert</i> | 159 | + <span class="pull-right"> </span> |
| 160 | + <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_n2}}')" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
| 161 | + <i class="material-icons md-18">delete_forever</i> | ||
| 151 | </a> | 162 | </a> |
| 163 | + <span class="nomeitem"> | ||
| 164 | + <i class="material-icons move" style="color: gray; display:none;position:absolute;left:-5px;">swap_vert</i> | ||
| 165 | + {{{nome_subgrupo}}} | ||
| 166 | + </span> | ||
| 152 | </h3> | 167 | </h3> |
| 153 | </div> | 168 | </div> |
| 154 | - <div class="panel-body panel-collapse collapse" id="body-formNo-{{id_n2}}"> | ||
| 155 | - <form style="" action="#" onsubmit="{{onSalvar}}('{{id_n2}}');return false;" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" method="post" > | ||
| 156 | - <div class="row"> | ||
| 157 | - <div class="col-md-12"> | ||
| 158 | - <div class="form-group form-group-lg"> | ||
| 159 | - <label class="col-md-4 control-label" for="id_subgrupo">{{{nomeTxt}}}</label> | ||
| 160 | - <div class="col-md-6"> | ||
| 161 | - <select title="{{{nomeTxt}}}" class="form-control" name="id_subgrupo"> | ||
| 162 | - {{{opcoesNo}}} | ||
| 163 | - </select> | ||
| 164 | - </div> | ||
| 165 | - <div class="col-md-2"> | ||
| 166 | - <a onclick="i3GEOadmin.subgrupos.editarListaDeSubGrupos('{{id_n2}}','{{{nome_subgrupo}}}');" href="javascript:void(0)" | ||
| 167 | - class="btn btn-primary btn-xs" role="button">{{{editarLista}}}</a> | ||
| 168 | - </div> | ||
| 169 | - </div> | ||
| 170 | - <div class="form-group form-group-lg"> | ||
| 171 | - <label class="col-md-4 control-label" for="ordem">{{{ordemTxt}}}</label> | ||
| 172 | - <div class="col-md-8"> | ||
| 173 | - <input title="{{{ordemTxt}}}" type="text" value="{{{ordem}}}" class="form-control" name="ordem"> | ||
| 174 | - </div> | ||
| 175 | - </div> | ||
| 176 | - <div class="form-group form-group-lg"> | ||
| 177 | - <label class="col-md-4 control-label" for="publicado">{{{publicadoTxt}}}</label> | ||
| 178 | - <div class="col-md-8"> | ||
| 179 | - <select title="{{{publicadoTxt}}}" name="publicado" class="form-control"> | ||
| 180 | - {{{opcoesPublicado}}} | ||
| 181 | - </select> | ||
| 182 | - </div> | ||
| 183 | - </div> | ||
| 184 | - <div class="form-group form-group-lg"> | ||
| 185 | - <label class="col-md-4 control-label" for="perfil">{{{perfis}}}</label> | ||
| 186 | - <div class="col-md-4"> | ||
| 187 | - <input title="{{{perfis}}}" id="perfil_no-{{id_n2}}" type="text" value="{{{n2_perfil}}}" class="form-control" name="n2_perfil"> | ||
| 188 | - </div> | ||
| 189 | - <div class="col-md-4"> | ||
| 190 | - <select title="{{{perfis}}}" class="form-control" onchange="i3GEOadmin.subgrupos.addInput('perfil_no-{{id_n2}}',this.value)"> | ||
| 191 | - {{{opcoesPerfil}}} | ||
| 192 | - </select> | ||
| 193 | - </div> | ||
| 194 | - </div> | 169 | + <div class="list-group-separator"></div> |
| 170 | +</div> | ||
| 171 | +</script> | ||
| 172 | +<script id="templateFormNos" type="x-tmpl-mustache"> | ||
| 173 | +<form id="form-edicao-no-{{id_n2}}" style="" action="#" onsubmit="{{onSalvar}}('{{id_n2}}');return false;" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" method="post" > | ||
| 174 | + <div class="row"> | ||
| 175 | + <div class="col-md-12"> | ||
| 176 | + <div class="form-group form-group-lg"> | ||
| 177 | + <label class="col-md-4 control-label" for="id_subgrupo">{{{nomeTxt}}}</label> | ||
| 178 | + <div class="col-md-6"> | ||
| 179 | + <select title="{{{nomeTxt}}}" class="form-control" name="id_subgrupo"> | ||
| 180 | + {{{opcoesNo}}} | ||
| 181 | + </select> | ||
| 182 | + </div> | ||
| 183 | + <div class="col-md-2"> | ||
| 184 | + <a onclick="i3GEOadmin.subgrupos.editarListaDeSubGrupos('{{id_n2}}','{{{nome_subgrupo}}}');" href="javascript:void(0)" | ||
| 185 | + class="btn btn-primary btn-xs" role="button">{{{editarLista}}}</a> | ||
| 186 | + </div> | ||
| 187 | + </div> | ||
| 188 | + <div class="form-group form-group-lg"> | ||
| 189 | + <label class="col-md-4 control-label" for="ordem">{{{ordemTxt}}}</label> | ||
| 190 | + <div class="col-md-8"> | ||
| 191 | + <input title="{{{ordemTxt}}}" type="text" value="{{{ordem}}}" class="form-control" name="ordem"> | ||
| 192 | + </div> | ||
| 193 | + </div> | ||
| 194 | + <div class="form-group form-group-lg"> | ||
| 195 | + <label class="col-md-4 control-label" for="publicado">{{{publicadoTxt}}}</label> | ||
| 196 | + <div class="col-md-8"> | ||
| 197 | + <select title="{{{publicadoTxt}}}" name="publicado" class="form-control"> | ||
| 198 | + {{{opcoesPublicado}}} | ||
| 199 | + </select> | ||
| 200 | + </div> | ||
| 201 | + </div> | ||
| 202 | + <div class="form-group form-group-lg"> | ||
| 203 | + <label class="col-md-4 control-label" for="perfil">{{{perfis}}}</label> | ||
| 204 | + <div class="col-md-4"> | ||
| 205 | + <input title="{{{perfis}}}" id="perfil_no-{{id_n2}}" type="text" value="{{{n2_perfil}}}" class="form-control" name="n2_perfil"> | ||
| 206 | + </div> | ||
| 207 | + <div class="col-md-4"> | ||
| 208 | + <select title="{{{perfis}}}" class="form-control" onchange="i3GEOadmin.grupos.addInput('perfil_no-{{id_n2}}',this.value)"> | ||
| 209 | + {{{opcoesPerfil}}} | ||
| 210 | + </select> | ||
| 195 | </div> | 211 | </div> |
| 196 | </div> | 212 | </div> |
| 197 | - <div class="pull-right"> | ||
| 198 | - <button type="submit" class="btn btn-primary" role="button" style="color:#008579;">{{salvar}}</button> | ||
| 199 | </div> | 213 | </div> |
| 200 | - </form> | ||
| 201 | - | ||
| 202 | </div> | 214 | </div> |
| 203 | - <div class="panel-footer {{escondido}}" style="padding-top: 0px; padding-bottom: 0px;"> | ||
| 204 | - <div class="pull-right"> | ||
| 205 | - <button style="color:#007a6f;" onclick="i3GEOadmin.subgrupos.editarTemas('{{id_n2}}','{{{nome_subgrupo}}}')" class="btn btn-primary btn-xs" style="margin-top: 2px; margin-bottom: 2px;"> | ||
| 206 | - <i class="material-icons">folder_open</i> {{{editarSub}}} | ||
| 207 | - </button> | ||
| 208 | - </div> | ||
| 209 | - <div class="clearfix"></div> | 215 | + <div class="pull-right"> |
| 216 | + <button type="submit" class="btn btn-primary" role="button" style="color:#008579;">{{salvar}}</button> | ||
| 210 | </div> | 217 | </div> |
| 211 | -</div> | 218 | + <div class="clearfix"></div> |
| 219 | +</form> | ||
| 212 | </script> | 220 | </script> |
| 221 | + | ||
| 213 | <script id="templateOpcoesPublicado" type="x-tmpl-mustache"> | 222 | <script id="templateOpcoesPublicado" type="x-tmpl-mustache"> |
| 214 | <option value="">---</option> | 223 | <option value="">---</option> |
| 215 | <option {{SIM-sel}} value="SIM">{{{sim}}}</option> | 224 | <option {{SIM-sel}} value="SIM">{{{sim}}}</option> |
admin1/catalogo/menus/grupos/subgrupos/listadesubgrupos/exec.php
| @@ -31,7 +31,9 @@ include_once (dirname ( __FILE__ ) . "/../../../../../../admin/php/login.php"); | @@ -31,7 +31,9 @@ include_once (dirname ( __FILE__ ) . "/../../../../../../admin/php/login.php"); | ||
| 31 | $funcoesEdicao = array ( | 31 | $funcoesEdicao = array ( |
| 32 | "ADICIONAR", | 32 | "ADICIONAR", |
| 33 | "ALTERAR", | 33 | "ALTERAR", |
| 34 | - "EXCLUIR" | 34 | + "EXCLUIR", |
| 35 | + "LISTA", | ||
| 36 | + "LISTAUNICO" | ||
| 35 | ); | 37 | ); |
| 36 | if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { | 38 | if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { |
| 37 | if (verificaOperacaoSessao ( "admin/html/arvore" ) === false) { | 39 | if (verificaOperacaoSessao ( "admin/html/arvore" ) === false) { |
| @@ -72,8 +74,20 @@ switch ($funcao) { | @@ -72,8 +74,20 @@ switch ($funcao) { | ||
| 72 | retornaJSON ( $dados ); | 74 | retornaJSON ( $dados ); |
| 73 | exit (); | 75 | exit (); |
| 74 | break; | 76 | break; |
| 77 | + case "LISTAUNICO" : | ||
| 78 | + $dados = pegaDados ( "SELECT * from ".$esquemaadmin."i3geoadmin_subgrupos WHERE id_subgrupo = $id_subgrupo", $dbh, false ); | ||
| 79 | + if ($dados === false) { | ||
| 80 | + $dbhw = null; | ||
| 81 | + $dbh = null; | ||
| 82 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
| 83 | + exit (); | ||
| 84 | + } | ||
| 85 | + $dbhw = null; | ||
| 86 | + $dbh = null; | ||
| 87 | + retornaJSON ( $dados[0] ); | ||
| 88 | + break; | ||
| 75 | case "LISTA" : | 89 | case "LISTA" : |
| 76 | - $dados = pegaDados ( "SELECT * from ".$esquemaadmin."i3geoadmin_subgrupos order by lower(nome_subgrupo)", $dbh, false ); | 90 | + $dados = pegaDados ( "SELECT id_subgrupo,nome_subgrupo from ".$esquemaadmin."i3geoadmin_subgrupos order by lower(nome_subgrupo)", $dbh, false ); |
| 77 | if ($dados === false) { | 91 | if ($dados === false) { |
| 78 | $dbhw = null; | 92 | $dbhw = null; |
| 79 | $dbh = null; | 93 | $dbh = null; |
admin1/catalogo/menus/grupos/subgrupos/listadesubgrupos/index.js
| @@ -27,6 +27,7 @@ i3GEOadmin.subgrupos = { | @@ -27,6 +27,7 @@ i3GEOadmin.subgrupos = { | ||
| 27 | ondeLista: "", | 27 | ondeLista: "", |
| 28 | //conteudo html do formulario de adicao de operacao | 28 | //conteudo html do formulario de adicao de operacao |
| 29 | formAdiciona: "", | 29 | formAdiciona: "", |
| 30 | + parametrosSalvar: "", | ||
| 30 | init: function(onde){ | 31 | init: function(onde){ |
| 31 | i3GEOadmin.subgrupos.ondeLista = onde; | 32 | i3GEOadmin.subgrupos.ondeLista = onde; |
| 32 | i3GEOadmin.subgrupos.lista(); | 33 | i3GEOadmin.subgrupos.lista(); |
| @@ -49,7 +50,6 @@ Obt&eacute;m a lista de grupos | @@ -49,7 +50,6 @@ Obt&eacute;m a lista de grupos | ||
| 49 | var json = jQuery.parseJSON(data); | 50 | var json = jQuery.parseJSON(data); |
| 50 | //template do form de cada operacao | 51 | //template do form de cada operacao |
| 51 | var templateLista = $("#templateLista").html(); | 52 | var templateLista = $("#templateLista").html(); |
| 52 | - templateLista = templateLista.replace("{{{templateFormLista}}}",$("#templateFormLista").html()); | ||
| 53 | //lista todas as grupos | 53 | //lista todas as grupos |
| 54 | var html = Mustache.to_html( | 54 | var html = Mustache.to_html( |
| 55 | "{{#data}}" + templateLista + "{{/data}}", | 55 | "{{#data}}" + templateLista + "{{/data}}", |
| @@ -59,7 +59,7 @@ Obt&eacute;m a lista de grupos | @@ -59,7 +59,7 @@ Obt&eacute;m a lista de grupos | ||
| 59 | { | 59 | { |
| 60 | "data": json, | 60 | "data": json, |
| 61 | "onExcluir": "i3GEOadmin.subgrupos.excluirDialogo",//funcao | 61 | "onExcluir": "i3GEOadmin.subgrupos.excluirDialogo",//funcao |
| 62 | - "onSalvar": "i3GEOadmin.subgrupos.salvarDialogo"//funcao | 62 | + "onEditar": "i3GEOadmin.subgrupos.editarDialogo"//funcao |
| 63 | } | 63 | } |
| 64 | ) | 64 | ) |
| 65 | ); | 65 | ); |
| @@ -102,12 +102,46 @@ Obt&eacute;m a lista de grupos | @@ -102,12 +102,46 @@ Obt&eacute;m a lista de grupos | ||
| 102 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | 102 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); |
| 103 | }); | 103 | }); |
| 104 | }, | 104 | }, |
| 105 | + editarDialogo: function(id){ | ||
| 106 | + i3GEOadmin.core.fechaModalGeral(); | ||
| 107 | + i3GEOadmin.core.modalAguarde(true); | ||
| 108 | + $.post( | ||
| 109 | + "exec.php?funcao=listaunico", | ||
| 110 | + "id_subgrupo=" + id | ||
| 111 | + ) | ||
| 112 | + .done( | ||
| 113 | + function(data, status){ | ||
| 114 | + var json = jQuery.parseJSON(data); | ||
| 115 | + //lista todas as grupos | ||
| 116 | + var html = Mustache.to_html( | ||
| 117 | + "{{#data}}" + $("#templateFormLista").html() + "{{/data}}", | ||
| 118 | + $.extend( | ||
| 119 | + {}, | ||
| 120 | + i3GEOadmin.subgrupos.dicionario, | ||
| 121 | + { | ||
| 122 | + "data": json, | ||
| 123 | + "onExcluir": "i3GEOadmin.subgrupos.excluirDialogo",//funcao | ||
| 124 | + "onSalvar": "i3GEOadmin.subgrupos.salvarDialogo"//funcao | ||
| 125 | + } | ||
| 126 | + ) | ||
| 127 | + ); | ||
| 128 | + i3GEOadmin.subgrupos.ondeLista.html(html); | ||
| 129 | + i3GEOadmin.core.abreModalGeral(html); | ||
| 130 | + } | ||
| 131 | + ) | ||
| 132 | + .fail( | ||
| 133 | + function(data){ | ||
| 134 | + i3GEOadmin.core.modalAguarde(false); | ||
| 135 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
| 136 | + } | ||
| 137 | + ); | ||
| 138 | + }, | ||
| 105 | adicionaDialogo: function(){ | 139 | adicionaDialogo: function(){ |
| 106 | i3GEOadmin.core.abreModalGeral(i3GEOadmin.subgrupos.formAdiciona); | 140 | i3GEOadmin.core.abreModalGeral(i3GEOadmin.subgrupos.formAdiciona); |
| 107 | }, | 141 | }, |
| 108 | // os parametros sao obtidos do formulario aberto do modal | 142 | // os parametros sao obtidos do formulario aberto do modal |
| 109 | adiciona: function(){ | 143 | adiciona: function(){ |
| 110 | - var parametros = $("#modalGeral form").serialize(); | 144 | + var parametros = $("#form-edicao-modal").serialize(); |
| 111 | i3GEOadmin.core.fechaModalGeral(); | 145 | i3GEOadmin.core.fechaModalGeral(); |
| 112 | i3GEOadmin.core.modalAguarde(true); | 146 | i3GEOadmin.core.modalAguarde(true); |
| 113 | $.post( | 147 | $.post( |
| @@ -159,17 +193,18 @@ Obt&eacute;m a lista de grupos | @@ -159,17 +193,18 @@ Obt&eacute;m a lista de grupos | ||
| 159 | ); | 193 | ); |
| 160 | }, | 194 | }, |
| 161 | salvarDialogo: function(id){ | 195 | salvarDialogo: function(id){ |
| 196 | + i3GEOadmin.subgrupos.parametrosSalvar = $("#form-edicao-" + id).serialize(); | ||
| 162 | var hash = { | 197 | var hash = { |
| 163 | "mensagem": i3GEOadmin.subgrupos.dicionario.confirma, | 198 | "mensagem": i3GEOadmin.subgrupos.dicionario.confirma, |
| 164 | "onBotao1": "i3GEOadmin.subgrupos.salvar('"+id+"')", | 199 | "onBotao1": "i3GEOadmin.subgrupos.salvar('"+id+"')", |
| 165 | "botao1": i3GEOadmin.subgrupos.dicionario.sim, | 200 | "botao1": i3GEOadmin.subgrupos.dicionario.sim, |
| 166 | - "onBotao2": "i3GEOadmin.core.fechaModalConfirma();", | 201 | + "onBotao2": "i3GEOadmin.subgrupos.parametrosSalvar = '';i3GEOadmin.core.fechaModalConfirma();", |
| 167 | "botao2": i3GEOadmin.subgrupos.dicionario.nao | 202 | "botao2": i3GEOadmin.subgrupos.dicionario.nao |
| 168 | }; | 203 | }; |
| 169 | i3GEOadmin.core.abreModalConfirma(hash); | 204 | i3GEOadmin.core.abreModalConfirma(hash); |
| 170 | }, | 205 | }, |
| 171 | salvar: function(id){ | 206 | salvar: function(id){ |
| 172 | - var parametros = $("#form-" + id + " form").serialize(); | 207 | + var parametros = i3GEOadmin.subgrupos.parametrosSalvar; |
| 173 | i3GEOadmin.core.fechaModalGeral(); | 208 | i3GEOadmin.core.fechaModalGeral(); |
| 174 | i3GEOadmin.core.modalAguarde(true); | 209 | i3GEOadmin.core.modalAguarde(true); |
| 175 | $.post( | 210 | $.post( |
| @@ -178,6 +213,7 @@ Obt&eacute;m a lista de grupos | @@ -178,6 +213,7 @@ Obt&eacute;m a lista de grupos | ||
| 178 | ) | 213 | ) |
| 179 | .done( | 214 | .done( |
| 180 | function(data, status){ | 215 | function(data, status){ |
| 216 | + i3GEOadmin.subgrupos.parametrosSalvar = ''; | ||
| 181 | i3GEOadmin.core.modalAguarde(false); | 217 | i3GEOadmin.core.modalAguarde(false); |
| 182 | i3GEOadmin.core.iconeAguarde(i3GEOadmin.subgrupos.ondeLista); | 218 | i3GEOadmin.core.iconeAguarde(i3GEOadmin.subgrupos.ondeLista); |
| 183 | i3GEOadmin.subgrupos.lista(); | 219 | i3GEOadmin.subgrupos.lista(); |
| @@ -185,6 +221,7 @@ Obt&eacute;m a lista de grupos | @@ -185,6 +221,7 @@ Obt&eacute;m a lista de grupos | ||
| 185 | ) | 221 | ) |
| 186 | .fail( | 222 | .fail( |
| 187 | function(data){ | 223 | function(data){ |
| 224 | + i3GEOadmin.subgrupos.parametrosSalvar = ''; | ||
| 188 | i3GEOadmin.core.modalAguarde(false); | 225 | i3GEOadmin.core.modalAguarde(false); |
| 189 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | 226 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); |
| 190 | } | 227 | } |
admin1/catalogo/menus/grupos/subgrupos/listadesubgrupos/index.php
| @@ -10,27 +10,20 @@ $nome_subgrupo = filter_var ( $_GET ["nome_subgrupo"], FILTER_SANITIZE_STRING ); | @@ -10,27 +10,20 @@ $nome_subgrupo = filter_var ( $_GET ["nome_subgrupo"], FILTER_SANITIZE_STRING ); | ||
| 10 | $id_menu = filter_var ( $_GET ["id_menu"], FILTER_SANITIZE_NUMBER_INT ); | 10 | $id_menu = filter_var ( $_GET ["id_menu"], FILTER_SANITIZE_NUMBER_INT ); |
| 11 | $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | 11 | $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); |
| 12 | ?> | 12 | ?> |
| 13 | -<div class="container-fluid"> | 13 | +<div class="container-fluid migalha"> |
| 14 | <div class="row"> | 14 | <div class="row"> |
| 15 | - <ol class="breadcrumb"> | ||
| 16 | - <li><a href="../../../../../init/index.php">i3Geo</a></li> | ||
| 17 | - <li><a href="../../../../../index.php">Admin</a></li> | ||
| 18 | - <li>Catálogo</li> | ||
| 19 | - <li><a href="../../../index.php">menus</a></li> | ||
| 20 | - <li><a href="../../../index.php?id_filtro=<?php echo $id_menu; ?>"> <?php echo $nome_menu; ?></a></li> | ||
| 21 | - <li><a href="../../index.php?id_menu=<?php echo $id_menu; ?>&nome_menu=<?php echo $nome_menu; ?>">grupos</a></li> | ||
| 22 | - <li><a href="../../index.php?id_filtro=<?php echo $id_n1; ?>&id_menu=<?php echo $id_menu; ?>&nome_menu=<?php echo $nome_menu; ?>"> <?php echo $nome_grupo; ?></a></li> | ||
| 23 | - <li><a | ||
| 24 | - href="../index.php?id_filtro=<?php echo $id_n1; ?>&id_menu=<?php echo $id_menu; ?>&nome_menu=<?php echo $nome_menu; ?>"> <?php echo $nome_grupo; ?></a></li> | ||
| 25 | - <li><a | ||
| 26 | - href="../index.php?id_menu=<?php echo $id_menu; ?>&nome_menu=<?php echo $nome_menu; ?>&id_grupo=<?php echo $id_grupo; ?>&nome_grupo=<?php echo $nome_grupo; ?>">subgrupos</a></li> | ||
| 27 | - <li><a | ||
| 28 | - href="../index.php?id_filtro=<?php echo $id_n2; ?>&id_menu=<?php echo $id_menu; ?>&nome_menu=<?php echo $nome_menu; ?>&id_grupo=<?php echo $id_grupo; ?>&nome_grupo=<?php echo $nome_grupo; ?>"> <?php echo $nome_subgrupo; ?></a></li> | ||
| 29 | - | ||
| 30 | - <li class="active">lista de subgrupos</li> | ||
| 31 | - </ol> | 15 | + <div class="btn-group btn-breadcrumb"> |
| 16 | + <a class="btn btn-default" href="../../../../../../init/index.php"><div>i3Geo</div></a> | ||
| 17 | + <a class="btn btn-default" href="../../../../../index.php"><div>Admin</div></a> | ||
| 18 | + <a class="btn btn-default" style="pointer-events: none"><div>Catálogo</div></a> | ||
| 19 | + <a class="btn btn-default" href="../../../index.php"><div>Menus</div></a> | ||
| 20 | + <a class="btn btn-default" href="../../index.php?id_menu=<?php echo $id_menu; ?>"><div>Grupos</div></a> | ||
| 21 | + <a class="btn btn-default" href="../index.php?id_n1=<?php echo $id_n1; ?>"><div>Subgrupos</div></a> | ||
| 22 | + <a class="btn btn-default" style="pointer-events: none"><div>Lista de sub grupos</div></a> | ||
| 23 | + </div> | ||
| 32 | </div> | 24 | </div> |
| 33 | </div> | 25 | </div> |
| 26 | + | ||
| 34 | <div class="container"> | 27 | <div class="container"> |
| 35 | <div class="row center-block"> | 28 | <div class="row center-block"> |
| 36 | <div class="col-md-12"> | 29 | <div class="col-md-12"> |
| @@ -41,8 +34,8 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | @@ -41,8 +34,8 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | ||
| 41 | <i class="material-icons">help</i> | 34 | <i class="material-icons">help</i> |
| 42 | </button> | 35 | </button> |
| 43 | --> | 36 | --> |
| 44 | - <h3>{{{txtTituloGrupos}}}</h3> | ||
| 45 | - <h4>{{{txtDescGrupos}}}</h4> | 37 | + <h2><small>{{{txtListaDeSubGrupos}}}</small></h2> |
| 38 | + <blockquote>{{{descListaDeSubGrupos}}}</blockquote> | ||
| 46 | <!-- aqui entra o filtro --> | 39 | <!-- aqui entra o filtro --> |
| 47 | <div class="form-group"> | 40 | <div class="form-group"> |
| 48 | <select | 41 | <select |
| @@ -54,17 +47,6 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | @@ -54,17 +47,6 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | ||
| 54 | class="btn btn-primary" role="button" style="color:#008579;">{{{adicionar}}}</a> | 47 | class="btn btn-primary" role="button" style="color:#008579;">{{{adicionar}}}</a> |
| 55 | </div> | 48 | </div> |
| 56 | <div class="clearfix"></div> | 49 | <div class="clearfix"></div> |
| 57 | - <!-- | ||
| 58 | - <div id="ajudaPrincipal" class="modal fade" tabindex="-1"> | ||
| 59 | - <div class="modal-dialog"> | ||
| 60 | - <div class="modal-content"> | ||
| 61 | - <div class="modal-body"> | ||
| 62 | - <p>{{{txtAjuda}}}</p> | ||
| 63 | - </div> | ||
| 64 | - </div> | ||
| 65 | - </div> | ||
| 66 | - </div> | ||
| 67 | - --> | ||
| 68 | </div> | 50 | </div> |
| 69 | <div class="well hidden"> | 51 | <div class="well hidden"> |
| 70 | <div id="corpo"></div> | 52 | <div id="corpo"></div> |
| @@ -76,55 +58,62 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | @@ -76,55 +58,62 @@ $nome_menu = filter_var ( $_GET ["nome_menu"], FILTER_SANITIZE_STRING ); | ||
| 76 | <option value="form-{{id_subgrupo}}">{{{nome_subgrupo}}}</option> | 58 | <option value="form-{{id_subgrupo}}">{{{nome_subgrupo}}}</option> |
| 77 | </script> | 59 | </script> |
| 78 | <script id="templateFormLista" type="x-tmpl-mustache"> | 60 | <script id="templateFormLista" type="x-tmpl-mustache"> |
| 79 | -<form style="" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" | 61 | +<form id="form-edicao-{{id_subgrupo}}" style="" action="#" onsubmit="{{onSalvar}}('{{id_subgrupo}}');return false;" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" |
| 80 | method="post" > | 62 | method="post" > |
| 81 | - <div class="form-group form-group-lg"> | ||
| 82 | - <label class="col-md-2 control-label" for="nome">{{{nomeTxt}}} (Pt)</label> | ||
| 83 | - <div class="col-md-10"> | ||
| 84 | - <input type="text" value="{{{nome_subgrupo}}}" class="form-control" name="nome_subgrupo" required> | ||
| 85 | - </div> | ||
| 86 | - </div> | ||
| 87 | - <div class="form-group form-group-lg"> | ||
| 88 | - <label class="col-md-2 control-label" for="desc_subgrupo">{{{descricaoTxt}}}</label> | ||
| 89 | - <div class="col-md-10"> | ||
| 90 | - <input type="text" value="{{{desc_subgrupo}}}" class="form-control" name="desc_subgrupo" required> | ||
| 91 | - </div> | ||
| 92 | - </div> | ||
| 93 | - <div class="form-group form-group-lg"> | ||
| 94 | - <label class="col-md-2 control-label" for="es">Es</label> | ||
| 95 | - <div class="col-md-10"> | ||
| 96 | - <input type="text" value="{{{es}}}" class="form-control" name="es" required> | 63 | + <div class="row"> |
| 64 | + <div class="col-md-12"> | ||
| 65 | + <div class="form-group form-group-lg"> | ||
| 66 | + <label class="col-md-2 control-label" for="nome">{{{nomeTxt}}} (Pt)</label> | ||
| 67 | + <div class="col-md-10"> | ||
| 68 | + <input title="{{{nomeTxt}}}" type="text" value="{{{nome_subgrupo}}}" class="form-control" name="nome_subgrupo" required> | ||
| 69 | + </div> | ||
| 70 | + </div> | ||
| 71 | + <div class="form-group form-group-lg"> | ||
| 72 | + <label class="col-md-2 control-label" for="desc_grupo">{{{descricaoTxt}}}</label> | ||
| 73 | + <div class="col-md-10"> | ||
| 74 | + <input title="{{{descricaoTxt}}}" type="text" value="{{{desc_subgrupo}}}" class="form-control" name="desc_subgrupo" > | ||
| 75 | + </div> | ||
| 76 | + </div> | ||
| 77 | + <div class="form-group form-group-lg"> | ||
| 78 | + <label class="col-md-2 control-label" for="es">Es</label> | ||
| 79 | + <div class="col-md-10"> | ||
| 80 | + <input title="Espanhol" type="text" value="{{{es}}}" class="form-control" name="es" > | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + <div class="form-group form-group-lg"> | ||
| 84 | + <label class="col-md-2 control-label" for="en">En</label> | ||
| 85 | + <div class="col-md-10"> | ||
| 86 | + <input title="Ingles" type="text" value="{{{en}}}" class="form-control" name="en" > | ||
| 87 | + </div> | ||
| 88 | + </div> | ||
| 97 | </div> | 89 | </div> |
| 98 | </div> | 90 | </div> |
| 99 | - <div class="form-group form-group-lg"> | ||
| 100 | - <label class="col-md-2 control-label" for="en">En</label> | ||
| 101 | - <div class="col-md-10"> | ||
| 102 | - <input type="text" value="{{{en}}}" class="form-control" name="en" required> | ||
| 103 | - </div> | 91 | + <div class="pull-right"> |
| 92 | + <button type="submit" class="btn btn-primary" role="button" style="color:#008579;">{{salvar}}</button> | ||
| 104 | </div> | 93 | </div> |
| 105 | <div class="clearfix"></div> | 94 | <div class="clearfix"></div> |
| 106 | </form> | 95 | </form> |
| 107 | </script> | 96 | </script> |
| 108 | <script id="templateLista" type="x-tmpl-mustache"> | 97 | <script id="templateLista" type="x-tmpl-mustache"> |
| 109 | - <div class="panel panel-default" id="form-{{id_subgrupo}}"> | ||
| 110 | - <div class="panel-body"> | ||
| 111 | - <div class="row"> | ||
| 112 | - <div class="col-md-12"> | ||
| 113 | - {{{templateFormLista}}} | ||
| 114 | - </div> | ||
| 115 | - </div> | ||
| 116 | - <div class="row"> | ||
| 117 | - <div class="col-md-12"> | ||
| 118 | - <div class="pull-right"> | ||
| 119 | - <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_subgrupo}}')" class="btn btn-danger" | ||
| 120 | - style="color:#e13023;" role="button">{{excluir}}</a> | ||
| 121 | - <a href="javascript:void(0)" | ||
| 122 | - onclick="{{onSalvar}}('{{id_subgrupo}}')" class="btn btn-primary" role="button" style="color:#008579;">{{salvar}}</a> | ||
| 123 | - </div> | ||
| 124 | - </div> | ||
| 125 | - </div> | ||
| 126 | - </div> | 98 | +<div class="list-group-item" id="form-{{id_subgrupo}}"> |
| 99 | + <div class="row-content"> | ||
| 100 | + <h3 class="list-group-item-heading {{escondido}}"> | ||
| 101 | + <span class="pull-right"> </span> | ||
| 102 | + <a href="javascript:void(0)" onclick="{{onEditar}}('{{id_subgrupo}}')" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
| 103 | + <i class="material-icons md-18">edit</i> | ||
| 104 | + </a> | ||
| 105 | + <span class="pull-right"> </span> | ||
| 106 | + <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_subgrupo}}')" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
| 107 | + <i class="material-icons md-18">delete_forever</i> | ||
| 108 | + </a> | ||
| 109 | + <span class="nomeitem"> | ||
| 110 | + <i class="material-icons move" style="color: gray; display:none;position:absolute;left:-5px;">swap_vert</i> | ||
| 111 | + {{{nome_subgrupo}}} | ||
| 112 | + </span> | ||
| 113 | + </h3> | ||
| 127 | </div> | 114 | </div> |
| 115 | + <div class="list-group-separator"></div> | ||
| 116 | +</div> | ||
| 128 | </script> | 117 | </script> |
| 129 | <script type="text/javascript" src="index.js"></script> | 118 | <script type="text/javascript" src="index.js"></script> |
| 130 | <script type="text/javascript" src="../../../../../dicionario/subgrupos.js"></script> | 119 | <script type="text/javascript" src="../../../../../dicionario/subgrupos.js"></script> |
admin1/catalogo/menus/grupos/subgrupos/temas/exec.php
| @@ -35,7 +35,9 @@ $funcoesEdicao = array ( | @@ -35,7 +35,9 @@ $funcoesEdicao = array ( | ||
| 35 | "ADICIONAR", | 35 | "ADICIONAR", |
| 36 | "ALTERAR", | 36 | "ALTERAR", |
| 37 | "EXCLUIR", | 37 | "EXCLUIR", |
| 38 | - "ORDENA" | 38 | + "ORDENA", |
| 39 | + "LISTA", | ||
| 40 | + "LISTAUNICO" | ||
| 39 | ); | 41 | ); |
| 40 | if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { | 42 | if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { |
| 41 | if (verificaOperacaoSessao ( "admin/html/arvore" ) === false) { | 43 | if (verificaOperacaoSessao ( "admin/html/arvore" ) === false) { |
| @@ -53,7 +55,7 @@ testaSafeNumerico([$id_tema,$id_n2,$id_n3]); | @@ -53,7 +55,7 @@ testaSafeNumerico([$id_tema,$id_n2,$id_n3]); | ||
| 53 | $funcao = strtoupper ( $funcao ); | 55 | $funcao = strtoupper ( $funcao ); |
| 54 | switch ($funcao) { | 56 | switch ($funcao) { |
| 55 | case "ORDENA" : | 57 | case "ORDENA" : |
| 56 | - $ordem = explode(" ",$_POST["ordem"]); | 58 | + $ordem = explode(" ",$_POST["novaordem"]); |
| 57 | //verifica se existe a mesma quantidade de registros no banco e na lista de ids | 59 | //verifica se existe a mesma quantidade de registros no banco e na lista de ids |
| 58 | $dados = pegaDados ( "SELECT ordem from ".$esquemaadmin."i3geoadmin_n3 WHERE id_n2 = $id_n2", $dbh, false ); | 60 | $dados = pegaDados ( "SELECT ordem from ".$esquemaadmin."i3geoadmin_n3 WHERE id_n2 = $id_n2", $dbh, false ); |
| 59 | if(count($dados) != count($ordem)){ | 61 | if(count($dados) != count($ordem)){ |
| @@ -102,6 +104,18 @@ switch ($funcao) { | @@ -102,6 +104,18 @@ switch ($funcao) { | ||
| 102 | retornaJSON ( $dados ); | 104 | retornaJSON ( $dados ); |
| 103 | exit (); | 105 | exit (); |
| 104 | break; | 106 | break; |
| 107 | + case "LISTAUNICO" : | ||
| 108 | + $dados = pegaDados("SELECT * from ".$esquemaadmin."i3geoadmin_n3 LEFT JOIN ".$esquemaadmin."i3geoadmin_temas ON i3geoadmin_n3.id_tema = i3geoadmin_temas.id_tema where id_n3 = $id_n3"); | ||
| 109 | + if ($dados === false) { | ||
| 110 | + $dbhw = null; | ||
| 111 | + $dbh = null; | ||
| 112 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
| 113 | + exit (); | ||
| 114 | + } | ||
| 115 | + $dbhw = null; | ||
| 116 | + $dbh = null; | ||
| 117 | + retornaJSON($dados[0]); | ||
| 118 | + break; | ||
| 105 | case "LISTA" : | 119 | case "LISTA" : |
| 106 | $perfis = pegaDados ( "SELECT id_perfil, perfil from ".$esquemaadmin."i3geoadmin_perfis order by lower(perfil)", $dbh, false ); | 120 | $perfis = pegaDados ( "SELECT id_perfil, perfil from ".$esquemaadmin."i3geoadmin_perfis order by lower(perfil)", $dbh, false ); |
| 107 | $dbhw = null; | 121 | $dbhw = null; |
admin1/catalogo/menus/grupos/subgrupos/temas/index.js
| @@ -30,6 +30,8 @@ i3GEOadmin.temas = { | @@ -30,6 +30,8 @@ i3GEOadmin.temas = { | ||
| 30 | id_n2: "", | 30 | id_n2: "", |
| 31 | nome_subgrupo: "", | 31 | nome_subgrupo: "", |
| 32 | onde: "", | 32 | onde: "", |
| 33 | + listaDeTemas: "", | ||
| 34 | + opcoesPerfil: "", | ||
| 33 | //conteudo html do formulario de adicao na raiz | 35 | //conteudo html do formulario de adicao na raiz |
| 34 | formAdiciona: "", | 36 | formAdiciona: "", |
| 35 | init: function(onde){ | 37 | init: function(onde){ |
| @@ -54,6 +56,8 @@ i3GEOadmin.temas = { | @@ -54,6 +56,8 @@ i3GEOadmin.temas = { | ||
| 54 | ); | 56 | ); |
| 55 | //valor do filtro atual | 57 | //valor do filtro atual |
| 56 | var filtro = i3GEOadmin.core.valorFiltro(); | 58 | var filtro = i3GEOadmin.core.valorFiltro(); |
| 59 | + i3GEOadmin.temas.opcoesPerfil = opcoesPerfil; | ||
| 60 | + i3GEOadmin.temas.listaDeTemas = json["temas"]; | ||
| 57 | //filtro | 61 | //filtro |
| 58 | html = Mustache.to_html( | 62 | html = Mustache.to_html( |
| 59 | "{{#data}}" + $("#templateFiltro").html() + "{{/data}}", | 63 | "{{#data}}" + $("#templateFiltro").html() + "{{/data}}", |
| @@ -67,7 +71,7 @@ i3GEOadmin.temas = { | @@ -67,7 +71,7 @@ i3GEOadmin.temas = { | ||
| 67 | i3GEOadmin.core.defineFiltro(filtro); | 71 | i3GEOadmin.core.defineFiltro(filtro); |
| 68 | i3GEOadmin.core.filtra(i3GEOadmin.core.pegaFiltro()); | 72 | i3GEOadmin.core.filtra(i3GEOadmin.core.pegaFiltro()); |
| 69 | } | 73 | } |
| 70 | - i3GEOadmin.temas.listaTemas(json["dados"],opcoesPerfil,json["temas"]); | 74 | + i3GEOadmin.temas.listaTemas(json["dados"]); |
| 71 | 75 | ||
| 72 | //torna os paineis ordenavies | 76 | //torna os paineis ordenavies |
| 73 | i3GEOadmin.temas.onde.sortable({ | 77 | i3GEOadmin.temas.onde.sortable({ |
| @@ -78,7 +82,7 @@ i3GEOadmin.temas = { | @@ -78,7 +82,7 @@ i3GEOadmin.temas = { | ||
| 78 | }); | 82 | }); |
| 79 | 83 | ||
| 80 | //faz com que seja mostrado um icone de ordenamento no mouseover | 84 | //faz com que seja mostrado um icone de ordenamento no mouseover |
| 81 | - $('.panel').hover( | 85 | + $('.nomeitem').hover( |
| 82 | function(){ | 86 | function(){ |
| 83 | $(this).find('.move').fadeIn(400); | 87 | $(this).find('.move').fadeIn(400); |
| 84 | }, | 88 | }, |
| @@ -95,41 +99,17 @@ i3GEOadmin.temas = { | @@ -95,41 +99,17 @@ i3GEOadmin.temas = { | ||
| 95 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | 99 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); |
| 96 | }); | 100 | }); |
| 97 | }, | 101 | }, |
| 98 | - listaTemas: function(dados,opcoesPerfil,temas){ | ||
| 99 | - var template = $("#templateTemas").html(); | 102 | + listaTemas: function(dados){ |
| 100 | var html = Mustache.to_html( | 103 | var html = Mustache.to_html( |
| 101 | - "{{#data}}" + template + "{{/data}}", | 104 | + "{{#data}}" + $("#templateTemas").html() + "{{/data}}", |
| 102 | $.extend( | 105 | $.extend( |
| 103 | {}, | 106 | {}, |
| 104 | i3GEOadmin.temas.dicionario, | 107 | i3GEOadmin.temas.dicionario, |
| 105 | { | 108 | { |
| 106 | "data": dados, | 109 | "data": dados, |
| 107 | - "opcoesPerfil": opcoesPerfil, | 110 | + "opcoesPerfil": i3GEOadmin.temas.opcoesPerfil, |
| 108 | "onExcluir": "i3GEOadmin.temas.excluirTemaDialogo",//funcao | 111 | "onExcluir": "i3GEOadmin.temas.excluirTemaDialogo",//funcao |
| 109 | - "onSalvar": "i3GEOadmin.temas.salvarTemaDialogo",//funcao | ||
| 110 | - "opcoesTema": function(){ | ||
| 111 | - var p = this.codigo_tema; | ||
| 112 | - var id = ""; | ||
| 113 | - //marca o selecionado | ||
| 114 | - $(temas).each( | ||
| 115 | - function(i,el){ | ||
| 116 | - if(el.codigo_tema == p){ | ||
| 117 | - temas[i]["selected"] = "selected"; | ||
| 118 | - id = i; | ||
| 119 | - } | ||
| 120 | - else{ | ||
| 121 | - temas[i]["selected"] = ""; | ||
| 122 | - } | ||
| 123 | - } | ||
| 124 | - ); | ||
| 125 | - var html = '<option value="">---</option>' + Mustache.to_html( | ||
| 126 | - "{{#data}}" + $("#templateOpcoesTema").html() + "{{/data}}", | ||
| 127 | - {"data":temas} | ||
| 128 | - ); | ||
| 129 | - //volta ao normal | ||
| 130 | - temas[id]["selected"] = ""; | ||
| 131 | - return html; | ||
| 132 | - } | 112 | + "onEditar": "i3GEOadmin.temas.editarTemaDialogo" |
| 133 | } | 113 | } |
| 134 | ) | 114 | ) |
| 135 | ); | 115 | ); |
| @@ -138,21 +118,21 @@ i3GEOadmin.temas = { | @@ -138,21 +118,21 @@ i3GEOadmin.temas = { | ||
| 138 | //monta um template para o modal de inclusao de novo tema | 118 | //monta um template para o modal de inclusao de novo tema |
| 139 | if(i3GEOadmin.temas.formAdiciona == ""){ | 119 | if(i3GEOadmin.temas.formAdiciona == ""){ |
| 140 | html = Mustache.to_html( | 120 | html = Mustache.to_html( |
| 141 | - $("#templateTemas").html(), | 121 | + $("#templateForm").html(), |
| 142 | $.extend( | 122 | $.extend( |
| 143 | {}, | 123 | {}, |
| 144 | i3GEOadmin.temas.dicionario, | 124 | i3GEOadmin.temas.dicionario, |
| 145 | { | 125 | { |
| 146 | "id_n3": "modal", | 126 | "id_n3": "modal", |
| 147 | "escondido": "hidden", | 127 | "escondido": "hidden", |
| 148 | - "opcoesPerfil": opcoesPerfil, | 128 | + "opcoesPerfil": i3GEOadmin.temas.opcoesPerfil, |
| 149 | "excluir": i3GEOadmin.temas.dicionario.cancelar, | 129 | "excluir": i3GEOadmin.temas.dicionario.cancelar, |
| 150 | "onExcluir": "i3GEOadmin.core.fechaModalGeral",//funcao | 130 | "onExcluir": "i3GEOadmin.core.fechaModalGeral",//funcao |
| 151 | "onSalvar": "i3GEOadmin.temas.adicionaTema",//funcao | 131 | "onSalvar": "i3GEOadmin.temas.adicionaTema",//funcao |
| 152 | "opcoesTema": function(){ | 132 | "opcoesTema": function(){ |
| 153 | var html = '<option value="">---</option>' + Mustache.to_html( | 133 | var html = '<option value="">---</option>' + Mustache.to_html( |
| 154 | "{{#data}}" + $("#templateOpcoesTema").html() + "{{/data}}", | 134 | "{{#data}}" + $("#templateOpcoesTema").html() + "{{/data}}", |
| 155 | - {"data":temas} | 135 | + {"data":i3GEOadmin.temas.listaDeTemas} |
| 156 | ); | 136 | ); |
| 157 | return html; | 137 | return html; |
| 158 | } | 138 | } |
| @@ -162,13 +142,69 @@ i3GEOadmin.temas = { | @@ -162,13 +142,69 @@ i3GEOadmin.temas = { | ||
| 162 | i3GEOadmin.temas.formAdiciona = html; | 142 | i3GEOadmin.temas.formAdiciona = html; |
| 163 | } | 143 | } |
| 164 | }, | 144 | }, |
| 145 | + editarTemaDialogo: function(id){ | ||
| 146 | + i3GEOadmin.core.fechaModalGeral(); | ||
| 147 | + i3GEOadmin.core.modalAguarde(true); | ||
| 148 | + $.post( | ||
| 149 | + "exec.php?funcao=listaunico", | ||
| 150 | + "id_n3=" + id | ||
| 151 | + ) | ||
| 152 | + .done( | ||
| 153 | + function(data, status){ | ||
| 154 | + var json = jQuery.parseJSON(data); | ||
| 155 | + var html = Mustache.to_html( | ||
| 156 | + "{{#data}}" + $("#templateForm").html() + "{{/data}}", | ||
| 157 | + $.extend( | ||
| 158 | + {}, | ||
| 159 | + i3GEOadmin.temas.dicionario, | ||
| 160 | + { | ||
| 161 | + "data": json, | ||
| 162 | + "opcoesPerfil": i3GEOadmin.temas.opcoesPerfil, | ||
| 163 | + "onExcluir": "i3GEOadmin.temas.excluirTemaDialogo",//funcao | ||
| 164 | + "onSalvar": "i3GEOadmin.temas.salvarTemaDialogo",//funcao | ||
| 165 | + "opcoesTema": function(){ | ||
| 166 | + var p = this.codigo_tema; | ||
| 167 | + var id = ""; | ||
| 168 | + var temas = i3GEOadmin.temas.listaDeTemas; | ||
| 169 | + //marca o selecionado | ||
| 170 | + $(temas).each( | ||
| 171 | + function(i,el){ | ||
| 172 | + if(el.codigo_tema == p){ | ||
| 173 | + temas[i]["selected"] = "selected"; | ||
| 174 | + id = i; | ||
| 175 | + } | ||
| 176 | + else{ | ||
| 177 | + temas[i]["selected"] = ""; | ||
| 178 | + } | ||
| 179 | + } | ||
| 180 | + ); | ||
| 181 | + var html = '<option value="">---</option>' + Mustache.to_html( | ||
| 182 | + "{{#data}}" + $("#templateOpcoesTema").html() + "{{/data}}", | ||
| 183 | + {"data":temas} | ||
| 184 | + ); | ||
| 185 | + //volta ao normal | ||
| 186 | + temas[id]["selected"] = ""; | ||
| 187 | + return html; | ||
| 188 | + } | ||
| 189 | + } | ||
| 190 | + ) | ||
| 191 | + ); | ||
| 192 | + i3GEOadmin.core.abreModalGeral(html); | ||
| 193 | + } | ||
| 194 | + ) | ||
| 195 | + .fail( | ||
| 196 | + function(data){ | ||
| 197 | + i3GEOadmin.core.modalAguarde(false); | ||
| 198 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
| 199 | + } | ||
| 200 | + ); | ||
| 201 | + }, | ||
| 165 | adicionaTemaDialogo: function(){ | 202 | adicionaTemaDialogo: function(){ |
| 166 | i3GEOadmin.core.abreModalGeral(i3GEOadmin.temas.formAdiciona); | 203 | i3GEOadmin.core.abreModalGeral(i3GEOadmin.temas.formAdiciona); |
| 167 | - $("#body-form-modal").collapse('show'); | ||
| 168 | }, | 204 | }, |
| 169 | // os parametros sao obtidos do formulario aberto do modal | 205 | // os parametros sao obtidos do formulario aberto do modal |
| 170 | adicionaTema: function(){ | 206 | adicionaTema: function(){ |
| 171 | - var parametros = $("#modalGeral form").serialize(); | 207 | + var parametros = $("#form-edicao-modal").serialize(); |
| 172 | i3GEOadmin.core.fechaModalGeral(); | 208 | i3GEOadmin.core.fechaModalGeral(); |
| 173 | i3GEOadmin.core.modalAguarde(true); | 209 | i3GEOadmin.core.modalAguarde(true); |
| 174 | $.post( | 210 | $.post( |
| @@ -220,17 +256,18 @@ i3GEOadmin.temas = { | @@ -220,17 +256,18 @@ i3GEOadmin.temas = { | ||
| 220 | ); | 256 | ); |
| 221 | }, | 257 | }, |
| 222 | salvarTemaDialogo: function(id){ | 258 | salvarTemaDialogo: function(id){ |
| 259 | + i3GEOadmin.temas.parametrosSalvar = $("#form-edicao-" + id).serialize(); | ||
| 223 | var hash = { | 260 | var hash = { |
| 224 | "mensagem": i3GEOadmin.temas.dicionario.confirma, | 261 | "mensagem": i3GEOadmin.temas.dicionario.confirma, |
| 225 | "onBotao1": "i3GEOadmin.temas.salvarTema('"+id+"')", | 262 | "onBotao1": "i3GEOadmin.temas.salvarTema('"+id+"')", |
| 226 | "botao1": i3GEOadmin.temas.dicionario.sim, | 263 | "botao1": i3GEOadmin.temas.dicionario.sim, |
| 227 | - "onBotao2": "i3GEOadmin.core.fechaModalConfirma();", | 264 | + "onBotao2": "i3GEOadmin.temas.parametrosSalvar = '';i3GEOadmin.core.fechaModalConfirma();", |
| 228 | "botao2": i3GEOadmin.temas.dicionario.nao | 265 | "botao2": i3GEOadmin.temas.dicionario.nao |
| 229 | }; | 266 | }; |
| 230 | i3GEOadmin.core.abreModalConfirma(hash); | 267 | i3GEOadmin.core.abreModalConfirma(hash); |
| 231 | }, | 268 | }, |
| 232 | salvarTema: function(id){ | 269 | salvarTema: function(id){ |
| 233 | - var parametros = $("#form-" + id + " form").serialize(); | 270 | + var parametros = i3GEOadmin.temas.parametrosSalvar; |
| 234 | i3GEOadmin.core.fechaModalGeral(); | 271 | i3GEOadmin.core.fechaModalGeral(); |
| 235 | i3GEOadmin.core.modalAguarde(true); | 272 | i3GEOadmin.core.modalAguarde(true); |
| 236 | $.post( | 273 | $.post( |
| @@ -239,6 +276,7 @@ i3GEOadmin.temas = { | @@ -239,6 +276,7 @@ i3GEOadmin.temas = { | ||
| 239 | ) | 276 | ) |
| 240 | .done( | 277 | .done( |
| 241 | function(data, status){ | 278 | function(data, status){ |
| 279 | + i3GEOadmin.temas.parametrosSalvar = ''; | ||
| 242 | i3GEOadmin.core.modalAguarde(false); | 280 | i3GEOadmin.core.modalAguarde(false); |
| 243 | i3GEOadmin.core.iconeAguarde(i3GEOadmin.temas.onde); | 281 | i3GEOadmin.core.iconeAguarde(i3GEOadmin.temas.onde); |
| 244 | i3GEOadmin.temas.lista(); | 282 | i3GEOadmin.temas.lista(); |
| @@ -246,6 +284,7 @@ i3GEOadmin.temas = { | @@ -246,6 +284,7 @@ i3GEOadmin.temas = { | ||
| 246 | ) | 284 | ) |
| 247 | .fail( | 285 | .fail( |
| 248 | function(data){ | 286 | function(data){ |
| 287 | + i3GEOadmin.temas.parametrosSalvar = ''; | ||
| 249 | i3GEOadmin.core.modalAguarde(false); | 288 | i3GEOadmin.core.modalAguarde(false); |
| 250 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | 289 | i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); |
| 251 | } | 290 | } |
| @@ -255,7 +294,7 @@ i3GEOadmin.temas = { | @@ -255,7 +294,7 @@ i3GEOadmin.temas = { | ||
| 255 | i3GEOadmin.core.modalAguarde(true); | 294 | i3GEOadmin.core.modalAguarde(true); |
| 256 | $.post( | 295 | $.post( |
| 257 | "exec.php?funcao=ordena", | 296 | "exec.php?funcao=ordena", |
| 258 | - "id_n2=" + i3GEOadmin.temas.id_n2 + "&ordem=" + data.join(" ") | 297 | + "id_n2=" + i3GEOadmin.temas.id_n2 + "&novaordem=" + data.join(" ") |
| 259 | ) | 298 | ) |
| 260 | .done( | 299 | .done( |
| 261 | function(data, status){ | 300 | function(data, status){ |
admin1/catalogo/menus/grupos/subgrupos/temas/index.php
| @@ -47,7 +47,7 @@ $nome_subgrupo = filter_var ( $_GET ["nome_subgrupo"], FILTER_SANITIZE_STRING ); | @@ -47,7 +47,7 @@ $nome_subgrupo = filter_var ( $_GET ["nome_subgrupo"], FILTER_SANITIZE_STRING ); | ||
| 47 | </div> | 47 | </div> |
| 48 | <div class="row pull-right"> | 48 | <div class="row pull-right"> |
| 49 | <a onclick="i3GEOadmin.temas.adicionaTemaDialogo();" href="javascript:void(0)" | 49 | <a onclick="i3GEOadmin.temas.adicionaTemaDialogo();" href="javascript:void(0)" |
| 50 | - class="btn btn-primary" role="button" style="color:#008579;">{{{adicionarTema}}}</a> | 50 | + class="btn btn-primary" role="button" style="color:#008579;">{{{adicionar}}}</a> |
| 51 | </div> | 51 | </div> |
| 52 | <div class="clearfix"></div> | 52 | <div class="clearfix"></div> |
| 53 | </div> | 53 | </div> |
| @@ -61,57 +61,62 @@ $nome_subgrupo = filter_var ( $_GET ["nome_subgrupo"], FILTER_SANITIZE_STRING ); | @@ -61,57 +61,62 @@ $nome_subgrupo = filter_var ( $_GET ["nome_subgrupo"], FILTER_SANITIZE_STRING ); | ||
| 61 | <option value="form-{{id_n3}}">{{{nome_tema}}}</option> | 61 | <option value="form-{{id_n3}}">{{{nome_tema}}}</option> |
| 62 | </script> | 62 | </script> |
| 63 | <script id="templateTemas" type="x-tmpl-mustache"> | 63 | <script id="templateTemas" type="x-tmpl-mustache"> |
| 64 | -<div class="panel panel-default" data-id="{{id_n3}}" id="form-{{id_n3}}"> | ||
| 65 | - <div class="panel-heading icon" role="tab"> | ||
| 66 | - <h3 class="panel-title" {{escondido}}> | ||
| 67 | - <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_n3}}')" class="btn btn-danger btn-fab btn-fab-mini" role="button"> | ||
| 68 | - <i class="material-icons">delete_forever</i> | 64 | +<div class="list-group-item" data-id="{{id_n3}}" id="form-{{id_n3}}"> |
| 65 | + <div class="row-content"> | ||
| 66 | + <h3 class="list-group-item-heading {{escondido}}"> | ||
| 67 | + <span class="pull-right"> </span> | ||
| 68 | + <a href="javascript:void(0)" onclick="{{onEditar}}('{{id_n3}}')" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
| 69 | + <i class="material-icons md-18">edit</i> | ||
| 69 | </a> | 70 | </a> |
| 70 | - | ||
| 71 | - <a class="collapsed in" role="button" data-toggle="collapse" href="#body-form-{{id_n3}}" | ||
| 72 | - aria-expanded="false" aria-controls="#body-form-{{id_n3}}"> {{{nome_tema}}} | ||
| 73 | - <i class="material-icons move" style="color: gray; display:none;">swap_vert</i> | 71 | + <span class="pull-right"> </span> |
| 72 | + <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_n3}}')" class="btn btn-danger btn-fab btn-fab-mini pull-right" role="button"> | ||
| 73 | + <i class="material-icons md-18">delete_forever</i> | ||
| 74 | </a> | 74 | </a> |
| 75 | + <span class="nomeitem"> | ||
| 76 | + <i class="material-icons move" style="color: gray; display:none;position:absolute;left:-5px;">swap_vert</i> | ||
| 77 | + {{{nome_tema}}} | ||
| 78 | + </span> | ||
| 75 | </h3> | 79 | </h3> |
| 76 | </div> | 80 | </div> |
| 77 | - <div class="panel-body panel-collapse collapse" id="body-form-{{id_n3}}"> | ||
| 78 | - <form style="" action="#" onsubmit="{{onSalvar}}('{{id_n3}}');return false;" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" method="post" > | ||
| 79 | - <div class="row"> | ||
| 80 | - <div class="col-md-12"> | ||
| 81 | - <div class="form-group form-group-lg"> | ||
| 82 | - <label class="col-md-4 control-label" for="id_tema">{{{tema}}}</label> | ||
| 83 | - <div class="col-md-8"> | ||
| 84 | - <select title="{{{tema}}}" class="form-control" name="id_tema"> | ||
| 85 | - {{{opcoesTema}}} | ||
| 86 | - </select> | ||
| 87 | - </div> | ||
| 88 | - </div> | ||
| 89 | - <div class="form-group form-group-lg"> | ||
| 90 | - <label class="col-md-4 control-label" for="ordem">{{{ordemTxt}}}</label> | ||
| 91 | - <div class="col-md-8"> | ||
| 92 | - <input title="{{{ordemTxt}}}" type="text" value="{{{ordem}}}" class="form-control" name="ordem"> | ||
| 93 | - </div> | ||
| 94 | - </div> | ||
| 95 | - <div class="form-group form-group-lg"> | ||
| 96 | - <label class="col-md-4 control-label" for="perfil">{{{perfis}}}</label> | ||
| 97 | - <div class="col-md-4"> | ||
| 98 | - <input title="{{{perfis}}}" id="perfil_tema-{{id_n3}}" type="text" value="{{{n3_perfil}}}" class="form-control" name="n3_perfil"> | ||
| 99 | - </div> | ||
| 100 | - <div class="col-md-4"> | ||
| 101 | - <select title="{{{perfis}}}" class="form-control" onchange="i3GEOadmin.temas.addInput('perfil_tema-{{id_n3}}',this.value)"> | ||
| 102 | - {{{opcoesPerfil}}} | ||
| 103 | - </select> | ||
| 104 | - </div> | ||
| 105 | - </div> | 81 | + <div class="list-group-separator"></div> |
| 82 | +</div> | ||
| 83 | +</script> | ||
| 84 | +<script id="templateForm" type="x-tmpl-mustache"> | ||
| 85 | +<form id="form-edicao-{{id_n3}}" style="" action="#" onsubmit="{{onSalvar}}('{{id_n3}}');return false;" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" method="post" > | ||
| 86 | + <div class="row"> | ||
| 87 | + <div class="col-md-12"> | ||
| 88 | + <div class="form-group form-group-lg"> | ||
| 89 | + <label class="col-md-4 control-label" for="id_tema">{{{tema}}}</label> | ||
| 90 | + <div class="col-md-8"> | ||
| 91 | + <select title="{{{tema}}}" class="form-control" name="id_tema"> | ||
| 92 | + {{{opcoesTema}}} | ||
| 93 | + </select> | ||
| 94 | + </div> | ||
| 95 | + </div> | ||
| 96 | + <div class="form-group form-group-lg"> | ||
| 97 | + <label class="col-md-4 control-label" for="ordem">{{{ordemTxt}}}</label> | ||
| 98 | + <div class="col-md-8"> | ||
| 99 | + <input title="{{{ordemTxt}}}" type="text" value="{{{ordem}}}" class="form-control" name="ordem"> | ||
| 100 | + </div> | ||
| 101 | + </div> | ||
| 102 | + <div class="form-group form-group-lg"> | ||
| 103 | + <label class="col-md-4 control-label" for="perfil">{{{perfis}}}</label> | ||
| 104 | + <div class="col-md-4"> | ||
| 105 | + <input title="{{{perfis}}}" id="perfil_tema-{{id_n3}}" type="text" value="{{{perfil}}}" class="form-control" name="perfil"> | ||
| 106 | + </div> | ||
| 107 | + <div class="col-md-4"> | ||
| 108 | + <select title="{{{perfis}}}" class="form-control" onchange="i3GEOadmin.subgrupos.addInput('perfil_tema-{{id_n3}}',this.value)"> | ||
| 109 | + {{{opcoesPerfil}}} | ||
| 110 | + </select> | ||
| 106 | </div> | 111 | </div> |
| 107 | </div> | 112 | </div> |
| 108 | - <div class="pull-right"> | ||
| 109 | - <button type="submit" class="btn btn-primary" role="button" style="color:#008579;">{{salvar}}</button> | ||
| 110 | </div> | 113 | </div> |
| 111 | - </form> | ||
| 112 | - | ||
| 113 | </div> | 114 | </div> |
| 114 | -</div> | 115 | + <div class="pull-right"> |
| 116 | + <button type="submit" class="btn btn-primary" role="button" style="color:#008579;">{{salvar}}</button> | ||
| 117 | + </div> | ||
| 118 | + <div class="clearfix"></div> | ||
| 119 | +</form> | ||
| 115 | </script> | 120 | </script> |
| 116 | <script id="templateOpcoesPublicado" type="x-tmpl-mustache"> | 121 | <script id="templateOpcoesPublicado" type="x-tmpl-mustache"> |
| 117 | <option value="">---</option> | 122 | <option value="">---</option> |
admin1/dicionario/arvore.js
| @@ -12,12 +12,12 @@ i3GEOadmin.arvore.dicionario = { | @@ -12,12 +12,12 @@ i3GEOadmin.arvore.dicionario = { | ||
| 12 | es : "" | 12 | es : "" |
| 13 | } ], | 13 | } ], |
| 14 | 'txtAjuda' : [ { | 14 | 'txtAjuda' : [ { |
| 15 | - pt : "<p>Este formulário permite editar árvore de temas que seráutilizada pelo i3Geo.<p>A árvore é composta de menus, grupos, sub-grupos e temas. Vcdeve criar os menus, a lista de grupos e a lista de sub-grupos. Aocriar um menu, esse é mostrado imediatamente na árvore.<p>Menus ou nós da árvore marcados como não publicados sãomostrados em vermelho e aparecem apenas para os administradores.<p>Em cada nó da árvore podem ser associados os temas, mesmo naraiz de um dos níveis. Os temas são arquivos mapfiles armazenadosem i3geo/temas e registrados no sistema de administração.<p>A criação de mapfiles e a vinculação tema-mapfile é feitapor meio do editor de mapfiles, e consiste na determinação de umnome para cada mapfile. Esse nome é listado ao ser adicionado umtema na árvore.", | 15 | + pt : "<p>Este formulário permite editar árvore de temas que seráutilizada pelo i3Geo.<p>A árvore é composta de menus, grupos, subgrupos e temas. Vcdeve criar os menus, a lista de grupos e a lista de sub-grupos. Aocriar um menu, esse é mostrado imediatamente na árvore.<p>Menus ou nós da árvore marcados como não publicados sãomostrados em vermelho e aparecem apenas para os administradores.<p>Em cada nó da árvore podem ser associados os temas, mesmo naraiz de um dos níveis. Os temas são arquivos mapfiles armazenadosem i3geo/temas e registrados no sistema de administração.<p>A criação de mapfiles e a vinculação tema-mapfile é feitapor meio do editor de mapfiles, e consiste na determinação de umnome para cada mapfile. Esse nome é listado ao ser adicionado umtema na árvore.", |
| 16 | en : "", | 16 | en : "", |
| 17 | es : "" | 17 | es : "" |
| 18 | } ], | 18 | } ], |
| 19 | 'txtCria' : [ { | 19 | 'txtCria' : [ { |
| 20 | - pt : "<p class=paragrafo>Utilize os botões para criar novos nomes de menus, grupos ou sub-grupos, formando listas de itens.<br>Os itens criados podem ser reaproveitados em vários nós da árvore.</p>", | 20 | + pt : "<p class=paragrafo>Utilize os botões para criar novos nomes de menus, grupos ou subgrupos, formando listas de itens.<br>Os itens criados podem ser reaproveitados em vários nós da árvore.</p>", |
| 21 | en : "", | 21 | en : "", |
| 22 | es : "" | 22 | es : "" |
| 23 | } ], | 23 | } ], |
| @@ -27,7 +27,7 @@ i3GEOadmin.arvore.dicionario = { | @@ -27,7 +27,7 @@ i3GEOadmin.arvore.dicionario = { | ||
| 27 | es : "" | 27 | es : "" |
| 28 | } ], | 28 | } ], |
| 29 | 'editaSubgrupos' : [ { | 29 | 'editaSubgrupos' : [ { |
| 30 | - pt : "Editar lista de sub-grupos", | 30 | + pt : "Editar lista de subgrupos", |
| 31 | en : "", | 31 | en : "", |
| 32 | es : "" | 32 | es : "" |
| 33 | } ], | 33 | } ], |
admin1/dicionario/grupos.js
| @@ -42,7 +42,7 @@ i3GEOadmin.grupos.dicionario = { | @@ -42,7 +42,7 @@ i3GEOadmin.grupos.dicionario = { | ||
| 42 | es : "" | 42 | es : "" |
| 43 | } ], | 43 | } ], |
| 44 | 'txtAjuda' : [ { | 44 | 'txtAjuda' : [ { |
| 45 | - pt : "A árvore é composta por níveis hierárquicos que iniciam com um menu, seguido de grupos e esses por sub-grupos. Na raiz de cada nível podem existir temas, assim como no último nível (sub-grupos).", | 45 | + pt : "A árvore é composta por níveis hierárquicos que iniciam com um menu, seguido de grupos e esses por subgrupos. Na raiz de cada nível podem existir temas, assim como no último nível (sub-grupos).", |
| 46 | en : "", | 46 | en : "", |
| 47 | es : "" | 47 | es : "" |
| 48 | } ], | 48 | } ], |
admin1/dicionario/menup.js
| @@ -315,5 +315,15 @@ i3GEOadmin.menup.dicionario = { | @@ -315,5 +315,15 @@ i3GEOadmin.menup.dicionario = { | ||
| 315 | pt : "Cadastros", | 315 | pt : "Cadastros", |
| 316 | en : "", | 316 | en : "", |
| 317 | es : "" | 317 | es : "" |
| 318 | + } ], | ||
| 319 | + 'listaDeGrupos' : [ { | ||
| 320 | + pt : "Lista de nomes de grupos", | ||
| 321 | + en : "", | ||
| 322 | + es : "" | ||
| 323 | + } ], | ||
| 324 | + 'listaDeSubGrupos' : [ { | ||
| 325 | + pt : "Lista de nomes de subgrupos", | ||
| 326 | + en : "", | ||
| 327 | + es : "" | ||
| 318 | } ] | 328 | } ] |
| 319 | }; | 329 | }; |
admin1/dicionario/menus.js
| @@ -11,7 +11,7 @@ i3GEOadmin.menus.dicionario = { | @@ -11,7 +11,7 @@ i3GEOadmin.menus.dicionario = { | ||
| 11 | es : "" | 11 | es : "" |
| 12 | } ], | 12 | } ], |
| 13 | 'txtAjuda' : [ { | 13 | 'txtAjuda' : [ { |
| 14 | - pt : "Este formulário permite editar a lista de menus que será utilizada pelo i3Geo.<p>A árvore é composta de menus, grupos, sub-grupos e temas. Vc deve criar os menus, a lista de grupos e a lista de sub-grupos. Ao criar um menu, esse é mostrado imediatamente na árvore.<p>Menus ou nós da árvore marcados como não publicados são mostrados em vermelho e aparecem apenas para os administradores.<p>Em cada nó da árvore podem ser associados os temas, mesmo na raiz de um dos níveis. Os temas são arquivos mapfiles armazenados em i3geo/temas e registrados no sistema de administração.<p>A criação de mapfiles e a vinculação tema-mapfile é feita por meio do editor de mapfiles, e consiste na determinação de um nome para cada mapfile. Esse nome é listado ao ser adicionado um tema na árvore.</div>", | 14 | + pt : "Este formulário permite editar a lista de menus que será utilizada pelo i3Geo.<p>A árvore é composta de menus, grupos, subgrupos e temas. Vc deve criar os menus, a lista de grupos e a lista de sub-grupos. Ao criar um menu, esse é mostrado imediatamente na árvore.<p>Menus ou nós da árvore marcados como não publicados são mostrados em vermelho e aparecem apenas para os administradores.<p>Em cada nó da árvore podem ser associados os temas, mesmo na raiz de um dos níveis. Os temas são arquivos mapfiles armazenados em i3geo/temas e registrados no sistema de administração.<p>A criação de mapfiles e a vinculação tema-mapfile é feita por meio do editor de mapfiles, e consiste na determinação de um nome para cada mapfile. Esse nome é listado ao ser adicionado um tema na árvore.</div>", |
| 15 | en : "", | 15 | en : "", |
| 16 | es : "" | 16 | es : "" |
| 17 | } ], | 17 | } ], |
admin1/dicionario/perfis.js
| @@ -11,7 +11,7 @@ i3GEOadmin.perfis.dicionario = { | @@ -11,7 +11,7 @@ i3GEOadmin.perfis.dicionario = { | ||
| 11 | es : "" | 11 | es : "" |
| 12 | } ], | 12 | } ], |
| 13 | 'txtDesc' : [ { | 13 | 'txtDesc' : [ { |
| 14 | - pt : "Os perfis são utilizados para restringir o acesso a determinados temas, grupos, sub-grupos e menus. Ao remover ou modificar um perfil, isso se refletirá em todas as tabelas onde houver registro do perfil.", | 14 | + pt : "Os perfis são utilizados para restringir o acesso a determinados temas, grupos, subgrupos e menus. Ao remover ou modificar um perfil, isso se refletirá em todas as tabelas onde houver registro do perfil.", |
| 15 | en : "", | 15 | en : "", |
| 16 | es : "" | 16 | es : "" |
| 17 | } ], | 17 | } ], |
admin1/dicionario/subgrupos.js
| @@ -6,7 +6,7 @@ i3GEOadmin.subgrupos.dicionario = { | @@ -6,7 +6,7 @@ i3GEOadmin.subgrupos.dicionario = { | ||
| 6 | es : "" | 6 | es : "" |
| 7 | } ], | 7 | } ], |
| 8 | 'subgrupos' : [ { | 8 | 'subgrupos' : [ { |
| 9 | - pt : "Subgrupos", | 9 | + pt : "Subgrupos vinculados ao grupo", |
| 10 | en : "", | 10 | en : "", |
| 11 | es : "" | 11 | es : "" |
| 12 | } ], | 12 | } ], |
| @@ -65,8 +65,18 @@ i3GEOadmin.subgrupos.dicionario = { | @@ -65,8 +65,18 @@ i3GEOadmin.subgrupos.dicionario = { | ||
| 65 | en : "", | 65 | en : "", |
| 66 | es : "" | 66 | es : "" |
| 67 | } ], | 67 | } ], |
| 68 | - '' : [ { | ||
| 69 | - pt : "", | 68 | + 'temas' : [ { |
| 69 | + pt : "temas", | ||
| 70 | + en : "", | ||
| 71 | + es : "" | ||
| 72 | + } ], | ||
| 73 | + 'txtListaDeSubGrupos' : [ { | ||
| 74 | + pt : "Lista controlada de nomes de subgrupos", | ||
| 75 | + en : "", | ||
| 76 | + es : "" | ||
| 77 | + } ], | ||
| 78 | + 'descListaDeSubGrupos' : [ { | ||
| 79 | + pt : "Os nomes de subgrupos são utilizados para nomear os nós da árvore do catálogo. Cada nome recebe um identificador, de forma que ao ser modificado a árvore refletirá as edições.", | ||
| 70 | en : "", | 80 | en : "", |
| 71 | es : "" | 81 | es : "" |
| 72 | } ] | 82 | } ] |
admin1/head.js
| @@ -115,6 +115,10 @@ menuPrincipal = [ | @@ -115,6 +115,10 @@ menuPrincipal = [ | ||
| 115 | html: "<a href='" + i3GEO.configura.locaplic + "/admin1/catalogo/mapas/index.php' >"+$trad("linkMapas",i3GEOadmin.menup.dicionario)+"</a>" | 115 | html: "<a href='" + i3GEO.configura.locaplic + "/admin1/catalogo/mapas/index.php' >"+$trad("linkMapas",i3GEOadmin.menup.dicionario)+"</a>" |
| 116 | },{ | 116 | },{ |
| 117 | html: "<a href='" + i3GEO.configura.locaplic + "/admin1/catalogo/atlas/index.php' >"+$trad("atlas",i3GEOadmin.menup.dicionario)+"</a>" | 117 | html: "<a href='" + i3GEO.configura.locaplic + "/admin1/catalogo/atlas/index.php' >"+$trad("atlas",i3GEOadmin.menup.dicionario)+"</a>" |
| 118 | + },{ | ||
| 119 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin1/catalogo/menus/grupos/listadegrupos/index.php' >"+$trad("listaDeGrupos",i3GEOadmin.menup.dicionario)+"</a>" | ||
| 120 | + },{ | ||
| 121 | + html: "<a href='" + i3GEO.configura.locaplic + "/admin1/catalogo/menus/grupos/subgrupos/listadesubgrupos/index.php' >"+$trad("listaDeSubGrupos",i3GEOadmin.menup.dicionario)+"</a>" | ||
| 118 | } | 122 | } |
| 119 | ]},{ | 123 | ]},{ |
| 120 | html: $trad("cadastros",i3GEOadmin.menup.dicionario), | 124 | html: $trad("cadastros",i3GEOadmin.menup.dicionario), |