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

commits en pressenter.com.ar commits en pressenter.com.ar
Lun Oct 29 17:02:19 CET 2007


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/acti=
ons/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/temp=
lates/indexSuccess.php
Log:
Correcci?\195?\179n del filtro de alumno en Buscar Alumno Para.. Ticket: =
#261

Modified: prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogi=
co/actions/actions.class.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/act=
ions/actions.class.php	2007-10-29 15:07:39 UTC (rev 5271)
+++ prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/act=
ions/actions.class.php	2007-10-29 16:02:19 UTC (rev 5272)
@@ -37,9 +37,7 @@
    * Executes index action
    *
    */
-    public function executeIndex()
-    {
-       =20
+    public function executeIndex(){
         // inicializando variables
         $optionsDivision =3D array();
         $aAlumno  =3D array();       =20
@@ -63,13 +61,13 @@
         if ($this->getRequest()->getMethod() =3D=3D sfRequest::POST) {
             // buscando alumnos
             $criteria =3D new Criteria();
+            $criteria->add(AlumnoPeer::FK_ESTABLECIMIENTO_ID, $estableci=
miento_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);
             }
            =20
-       =20
             if($txt_apellido) {
                 $criteria->add(AlumnoPeer::APELLIDO, "$txt_apellido%", C=
riteria::LIKE);
             }
@@ -87,10 +85,8 @@
         $this->txt_apellido =3D $txt_apellido;
         $this->txt_nombre =3D $txt_nombre;
         $this->aAlumno =3D $aAlumno;
-
     }
=20
-
     public function executeVerLegajo() {
         // inicializando variables
         $aEntradaLegajo =3D array();
@@ -111,20 +107,9 @@
                 $criteria->add(LegajopedagogicoPeer::FK_LEGAJOCATEGORIA_=
ID, $legajo_categoria_id);
             }
             $aEntradaLegajo=3D LegajopedagogicoPeer::doSelect($criteria)=
;
-
         }
=20
-
         // lleno en combo de categorias de legajo
-/*        $criteria =3D new Criteria();
-        $categoriaLegajos =3D LegajocategoriaPeer::doSelect($criteria);
-        $optionsCategoriaLegajo[]  =3D "";
-        foreach($categoriaLegajos as $categoriaLegajo) {
-            $optionsCategoriaLegajo[$categoriaLegajo->getId()] =3D $cate=
goriaLegajo->getDescripcion();
-        }
-        asort($optionsCategoriaLegajo);*/
-       =20
-        // lleno en combo de categorias de legajo
         $optionsCategoriaLegajo =3D $this->getCategorias();
=20
         // asignando variables para ser usadas en el template
@@ -135,7 +120,6 @@
     }
=20
     protected function getCategorias() {
-       =20
         $optionsCategoriaLegajo =3D array();
         $criteria =3D new Criteria();
         $categoriaLegajos =3D LegajocategoriaPeer::doSelect($criteria);
@@ -147,67 +131,50 @@
         return $optionsCategoriaLegajo;   =20
     }
=20
-
-    public function executeCreate ()
-    {
+    public function executeCreate (){
         return $this->forward('legajopedagogico', 'edit');
     }
=20
-    public function executeSave ()
-    {
+    public function executeSave (){
+        $this->legajopedagogico =3D $this->getLegajopedagogicoOrCreate()=
;
+        $this->updateLegajopedagogicoFromRequest();
+        $this->legajopedagogico->setFkUsuarioId($this->getUser()->getAtt=
ribute('id'));   // guardo el usuario que hizo esta entrada
+        $this->saveLegajopedagogico($this->legajopedagogico);
+      =20
+        // adding a attachment
+        if($this->getRequest()->getFileName('file')) {
+            $mimetype  =3D $this->getRequest()->getFileType('file');
+            $ext =3D $this->getRequest()->getFileExtension('file');     =
                  =20
+            $realFileName =3D $this->getRequest()->getFileName('file'); =
     =20
+            $uniqueFileName =3D uniqid(rand()) . $ext;           =20
+            $this->getRequest()->moveFile('file', sfConfig::get('sf_uplo=
ad_dir').'/'.$uniqueFileName);
+            $adjunto =3D new Adjunto();=20
+            $adjunto->setFecha(date('Y-m-d'));
+            $adjunto->setNombreArchivo($realFileName);
+            $adjunto->setTipoArchivo($mimetype);    =20
+            $adjunto->setRuta($uniqueFileName);
+            $adjunto->save();
+            $legajoadjunto =3D new Legajoadjunto();
+            $legajoadjunto->setFkLegajopedagogicoId($this->legajopedagog=
ico->getId()); =20
+            $legajoadjunto->setFkAdjuntoId($adjunto->getId()); =20
+            $legajoadjunto->save();=20
+        }
=20
-            $this->legajopedagogico =3D $this->getLegajopedagogicoOrCrea=
te();
-            $this->updateLegajopedagogicoFromRequest();
-            $this->legajopedagogico->setFkUsuarioId($this->getUser()->ge=
tAttribute('id'));   // guardo el usuario que hizo esta entrada
-            $this->saveLegajopedagogico($this->legajopedagogico);
-          =20
-            // adding a attachment
-            if($this->getRequest()->getFileName('file')) {
-                $mimetype  =3D $this->getRequest()->getFileType('file');
-                $ext =3D $this->getRequest()->getFileExtension('file'); =
                      =20
-                $realFileName =3D $this->getRequest()->getFileName('file=
');      =20
-                $uniqueFileName =3D uniqid(rand()) . $ext;           =20
-                $this->getRequest()->moveFile('file', sfConfig::get('sf_=
upload_dir').'/'.$uniqueFileName);
-                $adjunto =3D new Adjunto();=20
-                $adjunto->setFecha(date('Y-m-d'));
-                $adjunto->setNombreArchivo($realFileName);
-                $adjunto->setTipoArchivo($mimetype);    =20
-                $adjunto->setRuta($uniqueFileName);
-                $adjunto->save();
-                $legajoadjunto =3D new Legajoadjunto();
-                $legajoadjunto->setFkLegajopedagogicoId($this->legajoped=
agogico->getId()); =20
-                $legajoadjunto->setFkAdjuntoId($adjunto->getId()); =20
-                $legajoadjunto->save();=20
-            }
+        $this->setFlash('notice', 'Your modifications have been saved');
+        if ($this->getRequestParameter('save_and_add')) {
+            return $this->redirect('legajopedagogico/create?aid=3D'.$thi=
s->legajopedagogico->getFkAlumnoId().'&cid=3D'.$this->legajopedagogico->g=
etFkLegajocategoriaId());
+        } else  {
+            return $this->redirect('legajopedagogico/edit?aid=3D'.$this-=
>legajopedagogico->getFkAlumnoId().'&cid=3D'.$this->legajopedagogico->get=
FkLegajocategoriaId().'&id=3D'.$this->legajopedagogico->getId());
+        }
=20
-            $this->setFlash('notice', 'Your modifications have been save=
d');
-            if ($this->getRequestParameter('save_and_add')) {
-                return $this->redirect('legajopedagogico/create?aid=3D'.=
$this->legajopedagogico->getFkAlumnoId().'&cid=3D'.$this->legajopedagogic=
o->getFkLegajocategoriaId());
-            } else  {
-                return $this->redirect('legajopedagogico/edit?aid=3D'.$t=
his->legajopedagogico->getFkAlumnoId().'&cid=3D'.$this->legajopedagogico-=
>getFkLegajocategoriaId().'&id=3D'.$this->legajopedagogico->getId());
-            }
-
-
-
-
-
-
-
-
     }
=20
-
-   =20
-
-
-
     public function executeEdit() {
         $this->alumno_id =3D $this->getRequestParameter('aid');
         $this->legajo_categoria_id  =3D $this->getRequestParameter('cid'=
);
         $this->optionsCategoriaLegajo =3D $this->getCategorias();
         $this->legajopedagogico =3D $this->getLegajopedagogicoOrCreate()=
;
         $this->alumno =3D AlumnoPeer::retrieveByPk($this->alumno_id);
-
         $this->aFile =3D array();
=20
         // 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');
-
-      =20
     }
=20
     public function handleErrorSave() {
@@ -237,8 +202,6 @@
         return sfView::SUCCESS;
     }
=20
-
-
     protected function saveLegajopedagogico($legajopedagogico) {
         $legajopedagogico->save();
     }
@@ -254,7 +217,6 @@
             $this->legajopedagogico->setTitulo($legajopedagogico['titulo=
']);
         }
=20
-
         if (isset($legajopedagogico['fecha'])) {
             if ($legajopedagogico['fecha']) {
                 list($d, $m, $y) =3D sfI18N::getDateForCulture($legajope=
dagogico['fecha'], $this->getUser()->getCulture());
@@ -279,7 +241,6 @@
         if (isset($legajopedagogico['fk_legajocategoria_id'])) {
             $this->legajopedagogico->setFkLegajocategoriaId($legajopedag=
ogico['fk_legajocategoria_id']);
         }
-
     }
=20
     protected function getLegajopedagogicoOrCreate($id =3D 'id') {
@@ -289,12 +250,10 @@
             $legajopedagogico=3D LegajopedagogicoPeer::retrieveByPk($thi=
s->getRequestParameter($id));
             $this->forward404Unless($legajopedagogico);
         }
-
         return $legajopedagogico;
     }
=20
-    public function executeDelete()
-    {
+    public function executeDelete(){
         $alumno_id =3D $this->getRequestParameter('aid');
         $legajo_categoria_id  =3D $this->getRequestParameter('cid');
         $this->legajopedagogico =3D LegajopedagogicoPeer::retrieveByPk($=
this->getRequestParameter('id'));
@@ -303,12 +262,10 @@
         return $this->redirect("legajopedagogico?action=3DverLegajo&aid=3D=
".$alumno_id."&cid=3D".$legajo_categoria_id);
     }
=20
-    protected function deleteLegajopedagogico($legajopedagogico)
-    {
+    protected function deleteLegajopedagogico($legajopedagogico){
         $legajopedagogico->delete();
     }
=20
-
     public function executeBorrarAdjunto() {
         $this->alumno_id =3D $this->getRequestParameter('aid');
         $this->legajopedagogico_id =3D $this->getRequestParameter('id');
@@ -333,11 +290,9 @@
         $alumnos =3D AlumnoPeer::doSelect($criteria);
         $this->forward404Unless($alumnos);
=20
-
         $this->aAlumno =3D $alumnos;
     }
=20
-
     public function executeAutocompletarNom() {
         $txt_nombre =3D $this->getRequestParameter('txt_nombre');
         $criteria =3D new Criteria();
@@ -346,8 +301,5 @@
         $this->forward404Unless($alumnos);
         $this->aAlumno =3D $alumnos;
     }
-
-
 }
-
-?>
\ No newline at end of file
+?>

Modified: prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogi=
co/templates/indexSuccess.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/tem=
plates/indexSuccess.php	2007-10-29 15:07:39 UTC (rev 5271)
+++ prosistem/alba/trunk/alba/apps/principal/modules/legajopedagogico/tem=
plates/indexSuccess.php	2007-10-29 16:02:19 UTC (rev 5272)
@@ -47,7 +47,7 @@
=20
 <?php if (count($aAlumno) > 0) {
         if ($txt_apellido OR $txt_nombre) { ?>
-    Usted busco -<?php echo (($txt_apellido)?$txt_apellido:"")." ".(($tx=
t_nombre)?$txt_nombre:"") ?>-
+    Usted busc&oacute; -<?php echo (($txt_apellido)?$txt_apellido:"")." =
".(($txt_nombre)?$txt_nombre:"") ?>-
     <?php } ?>
 <h1>Alumnos</h1>
 <table cellspacing=3D"0" class=3D"sf_admin_list">
@@ -90,4 +90,4 @@
     <?php }=20
 }=20
 ?>
-</div>
\ No newline at end of file
+</div>


--=20
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que est=E1 limpio.
For all your IT requirements visit: http://www.transtec.co.uk




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