2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4 foldmethod=marker:
3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997-2003 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.02 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Created: mar may 27 15:16:38 ART 2003
17 // | Author: Martin Marrese <mmarre@mecon.gov.ar>
18 // +----------------------------------------------------------------------+
23 require_once 'MECON/HTML/Tabla.php';
24 require_once 'SAMURAI/Permiso.php';
26 //LINKS A PERMISOS-ABM {{{
27 $aH = '<a href="permisos-abm?accion=##ACCION##&idPermiso=##NUEVO##">';
28 $aHModif = $aH.'<img src="/MECON/images/general_modificar.gif" border="0" alt="Modificar Permiso"></a>';
29 $aHElim = $aH.'<img src="/MECON/images/general_eliminar.gif" border="0" alt="Eliminar Permiso" ></a>';
30 $aHModifdes = '<img src="/MECON/images/general_modificar_des.gif" border="0" alt="No se puede modificar Permiso">';
31 $aHElimdes = '<img src="/MECON/images/general_eliminar_des.gif" border="0" alt="No se puede eliminar Permiso">';
33 //VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
34 if (!@$_SESSION['samurai']['id_sistema'] || !@$_SESSION['samurai']['login']) {
35 header('Location: ./../sel-sistema');
38 //CREO LOS OBJETOS NECESARIOS {{{
39 $TABLA2 = new Tabla ('cellspacing=0');
40 $TABLA = new Tabla ('cellpadding=2');
42 //OBTENGO LA INFORMACION DE LA BASE {{{
43 $permisos = SAMURAI_Permiso::getPermisos($DB);
45 //AGREGO LOS DATOS A LAS TABLAS {{{
46 $row = array ($aH.'<img src="/MECON/images/general_nuevo.gif" border="0">Ingresar Nuevo Permiso</a>');
47 $TABLA2->addRow($row,'align=right');
48 $row = array ('Id','Descripcion','Modif.','Elim.');
49 $TABLA->addRow($row,'cabecera');
51 foreach ($permisos as $permiso) {
52 if ($permiso->asociadoASistema()) {
57 $Modif = ereg_replace('##NUEVO##' , $permiso->getId(), $aHModif);
58 $Elim = ereg_replace('##NUEVO##' , $permiso->getId(), $aHElim );
59 $Modif = ereg_replace('##ACCION##' , 'm' , $Modif );
60 $Elim = ereg_replace('##ACCION##' , 'e' , $Elim );
62 $row = array ( $permiso->getId(),
63 $permiso->getDescripcion(),
70 //DIBUJO LA PAGINA {{{
71 $MARCO = new Marco ('../../conf/confSecciones.php');
72 $MARCO->addBody($TABLA2->toHtml(1));
73 $MARCO->addBody($TABLA);