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 // +----------------------------------------------------------------------+
22 //VERIFICO SI SE TIENE ACCESO A LA PAGINA {{{
23 $SAMURAI_PERM->setSistema(SAMURAI_PERM);
24 if (!$SAMURAI_PERM->tiene(SAMURAI_PERM_DEVELOPER)) {
25 $SAMURAI_PERM->chequear(SAMURAI_PERM_DEVELOPER);
27 $MARCO =& new MECON_Marco ('/var/www/sistemas/samurai/sistema/conf/confSecciones.php', $SAMURAI_PERM);
31 require_once 'MECON/HTML/Image.php';
32 require_once 'MECON/HTML/Link.php';
33 require_once 'MECON/HTML/TablaDB.php';
34 require_once 'SAMURAI/Permiso.php';
37 //VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
38 if (!@$_SESSION['samurai']['id_sistema']) {
39 header('Location: ./../sel-sistema?redirect=permisos/permisos');
43 //OBTENGO LA INFORMACION DE LA BASE {{{
44 $res = SAMURAI_Permiso::getPermisosPager($DB);
45 if (PEAR::isError($res)) {
46 trigger_error('Error: ' . $res->getMessage() . "\n", E_USER_ERROR);
51 //CREO LA TABLA DE PERMISOS {{{
52 $TABLA =& new MECON_HTML_TablaDB ('Permisos');
56 'permisos-abm', 'Nuevo Permiso',
58 'accion' => '##ACCION##',
59 'idPermiso' => '##NUEVO##'
63 $TABLA->addRow(array('Id', 'DescripciĆ³n', 'Modif.', 'Elimn.'), 'cabecera');
64 $pager = $TABLA->addPager($res, null, new MECON_HTML_Link ('permisos', null), 25);
66 //Agrego las columnas de modificacion y eliminacion {{{
67 $link = new MECON_HTML_Link ('permisos-abm', null, array('accion' => 'm'));
68 $TABLA->addRowsIcon('modificar', 'id_permiso', $link, 'cuenta');
69 $link->setGetVar('accion', 'e');
70 $TABLA->addRowsIcon('eliminar', 'id_permiso', $link, 'cuenta');
73 $TABLA->addRows($pager, array ('id_permiso', 'desc_permiso'));
74 $TABLA->updateColAttributes(0,'width="10%" ');
75 $TABLA->updateColAttributes(1,'width="70%"');
76 $TABLA->updateColAttributes(2,'width="10%"');
77 $TABLA->updateColAttributes(3,'width="10%"');
80 //DIBUJO LA PAGINA {{{
81 $MARCO->addBody($TABLA);