[Alba-desarrollo] SVN Alba r5778 - in prosistem/alba/trunk/alba: apps/principal/modules/boletin/actions apps/principal/modules/boletin/templates config data/sql

commits en pressenter.com.ar commits en pressenter.com.ar
Mar Jul 29 19:48:52 CEST 2008


Author: josx
Date: 2008-07-29 14:48:51 -0300 (Tue, 29 Jul 2008)
New Revision: 5778

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/boletin/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/boletin/templates/listConceptoSuccess.php
   prosistem/alba/trunk/alba/apps/principal/modules/boletin/templates/listSuccess.php
   prosistem/alba/trunk/alba/config/schema.yml
   prosistem/alba/trunk/alba/data/sql/actualizacion_1.0_luego.sql
Log:
Agregando filtros de carrera en boletin (notas y concepto). Adem?\195?\161s se quita la obligatoriedad de cargar la observacion.

Modified: prosistem/alba/trunk/alba/apps/principal/modules/boletin/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/boletin/actions/actions.class.php	2008-07-29 15:28:25 UTC (rev 5777)
+++ prosistem/alba/trunk/alba/apps/principal/modules/boletin/actions/actions.class.php	2008-07-29 17:48:51 UTC (rev 5778)
@@ -92,12 +92,26 @@
         return $this->redirect("boletin?action=list&division_id=$division_id&actividad_id=$actividad_id&periodo_id=$periodo_id");
     }   
 
+    protected function getCarreras($establecimiento_id) {
+        $optionsCarrera = array();
+        $criteria = new Criteria();
+        $criteria->add(CarreraPeer::FK_ESTABLECIMIENTO_ID, $establecimiento_id);
+        $carreras = CarreraPeer::doSelect($criteria);
+        $optionsCarrera[]  = "";
+        foreach($carreras as $carrera) {
+            $optionsCarrera[$carrera->getId()] = $carrera->__toString();
+        }
+        asort($optionsCarrera);
+        return $optionsCarrera;
+    }
 
-
-    protected function getDivisiones($establecimiento_id) {
+    protected function getDivisiones($establecimiento_id, $carrera_id = '') {
         $optionsDivision = array();
         $criteria = new Criteria();
         $criteria->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $establecimiento_id);
+        if($carrera_id != '') {
+            $criteria->add(AnioPeer::FK_CARRERA_ID, $carrera_id);
+        }
         $divisiones = DivisionPeer::doSelectJoinAnio($criteria);
         $optionsDivision[]  = "";
         foreach($divisiones as $division) {
@@ -139,26 +153,29 @@
         // inicializando variables
         $optionsActividad = array();
         $optionsDivision = array();
+        $optionsCarrera = array();
         $aAlumno = array();    
         $division_id = "";
         $actividad_id = "";
         $periodo_id = "";
+        $carrera_id = "";
         $aPeriodo = array();
         $aPosiblesNotas = array();
         $optionsPeriodo = array();
         $aNotaAlumno = array();
         $sizeNota = 0;
-    
 
         $establecimiento_id = $this->getUser()->getAttribute('fk_establecimiento_id');
-        
-        // llenando el combo de division segun establecimiento
-        $optionsDivision = $this->getDivisiones($establecimiento_id);
 
         // tomando los datos del formulario
         $division_id = $this->getRequestParameter('division_id');
         $periodo_id = $this->getRequestParameter('periodo_id');
+        $carrera_id = $this->getRequestParameter('carrera_id');
 
+        // llenando el combo de division segun establecimiento
+        $optionsDivision = $this->getDivisiones($establecimiento_id, $carrera_id);
+        $optionsCarrera = $this->getCarreras($establecimiento_id);
+
         if($division_id) {
             $actividad_id = $this->getRequestParameter('actividad_id');
             $optionsActividad = $this->getActividades($division_id);
@@ -218,6 +235,8 @@
         $this->aAlumno = $aAlumno;
         $this->division_id = $division_id;
         $this->actividad_id = $actividad_id;
+        $this->carrera_id = $carrera_id;
+        $this->optionsCarrera = $optionsCarrera;
         $this->periodo_id = $periodo_id;
         $this->aPeriodo = $aPeriodo;
         $this->aPosiblesNotas = $aPosiblesNotas;
@@ -242,10 +261,12 @@
         // inicializando variables
         $optionsConcepto = array();
         $optionsDivision = array();
+        $optionsCarrera = array();
         $aAlumno = array();    
         $division_id = "";
         $concepto_id = "";
         $periodo_id = "";
+        $carrera_id = "";
         $aPeriodo = array();
         $aPosiblesNotas = array();
         $optionsPeriodo = array();
@@ -255,14 +276,17 @@
 
         $establecimiento_id = $this->getUser()->getAttribute('fk_establecimiento_id');
         
-        // llenando el combo de division segun establecimiento
-        $optionsDivision = $this->getDivisiones($establecimiento_id);
-
         // tomando los datos del formulario
         $division_id = $this->getRequestParameter('division_id');
         $periodo_id = $this->getRequestParameter('periodo_id');
         $concepto_id = $this->getRequestParameter('concepto_id');
-             
+        $carrera_id = $this->getRequestParameter('carrera_id');
+
+        // llenando el combo de division segun establecimiento
+        $optionsDivision = $this->getDivisiones($establecimiento_id, $carrera_id);
+
+        $optionsCarrera = $this->getCarreras($establecimiento_id);
+
         $optionsConcepto [] = "";
         $optionsConcepto = array_merge($optionsConcepto, $this->getConcepto($establecimiento_id));
 
@@ -297,8 +321,10 @@
                         if($boletinConceptual->getFkEscalanotaId()) {
                             $aNotaAlumno[$alumno->getId()][$periodo->getId()] = $boletinConceptual->getEscalanota()->getNombre();
                         }
-                        if($boletinConceptual->getObservacion()->getContents()) {
-                            $aNotaAlumnoObs[$alumno->getId()][$periodo->getId()] = $boletinConceptual->getObservacion()->getContents();
+                        if($boletinConceptual->getObservacion()) {
+                            if($boletinConceptual->getObservacion()->getContents()) {
+                                $aNotaAlumnoObs[$alumno->getId()][$periodo->getId()] = $boletinConceptual->getObservacion()->getContents();
+                            }
                         }
                     }
                 }
@@ -323,6 +349,8 @@
         $this->division_id = $division_id;
         $this->concepto_id = $concepto_id;
         $this->periodo_id = $periodo_id;
+        $this->carrera_id = $carrera_id;
+        $this->optionsCarrera = $optionsCarrera;
         $this->aPeriodo = $aPeriodo;
         $this->aPosiblesNotas = $aPosiblesNotas;
         $this->optionsPeriodo = $optionsPeriodo;
@@ -449,6 +477,7 @@
         $division_id = $this->getRequestParameter('division_id');
         $concepto_id = $this->getRequestParameter('concepto_id');
         $periodo_id = $this->getRequestParameter('periodo_id');
+        $carrera_id = $this->getRequestParameter('carrera_id');
         $aNota = $this->getRequestParameter('nota');
         $aNotaObs = $this->getRequestParameter('notaObs');
 
@@ -502,7 +531,7 @@
                  throw $e;  
             }
         }
-        return $this->redirect("boletin?action=listConcepto&division_id=$division_id&concepto_id=$concepto_id&periodo_id=$periodo_id");
+        return $this->redirect("boletin?action=listConcepto&division_id=$division_id&concepto_id=$concepto_id&periodo_id=$periodo_id&carrera_id=$carrera_id");
     }   
 
 

Modified: prosistem/alba/trunk/alba/apps/principal/modules/boletin/templates/listConceptoSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/boletin/templates/listConceptoSuccess.php	2008-07-29 15:28:25 UTC (rev 5777)
+++ prosistem/alba/trunk/alba/apps/principal/modules/boletin/templates/listConceptoSuccess.php	2008-07-29 17:48:51 UTC (rev 5778)
@@ -1,14 +1,26 @@
 <?php use_helper("I18N")?>
 <script>
      function linkTo(flag) {
-        
         var objd = document.getElementById('division_id');
         var objp = document.getElementById('periodo_id');
-        var url  = "<?php echo url_for('boletin/', false);?>/listConcepto/division_id/"+objd.options[objd.selectedIndex].value;
+        var objc = document.getElementById('carrera_id');
+
+        var url  = "<?php echo url_for('boletin/', false);?>/listConcepto/";
+        if(flag == 2) {
+            url = url + "carrera_id/"+objc.options[objc.selectedIndex].value;
+        }
+
+        if(flag == 0) {
+            url = url + "division_id/"+objd.options[objd.selectedIndex].value;
+            url = url + "/carrera_id/"+objc.options[objc.selectedIndex].value;
+        }
+
         if(flag == 1) {
+            url = url + "division_id/"+objd.options[objd.selectedIndex].value;
+            url = url + "/carrera_id/"+objc.options[objc.selectedIndex].value;
             url = url + "/periodo_id/"+objp.options[objp.selectedIndex].value;
         }
-        
+
         var obja = document.getElementById('concepto_id');
         url = url + "/concepto_id/"+obja.options[obja.selectedIndex].value;
         location.href = url;
@@ -22,6 +34,10 @@
 
 <fieldset id="sf_fieldset_none" class="">
     <div class="form-row">
+        <?php echo label_for('carrera', __('Carrera:')) ?>
+        <?php echo select_tag('carrera_id', options_for_select($optionsCarrera, $carrera_id), "onChange='linkTo(2)'") ?>
+    </div>
+    <div class="form-row">
         <?php echo label_for('division', __('Division:')) ?>
         <?php echo select_tag('division_id', options_for_select($optionsDivision, $division_id), "onChange='linkTo(0)'") ?>
     </div>

Modified: prosistem/alba/trunk/alba/apps/principal/modules/boletin/templates/listSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/boletin/templates/listSuccess.php	2008-07-29 15:28:25 UTC (rev 5777)
+++ prosistem/alba/trunk/alba/apps/principal/modules/boletin/templates/listSuccess.php	2008-07-29 17:48:51 UTC (rev 5778)
@@ -3,12 +3,24 @@
 <script>
      function linkTo(flag) {
         var objd = document.getElementById('division_id');
-        var url  = "<?php echo url_for('boletin/', false);?>/list/division_id/"+objd.options[objd.selectedIndex].value;
-        if(flag == 1){
-            var objp = document.getElementById('periodo_id');
+        var objp = document.getElementById('periodo_id');
+        var objc = document.getElementById('carrera_id');
+        var obja = document.getElementById('actividad_id');
+        var url  = "<?php echo url_for('boletin/', false);?>/list/";
+
+        if(flag == 2) {
+            url = url + "carrera_id/"+objc.options[objc.selectedIndex].value;
+        }
+
+        if(flag == 0) {
+            url = url + "division_id/"+objd.options[objd.selectedIndex].value;
+            url = url + "/carrera_id/"+objc.options[objc.selectedIndex].value;
+        }
+
+        if(flag == 1) {
+            url = url + "division_id/"+objd.options[objd.selectedIndex].value;
+            url = url + "/carrera_id/"+objc.options[objc.selectedIndex].value;
             url = url + "/periodo_id/"+objp.options[objp.selectedIndex].value;
-        
-            var obja = document.getElementById('actividad_id');
             url = url + "/actividad_id/"+obja.options[obja.selectedIndex].value;
         }
 
@@ -23,6 +35,10 @@
 
 <fieldset id="sf_fieldset_none" class="">
     <div class="form-row">
+        <?php echo label_for('carrera', __('Carrera:')) ?>
+        <?php echo select_tag('carrera_id', options_for_select($optionsCarrera, $carrera_id), "onChange='linkTo(2)'") ?>
+    </div>
+    <div class="form-row">
         <?php echo label_for('division', __('Divisi&oacute;n:')) ?>
         <?php echo select_tag('division_id', options_for_select($optionsDivision, $division_id), "onChange='linkTo(0)'") ?>
     </div>

Modified: prosistem/alba/trunk/alba/config/schema.yml
===================================================================
--- prosistem/alba/trunk/alba/config/schema.yml	2008-07-29 15:28:25 UTC (rev 5777)
+++ prosistem/alba/trunk/alba/config/schema.yml	2008-07-29 17:48:51 UTC (rev 5778)
@@ -1215,7 +1215,7 @@
       foreignReference: id
     observacion: 
       type: blob
-      required: true
+      required: false
     fecha: 
       type: timestamp
       required: true
@@ -1274,7 +1274,7 @@
       foreignReference: id
     observacion: 
       type: blob
-      required: true
+      required: false
     fecha: 
       type: timestamp
       required: true

Modified: prosistem/alba/trunk/alba/data/sql/actualizacion_1.0_luego.sql
===================================================================
--- prosistem/alba/trunk/alba/data/sql/actualizacion_1.0_luego.sql	2008-07-29 15:28:25 UTC (rev 5777)
+++ prosistem/alba/trunk/alba/data/sql/actualizacion_1.0_luego.sql	2008-07-29 17:48:51 UTC (rev 5778)
@@ -63,5 +63,8 @@
 ALTER TABLE "anio" ADD CONSTRAINT "anio_FK_2" FOREIGN KEY ("fk_carrera_id") REFERENCES "carrera" ("id")
 
 
+ALTER TABLE "boletin_conceptual" ALTER observacion DROP NOT NULL;
+ALTER TABLE "boletin_actividades" ALTER observacion DROP NOT NULL;
+
 # This restores the fkey checks, after having unset them earlier
 SET FOREIGN_KEY_CHECKS = 1;




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