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 $SAMURAI_PERM->chequear(SAMURAI_PERM_DEVELOPER);
26 require_once 'MECON/HTML/Tabla.php';
27 require_once 'SAMURAI/Permiso.php';
29 //LINKS A PERMISOS-ABM {{{
30 $aH = '<a href="permisos-abm?accion=##ACCION##&idPermiso=##NUEVO##">';
31 $aHModif = $aH.'<img src="/MECON/images/general_modificar.gif" border="0" alt="Modificar Permiso"></a>';
32 $aHElim = $aH.'<img src="/MECON/images/general_eliminar.gif" border="0" alt="Eliminar Permiso" ></a>';
33 $aHModifdes = '<img src="/MECON/images/general_modificar_des.gif" border="0" alt="No se puede modificar Permiso">';
34 $aHElimdes = '<img src="/MECON/images/general_eliminar_des.gif" border="0" alt="No se puede eliminar Permiso">';
36 //VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
37 if (!@$_SESSION['samurai']['id_sistema']) {
38 header('Location: ./../sel-sistema?redirect=permisos/permisos');
41 //CREO LOS OBJETOS NECESARIOS {{{
42 $TABLA2 = new MECON_HTML_Tabla ('cellspacing=0');
43 $TABLA = new MECON_HTML_Tabla ('cellpadding=2');
45 //OBTENGO LA INFORMACION DE LA BASE {{{
46 $permisos = SAMURAI_Permiso::getPermisos($DB);
48 //AGREGO LOS DATOS A LAS TABLAS {{{
49 $row = array ($aH.'<img src="/MECON/images/general_nuevo.gif" border="0">Ingresar Nuevo Permiso</a>');
50 $TABLA2->addRow($row,'align=right');
51 $row = array ('Id','Descripcion','Modif.','Elim.');
52 $TABLA->addRow($row,'cabecera');
54 foreach ($permisos as $permiso) {
55 if ($permiso->asociadoASistema()) {
60 $Modif = ereg_replace('##NUEVO##' , $permiso->getId(), $aHModif);
61 $Elim = ereg_replace('##NUEVO##' , $permiso->getId(), $aHElim );
62 $Modif = ereg_replace('##ACCION##' , 'm' , $Modif );
63 $Elim = ereg_replace('##ACCION##' , 'e' , $Elim );
65 $row = array ( $permiso->getId(),
66 $permiso->getDescripcion(),
71 $TABLA->updateColAttributes(0,'width="10%" ');
72 $TABLA->updateColAttributes(1,'width="70%"');
73 $TABLA->updateColAttributes(2,'width="10%"');
74 $TABLA->updateColAttributes(3,'width="10%"');
75 $TABLA->updateRowAttributes(0,'cabecera');
78 //DIBUJO LA PAGINA {{{
79 $MARCO->addBody($TABLA2->toHtml(1));
80 $MARCO->addBody($TABLA);