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 //VERIFICO SI SE TIENE ACCESO A LA PAGINA{{{
24 if (!$SAMURAI_PERM->tiene(SAMURAI_DEVELOPER)) {
25 // header('Location: error')
28 require_once 'MECON/HTML/Tabla.php';
29 require_once 'SAMURAI/Permiso.php';
31 //LINKS A PERMISOS-ABM {{{
32 $aH = '<a href="permisos-abm?accion=##ACCION##&idPermiso=##NUEVO##">';
33 $aHModif = $aH.'<img src="/MECON/images/general_modificar.gif" border="0" alt="Modificar Permiso"></a>';
34 $aHElim = $aH.'<img src="/MECON/images/general_eliminar.gif" border="0" alt="Eliminar Permiso" ></a>';
35 $aHModifdes = '<img src="/MECON/images/general_modificar_des.gif" border="0" alt="No se puede modificar Permiso">';
36 $aHElimdes = '<img src="/MECON/images/general_eliminar_des.gif" border="0" alt="No se puede eliminar Permiso">';
38 //VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
39 if (!@$_SESSION['samurai']['id_sistema'] || !@$_SESSION['samurai']['login']) {
40 header('Location: ./../sel-sistema');
43 //CREO LOS OBJETOS NECESARIOS {{{
44 $TABLA2 = new MECON_HTML_Tabla ('cellspacing=0');
45 $TABLA = new MECON_HTML_Tabla ('cellpadding=2');
47 //OBTENGO LA INFORMACION DE LA BASE {{{
48 $permisos = SAMURAI_Permiso::getPermisos($DB);
50 //AGREGO LOS DATOS A LAS TABLAS {{{
51 $row = array ($aH.'<img src="/MECON/images/general_nuevo.gif" border="0">Ingresar Nuevo Permiso</a>');
52 $TABLA2->addRow($row,'align=right');
53 $row = array ('Id','Descripcion','Modif.','Elim.');
54 $TABLA->addRow($row,'cabecera');
56 foreach ($permisos as $permiso) {
57 if ($permiso->asociadoASistema()) {
62 $Modif = ereg_replace('##NUEVO##' , $permiso->getId(), $aHModif);
63 $Elim = ereg_replace('##NUEVO##' , $permiso->getId(), $aHElim );
64 $Modif = ereg_replace('##ACCION##' , 'm' , $Modif );
65 $Elim = ereg_replace('##ACCION##' , 'e' , $Elim );
67 $row = array ( $permiso->getId(),
68 $permiso->getDescripcion(),
73 $TABLA->updateColAttributes(0,'width="10%" ');
74 $TABLA->updateColAttributes(1,'width="70%"');
75 $TABLA->updateColAttributes(2,'width="10%"');
76 $TABLA->updateColAttributes(3,'width="10%"');
77 $TABLA->updateRowAttributes(0,'cabecera');
80 //DIBUJO LA PAGINA {{{
81 $MARCO->addBody($TABLA2->toHtml(1));
82 $MARCO->addBody($TABLA);