SVN Alba r5272 - in prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico: actions templates
Author: hsanchez Date: 2007-10-29 13:02:19 -0300 (Mon, 29 Oct 2007) New Revision: 5272 Modified: prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/actions/actions.class.php prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/templates/indexSuccess.php Log: Correcci?\195?\179n del filtro de alumno en Buscar Alumno Para.. Ticket: #261 Modified: prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/actions/actions.class.php =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/actions/actions.class.php 2007-10-29 15:07:39 UTC (rev 5271) +++ prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/actions/actions.class.php 2007-10-29 16:02:19 UTC (rev 5272) @@ -37,9 +37,7 @@ * Executes index action * */ - public function executeIndex() - { - + public function executeIndex(){ // inicializando variables $optionsDivision = array(); $aAlumno = array(); @@ -63,13 +61,13 @@ if ($this->getRequest()->getMethod() == sfRequest::POST) { // buscando alumnos $criteria = new Criteria(); + $criteria->add(AlumnoPeer::FK_ESTABLECIMIENTO_ID, $establecimiento_id); if($division_id) { $criteria->add(DivisionPeer::ID, $division_id); $criteria->addJoin(RelAlumnoDivisionPeer::FK_ALUMNO_ID, AlumnoPeer::ID); $criteria->addJoin(RelAlumnoDivisionPeer::FK_DIVISION_ID, DivisionPeer::ID); } - if($txt_apellido) { $criteria->add(AlumnoPeer::APELLIDO, "$txt_apellido%", Criteria::LIKE); } @@ -87,10 +85,8 @@ $this->txt_apellido = $txt_apellido; $this->txt_nombre = $txt_nombre; $this->aAlumno = $aAlumno; - } - public function executeVerLegajo() { // inicializando variables $aEntradaLegajo = array(); @@ -111,20 +107,9 @@ $criteria->add(LegajopedagogicoPeer::FK_LEGAJOCATEGORIA_ID, $legajo_categoria_id); } $aEntradaLegajo= LegajopedagogicoPeer::doSelect($criteria); - } - // lleno en combo de categorias de legajo -/* $criteria = new Criteria(); - $categoriaLegajos = LegajocategoriaPeer::doSelect($criteria); - $optionsCategoriaLegajo[] = ""; - foreach($categoriaLegajos as $categoriaLegajo) { - $optionsCategoriaLegajo[$categoriaLegajo->getId()] = $categoriaLegajo->getDescripcion(); - } - asort($optionsCategoriaLegajo);*/ - - // lleno en combo de categorias de legajo $optionsCategoriaLegajo = $this->getCategorias(); // asignando variables para ser usadas en el template @@ -135,7 +120,6 @@ } protected function getCategorias() { - $optionsCategoriaLegajo = array(); $criteria = new Criteria(); $categoriaLegajos = LegajocategoriaPeer::doSelect($criteria); @@ -147,67 +131,50 @@ return $optionsCategoriaLegajo; } - - public function executeCreate () - { + public function executeCreate (){ return $this->forward('legajopedagogico', 'edit'); } - public function executeSave () - { + public function executeSave (){ + $this->legajopedagogico = $this->getLegajopedagogicoOrCreate(); + $this->updateLegajopedagogicoFromRequest(); + $this->legajopedagogico->setFkUsuarioId($this->getUser()->getAttribute('id')); // guardo el usuario que hizo esta entrada + $this->saveLegajopedagogico($this->legajopedagogico); + + // adding a attachment + if($this->getRequest()->getFileName('file')) { + $mimetype = $this->getRequest()->getFileType('file'); + $ext = $this->getRequest()->getFileExtension('file'); + $realFileName = $this->getRequest()->getFileName('file'); + $uniqueFileName = uniqid(rand()) . $ext; + $this->getRequest()->moveFile('file', sfConfig::get('sf_upload_dir').'/'.$uniqueFileName); + $adjunto = new Adjunto(); + $adjunto->setFecha(date('Y-m-d')); + $adjunto->setNombreArchivo($realFileName); + $adjunto->setTipoArchivo($mimetype); + $adjunto->setRuta($uniqueFileName); + $adjunto->save(); + $legajoadjunto = new Legajoadjunto(); + $legajoadjunto->setFkLegajopedagogicoId($this->legajopedagogico->getId()); + $legajoadjunto->setFkAdjuntoId($adjunto->getId()); + $legajoadjunto->save(); + } - $this->legajopedagogico = $this->getLegajopedagogicoOrCreate(); - $this->updateLegajopedagogicoFromRequest(); - $this->legajopedagogico->setFkUsuarioId($this->getUser()->getAttribute('id')); // guardo el usuario que hizo esta entrada - $this->saveLegajopedagogico($this->legajopedagogico); - - // adding a attachment - if($this->getRequest()->getFileName('file')) { - $mimetype = $this->getRequest()->getFileType('file'); - $ext = $this->getRequest()->getFileExtension('file'); - $realFileName = $this->getRequest()->getFileName('file'); - $uniqueFileName = uniqid(rand()) . $ext; - $this->getRequest()->moveFile('file', sfConfig::get('sf_upload_dir').'/'.$uniqueFileName); - $adjunto = new Adjunto(); - $adjunto->setFecha(date('Y-m-d')); - $adjunto->setNombreArchivo($realFileName); - $adjunto->setTipoArchivo($mimetype); - $adjunto->setRuta($uniqueFileName); - $adjunto->save(); - $legajoadjunto = new Legajoadjunto(); - $legajoadjunto->setFkLegajopedagogicoId($this->legajopedagogico->getId()); - $legajoadjunto->setFkAdjuntoId($adjunto->getId()); - $legajoadjunto->save(); - } + $this->setFlash('notice', 'Your modifications have been saved'); + if ($this->getRequestParameter('save_and_add')) { + return $this->redirect('legajopedagogico/create?aid='.$this->legajopedagogico->getFkAlumnoId().'&cid='.$this->legajopedagogico->getFkLegajocategoriaId()); + } else { + return $this->redirect('legajopedagogico/edit?aid='.$this->legajopedagogico->getFkAlumnoId().'&cid='.$this->legajopedagogico->getFkLegajocategoriaId().'&id='.$this->legajopedagogico->getId()); + } - $this->setFlash('notice', 'Your modifications have been saved'); - if ($this->getRequestParameter('save_and_add')) { - return $this->redirect('legajopedagogico/create?aid='.$this->legajopedagogico->getFkAlumnoId().'&cid='.$this->legajopedagogico->getFkLegajocategoriaId()); - } else { - return $this->redirect('legajopedagogico/edit?aid='.$this->legajopedagogico->getFkAlumnoId().'&cid='.$this->legajopedagogico->getFkLegajocategoriaId().'&id='.$this->legajopedagogico->getId()); - } - - - - - - - - } - - - - - public function executeEdit() { $this->alumno_id = $this->getRequestParameter('aid'); $this->legajo_categoria_id = $this->getRequestParameter('cid'); $this->optionsCategoriaLegajo = $this->getCategorias(); $this->legajopedagogico = $this->getLegajopedagogicoOrCreate(); $this->alumno = AlumnoPeer::retrieveByPk($this->alumno_id); - $this->aFile = array(); // buscando los adjuntos de la entrada al legajo pedagogico @@ -226,8 +193,6 @@ // add javascripts $this->getResponse()->addJavascript(sfConfig::get('sf_prototype_web_dir').'/js/prototype'); $this->getResponse()->addJavascript(sfConfig::get('sf_admin_web_dir').'/js/collapse'); - - } public function handleErrorSave() { @@ -237,8 +202,6 @@ return sfView::SUCCESS; } - - protected function saveLegajopedagogico($legajopedagogico) { $legajopedagogico->save(); } @@ -254,7 +217,6 @@ $this->legajopedagogico->setTitulo($legajopedagogico['titulo']); } - if (isset($legajopedagogico['fecha'])) { if ($legajopedagogico['fecha']) { list($d, $m, $y) = sfI18N::getDateForCulture($legajopedagogico['fecha'], $this->getUser()->getCulture()); @@ -279,7 +241,6 @@ if (isset($legajopedagogico['fk_legajocategoria_id'])) { $this->legajopedagogico->setFkLegajocategoriaId($legajopedagogico['fk_legajocategoria_id']); } - } protected function getLegajopedagogicoOrCreate($id = 'id') { @@ -289,12 +250,10 @@ $legajopedagogico= LegajopedagogicoPeer::retrieveByPk($this->getRequestParameter($id)); $this->forward404Unless($legajopedagogico); } - return $legajopedagogico; } - public function executeDelete() - { + public function executeDelete(){ $alumno_id = $this->getRequestParameter('aid'); $legajo_categoria_id = $this->getRequestParameter('cid'); $this->legajopedagogico = LegajopedagogicoPeer::retrieveByPk($this->getRequestParameter('id')); @@ -303,12 +262,10 @@ return $this->redirect("legajopedagogico?action=verLegajo&aid=".$alumno_id."&cid=".$legajo_categoria_id); } - protected function deleteLegajopedagogico($legajopedagogico) - { + protected function deleteLegajopedagogico($legajopedagogico){ $legajopedagogico->delete(); } - public function executeBorrarAdjunto() { $this->alumno_id = $this->getRequestParameter('aid'); $this->legajopedagogico_id = $this->getRequestParameter('id'); @@ -333,11 +290,9 @@ $alumnos = AlumnoPeer::doSelect($criteria); $this->forward404Unless($alumnos); - $this->aAlumno = $alumnos; } - public function executeAutocompletarNom() { $txt_nombre = $this->getRequestParameter('txt_nombre'); $criteria = new Criteria(); @@ -346,8 +301,5 @@ $this->forward404Unless($alumnos); $this->aAlumno = $alumnos; } - - } - -?> \ No newline at end of file +?> Modified: prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/templates/indexSuccess.php =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/templates/indexSuccess.php 2007-10-29 15:07:39 UTC (rev 5271) +++ prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/templates/indexSuccess.php 2007-10-29 16:02:19 UTC (rev 5272) @@ -47,7 +47,7 @@ <?php if (count($aAlumno) > 0) { if ($txt_apellido OR $txt_nombre) { ?> - Usted busco -<?php echo (($txt_apellido)?$txt_apellido:"")." ".(($txt_nombre)?$txt_nombre:"") ?>- + Usted buscó -<?php echo (($txt_apellido)?$txt_apellido:"")." ".(($txt_nombre)?$txt_nombre:"") ?>- <?php } ?> <h1>Alumnos</h1> <table cellspacing="0" class="sf_admin_list"> @@ -90,4 +90,4 @@ <?php } } ?> -</div> \ No newline at end of file +</div> -- Este mensaje ha sido analizado por MailScanner en busca de virus y otros contenidos peligrosos, y se considera que est� limpio. For all your IT requirements visit: http://www.transtec.co.uk
participants (1)
-
commits@pressenter.com.ar