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: jue jul 17 16:29:54 ART 2003
17 // | Author: Martin Marrese <mmarre@mecon.gov.ar>
18 // +----------------------------------------------------------------------+
23 //VERIFICO SI SE TIENE ACCESO A LA PAGINA{{{
24 $SAMURAI_PERM->setSistema(SAMURAI_PERM);
25 if (!$SAMURAI_PERM->tiene(SAMURAI_PERM_DEVELOPER)) {
26 $SAMURAI_PERM->setSistema($_SESSION['samurai']['id_sistema']);
27 $SAMURAI_PERM->chequear(SAMURAI_PERM_PERFIL_ALTA,SAMURAI_PERM_PERFIL_BAJA,SAMURAI_PERM_PERFIL_MODIF, SAMURAI_PERM_DEVELOPER);
29 $MARCO =& new MECON_Marco ('/var/www/sistemas/samurai/sistema/conf/confSecciones.php', $SAMURAI_PERM);
34 require_once 'MECON/HTML/QuickForm.php';
35 require_once 'MECON/HTML/Error.php';
38 require_once 'SAMURAI/Perfil.php';
39 require_once 'SAMURAI/Permiso.php';
40 require_once 'SAMURAI/Sistema.php';
42 require_once 'MECON/HTML/Image.php';
43 require_once 'HTML/Page.php';
46 //CREO LOS OBJETOS NECESARIOS {{{
47 if (!@$_GET['id_perfil']) {
48 $FORM = new MECON_HTML_Error('No hay un perfil seleccionado');
51 $PAGE = new HTML_Page(array ('doctype'=>'HTML 4.01 Transitional',
52 'charset' => 'iso-8859-1',
57 $PAGE->addStyleSheet('/MECON/css/marco.css');
58 $FORM = new MECON_HTML_QuickForm ('perfil_datos','post','perfil-datos');
59 $PERFIL = new SAMURAI_Perfil($DB, $_GET['id_perfil'],
60 $_SESSION['samurai']['id_sistema']);
61 $SISTEMA = new SAMURAI_Sistema ($DB, $_SESSION['samurai']['id_sistema']);
64 //OBTENGO LOS PERMISOS DEL SISTEMA {{{
65 $ASOCIACIONES = $SISTEMA->getAsociaciones();
68 foreach ($ASOCIACIONES as $as) {
69 $clave = $as['id'].'##'.$as['obs'];
70 $texto = ($as['obs'] != '') ? $as['desc'].' - '.$as['obs']: $as['desc'];
71 $PERMISOS[$clave] = $texto;
74 //AGREGO LOS ELEMENTOS AL FORM {{{
75 $FORM->addElement ('static', 'id_perfil' , 'Id Perfil' , $PERFIL->getId() );
76 $FORM->addElement ('static', 'desc_perfil', 'Descricion' , $PERFIL->getDescripcion() );
77 $perf =& $FORM->addElement('select', 'permisos' , 'Permisos' , $PERMISOS, array ('size'=>'5'));
78 $perf->setSelected($PERFIL->getPermisos());
82 //DIBUJO LA PAGINA {{{
83 $PAGE->addBodyContent($FORM);
84 $imagen = new MECON_HTML_Image('/MECON/images/general_cerrar.gif');
85 $PAGE->addBodyContent('<a href="" onClick=\'self.close();return false;\'>'.$imagen->toHtml().'</a>');
86 $PAGE->setTitle('Datos del Perfil');