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

commits en pressenter.com.ar commits en pressenter.com.ar
Mie Nov 28 20:07:59 CET 2007


Author: josx
Date: 2007-11-28 16:07:59 -0300 (Wed, 28 Nov 2007)
New Revision: 5320

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:
Modificaciones en informes para soportar variables personalizadas en listados

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	2007-11-28 15:36:29 UTC (rev 5319)
+++ prosistem/alba/trunk/alba/apps/principal/modules/informes/actions/actions.class.php	2007-11-28 19:07:59 UTC (rev 5320)
@@ -329,7 +329,14 @@
         $this->forward404Unless($informe);
 
         if($informe->getVariables() AND $this->getRequestParameter('v')!= 1) {
-            $this->redirect('informes/variables?id='.$informe->getId().'&alumno_id='.$this->getRequestParameter('alumno_id'));
+            $url = 'informes/variables?id='.$informe->getId();
+            if($this->getRequestParameter('alumno_id')) {
+                $url .= '&alumno_id='.$this->getRequestParameter('alumno_id');
+            }
+            if($this->getRequestParameter('division_id')) {
+                $url .= '&division_id='.$this->getRequestParameter('division_id');
+            }
+            $this->redirect($url);
         } else {
             $this->reporteTBSOO($informe);
         }
@@ -342,11 +349,13 @@
         $informe = InformePeer::retrieveByPk($this->getRequestParameter('id'));
         $this->forward404Unless($informe);
 
-        $alumno = AlumnoPeer::retrieveByPk($this->getRequestParameter('alumno_id'));
-        $this->forward404Unless($alumno);
+        if($this->getRequestParameter('alumno_id')) {
+            $alumno = AlumnoPeer::retrieveByPk($this->getRequestParameter('alumno_id'));
+            $this->forward404Unless($alumno);
+            $this->alumno = $alumno;
+        }
 
         $this->variables = explode(";",$informe->getVariables());
-        $this->alumno = $alumno;
         $this->informe = $informe;
     }
 
@@ -519,7 +528,7 @@
                     } else {
                         $c = new Criteria();
                         $c->add(RelAlumnoDivisionPeer::FK_ALUMNO_ID, $this->getRequestParameter('alumno_id'));
-                        $relAlumnoDivision = RelAlumnoDivisionPeer::doSelectOne($c);
+                            $relAlumnoDivision = RelAlumnoDivisionPeer::doSelectOne($c);
                         $d = $relAlumnoDivision->getDivision();
                     }
                     $aDato['division'] = $d->toArrayInforme();

Modified: prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/variablesSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/variablesSuccess.php	2007-11-28 15:36:29 UTC (rev 5319)
+++ prosistem/alba/trunk/alba/apps/principal/modules/informes/templates/variablesSuccess.php	2007-11-28 19:07:59 UTC (rev 5320)
@@ -1,6 +1,12 @@
 <?php use_helper('I18N'); ?>
 <div id="sf_admin_container">
-<h1>Informe: <?php echo $informe->getNombre(); ?> para <?php echo $alumno->getApellido().", ".$alumno->getNombre();?></h1>
+<h1>Informe: <?php echo $informe->getNombre(); ?> 
+<?php 
+    if(isset($alumno)) {
+        echo $alumno->getApellido().", ".$alumno->getNombre();
+    }
+?>
+</h1>
 
 <?php if ($sf_request->hasErrors()) {?>
 <div class="form-errors">
@@ -30,7 +36,18 @@
     
 </fieldset>
 
-<?php echo input_hidden_tag('alumno_id', $alumno->getId()) ?>
+
+
+<?php 
+    if(isset($alumno)) {
+        echo input_hidden_tag('alumno_id', $alumno->getId());
+    }
+
+    if($sf_params->get('division_id')) {
+        echo input_hidden_tag('division_id', $sf_params->get('division_id'));
+    }
+?>
+
 <?php echo input_hidden_tag('id', $informe->getId()) ?>
 <?php echo input_hidden_tag('v', '1') ?>
 




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