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

commits en pressenter.com.ar commits en pressenter.com.ar
Mar Mar 4 20:17:13 CET 2008


Author: josx
Date: 2008-03-04 17:17:13 -0200 (Tue, 04 Mar 2008)
New Revision: 5488

Added:
   prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_listado_alumnos.php
   prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_listado_divisiones.php
   prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/busquedaDivisionSuccess.php
   prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/busquedaSuccess.php
Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/editSuccess.php
Log:
relAlumnoDivision: Se agregaron los buscadores para alumno y division en ajax.

Modified: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/actions/actions.class.php	2008-03-03 19:04:44 UTC (rev 5487)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/actions/actions.class.php	2008-03-04 19:17:13 UTC (rev 5488)
@@ -78,6 +78,89 @@
     }
 */
 
+
+
+        function executeBusqueda() {
+        $aAlumnoId = array();
+        $criteria = new Criteria();
+
+        if($this->getRequestParameter('filtro_nombre_alumnos')) {
+            $txt_nombre = $this->getRequestParameter('filtro_nombre_alumnos');
+            $cton1 = $criteria->getNewCriterion(AlumnoPeer::APELLIDO, "$txt_nombre%", Criteria::LIKE);
+        }
+
+        if($this->getRequestParameter('filtro_alumnos')) {
+            switch($this->getRequestParameter('filtro_alumnos')) {
+                case 0: break;
+                case 1: 
+                        $c = new Criteria();
+                        $c->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $this->getUser()->getAttribute('fk_establecimiento_id'));
+                        $c->addJoin(RelAlumnoDivisionPeer::FK_DIVISION_ID, DivisionPeer::ID);
+                        $c->addJoin(AnioPeer::ID, DivisionPeer::FK_ANIO_ID);
+                        $relAlumnoDivision = RelAlumnoDivisionPeer::doSelect($c);
+                        foreach($relAlumnoDivision as $r) {
+                            $aAlumnoId[] = $r->getFkAlumnoId();
+                        }
+                        $criteria->add(AlumnoPeer::ID, $r->getFkAlumnoId(), Criteria::NOT_IN);
+                        $cton2 = $criteria->getNewCriterion(AlumnoPeer::ID, $aAlumnoId, Criteria::NOT_IN);
+                        if($this->getRequestParameter('filtro_nombre_alumnos')) {
+                            $cton1->addAnd($cton2);
+                        } else {
+                            $criteria->add($cton2);
+                        }
+
+                        break;
+                default:
+            }
+        }
+
+        if($this->getRequestParameter('filtro_nombre_alumnos')) {
+            $criteria->add($cton1);
+        }
+
+        $alumnos = AlumnoPeer::doSelect($criteria);
+        $this->optionsAlumno = $alumnos;
+    }
+
+
+
+    function executeBusquedaDivision() {
+        $criteria = new Criteria();
+
+        if($this->getRequestParameter('filtro_nombre_divisiones')) {
+            $txt_nombre = $this->getRequestParameter('filtro_nombre_divisiones');
+            $criteria->add(DivisionPeer::DESCRIPCION, "$txt_nombre%", Criteria::LIKE);
+        }
+
+        if($this->getRequestParameter('fk_turno_id')) {
+            $criteria->add(DivisionPeer::FK_TURNO_ID, $this->getRequestParameter('fk_turno_id'));
+        }
+
+        if($this->getRequestParameter('fk_orientacion_id')) {
+            $criteria->add(DivisionPeer::FK_ORIENTACION_ID, $this->getRequestParameter('fk_orientacion_id'));
+        }   
+
+        if($this->getRequestParameter('fk_anio_id')) {
+            $criteria->add(DivisionPeer::FK_ANIO_ID, $this->getRequestParameter('fk_anio_id'));
+        }
+
+/*
+
+        if($this->getRequestParameter('filtro_divisiones')) {
+            switch($this->getRequestParameter('filtro_divisiones')) {
+                case 0: break;
+                case 1: break;
+                default:
+            }
+        }
+
+*/
+        $aDivision = DivisionPeer::doSelect($criteria);
+        $this->optionsDivision = $aDivision;
+    }
+
+
+
     function executeEdit() {
 
         //Listado de alumnos
@@ -88,12 +171,14 @@
         //Listado de division
         $c = new Criteria();
         $aDivision = DivisionPeer::doSelect($c);
+        $this->division = $aDivision;
 
         $optionsDivision = array();
         foreach($aDivision as $division) {
             $optionsDivision[$division->getId()] = $division->__toString();
         }
         $this->optionsDivision = $optionsDivision;
+
     }
 
 

Added: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_listado_alumnos.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_listado_alumnos.php	                        (rev 0)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_listado_alumnos.php	2008-03-04 19:17:13 UTC (rev 5488)
@@ -0,0 +1,29 @@
+<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?>
+<?php if(count($optionsAlumno) > 0) { ?>
+
+<table cellspacing="0">
+    <tr>
+<?php 
+
+    $i=0;
+    foreach ($optionsAlumno as $alumno)  {
+        if ($i>5){
+            echo "</tr>";
+            $i=0;
+            echo "<tr>";
+        }   
+        $i+=1;
+    ?>
+    <td>
+    <div id="<?php echo "alumno_".$alumno->getId()?>" class="alumno"> <?php echo $alumno->__toString()?><br>
+    (<?php echo $alumno->getNroDocumento();?>)
+    </div><?php echo draggable_element('alumno_'.$alumno->getId(), array('revert' => true));  ?>
+    </td>
+    <?php } ?>
+
+    </tr>
+</table>
+
+<?php } else { ?>
+    No se encontraron coincidencias
+<?php } ?>
\ No newline at end of file

Added: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_listado_divisiones.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_listado_divisiones.php	                        (rev 0)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_listado_divisiones.php	2008-03-04 19:17:13 UTC (rev 5488)
@@ -0,0 +1,30 @@
+<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?>
+<?php if(count($optionsDivision) > 0) { ?>
+
+<table>
+    <tr>
+<?php 
+    $i=0;
+    foreach ($optionsDivision as $indice => $contenido)  {
+        if ($i>5){
+            echo "</tr>";
+            $i=0;
+            echo "<tr>";
+        }   
+        $i+=1;
+    ?>
+    <td>
+    <?php echo $contenido;?>
+        <div id="division_<?php echo $indice?>" class="cart" style="position:relative;left:20px;"></div>
+        <?php echo drop_receiving_element('division_'.$indice, array(
+        'url'        => 'relAlumnoDivision/asignarAlumno?division_id='.$indice,
+        'accept'     => 'alumno',
+       'update'     => 'division_'.$indice,)) ?> 
+    </td>
+<?php } ?>
+    </tr>
+</table>
+
+<?php } else { ?>
+    No se encontraron coincidencias
+<?php } ?>
\ No newline at end of file

Added: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/busquedaDivisionSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/busquedaDivisionSuccess.php	                        (rev 0)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/busquedaDivisionSuccess.php	2008-03-04 19:17:13 UTC (rev 5488)
@@ -0,0 +1 @@
+<?php include_partial('relAlumnoDivision/listado_divisiones', array('optionsDivision' => $optionsDivision)) ?>

Added: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/busquedaSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/busquedaSuccess.php	                        (rev 0)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/busquedaSuccess.php	2008-03-04 19:17:13 UTC (rev 5488)
@@ -0,0 +1 @@
+<?php include_partial('relAlumnoDivision/listado_alumnos', array('optionsAlumno' => $optionsAlumno)) ?>

Modified: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/editSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/editSuccess.php	2008-03-03 19:04:44 UTC (rev 5487)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/editSuccess.php	2008-03-04 19:17:13 UTC (rev 5488)
@@ -11,70 +11,70 @@
 <h1><?php echo __('Asignar alumno a grado y secci&oacute;n', 
 array()) ?></h1>
 
-<?php //print_r($rel_alumno_division)?>
-<?php //include_partial('relAlumnoDivision/edit_header', array('rel_alumno_division' => $rel_alumno_division)) ?>
-
 <!-- Filtro Alumnos -->
+<?php echo form_remote_tag(array(
+    'update'   => 'alumnos',
+    'url'      => 'relAlumnoDivision/busqueda',
+    'script'    => true
+)) ?>
+    <div id="filtros_alumnos">Apellido:
+        <?php echo input_tag("filtro_nombre_alumnos", '', array ( 'size' => 20, 'class'=>'text' )) ?>
+        <?php echo select_tag('filtro_alumnos', options_for_select(array('Todos',  'No Asignados',), 0)) ?>
+        <ul class="sf_admin_actions">
+            <li><?php echo submit_tag(__('Buscar'), array ( 'class' => 'sf_admin_action_save',)) ?></li>
+        </ul>
+    </div>
+</form>
 
-<?php echo form_tag('relAlumnoDivision/list', array('method' => 'get')) ?>
 
-<div id="filtros_alumnos">
-    Filtro Alumnos: 
-    <?php echo input_tag("filtro_nombre_alumnos", '', array (
-  'size' => 20, 'class'=>'text'
-)) ?>
-    <?php echo select_tag('filtro_alumnos', options_for_select(array(
-  'Todos',  'No Asignados',), 0)) ?>
-    </form>
+<!-- Alumnos -->
+<div id="alumnos">
+<?php include_partial('relAlumnoDivision/listado_alumnos', array('optionsAlumno' => $optionsAlumno)) ?>
 </div>
 
-<!-- Alumnos -->
-<?php 
-  foreach ($optionsAlumno as $alumno)  {
-        ?>
-      <div id="<?php echo "alumno_".$alumno->getId()?>" class="alumno" style="position:relative;left:20px;"> <?php echo $alumno->getId() ." - " .$alumno->__toString()?> </div>
-<?php
-      echo draggable_element('alumno_'.$alumno->getId(), array('revert' => true));
-}
-?>
 
 <!-- Filtro Divisiones -->
 <br/>
-<?php echo form_tag('relAlumnoDivision/list', array('method' => 'get')) ?>
-<div id="filtros_secciones">
-    Filtro Divisiones:
-    <?php echo input_tag("filtro_nombre_divisiones", '', array (
-  'size' => 20, 'class'=>'text'
-)) ?>
-    <?php echo select_tag('filtro_divisiones', options_for_select(array(
-  'Todos',  'No Asignados',), 0)) ?>
-    </form>
-</div>
+<?php echo form_remote_tag(array( 'update'   => 'divisiones', 'url' => 'relAlumnoDivision/busquedaDivision',  'script'    => true )) ?>
+    <div id="filtros_secciones">Divisiones:
+        <?php echo input_tag("filtro_nombre_divisiones", '', array ('size' => 20, 'class'=>'text')) ?>
 
+    &nbsp;Orientaci&oacute;n:
+  <?php $value = object_select_tag($division, 'getFkOrientacionId', array (
+  'related_class' => 'Orientacion',
+  'control_name' => 'fk_orientacion_id',
+  'include_blank' => true,
+)); echo $value ? $value : '&nbsp;' ?>
+
+    &nbsp;A&ntilde;o: 
+  <?php $value = object_select_tag($division, 'getFkAnioId', array (
+  'related_class' => 'Anio',
+  'control_name' => 'fk_anio_id',
+  'include_blank' => true,
+)); echo $value ? $value : '&nbsp;' ?>
+
+    &nbsp;Turno:
+  <?php $value = object_select_tag($division, 'getFkTurnoId', array (
+  'related_class' => 'Turno',
+  'control_name' => 'fk_turno_id',
+  'include_blank' => true,
+)); echo $value ? $value : '&nbsp;' ?>
+
+
+<!-- 
+<?php echo select_tag('filtro_divisiones', options_for_select(array('Todos',  'No Asignados',), 0)) ?>
+-->
+
+    </div>
+        <ul class="sf_admin_actions">
+            <li><?php echo submit_tag(__('Buscar'), array ( 'class' => 'sf_admin_action_save',)) ?></li>
+        </ul>
+</form>
+
+
 <!-- Divisiones-->
-<table>
-    <tr>
-<?php 
-    $i=0;
-    foreach ($optionsDivision as $indice=>$contenido)  {
-        if ($i>5){
-            echo "</tr>";
-            $i=0;
-            echo "<tr>";
-        }   
-        $i+=1;
-    ?>
-    <td>
-    <?php
-        echo $contenido;?>
-        <div id="division_<?php echo $indice?>" class="cart" style="position:relative;left:20px;"></div>
-        <?php echo drop_receiving_element('division_'.$indice, array(
-        'url'        => 'relAlumnoDivision/asignarAlumno?division_id='.$indice,
-        'accept'     => 'alumno',
-       'update'     => 'division_'.$indice,)) ?> 
-    </td>
-<?php } ?>
-    </tr>
-</table>
+<div id="divisiones">
+<?php include_partial('relAlumnoDivision/listado_divisiones', array('optionsDivision' => $optionsDivision)) ?>
+</div>
 
-</div>
+</div>
\ No newline at end of file




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