[Alba-desarrollo] SVN Alba r6242 - in prosistem/alba/trunk/alba/apps/principal/modules/division: actions config templates

commits en pressenter.com.ar commits en pressenter.com.ar
Lun Jul 13 23:35:56 CEST 2009


Author: josx
Date: 2009-07-13 18:35:55 -0300 (Mon, 13 Jul 2009)
New Revision: 6242

Added:
   prosistem/alba/trunk/alba/apps/principal/modules/division/templates/_fk_turno_id_filter.php
Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/division/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/division/config/generator.yml
   prosistem/alba/trunk/alba/apps/principal/modules/division/templates/_fk_turno_id.php
Log:
Agregando filtro para que muestre en el listado de division teniendo en cuenta el ciclo lectivo actual

Modified: prosistem/alba/trunk/alba/apps/principal/modules/division/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/division/actions/actions.class.php	2009-06-19 18:57:44 UTC (rev 6241)
+++ prosistem/alba/trunk/alba/apps/principal/modules/division/actions/actions.class.php	2009-07-13 21:35:55 UTC (rev 6242)
@@ -38,6 +38,10 @@
     }
 
     protected function addFiltersCriteria($c) {
+    
+        $c->addJoin(TurnoPeer::ID, DivisionPeer::FK_TURNO_ID);
+        $c->add(TurnoPeer::FK_CICLOLECTIVO_ID, $this->getUser()->getAttribute('fk_ciclolectivo_id'));
+    
         if (isset($this->filters['fk_anio_id_is_empty'])) {
             $criterion = $c->getNewCriterion(DivisionPeer::FK_ANIO_ID, '');
             $criterion->addOr($c->getNewCriterion(DivisionPeer::FK_ANIO_ID, null, Criteria::ISNULL));

Modified: prosistem/alba/trunk/alba/apps/principal/modules/division/config/generator.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/division/config/generator.yml	2009-06-19 18:57:44 UTC (rev 6241)
+++ prosistem/alba/trunk/alba/apps/principal/modules/division/config/generator.yml	2009-07-13 21:35:55 UTC (rev 6242)
@@ -8,6 +8,7 @@
         fk_anio_id: { name: Año }
         division: { name: División }
         fk_turno_id: { name: Turnos }
+        fk_turno_id_filter: { name: Turnos }
         descripcion: { name: División }
         orden: { name: Orden }
         fk_orientacion_id: { name: Orientacion }
@@ -25,5 +26,5 @@
             _edit:      -
             _delete:    -
             alumnosPorDivision:  { name: Alumnos por Division, action: alumnosPorDivision, icon: small/alumnos.png } 
-        filters: [ _carrera, fk_anio_id, fk_orientacion_id, fk_turno_id ]
+        filters: [ _carrera, fk_anio_id, fk_orientacion_id, _fk_turno_id_filter ]
 

Modified: prosistem/alba/trunk/alba/apps/principal/modules/division/templates/_fk_turno_id.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/division/templates/_fk_turno_id.php	2009-06-19 18:57:44 UTC (rev 6241)
+++ prosistem/alba/trunk/alba/apps/principal/modules/division/templates/_fk_turno_id.php	2009-07-13 21:35:55 UTC (rev 6242)
@@ -1,6 +1,6 @@
 <?php 
     $criteriaT = new Criteria(); 
-    $criteriaT->add(TurnoPeer::FK_CICLOLECTIVO_ID, $sf_user->getAttribute('fk_ciclolectivo_id'));    
+    $criteriaT->add(TurnoPeer::FK_CICLOLECTIVO_ID, $sf_user->getAttribute('fk_ciclolectivo_id'));
     $turnos = TurnoPeer::doSelect($criteriaT);
     $optionsTurnos = array();
     $optionsTurnos[""] = "--Seleccione un Turno--";   

Added: prosistem/alba/trunk/alba/apps/principal/modules/division/templates/_fk_turno_id_filter.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/division/templates/_fk_turno_id_filter.php	                        (rev 0)
+++ prosistem/alba/trunk/alba/apps/principal/modules/division/templates/_fk_turno_id_filter.php	2009-07-13 21:35:55 UTC (rev 6242)
@@ -0,0 +1,12 @@
+<?php 
+    $criteriaT = new Criteria(); 
+    $criteriaT->add(TurnoPeer::FK_CICLOLECTIVO_ID, $sf_user->getAttribute('fk_ciclolectivo_id'));
+    $turnos = TurnoPeer::doSelect($criteriaT);
+    $optionsTurnos = array();
+    $optionsTurnos[""] = "--Seleccione un Turno--";   
+    foreach ($turnos as $turno) {
+        $optionsTurnos[$turno->getId()] = $turno->getDescripcion();
+    }
+    asort($optionsTurnos);
+    echo select_tag('division[fk_turno_id]', options_for_select($optionsTurnos)) ;
+?>




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