Commit e8474a73e4cfb721b715d77b621f56f2f75383a1

Authored by Edmar Moretti
1 parent 4c179ac2
Exists in master

Inclusão de função para obtenção do catálogo completo do i3Geo para melhorar a p…

…erformance do mapa da saude
Showing 1 changed file with 42 additions and 0 deletions   Show diff stats
classesphp/mapa_controle.php
... ... @@ -1621,6 +1621,48 @@ switch (strtoupper($funcao)) {
1621 1621 $m = new Menutemas($map_file, $perfil, $locaplic, $urli3geo, $editores, $idioma);
1622 1622 $retorno = $m->pegaListaDeMenus($filtraOgc, $filtraDown);
1623 1623 break;
  1624 + case "PEGALISTADEMENUSCOMPLETA":
  1625 + $arq = $dir_tmp."/catalogoTemas.json";
  1626 + if (file_exists($arq)){
  1627 + $retorno = unserialize(file_get_contents($arq));
  1628 + } else {
  1629 + include_once ("classe_menutemas.php");
  1630 + if (isset($_pg["editores"])) {
  1631 + $editores = $_pg["editores"];
  1632 + } else {
  1633 + $editores = "";
  1634 + }
  1635 + if (isset($_pg["perfil"])) {
  1636 + $perfil = $_pg["perfil"];
  1637 + } else {
  1638 + $perfil = "";
  1639 + }
  1640 + $idioma = $_pg["idioma"];
  1641 + $filtraOgc = $_pg["filtraOgc"];
  1642 + $filtraDown = $_pg["filtraDown"];
  1643 + if (! isset($editores)) {
  1644 + $editores = "";
  1645 + }
  1646 + $m = new Menutemas($map_file, $perfil, $locaplic, $urli3geo, $editores, $idioma);
  1647 + $retorno = $m->pegaListaDeMenus($filtraOgc, $filtraDown);
  1648 + for($i = 0; $i < count($retorno); $i++){
  1649 + $idmenu = $retorno[$i]["idmenu"];
  1650 + $grupos = $m->pegaListaDeGrupos($retorno[$i]["idmenu"], "nao", "sim");
  1651 + for($j = 0; $j < count($grupos); $j++){
  1652 + $idgrupo = $grupos[$j]["id_n1"];
  1653 + for ($k = 0; $k < count($grupos[$j]["subgrupos"]); $k++){
  1654 + $idsubgrupo = $grupos[$j]["subgrupos"][$k]["id_n2"];
  1655 + $temas = $m->pegaListaDeTemas($idgrupo, $idsubgrupo, $idmenu);
  1656 + $grupos[$j]["subgrupos"][$k]["temas"] = $temas;
  1657 + }
  1658 + }
  1659 + $retorno[$i]["grupos"] = $grupos;
  1660 + }
  1661 + if (!file_exists($arq) && count($retorno) > 0){
  1662 + gravaDados([serialize($retorno)], $arq);
  1663 + }
  1664 + }
  1665 + break;
1624 1666 /*
1625 1667 * Valor: PEGALISTADEGRUPOS
1626 1668 *
... ...