1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80 foldmethod=marker:
2 -------------------------------------------------------------------------------
5 -------------------------------------------------------------------------------
6 This file is part of YATTA!.
8 YATTA! is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2 of the License, or (at your option)
13 YATTA! is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License; if not,
18 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 Boston, MA 02111-1307 USA
20 -------------------------------------------------------------------------------
21 Creado: mar dic 2 18:11:32 ART 2003
22 Autor: Martin Marrese <mmarre@mecon.gov.ar>
23 -------------------------------------------------------------------------------
25 -----------------------------------------------------------------------------*/
29 require_once 'MECON/HTML/Tabla.php';
30 require_once 'MECON/HTML/Link.php';
31 require_once 'MECON/HTML/Image.php';
32 require_once 'MECON/HTML/QuickForm.php';
35 require_once 'YATTA/ProcesoDB.php';
39 //Creo los objetos necesarios {{{
40 $PROCESO =& new YATTA_ProcesoDB;
41 $FORM =& new MECON_HTML_QuickForm('procesos_detener', 'post',
43 $FORM->renderer->updateAttributes('width="400"');
46 //Obtengo la info que se pasa por get {{{
47 $id = (@$_REQUEST['id']) ? $_REQUEST['id'] : null;
50 //Obtengo la informacion del proceso {{{
52 $PROCESO->owner = $_SESSION['usuario'];
53 $res = $PROCESO->buscar($DB);
54 if (PEAR::isError($res)) {
55 trigger_error('Error: ' . $res->getMessage() . "\n", E_USER_ERROR);
57 $PROCESO->cargar($res);
60 //Armo el formulario {{{
61 $FORM->addElement('header', 'cabecera', 'Ingrese una nota explicativa');
62 $text =& $FORM->addElement('textarea', 'nota', 'Nota',
63 array('rows' => '2','cols'=>'40', 'wrap'=>'virtual'));
64 $group[] =& HTML_QuickForm::createElement('submit', 'aceptar' , 'Aceptar');
65 $group[] =& HTML_QuickForm::createElement('submit', 'cancelar', 'Cancelar',
66 array ('onClick' => 'self.close();return false;'));
67 $FORM->addGroup($group,'botones');
70 //Valido el formulario {{{
71 if ($FORM->validate()) {
72 $f_botones = $FORM->getSubmitValue('botones');
75 if (@$f_botones['cancelar']) {
76 header ('location: procesos');
81 $PROCESO->nota = $text->getValue();
83 $res = $PROCESO->guardar($DB) ;
84 if (PEAR::isError($res)) {
85 trigger_error('Error: ' . $res->getMessage() . "\n", E_USER_ERROR);
87 header ('location: procesos');
92 //DIBUJO LA PAGINA {{{
93 $MARCO->addBody($FORM);
94 $MARCO->addStyleSheet('css/yatta.css');