X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/b465e1d227e49e33f3561e605af8fad7ec321c79..ac29a138e10e12fa3f0567323b7ab99ac900ab9d:/sistema/local_lib/HTML_Servicio.php diff --git a/sistema/local_lib/HTML_Servicio.php b/sistema/local_lib/HTML_Servicio.php index 9ceec18..233f349 100644 --- a/sistema/local_lib/HTML_Servicio.php +++ b/sistema/local_lib/HTML_Servicio.php @@ -2,16 +2,16 @@ // 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. | @@ -21,18 +21,16 @@ // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | // +--------------------------------------------------------------------+ // | Creado: Thu Jul 24 15:27:04 2003 | -// | Autor: Gonzalo Merayo | +// | Autor: Gonzalo Merayo | // +--------------------------------------------------------------------+ // -// $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'; @@ -58,12 +56,11 @@ class HTML_Servicio extends HTML_Table { '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, true, 'LENGTH(nombre)'); + $this->servicio->cargar($db); + $this->servicio->cargarHijos($db, true, AI_SERVICIO_ORDEN_LONG_NOMBRE); } // -X2C @@ -75,9 +72,9 @@ class HTML_Servicio extends HTML_Table { 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... @@ -91,7 +88,7 @@ class HTML_Servicio extends HTML_Table { $int =& new HTML_Table(array('width' =>'360', 'border' => '0', 'cellspacing' => '0', - 'cellpadding' => '3', + 'cellpadding' => '0', 'bgcolor' => '#FFFFFF')); $int->addRow(array($img, '',$img,''), array()); @@ -111,30 +108,35 @@ class HTML_Servicio extends HTML_Table { 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)); @@ -152,7 +154,7 @@ class HTML_Servicio extends HTML_Table { */ function getCSS() // ~X2C { - return "css/servicio.css"; + return 'css/servicio.css'; } // -X2C