From: Leandro Lucarella Date: Fri, 7 Nov 2003 17:11:46 +0000 (+0000) Subject: Cambios cortesía de gmeray: X-Git-Tag: svn_import~10 X-Git-Url: https://git.llucax.com/mecon/ai.git/commitdiff_plain/beb4f27c0f38e10c639f5ec2000a0ac57719221c Cambios cortesía de gmeray: - Agrega tabla nueva. - Hace que se carguen hijos y nietos en GrupoSecciones::cargar(). --- diff --git a/lib/AI/GrupoSecciones.php b/lib/AI/GrupoSecciones.php index df21dc6..a9c3839 100644 --- a/lib/AI/GrupoSecciones.php +++ b/lib/AI/GrupoSecciones.php @@ -133,10 +133,37 @@ class AI_GrupoSecciones extends AI_DBTreeObject { $id = intval($this->grupo); extract($this->conf['secciones'], EXTR_PREFIX_ALL, 'cnf'); $secciones = $db->getCol( - "SELECT $cnf_campo - FROM $cnf_base.$cnf_tabla + "SELECT $cnf_campo + FROM $cnf_base.$cnf_tabla WHERE $cnf_id = $id" ); + //Busco los hijos si corresponde + //Agregado por gmeray + if($this->mostrar_hijos) + { + //hijos + $secciones = array_merge($secciones, + $db->getCol( + "SELECT GSS.$cnf_campo + FROM $cnf_base.$cnf_tabla GSS, $cnf_base.grupo_secciones GS + WHERE GSS.$cnf_id = GS.grupo + AND GS.grupo_padre = $id" + ) + ); + //nietos + $secciones = array_merge($secciones, + $db->getCol( + "SELECT GSS.$cnf_campo + FROM $cnf_base.$cnf_tabla GSS, $cnf_base.grupo_secciones GS, $cnf_base.grupo_secciones GS2 + WHERE GSS.$cnf_id = GS.grupo + AND GS.grupo_padre = GS2.grupo + AND GS2.grupo_padre = $id" + ) + ); + //Si hace falta agreguen los bisnietos. + } + //Fin Agregado + if (DB::isError($secciones)) { return $secciones; } @@ -240,13 +267,14 @@ S } extract($conf_dav, EXTR_PREFIX_ALL, 'dav'); extract($conf_sec, EXTR_PREFIX_ALL, 'sec'); - return $db->getAssoc(" - SELECT d.$dav_id, d.$dav_campo - FROM $dav_base.$dav_tabla as d - LEFT JOIN $sec_base.$sec_tabla AS s - ON s.$sec_campo = d.$dav_id - WHERE s.$sec_campo IS NULL OR s.$sec_id = $grupo - ORDER BY d.$dav_campo ASC"); + return $db->getAssoc( + "SELECT d.$dav_id, d.$dav_campo + FROM $dav_base.$dav_tabla as d + LEFT JOIN $sec_base.$sec_tabla AS s + ON s.$sec_campo = d.$dav_id + WHERE s.$sec_campo IS NULL + OR s.$sec_id = $grupo + ORDER BY d.$dav_campo ASC"); } // -X2C @@ -269,10 +297,10 @@ S $conf = $conf['secciones']; } extract($conf); - return $db->getOne(" - SELECT $id - FROM $base.$tabla - WHERE $campo = " . $db->quote($seccion)); + return $db->getOne( + "SELECT $id + FROM $base.$tabla + WHERE $campo = " . $db->quote($seccion)); } // -X2C diff --git a/lib/AI/Servicio.php b/lib/AI/Servicio.php index d6277cf..29f2070 100644 --- a/lib/AI/Servicio.php +++ b/lib/AI/Servicio.php @@ -203,7 +203,7 @@ class AI_Servicio extends AI_DBTreeObject { } $query .= " GROUP BY A.$id_field - ORDER BY RENGLONES DESC, COUNT DESC"; + ORDER BY RENGLONES DESC, COUNT DESC, A.nombre"; } elseif ($orden === AI_SERVICIO_ORDEN_LONG_NOMBRE) { $query = " SELECT * diff --git a/sql/secciones_censuradas.sql b/sql/secciones_censuradas.sql new file mode 100644 index 0000000..80b6b1c --- /dev/null +++ b/sql/secciones_censuradas.sql @@ -0,0 +1,31 @@ +-- vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: +-- +--------------------------------------------------------------------+ +-- | Ministerio de Economía | +-- | AI (Administrador de Intranet) | +-- +--------------------------------------------------------------------+ +-- | This file is part of AI. | +-- | | +-- | AI is free software; you can redistribute it and/or modify | +-- | it under the terms of the GNU General Public License as published | +-- | by the Free Software Foundation; either version 2 of the License, | +-- | or (at your option) any later version. | +-- | | +-- | AI is distributed in the hope that it will be useful, but | +-- | WITHOUT ANY WARRANTY; without even the implied warranty of | +-- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +-- | General Public License for more details. | +-- | | +-- | You should have received a copy of the GNU General Public License | +-- | along with Hooks; if not, write to the Free Software Foundation, | +-- | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | +-- +--------------------------------------------------------------------+ +-- | Creado: mar nov 06 13:56:49 ART 2003 | +-- | Autor: Gonzalo Merayo | +-- +--------------------------------------------------------------------+ +-- +-- $Id$ +-- + +CREATE TABLE secciones_censuradas ( + seccion INTEGER NOT NULL PRIMARY KEY +);