Commit b56d2092ab66dd38468e952c5766767091124631
1 parent
b4ca27a5
Exists in
master
and in
7 other branches
Correção na edição de mapfiles quando o mesmo não tiver sido criado por meio do …
…sistema de administração
Showing
4 changed files
with
7 additions
and
6 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin1/catalogo/mapfile/exec.php
@@ -91,7 +91,7 @@ switch ($funcao) { | @@ -91,7 +91,7 @@ switch ($funcao) { | ||
91 | \admin\php\funcoesAdmin\retornaJSON ( $retorna ); | 91 | \admin\php\funcoesAdmin\retornaJSON ( $retorna ); |
92 | break; | 92 | break; |
93 | case "LISTAUNICO" : | 93 | case "LISTAUNICO" : |
94 | - $retorna = \admin\catalogo\mapfile\listaUnico ( $dbh, $codigo ); | 94 | + $retorna = \admin\catalogo\mapfile\listaUnico ( $dbhw, $codigo ); |
95 | $dbhw = null; | 95 | $dbhw = null; |
96 | $dbh = null; | 96 | $dbh = null; |
97 | if ($retorna === false) { | 97 | if ($retorna === false) { |
admin1/catalogo/mapfile/funcoes.php
@@ -394,7 +394,8 @@ function listar($dbh, $filtro = "", $palavra = "", $validar = "") { | @@ -394,7 +394,8 @@ function listar($dbh, $filtro = "", $palavra = "", $validar = "") { | ||
394 | } | 394 | } |
395 | return $lista; | 395 | return $lista; |
396 | } | 396 | } |
397 | -function listaUnico($dbh, $codigo) { | 397 | +//usar dbhw pois pode ser necessario adicionar o registro |
398 | +function listaUnico($dbhw, $codigo) { | ||
398 | $convUTF = $_SESSION["convUTF"]; | 399 | $convUTF = $_SESSION["convUTF"]; |
399 | $esquemaadmin = $_SESSION["esquemaadmin"]; | 400 | $esquemaadmin = $_SESSION["esquemaadmin"]; |
400 | $locaplic = $_SESSION["locaplic"]; | 401 | $locaplic = $_SESSION["locaplic"]; |
@@ -410,7 +411,7 @@ function listaUnico($dbh, $codigo) { | @@ -410,7 +411,7 @@ function listaUnico($dbh, $codigo) { | ||
410 | } | 411 | } |
411 | $titulolegenda = $layer->getmetadata("TEMA"); | 412 | $titulolegenda = $layer->getmetadata("TEMA"); |
412 | $metaestat = $layer->getmetadata("METAESTAT"); | 413 | $metaestat = $layer->getmetadata("METAESTAT"); |
413 | - $dados = \admin\php\funcoesAdmin\pegaDados ( "SELECT * from ".$esquemaadmin."i3geoadmin_temas WHERE codigo_tema = '$codigo' ", $dbh, false ); | 414 | + $dados = \admin\php\funcoesAdmin\pegaDados ( "SELECT * from ".$esquemaadmin."i3geoadmin_temas WHERE codigo_tema = '$codigo' ", $dbhw, false ); |
414 | //se nao existir no sistema de admin, faz o registro | 415 | //se nao existir no sistema de admin, faz o registro |
415 | if(count($dados) == 0){ | 416 | if(count($dados) == 0){ |
416 | $dataCol = array ( | 417 | $dataCol = array ( |
@@ -428,7 +429,7 @@ function listaUnico($dbh, $codigo) { | @@ -428,7 +429,7 @@ function listaUnico($dbh, $codigo) { | ||
428 | "en" => "" | 429 | "en" => "" |
429 | ); | 430 | ); |
430 | $id_tema = \admin\php\funcoesAdmin\i3GeoAdminInsertUnico($dbhw,"i3geoadmin_temas",$dataCol,"link_tema","id_tema"); | 431 | $id_tema = \admin\php\funcoesAdmin\i3GeoAdminInsertUnico($dbhw,"i3geoadmin_temas",$dataCol,"link_tema","id_tema"); |
431 | - $dados = \admin\php\funcoesAdmin\pegaDados ( "SELECT * from ".$esquemaadmin."i3geoadmin_temas WHERE codigo_tema = '$codigo' AND id_tema = $id_tema ", $dbh, false ); | 432 | + $dados = \admin\php\funcoesAdmin\pegaDados ( "SELECT * from ".$esquemaadmin."i3geoadmin_temas WHERE codigo_tema = '$codigo' AND id_tema = $id_tema ", $dbhw, false ); |
432 | if(count($dados) == 0){ | 433 | if(count($dados) == 0){ |
433 | $dbhw = null; | 434 | $dbhw = null; |
434 | $dbh = null; | 435 | $dbh = null; |
admin1/catalogo/mapfile/templates/templateManterTema.php
@@ -14,13 +14,13 @@ | @@ -14,13 +14,13 @@ | ||
14 | <div class="form-group form-group-lg"> | 14 | <div class="form-group form-group-lg"> |
15 | <label class="col-md-6 control-label" for="titulolegenda" >{{{tituloLegenda}}}</label> | 15 | <label class="col-md-6 control-label" for="titulolegenda" >{{{tituloLegenda}}}</label> |
16 | <div class="col-md-6"> | 16 | <div class="col-md-6"> |
17 | - <input title="{{{tituloLegenda}}}" type="text" value="{{{titulolegenda}}}" class="form-control" name="titulolegenda" > | 17 | + <input title="{{{tituloLegenda}}}" type="text" value="{{{titulolegenda}}}" class="form-control" name="titulolegenda" required > |
18 | </div> | 18 | </div> |
19 | </div> | 19 | </div> |
20 | <div class="form-group form-group-lg"> | 20 | <div class="form-group form-group-lg"> |
21 | <label class="col-md-6 control-label" for="nome_tema" >{{{tituloTema}}}</label> | 21 | <label class="col-md-6 control-label" for="nome_tema" >{{{tituloTema}}}</label> |
22 | <div class="col-md-6"> | 22 | <div class="col-md-6"> |
23 | - <input placeholder="{{{tituloPt}}}" title="{{{tituloTema}}}" type="text" value="{{{nome_tema}}}" class="form-control" name="nome_tema" > | 23 | + <input placeholder="{{{tituloPt}}}" title="{{{tituloTema}}}" type="text" value="{{{nome_tema}}}" class="form-control" name="nome_tema" required > |
24 | </div> | 24 | </div> |
25 | </div> | 25 | </div> |
26 | <div class="form-group form-group-lg"> | 26 | <div class="form-group form-group-lg"> |