// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
// +--------------------------------------------------------------------+
// | Ministerio de EconomÃa |
-// | Intranet |
+// | Intranet |
// +--------------------------------------------------------------------+
-// | This file is part of Intranet. |
+// | This file is part of Intranet. |
// | |
-// | Intranet is free software; you can redistribute it and/or modify |
+// | Intranet is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published |
// | by the Free Software Foundation; either version 2 of the License, |
// | or (at your option) any later version. |
// | |
-// | Intranet is distributed in the hope that it will be useful, but |
+// | Intranet is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +--------------------------------------------------------------------+
// | Creado: Thu Jul 24 15:27:04 2003 |
-// | Autor: Gonzalo Merayo <gmeray@mecon.gov.ar> |
+// | Autor: Gonzalo Merayo <gmeray@mecon.gov.ar> |
// +--------------------------------------------------------------------+
//
-// $Id: xmi2code.tpl.php 1 2003-06-23 18:29:20Z gmeray $
+// $Id$
//
-
require_once 'MECON/HTML/Image.php';
require_once 'MECON/HTML/Link.php';
-require_once 'DB.php';
+require_once 'intranetdb.php';
require_once 'AI/Servicio.php';
-// require_once 'AI/DB.php';
// +X2C includes
require_once 'HTML/Table.php';
'border' => '0',
'cellspacing' => '0',
'cellpadding' => '0',
- 'bgcolor' => '#FFFFFF',
- 'class' => 'servicio_tabla'));
- $bd = DB::Connect('mysql://intranet:intranet@bal747f/intranet');//FIXME
+ 'bgcolor' => '#FFFFFF'));
+ $db = IntranetDB::connect();
$this->servicio = new AI_Servicio($seccion);
- $this->servicio->cargar($bd);
- $this->servicio->cargarHijos($bd);
+ $this->servicio->cargar($db);
+ $this->servicio->cargarHijos($db, true, AI_SERVICIO_ORDEN_LONG_NOMBRE);
}
// -X2C
function toHTML() // ~X2C
{
if($this->servicio->link == '')
- $this->servicio->link = 'servicios.php?servicios='.$this->servicio->servicio;
+ $this->servicio->link = '?servicios='.$this->servicio->servicio;
elseif($this->servicio->necesita_logueo)
- $this->servicio->link = 'login.php?redirect='.$this->servicio->servicio;
+ $this->servicio->link = 'login?redirect='.$this->servicio->servicio;
$l = new MECON_HTML_Link($this->servicio->link, $this->servicio->nombre, array(),
array('class' => 'servicio_titulo_tabla'));
//$this->addRow(array(' '.$l->toHTML()),//Volvera...
foreach($this->servicio->getHijos() as $s)
{
if($s->link == '')
- $s->link = 'servicios.php?servicios='.$s->servicio;
+ $s->link = '?servicios='.$s->servicio;
elseif($s->necesita_logueo)
- $s->link = 'login.php?redirect='.$s->servicio;
+ $s->link = 'login?redirect='.$s->servicio;
+ $link = new MECON_HTML_Link($s->link, $s->nombre,
+ array(),
+ array('class' => 'servicio_tabla'));
+ if ($s->ventana_nueva) {
+ $link->updateAttributes(array(
+ // XXX - no lo pongo porque no le veo sentido para links externos sacarles las barras y eso.
+ //'OnClick' => "javascript:window.open('{$s->link}','serv{$s->servicio}',"
+ // . "'width=800,height=600,scrollbars=yes');return false;",
+ 'target' => '_blank',
+ ));
+ }
if($par)
{
- $int->setCellContents(0, 3, new MECON_HTML_Link($s->link, $s->nombre,
- array(),
- array('class' => 'servicio_tabla')));
- $this->addRow(array($int));
+ $int->setCellContents(0, 3, $link);
+ $this->addRow(array($int));
$par = false;
}
else
{
- $int->setCellContents(0, 1, new MECON_HTML_Link($s->link, $s->nombre,
- array(),
- array('class' => 'servicio_tabla')));
+ $int->setCellContents(0, 1, $link);
$par = true;
}
}
if($par)
{
- $int->setCellContents(0, 1, new MECON_HTML_Link($s->link, $s->nombre,
- array(),
- array('class' => 'servicio_tabla')));
+ $int->setCellContents(0, 1, $link);
$int->setCellContents(0, 2, '');
$int->setCellContents(0, 3, '');
$this->addRow(array($int));
*/
function getCSS() // ~X2C
{
- return "css/servicio.css";
+ return 'css/servicio.css';
}
// -X2C