X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/eb86d04858357c87d5d7a7e3cb528ef24949b725..fc32613380df9845ff3916e36771f361d0469345:/sistema/local_lib/HTML_Servicio.php?ds=sidebyside diff --git a/sistema/local_lib/HTML_Servicio.php b/sistema/local_lib/HTML_Servicio.php index ee65e0f..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 'HTML/Image.php'; -require_once 'HTML/Link.php'; -require_once 'DB.php'; +require_once 'MECON/HTML/Image.php'; +require_once 'MECON/HTML/Link.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'); + '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 @@ -74,18 +71,20 @@ class HTML_Servicio extends HTML_Table { */ function toHTML() // ~X2C { - echo ''; if($this->servicio->link == '') - $this->servicio->link = 'servicios.php?servicios='.$this->servicio->servicio; - $l = new HTML_Link($this->servicio->link, $this->servicio->nombre, array(), + $this->servicio->link = '?servicios='.$this->servicio->servicio; + elseif($this->servicio->necesita_logueo) + $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()), + //$this->addRow(array('   '.$l->toHTML()),//Volvera... + $this->addRow(array('   '.$this->servicio->nombre), array('align' => 'center', 'class' => 'arboltitulo', 'background'=>'images/servicio_cabecera.gif', 'height'=>30, 'class' => 'servicio_titulo_tabla')); - $img = new HTML_Image('images/servicio_bullet.gif'); + $img = new MECON_HTML_Image('images/servicio_bullet.gif'); $int =& new HTML_Table(array('width' =>'360', 'border' => '0', 'cellspacing' => '0', @@ -97,47 +96,67 @@ class HTML_Servicio extends HTML_Table { 'background' => 'images/servicio_borde_sup_izq.gif', 'valign' => 'top')); $int->updateColAttributes(1, array('width' => '40%', + 'valign' => 'top', 'background' => 'images/servicio_borde_sup_cen.gif')); $int->updateColAttributes(2, array('width' => '10%', 'background' => 'images/servicio_borde_sup_cen.gif', 'valign' => 'top')); $int->updateColAttributes(3, array('width' => '40%', + 'valign' => 'top', 'background' => 'images/servicio_borde_sup_der.gif')); $par = false; foreach($this->servicio->getHijos() as $s) { if($s->link == '') - $s->link = 'servicios.php?servicios='.$s->servicio; - if($par) + $s->link = '?servicios='.$s->servicio; + elseif($s->necesita_logueo) + $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 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 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 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)); } - $this->addRow(array(new HTML_Image('images/servicio_borde_inf.gif'))); + $this->addRow(array(new MECON_HTML_Image('images/servicio_borde_inf.gif'))); return parent::toHTML(); } // -X2C + // +X2C Operation 170 + /** + * @return void + * @access public + */ + function getCSS() // ~X2C + { + return 'css/servicio.css'; + } + // -X2C + } // -X2C Class :HTML_Servicio ?>