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

commits en pressenter.com.ar commits en pressenter.com.ar
Vie Feb 16 22:16:33 CET 2007


Author: josx
Date: 2007-02-16 18:16:33 -0300 (Fri, 16 Feb 2007)
New Revision: 4246

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/calendario/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/calendario/templates/indexSuccess.php
Log:
Mejor al calendario

Modified: prosistem/alba/trunk/alba/apps/principal/modules/calendario/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/calendario/actions/actions.class.php	2007-02-16 21:12:22 UTC (rev 4245)
+++ prosistem/alba/trunk/alba/apps/principal/modules/calendario/actions/actions.class.php	2007-02-16 21:16:33 UTC (rev 4246)
@@ -168,6 +168,7 @@
         $actividad_id = "";
         $optionsActividad = array();
         $horasMateriasTodas = array();
+        $anio_id = "";
         
 /*
         $criteria = new Criteria();
@@ -191,13 +192,6 @@
         $establecimiento_id = $this->getUser()->getAttribute('fk_establecimiento_id');
         $this->establecimiento_id = $establecimiento_id;
         
-        $optionsActividad[""] = "";        
-        $criteria = new Criteria();
-        $actividades = ActividadPeer::doSelect($criteria);   
-        foreach($actividades as $actividad) {
-            $optionsActividad[$actividad->getId()] = $actividad->getNombre();
-        }
-        $this->optionsActividad = $optionsActividad;
 
 /*      $criteria = new Criteria();
         $criteria->add(CiclolectivoPeer::FK_ESTABLECIMIENTO_ID, $establecimiento_id);
@@ -273,8 +267,10 @@
             $horarioescolares  = $this->getHorarioEscolar($establecimiento_id, $turnos_id);
 
             $criteria = new Criteria();
+            $criteria->add(DivisionPeer::FK_TURNOS_ID, $turnos_id);
             $criteria->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $establecimiento_id);
-            $divisiones = DivisionPeer::doSelectJoinAnio($criteria);
+            $criteria->addJoin(AnioPeer::ID, DivisionPeer::FK_ANIO_ID);
+            $divisiones = DivisionPeer::doSelect($criteria);
             $optionsDivision = array();
             
             foreach($divisiones as $division) {
@@ -293,6 +289,8 @@
             $this->horasMaterias = $this->getHorasMaterias($aAnio[$this->division_id], $actividad_id);
             $this->getUser()->setAttribute('anio_id', $aAnio[$this->division_id]); 
             $this->getUser()->setAttribute('division_id', $this->division_id);
+            $this->turnos_id = $turnos_id;
+            $anio_id = $aAnio[$this->division_id];
         } else {
             $this->aHour = array(strtotime("8:00"), strtotime("17:00"));
             $this->time_interval = 15;
@@ -352,7 +350,20 @@
             $this->aEvent = $this->cargarItemCalendario($this->division_id, $aEvent, $horasMateriasTodas );
             $this->getUser()->setAttribute('event', $aEvent);
 
-        }     
+        }
+
+        $optionsActividad[""] = "";        
+        $criteria = new Criteria();
+        $criteria->add(ActividadPeer::FK_ESTABLECIMIENTO_ID, $establecimiento_id);
+        $criteria->addJoin(RelAnioActividadPeer::FK_ACTIVIDAD_ID, ActividadPeer::ID);
+        if($anio_id)  {
+            $criteria->add(RelAnioActividadPeer::FK_ANIO_ID, $anio_id);
+        }
+        $actividades = ActividadPeer::doSelect($criteria);   
+        foreach($actividades as $actividad) {
+            $optionsActividad[$actividad->getId()] = $actividad->getNombre();
+        }
+        $this->optionsActividad = $optionsActividad;     
     }
 
 

Modified: prosistem/alba/trunk/alba/apps/principal/modules/calendario/templates/indexSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/calendario/templates/indexSuccess.php	2007-02-16 21:12:22 UTC (rev 4245)
+++ prosistem/alba/trunk/alba/apps/principal/modules/calendario/templates/indexSuccess.php	2007-02-16 21:16:33 UTC (rev 4246)
@@ -118,7 +118,7 @@
 
  <div class="form-row">
   <?php echo label_for('turnos_id', __('Turnos:'), 'class="required" ') ?>
-  <?php echo select_tag('turnos_id', options_for_select($optionsTurnos)) ?>
+  <?php echo select_tag('turnos_id', options_for_select($optionsTurnos,$turnos_id),'onChange="javascript:submitForm()"') ?>
  </div>
 
 <!--
@@ -134,7 +134,7 @@
 <? if(count($optionsDivision)>0) { ?>
  <div class="form-row">
   <?php echo label_for('division_id', __('Division:'), 'class="required" ') ?>
-  <?php echo select_tag('division_id', options_for_select($optionsDivision, $division_id),'') ?>
+  <?php echo select_tag('division_id', options_for_select($optionsDivision, $division_id),'onChange="javascript:submitForm()"') ?>
  </div>
 
  <div class="form-row">




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