X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/ab77106d0d0e5ffcef48bc563360a6332cab1d9d..3cf75bf27a5cea46f4896688c546b65aba12dc40:/lib/noticia.php?ds=sidebyside diff --git a/lib/noticia.php b/lib/noticia.php index 88f9f08..cc2b5f7 100644 --- a/lib/noticia.php +++ b/lib/noticia.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. | @@ -20,15 +20,15 @@ // | along with Hooks; if not, write to the Free Software Foundation, | // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | // +--------------------------------------------------------------------+ -// | Creado: Thu Jul 3 14:49:15 2003 | -// | Autor: Gonzalo Merayo | +// | Creado: Thu Jul 3 14:49:15 2003 | +// | Autor: Gonzalo Merayo | // +--------------------------------------------------------------------+ // // $Id: xmi2code.tpl.php 1 2003-06-23 18:29:20Z gmeray $ // -require_once 'mecondavdb.php'; - +require_once 'Date.php'; +require_once 'intranetdb.php'; // +X2C Class 161 :noticia /** @@ -52,17 +52,22 @@ class noticia { */ function noticia($noticia) // ~X2C { - $this->noticia; - $db = MEconDAVDB::Connect(); - $query = "SELECT headline, title, abstract, article - FROM Articles - WHERE Article_id = $noticia"; + $this->noticia = $noticia; + $db = IntranetDB::Connect(); + $query = "SELECT A.headline, A.title, A.abstract, A.article, + A.publication_date, S.description, S.section_id + FROM MEconDAV.Articles A, MEconDAV.Sections S + WHERE Article_id = $noticia + AND A.section_id = S.section_id"; $result = $db->query($query); $row = $result->fetchRow(); - $this->titulo2 = $row[0]; - $this->titulo = $row[1]; - $this->abstracto = $row[2]; + $this->titulo = $row[0]; + $this->titulo2 = $row[1]; + $this->sintesis = $row[2]; $this->texto = $row[3]; + $this->fecha = new Date($row[4]); + $this->seccion = $row[5]; + $this->id_seccion = $row[6]; } // -X2C @@ -93,9 +98,9 @@ class noticia { * @return string * @access public */ - function getAbstracto() // ~X2C + function getSintesis() // ~X2C { - return $this->abstracto; + return $this->sintesis; } // -X2C @@ -110,5 +115,75 @@ class noticia { } // -X2C + // +X2C Operation 186 + /** + * @return string + * @access public + */ + function getFecha() // ~X2C + { + return $this->fecha; + } + // -X2C + + // +X2C Operation 191 + /** + * @return void + * @access public + */ + function getSeccion() // ~X2C + { + return $this->seccion; + } + // -X2C + + // +X2C Operation 197 + /** + * @return void + * @access public + */ + function getidSeccion() // ~X2C + { + return $this->id_seccion; + } + // -X2C + + // +X2C Operation 199 + /** + * @return void + * @access public + */ + function getLinks() // ~X2C + { + $db = IntranetDB::Connect(); + $sql = "SELECT R.link_id, A.headline + FROM MEconDAV.Relations R, MEconDAV.Articles A + WHERE R.link_id = A.article_id + AND R.article_id = ".$this->noticia; + $result =& $db->query($sql); + $links = array(); + while($row =& $result->fetchRow()) + $links[] = array('numero'=>$row[0], 'texto'=>$row[1]); + return $links; + } + // -X2C + + // +X2C Operation 200 + /** + * @return void + * @access public + */ + function getArchivos() // ~X2C + { + $db = IntranetDB::Connect(); + $sql = "SELECT file_for_article_id, caption FROM MEconDAV.FilesForArticle WHERE article_id = ".$this->noticia; + $result =& $db->query($sql); + $archivos = array(); + while($row =& $result->fetchRow()) + $archivos[] = array('numero'=>$row[0], 'texto'=>$row[1]); + return $archivos; + } + // -X2C + } // -X2C Class :noticia ?>