[Alba-desarrollo] SVN Alba r6193 - in prosistem/alba/trunk/alba: apps/principal/modules/informes/actions apps/principal/modules/informes/templates web/uploads/informes

commits en pressenter.com.ar commits en pressenter.com.ar
Lun Mayo 18 21:47:28 CEST 2009


Author: josx
Date: 2009-05-18 16:47:28 -0300 (Mon, 18 May 2009)
New Revision: 6193

Added:
   prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/busquedaDocentesSuccess.php
   prosistem/alba/trunk/alba/web/uploads/informes/constancia_general.odt
Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/informes/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/variablesSuccess.php
Log:
Agregando soporte para informes de docentes con busqueda y agregando archivo para informe constancia general

Modified: prosistem/alba/trunk/alba/apps/principal/modules/informes/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/informes/actions/actions.class.php	2009-05-18 19:46:59 UTC (rev 6192)
+++ prosistem/alba/trunk/alba/apps/principal/modules/informes/actions/actions.class.php	2009-05-18 19:47:28 UTC (rev 6193)
@@ -318,6 +318,10 @@
                 } else {
                     $this->redirect('informes/busquedaListadoAlumnos?id='.$informe->getId()); break;
                 }
+
+            case 'Docente':
+                    $this->redirect('informes/busquedaDocentes?id='.$informe->getId()); break;
+                break;
             case 'General':
                 $this->redirect('informes/mostrar?id='.$informe->getId()); 
                 break;
@@ -339,6 +343,10 @@
             if($this->getRequestParameter('division_id')) {
                 $url .= '&division_id='.$this->getRequestParameter('division_id');
             }
+            if($this->getRequestParameter('docente_id')) {
+                $url .= '&docente_id='.$this->getRequestParameter('docente_id');
+            }
+
             $this->redirect($url);
         } else {
             $this->reporteTBSOO($informe);
@@ -431,7 +439,32 @@
         $this->informe = $informe;
     }
 
+    public function executeBusquedaDocentes() {
 
+        $informe = InformePeer::retrieveByPk($this->getRequestParameter('id'));
+        $this->forward404Unless($informe);
+
+        // inicializando variables
+        $aDocente  = array();        
+
+        // tomando los datos del formulario
+        $txt = $this->getRequestParameter('txt');
+
+        // llenando el combo de division segun establecimiento
+        $establecimiento_id = $this->getUser()->getAttribute('fk_establecimiento_id');
+
+        if ($this->getRequest()->getMethod() == sfRequest::POST) {
+            $aDocente = $this->_getDocentes( $txt);
+        }
+
+        // asignando variables para ser usadas en el template
+        $this->txt = $txt;
+        $this->aDocente = $aDocente;
+        $this->informe = $informe;
+
+    }
+
+
     private function reporteTBSOO($informe) {
         define('BASE',sfConfig::get('sf_app_module_dir') .'/informes/lib/');
         require_once(BASE.'tbs_class_php5.php');
@@ -466,7 +499,6 @@
             }
 
         }
-
         // lleno finalmente de diferente forma si es un array (ciclo) o no (variable comun)
         if(is_array($aDato)) {
             foreach($aDato as $idx => $dato) {
@@ -701,6 +733,7 @@
                             $aDato['docente'][] = $docente->toArray();
                         }
                     } else {
+                        
                         if($this->getRequestParameter('docente_id')) {
                             $docente = DocentePeer::retrieveByPK($this->getRequestParameter('docente_id'));
                             $aDato['docente'] = $docente->toArray();
@@ -791,8 +824,26 @@
         return $aAlumno;
     }   
 
+    private function _getDocentes($txt = '') {
+        $aDocente = array();
+        $criteria = new Criteria();
+        if($txt) {
+            $cton1 = $criteria->getNewCriterion(DocentePeer::NOMBRE, "%$txt%", Criteria::LIKE);
+            $cton2 = $criteria->getNewCriterion(DocentePeer::APELLIDO, "%$txt%", Criteria::LIKE);
+            $cton1->addOr($cton2);
+            $criteria->add($cton1);
+        }
 
+        $aDocente = DocentePeer::doSelect($criteria);
+/*        foreach($docentes as $d) {
+            $aDocente[] = $d->toArray();
+        }
+*/
+        return $aDocente;
+    }   
 
+
+
     private function _getTodosLosAlumnos($establecimiento_id = '', $txt = '') {
         $aAlumno = array();
 

Added: prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/busquedaDocentesSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/busquedaDocentesSuccess.php	                        (rev 0)
+++ prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/busquedaDocentesSuccess.php	2009-05-18 19:47:28 UTC (rev 6193)
@@ -0,0 +1,59 @@
+<?php use_helper('I18N','Form','Object'); ?>
+<div id="sf_admin_container">
+<h1>Informe: <?php echo $informe->getNombre(); ?></h1>
+<?php echo form_tag('informes/busquedaDocentes', 'id=sf_admin_edit_form name=sf_admin_edit_form multipart=true') ?>
+
+<fieldset id="sf_fieldset_none" class="">
+    <div class="form-row">
+        <?php echo label_for('Buscar', __('Buscar Docentes:')) ?>
+        <?php echo input_tag('txt', $txt) ?>   
+    </div>
+
+</fieldset>
+ <ul class="sf_admin_actions">
+  <li><?php echo submit_tag(__('Buscar'), array (
+  'name' => 'Mostrar',
+  'class' => 'sf_admin_action_save',
+)) ?></li>
+</ul>
+<?php echo object_input_hidden_tag($informe, 'getId') ?>
+</form>
+<?php if (count($aDocente) > 0) {
+    if ($txt) { ?>
+    Usted busc&oacute; -<?php echo $txt?>-
+    <?php } ?>
+<h1>Docentes</h1>
+<table cellspacing="0" class="sf_admin_list">
+  <thead>
+  <tr>
+    <th id="sf_admin_list_th_alumno"> Alumno</th>
+    <th id="sf_admin_list_th_sf_actions">Ver Informe</th>
+  </tr>
+  </thead>
+
+  <tbody>
+<?php
+    $i = 0;
+    foreach($aDocente as $docente){
+?>
+  <tr class="sf_admin_row_0">
+    <td><?php echo $docente->getApellido()." ".$docente->getNombre(); ?> </td>
+    <td>
+    <ul class="sf_admin_td_actions">
+     <li>
+        <?php echo link_to(image_tag('/images/small/report_go.png', array('alt' => 'editar', 'title' => 'Editar')) , 'informes/mostrar?docente_id='.$docente->getId().'&id='.$informe->getId()); ?>
+    </li>
+    </ul>
+    </td>
+  </tr>
+  <?php } ?>
+  </tbody>
+</table>
+
+<?php } else {
+    if ($txt) { ?>
+        Su b&uacute;squeda por -<?php echo $txt?>- no ha encontrado alumnos.
+    <?php } 
+} 
+?>
+</div>

Modified: prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/variablesSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/variablesSuccess.php	2009-05-18 19:46:59 UTC (rev 6192)
+++ prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/variablesSuccess.php	2009-05-18 19:47:28 UTC (rev 6193)
@@ -47,6 +47,10 @@
     if($sf_params->get('division_id')) {
         echo input_hidden_tag('division_id', $sf_params->get('division_id'));
     }
+    if($sf_params->get('docente_id')) {
+        echo input_hidden_tag('docente_id', $sf_params->get('docente_id'));
+    }
+
 ?>
 
 <?php echo input_hidden_tag('id', $informe->getId()) ?>

Added: prosistem/alba/trunk/alba/web/uploads/informes/constancia_general.odt
===================================================================
(Binary files differ)


Property changes on: prosistem/alba/trunk/alba/web/uploads/informes/constancia_general.odt
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream




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