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: lun jul 7 10:39:58 ART 2003
17 // | Author: Martin Marrese <mmarre@mecon.gov.ar>
18 // +----------------------------------------------------------------------+
22 require_once 'MECON/HTML/QuickForm.php';
23 require_once 'MECON/HTML/Tabla.php';
24 require_once 'SAMURAI/Sistema.php';
27 //CREO LOS OBJETOS NECESARIOS {{{
28 $FORM = new MECON_HTML_QuickForm ('sel_sistema','post','sel-sistema');
29 $SISTEMAS = SAMURAI_Sistema::getArraySistemas($DB);
31 //AGREGO LOS ELEMENTOS DEL FORM {{{
32 $FORM->addElement ('header', 'cabecera', 'Seleccione el sistema con el cual quiere trabajar');
33 $FORM->addElement ('select', 'sistemas', 'Sistemas', $SISTEMAS, array('size' => '1'));
35 //SI ESTA EL LOGIN NO LO PIDO {{{
36 if (!@$_SESSION['samurai']['login']) {
37 $FORM->addElement ('text', 'responsable', 'Responsable', array('size' => '30'));
38 $FORM->addRule ('responsable', 'El campo responsable es obligatorio', 'required');
41 $group[] = HTML_QuickForm::createElement('submit', 'aceptar' , 'Seleccionar');
42 $FORM->addGroup($group,'botones', '', ', ');
44 //VALIDO EL FORMULARIO {{{
45 if ($FORM->validate()) {
46 $sistema =& $FORM->getElement ('sistemas');
47 $tmp = $sistema->getSelected();
48 $_SESSION['samurai']['id_sistema'] = $tmp['0'];
50 if ($FORM->elementExists('responsable')) {
51 $responsable =& $FORM->getElement ('responsable');
52 $_SESSION['samurai']['login'] = $responsable->getValue();
54 header('Location: index');
57 // DIBUJO LA PAGINA {{{
58 $_SESSION['deshabilitar_links'] = true; //MODIFICAR ESTO CUANDO SE HAGA LA FUNCION DESHABILITAR LINKS
59 $MARCO = new Marco ('../conf/confSecciones.php');
60 $MARCO->addBody($FORM);