]> git.llucax.com Git - mecon/intranet.git/commitdiff
corrijo noticia para que la fecha sea un Date
authorGonzalo Merayo <merayo@gmail.com>
Mon, 7 Jul 2003 15:41:32 +0000 (15:41 +0000)
committerGonzalo Merayo <merayo@gmail.com>
Mon, 7 Jul 2003 15:41:32 +0000 (15:41 +0000)
corrijo HTML_Noticia para que muestre bien la fecha

doc/noticias.xmi
lib/noticia.php
sistema/local_lib/HTML_Noticia.php
sistema/www/noticias.php

index 94fc8eb4d14a878d6453992bf31c1879f27be442..4beeecdfb3eb429e3624b75e93b74b0092770d45 100644 (file)
@@ -10,7 +10,7 @@
  </XMI.header>
  <XMI.content>
   <docsettings viewid="160" documentation="
-" uniqueid="185" />
+" uniqueid="186" />
   <umlobjects>
    <UML:Class stereotype="" package="lib" xmi.id="161" abstract="0" documentation="" name="noticia" static="0" scope="200" >
     <UML:Operation stereotype="" package="" xmi.id="169" type="void" abstract="0" documentation="" name="noticia" static="0" scope="200" >
@@ -20,6 +20,7 @@
     <UML:Operation stereotype="" package="" xmi.id="183" type="string" abstract="0" documentation="" name="getTitulo2" static="0" scope="200" />
     <UML:Operation stereotype="" package="" xmi.id="181" type="string" abstract="0" documentation="" name="getTexto" static="0" scope="200" />
     <UML:Operation stereotype="" package="" xmi.id="182" type="string" abstract="0" documentation="" name="getAbstracto" static="0" scope="200" />
+    <UML:Operation stereotype="" package="" xmi.id="186" type="string" abstract="0" documentation="" name="getFecha" static="0" scope="200" />
     <UML:Attribute stereotype="" package="" xmi.id="168" value="" type="int" abstract="0" documentation="" name="Noticia" static="0" scope="200" />
    </UML:Class>
    <UML:Class stereotype="" package="sistema/local_lib" xmi.id="162" abstract="0" documentation="" name="HTML_Noticia" static="0" scope="200" >
@@ -37,7 +38,9 @@
     <UML:Attribute stereotype="" package="" xmi.id="184" value="" type="bool" abstract="0" documentation="" name="completa" static="0" scope="200" />
     <UML:Attribute stereotype="" package="" xmi.id="185" value="" type="int" abstract="0" documentation="" name="nuevo" static="0" scope="200" />
    </UML:Class>
-   <UML:Class stereotype="" package="" xmi.id="164" abstract="0" documentation="x2c:extern" name="HTML_Table" static="0" scope="200" />
+   <UML:Class stereotype="" package="" xmi.id="164" abstract="0" documentation="x2c:extern
+x2c:include:HTML/Table.php
+" name="HTML_Table" static="0" scope="200" />
    <UML:Class stereotype="" package="lib" xmi.id="170" abstract="0" documentation="" name="seccion" static="0" scope="200" >
     <UML:Operation stereotype="" package="" xmi.id="171" type="void" abstract="0" documentation="obtiene los objetos seccion de los codigos de seccion pasados, o todos." name="ObtenerSecciones" static="1" scope="200" >
      <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array[int]" abstract="0" documentation="codigos de las secciones" name="secciones" static="0" scope="200" />
@@ -52,8 +55,8 @@
   <diagrams>
    <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" showgrid="0" showopsig="1" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="160" documentation="" type="402" showops="1" showpackage="0" name="class diagram" localid="30000" showstereotype="0" showscope="1" font="Helvetica,8,-1,5,50,0,0,0,0,0" linecolor="#ff0000" >
     <widgets>
-     <UML:ConceptWidget usesdiagramfillcolour="0" width="160" showattsigs="601" usesdiagramusefillcolour="0" x="101" linecolour="#ff0000" y="233" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="112" usefillcolor="1" showattributes="1" xmi.id="161" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
-     <UML:ConceptWidget usesdiagramfillcolour="0" width="220" showattsigs="601" usesdiagramusefillcolour="0" x="408" linecolour="#ff0000" y="223" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="128" usefillcolor="1" showattributes="1" xmi.id="162" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="160" showattsigs="601" usesdiagramusefillcolour="0" x="101" linecolour="#ff0000" y="233" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="128" usefillcolor="1" showattributes="1" xmi.id="161" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="220" showattsigs="601" usesdiagramusefillcolour="0" x="408" linecolour="#ff0000" y="237" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="128" usefillcolor="1" showattributes="1" xmi.id="162" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
      <UML:ConceptWidget usesdiagramfillcolour="0" width="80" showattsigs="601" usesdiagramusefillcolour="0" x="477" linecolour="#ff0000" y="47" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="32" usefillcolor="1" showattributes="1" xmi.id="164" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
      <UML:ConceptWidget usesdiagramfillcolour="0" width="272" showattsigs="601" usesdiagramusefillcolour="0" x="65" linecolour="#ff0000" y="62" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="88" usefillcolor="1" showattributes="1" xmi.id="170" showoperations="1" showpackage="0" showscope="1" showstereotype="0" font="Helvetica,8,-1,5,50,0,0,0,0,0" />
     </widgets>
     <associations>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="164" widgetaid="162" documentation="" type="500" >
       <linepath>
-       <startpoint startx="518" starty="223" />
+       <startpoint startx="518" starty="237" />
        <endpoint endx="517" endy="79" />
       </linepath>
      </UML:AssocWidget>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="162" widgetaid="161" documentation="" type="510" >
       <linepath>
-       <startpoint startx="261" starty="289" />
-       <endpoint endx="408" endy="287" />
+       <startpoint startx="261" starty="297" />
+       <endpoint endx="408" endy="301" />
       </linepath>
      </UML:AssocWidget>
     </associations>
@@ -91,6 +94,7 @@
      <listitem open="1" type="813" id="161" label="noticia" >
       <listitem open="0" type="814" id="168" label="Noticia" />
       <listitem open="0" type="815" id="182" label="getAbstracto" />
+      <listitem open="0" type="815" id="186" label="getFecha" />
       <listitem open="0" type="815" id="181" label="getTexto" />
       <listitem open="0" type="815" id="180" label="getTitulo" />
       <listitem open="0" type="815" id="183" label="getTitulo2" />
index 6a07def9b9dbd6d102b14bee46881fea19561db3..96ba6b25411a8aa1beda412de3119f2314a10f71 100644 (file)
@@ -28,6 +28,7 @@
 //
 
 require_once 'mecondavdb.php';
+require_once 'Date.php';
 
 
 // +X2C Class 161 :noticia
@@ -52,9 +53,9 @@ class noticia {
      */
     function noticia($noticia) // ~X2C
     {
-        $this->noticia;
+        $this->noticia = $noticia;
         $db = MEconDAVDB::Connect();
-       $query = "SELECT headline, title, abstract, article
+       $query = "SELECT headline, title, abstract, article, publication_date
                  FROM Articles
                  WHERE Article_id = $noticia";
        $result = $db->query($query);
@@ -63,6 +64,7 @@ class noticia {
        $this->titulo = $row[1];
        $this->abstracto = $row[2];
        $this->texto = $row[3];
+       $this->fecha = new Date($row[4]);
     }
     // -X2C
 
@@ -110,5 +112,16 @@ class noticia {
     }
     // -X2C
 
+    // +X2C Operation 186
+    /**
+     * @return string
+     * @access public
+     */
+    function getFecha() // ~X2C
+    {
+        return $this->fecha;
+    }
+    // -X2C
+
 } // -X2C Class :noticia
-?>
\ No newline at end of file
+?>
index ad25c4150367ede282d4112908414b5c98e570f4..7477fe9b561f80b602e3091d3ba4d7ba1db28eed 100644 (file)
@@ -31,7 +31,6 @@
 
 // +X2C includes
 require_once 'HTML/Table.php';
-require_once 'HTML/Image.php';
 // ~X2C
 
 // +X2C Class 162 :HTML_Noticia
@@ -66,15 +65,16 @@ class HTML_Noticia extends HTML_Table {
      */
     function toHTML() // ~X2C
     {
-        $this->addRow(array('Subt&iacute;tulo'), array('class' => 'subtitulo'));
+        $this->addRow(array($this->noticia->getTitulo2()), array('class' => 'subtitulo'));
        $img_str = null;
        if($this->nuevo)
        {
          $nuevo = new HTML_Image('images/nuevo.gif');
          $img_str = $nuevo->toHTML();
        }
-        $this->addRow(array('Título de la noticia que nos vincula con su texto completo.'.$img_str), array('class' => 'titulo_noticia'));
-        $this->addRow(array('(10/02/03)'),
+        $this->addRow(array($this->noticia->getTitulo().$img_str), array('class' => 'titulo_noticia'));
+        $tmp = $this->noticia->getFecha();
+        $this->addRow(array($tmp->format('(%d/%m/%Y)')),
                                 array('class' => 'fecha_noticia'));
        $mas = new HTML_Image('images/mas.gif');
         $this->addRow(array($mas->toHTML().'ver más'),
index 9cc65a27c287c00a9f38281d1d696731b77719b7..9bc004fccbc622efc6fbdbbb2ef56b364696bf0d 100644 (file)
        require_once '../../lib/noticia.php';
        require_once '../local_lib/HTML_Noticia.php';
  
-      $not = new HTML_Noticia(1);
-      $not->setNuevo(true);
-      $ht = new HTML_Table(array('width'=>'600', 'border'=>'0', 'cellspacing'=>'0'));
-      $ht->addRow(array($not, $not));
-      $ht->addRow(array($not, $not));
-      $ht->addRow(array($not, $not));
-      $ht->display();
+       $n = new noticia(1294);
+       $not = new HTML_Noticia($n);
+       $not->setNuevo(true);
+       $ht = new HTML_Table(array('width'=>'600', 'border'=>'0', 'cellspacing'=>'0'));
+       $ht->addRow(array($not, $not));
+       $ht->addRow(array($not, $not));
+       $ht->addRow(array($not, $not));
+       $ht->display();
     ?>
     </td>
   </tr>