SVN Alba r5343 - prosistem/alba/trunk/alba/apps/principal/modules/informes/actions
Author: josx Date: 2007-12-19 17:07:29 -0300 (Wed, 19 Dec 2007) New Revision: 5343 Modified: prosistem/alba/trunk/alba/apps/principal/modules/informes/actions/actions.class.php Log: Agregue la posibilidad de mostrar en los informes los datos correspondiente a la organizacion actual 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-12-19 16:00:52 UTC (rev 5342) +++ prosistem/alba/trunk/alba/apps/principal/modules/informes/actions/actions.class.php 2007-12-19 20:07:29 UTC (rev 5343) @@ -517,8 +517,11 @@ $aDato['alumno'][] = $alumno->toArrayInforme(); } } else { - $alumno = AlumnoPeer::retrieveByPk($this->getRequestParameter('alumno_id')); - $aDato['alumno'] = $alumno->toArrayInforme(); + if($this->getRequestParameter('alumno_id')) { + $alumno = AlumnoPeer::retrieveByPk($this->getRequestParameter('alumno_id')); + $aDato['alumno'] = $alumno->toArrayInforme(); + } + } break; @@ -535,18 +538,22 @@ break; case 'establecimiento': - $establecimiento = EstablecimientoPeer::retrieveByPk($this->getUser()->getAttribute('fk_establecimiento_id')); - $aDato['establecimiento'] = $establecimiento->toArrayInforme(); + if($this->getUser()->getAttribute('fk_establecimiento_id')) { + $establecimiento = EstablecimientoPeer::retrieveByPk($this->getUser()->getAttribute('fk_establecimiento_id')); + $aDato['establecimiento'] = $establecimiento->toArrayInforme(); + } break; case 'ciclolectivo': - $ciclolectivo_id = $this->getUser()->getAttribute('fk_ciclolectivo_id'); - $ciclolectivo = CiclolectivoPeer::retrieveByPk($ciclolectivo_id); - $aDato['ciclolectivo'] = $ciclolectivo->toArray(); + if($this->getUser()->getAttribute('fk_ciclolectivo_id')) { + $ciclolectivo_id = $this->getUser()->getAttribute('fk_ciclolectivo_id'); + $ciclolectivo = CiclolectivoPeer::retrieveByPk($ciclolectivo_id); + $aDato['ciclolectivo'] = $ciclolectivo->toArray(); + } break; case 'locacion': - if( array_key_exists('loop', $result) AND $result['loop'] == 1) { + if( array_key_exists('loop', $result) AND $result['loop'] == 1 AND $this->getUser()->getAttribute('fk_establecimiento_id')) { $c = new Criteria(); $c->add(RelEstablecimientoLocacionPeer::FK_ESTABLECIMIENTO_ID, $this->getUser()->getAttribute('fk_establecimiento_id')); $c->addJoin(RelEstablecimientoLocacionPeer::FK_LOCACION_ID, LocacionPeer::ID); @@ -562,12 +569,10 @@ $aDato['locacion'] = $locacion->toArray(); } } -// print_R($aDato); -// die; break; case 'espacio': - if( array_key_exists('loop', $result) AND $result['loop'] == 1) { + if( array_key_exists('loop', $result) AND $result['loop'] == 1 AND $this->getUser()->getAttribute('fk_establecimiento_id')) { $c = new Criteria(); $c->add(RelEstablecimientoLocacionPeer::FK_ESTABLECIMIENTO_ID, $this->getUser()->getAttribute('fk_establecimiento_id')); $c->addJoin(RelEstablecimientoLocacionPeer::FK_LOCACION_ID, LocacionPeer::ID); @@ -589,6 +594,16 @@ } break; + case 'organizacion': + if($this->getUser()->getAttribute('fk_establecimiento_id')) { + $c = new Criteria(); + $c->add(EstablecimientoPeer::ID, $this->getUser()->getAttribute('fk_establecimiento_id')); + $c->addJoin(EstablecimientoPeer::FK_ORGANIZACION_ID, OrganizacionPeer::ID); + $organizacion = OrganizacionPeer::doSelectOne($c); + $aDato['organizacion'] = $organizacion->toArray(); + } + break; + default: } }
participants (1)
-
commits@pressenter.com.ar