2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
3 // +--------------------------------------------------------------------+
4 // | Ministerio de EconomÃa |
6 // +--------------------------------------------------------------------+
7 // | This file is part of Intranet. |
9 // | Intranet is free software; you can redistribute it and/or modify |
10 // | it under the terms of the GNU General Public License as published |
11 // | by the Free Software Foundation; either version 2 of the License, |
12 // | or (at your option) any later version. |
14 // | Intranet is distributed in the hope that it will be useful, but |
15 // | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 // | General Public License for more details. |
19 // | You should have received a copy of the GNU General Public License |
20 // | along with Hooks; if not, write to the Free Software Foundation, |
21 // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 // +--------------------------------------------------------------------+
23 // | Creado: Thu Jul 3 14:49:15 2003 |
24 // | Autor: Gonzalo Merayo <gmeray@mecon.gov.ar> |
25 // +--------------------------------------------------------------------+
27 // $Id: xmi2code.tpl.php 1 2003-06-23 18:29:20Z gmeray $
30 require_once 'Date.php';
31 require_once 'intranetdb.php';
33 // +X2C Class 161 :noticia
48 * @param int $noticia codigo de la noticia
53 function noticia($noticia) // ~X2C
55 $this->noticia = $noticia;
56 $db = IntranetDB::Connect();
57 $query = "SELECT A.headline, A.title, A.abstract, A.article,
58 A.publication_date, S.description, S.section_id
59 FROM MEconDAV.Articles A, MEconDAV.Sections S
60 WHERE Article_id = $noticia
61 AND A.section_id = S.section_id";
62 $result = $db->query($query);
63 $row = $result->fetchRow();
64 $this->titulo = $row[0];
65 $this->titulo2 = $row[1];
66 $this->sintesis = $row[2];
67 $this->texto = $row[3];
68 $this->fecha = new Date($row[4]);
69 $this->seccion = $row[5];
70 $this->id_seccion = $row[6];
79 function getTitulo() // ~X2C
90 function getTexto() // ~X2C
101 function getSintesis() // ~X2C
103 return $this->sintesis;
107 // +X2C Operation 183
112 function getTitulo2() // ~X2C
114 return $this->titulo2;
118 // +X2C Operation 186
123 function getFecha() // ~X2C
129 // +X2C Operation 191
134 function getSeccion() // ~X2C
136 return $this->seccion;
140 // +X2C Operation 197
145 function getidSeccion() // ~X2C
147 return $this->id_seccion;
151 // +X2C Operation 199
156 function getLinks() // ~X2C
158 $db = IntranetDB::Connect();
159 $sql = "SELECT R.link_id, A.headline
160 FROM MEconDAV.Relations R, MEconDAV.Articles A
161 WHERE R.link_id = A.article_id
162 AND R.article_id = ".$this->noticia;
163 $result =& $db->query($sql);
165 while($row =& $result->fetchRow())
166 $links[] = array('numero'=>$row[0], 'texto'=>$row[1]);
171 // +X2C Operation 200
176 function getArchivos() // ~X2C
178 $db = IntranetDB::Connect();
179 $sql = "SELECT file_for_article_id, caption FROM MEconDAV.FilesForArticle WHERE article_id = ".$this->noticia;
180 $result =& $db->query($sql);
182 while($row =& $result->fetchRow())
183 $archivos[] = array('numero'=>$row[0], 'texto'=>$row[1]);
188 } // -X2C Class :noticia