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: jue nov 27 18:58:19 ART 2003
22 Autor: Martin Marrese <mmarre@mecon.gov.ar>
23 -------------------------------------------------------------------------------
25 -----------------------------------------------------------------------------*/
28 require_once 'MECON/HTML/TablaDB.php';
29 require_once 'MECON/HTML/QuickForm.php';
30 require_once 'MECON/HTML/Link.php';
31 require_once 'MECON/HTML/Image.php';
34 //Creo el formulario de filtro {{{
35 $FORM =& new MECON_HTML_QuickForm ('procesos','get','procesos');
36 $FORM->renderer->updateAttributes ('width="350"');
37 $FORM->addElement('header', 'cabecera', 'Filtrar Procesos');
38 $FORM->addElement('text', 'sistema', 'Sistema', array('size'=>'30'));
39 $FORM->addElement('text', 'descripcion', 'Descripcion', array('size'=>'30'));
40 $FORM->addElement ('mdate', 'fecha', 'Fecha');
41 $FORM->addElement('select', 'status', 'Estado', array(' -- '=>' -- ',
42 'En_Espera' => 'En Espera', 'Procesando' => 'Procesando',
43 'Finalizado' => 'Finalizado', 'Error' => 'Error', 'Abortado' =>
45 $group[] = HTML_QuickForm::createElement('submit', 'aceptar' , 'Filtrar');
46 $FORM->addGroup($group,'botones');
49 //Valido el formulario {{{
50 if ($FORM->validate()) {
51 //Creo la tabla de resultados {{{
52 $TABLADB = new MECON_HTML_TablaDB ('Usuarios');
53 $TABLADB->addRow(array(
55 ), 'cabecera colspan="4" align="left"');
56 $TABLADB->addRow(array(
57 'Id', 'Fecha', 'Sistema', 'Descripcion', 'Estado'
61 //FIXME Usar YATTA_Proceso
63 //Agrego la info a la tabla {{{
65 foreach ($procesos as $proceso) {
66 //Switcheo por el status {{{
67 switch ($proceso['status']) {
69 $estado = new MECON_HTML_Link (
72 ('/sistemas/yatta/images/espera',
78 $estado = new MECON_HTML_Link (
81 ('/sistemas/yatta/images/procesando',
86 $estado = new MECON_HTML_Link ('archivos',
87 new MECON_HTML_Image ('/sistemas/yatta/images/fin',
91 $estado = new MECON_HTML_Link (
94 ('/sistemas/yatta/images/error',
96 array ('mensaje' => $proceso['nota']),
99 "javascript:window.open('popups/procesos','Procesos',".
100 "'width=400,height=300,scrollbars=yes');return false;",
101 'target' => '_blank')
105 $estado = new MECON_HTML_Link (
108 ('/sistemas/yatta/images/abortado',
110 array ('mensaje' => $proceso['nota']),
113 "javascript:window.open('popups/procesos','Procesos',".
114 "'width=400,height=300,scrollbars=yes');return false;",
115 'target' => '_blank')
121 $row = $TABLADB->addRow(array(
124 $proceso['nombre_sistema'],
125 $proceso['descripcion'],
133 $TABLADB->addRow(array(
134 'No se encontraron procesos'
137 $TABLADB->updateColAttributes(0,'width="8%"');
138 $TABLADB->updateColAttributes(2,'width="30%"');
139 $TABLADB->updateColAttributes(3,'width="40%"');
140 $TABLADB->updateColAttributes(4,'width="5%"');
145 //Agrego la info al marco y la muestro {{{
146 $MARCO->addStyleSheet('css/yatta.css');
147 $MARCO->addBody($FORM);
149 $MARCO->addBody('<BR>');
150 $MARCO->addBody($TABLADB);