[Alba-desarrollo] SVN Alba r6139 - in prosistem/alba/trunk/alba/apps/principal/modules/alumno: actions templates

commits en pressenter.com.ar commits en pressenter.com.ar
Lun Abr 27 23:41:00 CEST 2009


Author: hsanchez
Date: 2009-04-27 18:41:00 -0300 (Mon, 27 Apr 2009)
New Revision: 6139

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/alumno/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php
Log:
Agregando edad del alumno Ticket: #293

Modified: prosistem/alba/trunk/alba/apps/principal/modules/alumno/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/actions/actions.class.php	2009-04-27 21:02:42 UTC (rev 6138)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/actions/actions.class.php	2009-04-27 21:41:00 UTC (rev 6139)
@@ -107,11 +107,16 @@
     }
     $this->datosCuenta = $datosCuenta;
 
+    $today = getdate();
+    $fecha_nac = $this->alumno->getFechaNacimiento("Y");
+    if($fecha_nac!="")
+        $this->edad = $today['year'] - $fecha_nac;
+    else
+        $this->edad = "";
+
     if ($this->getRequest()->getMethod() == sfRequest::POST)
     {
       $this->alumno = $this->getAlumnoOrCreate();
-
-
       $this->updateAlumnoFromRequest();
     
       //Obteniendo fecha segun cultura

Modified: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php	2009-04-27 21:02:42 UTC (rev 6138)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php	2009-04-27 21:41:00 UTC (rev 6139)
@@ -144,7 +144,8 @@
               'withtime' => false,
               'calendar_button_img' => sfConfig::get('sf_admin_web_dir').'/images/date.png',
               'control_name' => 'alumno[fecha_nacimiento]',
-            )) ?>
+      )) ?>
+      Edad: <input type="text" value="<?php echo $edad?>" disabled="true" size="4">
                 </div>
             </div>
 




Más información sobre la lista de distribución Alba-desarrollo