X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/53e18344699b0c7545128534f757e4d4f3ec639f..ba00ad2867590a8c6d19a063b3e29d4379e38547:/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 ea8977f..6b298ec 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,14 +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 'MECON/HTML/Image.php'; +require_once 'MECON/HTML/Link.php'; +require_once 'intranetdb.php'; +require_once 'AI/Servicio.php'; // +X2C includes require_once 'HTML/Table.php'; @@ -55,6 +57,10 @@ class HTML_Servicio extends HTML_Table { 'cellspacing' => '0', 'cellpadding' => '0', 'bgcolor' => '#FFFFFF')); + $db = IntranetDB::connect(); + $this->servicio = new AI_Servicio($seccion); + $this->servicio->cargar($db); + $this->servicio->cargarHijos($db, true, AI_SERVICIO_ORDEN_LONG_NOMBRE); } // -X2C @@ -65,34 +71,93 @@ class HTML_Servicio extends HTML_Table { */ function toHTML() // ~X2C { - $this->addRow(array("Nombre(sin estilo)"), + if($this->servicio->link == '') + $this->servicio->link = $_SERVER['PHP_SELF'].'?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()),//Volvera... + $this->addRow(array('   '.$this->servicio->nombre), array('align' => 'center', 'class' => 'arboltitulo', 'background'=>'images/servicio_cabecera.gif', - 'height'=>30)); - $img = new HTML_Image('images/servicio_bullet.gif'); - $int =& new HTML_Table(array('width' =>'360', - 'border' => '0', - 'cellspacing' => '0', - 'cellpadding' => '0', - 'bgcolor' => '#FFFFFF')); - $int->addRow(array($img, 'Nombre(sin estilo)',$img,'nombre'), - array('valign' => 'top')); - $int->updateColAttributes(0, array('width' => '10%', - 'background' => 'images/servicio_borde_sup_izq.gif')); - $int->updateColAttributes(1, array('width' => '40%', - 'background' => 'images/servicio_borde_sup_cen.gif')); - $int->updateColAttributes(2, array('width' => '10%', - 'background' => 'images/servicio_borde_sup_cen.gif')); - $int->updateColAttributes(3, array('width' => '40%', - 'background' => 'images/servicio_borde_sup_der.gif')); - $this->addRow(array($int)); - $this->addRow(array($int)); - $this->addRow(array($int)); - $this->addRow(array(new HTML_Image('images/servicio_borde_inf.gif'))); - return parent::toHTML(); + 'height'=>30, + 'class' => 'servicio_titulo_tabla')); + $img = new MECON_HTML_Image('images/servicio_bullet.gif'); + $int =& new HTML_Table(array('width' =>'360', + 'border' => '0', + 'cellspacing' => '0', + 'cellpadding' => '0', + 'bgcolor' => '#FFFFFF')); + $int->addRow(array($img, '',$img,''), + array()); + $int->updateColAttributes(0, array('width' => '10%', + '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 = $_SERVER['PHP_SELF'].'?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, $link); + $this->addRow(array($int)); + $par = false; + } + else + { + $int->setCellContents(0, 1, $link); + $par = true; + } + } + if($par) + { + $int->setCellContents(0, 1, $link); + $int->setCellContents(0, 2, ''); + $int->setCellContents(0, 3, ''); + $this->addRow(array($int)); + } + + $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 + ?>