$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;
}
}
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
$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
--- /dev/null
+-- 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 <gmeray@mecon.gov.ar> |
+-- +--------------------------------------------------------------------+
+--
+-- $Id$
+--
+
+CREATE TABLE secciones_censuradas (
+ seccion INTEGER NOT NULL PRIMARY KEY
+);