[Alba-desarrollo] SVN Alba r4171 - in prosistem/alba/trunk/alba/apps/principal/modules: informes/templates locacion/actions

commits en pressenter.com.ar commits en pressenter.com.ar
Vie Feb 9 15:29:59 CET 2007


Author: josx
Date: 2007-02-09 11:29:48 -0300 (Fri, 09 Feb 2007)
New Revision: 4171

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/constanciaAlumnoRegularListadoSuccess.php
   prosistem/alba/trunk/alba/apps/principal/modules/locacion/actions/actions.class.php
Log:
Actualiza principal en locacion al modificarlo

Modified: prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/constanciaAlumnoRegularListadoSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/constanciaAlumnoRegularListadoSuccess.php	2007-02-07 21:51:09 UTC (rev 4170)
+++ prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/constanciaAlumnoRegularListadoSuccess.php	2007-02-09 14:29:48 UTC (rev 4171)
@@ -1,12 +1,14 @@
 GOBIERNO DE LA CIUDAD DE BUENOS AIRES<br>
 SECRETAR&Iacute;A DE EDUCACI&Oacute;N<br>
 <?=$establecimiento->getNombre()?> <br>
-<?=$locacion->getDireccion()?> - T&eacute;lefono: <?=$locacion->getTelefono()?> (<?=$locacion->getCodigoPostal()?>) <br> <?=$locacion->getCiudad()?><br>
+<? if($locacion) { ?><?=$locacion->getDireccion()?> - T&eacute;lefono: <?=$locacion->getTelefono()?> (<?=$locacion->getCodigoPostal()?>) <br> <?=$locacion->getCiudad()?><br><? } ?>
 CONSTANCIA DE ALUMNO REGULAR
 <br><br>
 Se hace constar de <?=$alumno->getApellido()?>, <?=$alumno->getNombre()?> es un alumno regular de:<br><br>
 A&ntilde;o: <?=$division->getAnio()->getDescripcion()?> Divisi&oacute;n: <?=$division->getDescripcion()?> Turno: <?=$turnos->getDescripcion();?>, en este establecimiento<br>
 
+<!--
 Fecha:
 Presentar en:
 Firma:
+-->
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/apps/principal/modules/locacion/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/locacion/actions/actions.class.php	2007-02-07 21:51:09 UTC (rev 4170)
+++ prosistem/alba/trunk/alba/apps/principal/modules/locacion/actions/actions.class.php	2007-02-09 14:29:48 UTC (rev 4171)
@@ -51,14 +51,17 @@
 
             if ($locacion->getPrincipal()) {
 
-                $c1 = new Criteria();
-                $c1->add(RelEstablecimientoLocacionPeer::FK_ESTABLECIMIENTO_ID, $this->getUser()->getAttribute('fk_establecimiento_id'));
-                $c1->addJoin(LocacionPeer::ID, RelEstablecimientoLocacionPeer::FK_LOCACION_ID);
-                $c2 = new Criteria();
-                $c2->add(LocacionPeer::PRINCIPAL,false);
+//                 $c1 = new Criteria();
+//                 $c1->add(RelEstablecimientoLocacionPeer::FK_ESTABLECIMIENTO_ID, $this->getUser()->getAttribute('fk_establecimiento_id'));
+//                 $c1->addJoin(LocacionPeer::ID, RelEstablecimientoLocacionPeer::FK_LOCACION_ID);
+//                 $c2 = new Criteria();
+//                 $c2->add(LocacionPeer::PRINCIPAL,false);
+//                 BasePeer::doUpdate($c1,$c2,$con);
 
-//                  BasePeer::doUpdate($c1,$c2,$con);
-
+                // Aparentemente propel no soporta aun joins dentro del update
+                $s = "UPDATE rel_establecimiento_locacion,locacion SET locacion.principal = 0 WHERE locacion.id = rel_establecimiento_locacion.fk_locacion_id AND rel_establecimiento_locacion.fk_establecimiento_id = ".$this->getUser()->getAttribute('fk_establecimiento_id');
+                $stmt = $con->createStatement();
+                $alumnos = $stmt->executeQuery($s);
             }
             
             $locacion->save();                                                                




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