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

commits en pressenter.com.ar commits en pressenter.com.ar
Mie Feb 7 17:35:27 CET 2007


Author: josx
Date: 2007-02-07 13:35:21 -0300 (Wed, 07 Feb 2007)
New Revision: 4165

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/act=
ions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/tem=
plates/_fk_alumno_id.php
Log:
Mejora de carga de alumnos por division ( Ticket #118 )

Modified: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivis=
ion/actions/actions.class.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/ac=
tions/actions.class.php	2007-02-07 14:56:03 UTC (rev 4164)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/ac=
tions/actions.class.php	2007-02-07 16:35:21 UTC (rev 4165)
@@ -23,8 +23,8 @@
  * relAlumnoDivision Acciones
  *
  * @package    alba
- * @author     Jos=E9 Luis Di Biase <josx en interorganic.com.ar>
- * @author     H=E9ctor Sanchez <hsanchez en pressenter.com.ar>
+ * @author     Jos=C3=A9 Luis Di Biase <josx en interorganic.com.ar>
+ * @author     H=C3=A9ctor Sanchez <hsanchez en pressenter.com.ar>
  * @author     Fernando Toledo <ftoledo en pressenter.com.ar>
  * @version    SVN: $Id$
  * @filesource

Modified: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivis=
ion/templates/_fk_alumno_id.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/te=
mplates/_fk_alumno_id.php	2007-02-07 14:56:03 UTC (rev 4164)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/te=
mplates/_fk_alumno_id.php	2007-02-07 16:35:21 UTC (rev 4165)
@@ -1,13 +1,39 @@
 <?php=20
     $c =3D new Criteria();=20
+
+    $c->addAsColumn("id", AlumnoPeer::ID);
+    $c->addAsColumn("nombre", AlumnoPeer::NOMBRE);
+    $c->addAsColumn("apellido", AlumnoPeer::APELLIDO);
+    $c->addAsColumn("division", DivisionPeer::DESCRIPCION);
+    $c->addAsColumn("anio", AnioPeer::DESCRIPCION);
+
     $c->add(AlumnoPeer::FK_ESTABLECIMIENTO_ID, $sf_user->getAttribute('f=
k_establecimiento_id'));   =20
+    $c->addJoin(AlumnoPeer::ID, RelAlumnoDivisionPeer::FK_ALUMNO_ID, Cri=
teria::LEFT_JOIN);
+    $c->addJoin(RelAlumnoDivisionPeer::FK_DIVISION_ID, DivisionPeer::ID,=
 Criteria::LEFT_JOIN);
+    $c->addJoin(DivisionPeer::FK_ANIO_ID, AnioPeer::ID ,Criteria::LEFT_J=
OIN);
+
     $c->addAscendingOrderByColumn(AlumnoPeer::APELLIDO);
     $c->addAscendingOrderByColumn(AlumnoPeer::NOMBRE);
-    $alumnos =3D AlumnoPeer::doSelect($c);
+
+   =20
+//     $alumnos =3D AlumnoPeer::doSelect($c);
+    $alumnos =3D BasePeer::doSelect($c);
+
+    $aDivision =3D array();
     $optionsAlumnos =3D array();
     $optionsAlumnos[""] =3D ">>Seleccione un Alumno<<";  =20
+
     foreach ($alumnos as $alumno) {
-        $optionsAlumnos[$alumno->getId()] =3D $alumno->getApellido() . "=
, " . $alumno->getNombre();
+        if($alumno[3] AND array_key_exists($alumno[0], $aDivision)) {
+            $separador =3D ", ";
+        } else {
+            $separador =3D "";
+        }
+        @$aDivision["$alumno[0]"] .=3D ($alumno[3]) ? $separador . $alum=
no[4]. " / " . $alumno[3]  : "";=20
+        $divisiones =3D ($aDivision["$alumno[0]"]) ? "( ".$aDivision["$a=
lumno[0]"]. " )" : "";
+        $alumnoNombres =3D $alumno[2] . ", " . $alumno[1];
+        $optionsAlumnos["$alumno[0]"] =3D  $alumnoNombres . " " .$divisi=
ones;
     }
+
     echo select_tag('rel_alumno_division[fk_alumno_id]', options_for_sel=
ect($optionsAlumnos, $rel_alumno_division->getFkAlumnoId()) ) ;
-?>
+?>
\ No newline at end of file




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