[Alba-desarrollo] SVN Alba r4285 - in prosistem/alba/trunk/alba/apps/principal: modules/ciclolectivo/actions modules/ciclolectivo/templates modules/seguridad/actions modules/turnos/actions modules/turnos/config modules/turnos/templates modules/turnos/validate templates

commits en pressenter.com.ar commits en pressenter.com.ar
Vie Feb 23 17:54:15 CET 2007


Author: ftoledo
Date: 2007-02-23 13:54:12 -0300 (Fri, 23 Feb 2007)
New Revision: 4285

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/actions/=
actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/template=
s/cambiarSuccess.php
   prosistem/alba/trunk/alba/apps/principal/modules/seguridad/actions/act=
ions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/turnos/actions/action=
s.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/turnos/config/generat=
or.yml
   prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_hor=
a_fin.php
   prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_hor=
a_inicio.php
   prosistem/alba/trunk/alba/apps/principal/modules/turnos/validate/edit.=
yml
   prosistem/alba/trunk/alba/apps/principal/templates/layout.php
Log:
validando ciclo lectivo y turnos

Modified: prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/a=
ctions/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/ciclolectivo/actions=
/actions.class.php	2007-02-23 16:09:55 UTC (rev 4284)
+++ prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/actions=
/actions.class.php	2007-02-23 16:54:12 UTC (rev 4285)
@@ -254,7 +254,23 @@
         return $this->redirect($this->getRequestParameter('referer', '@h=
omepage'));
   =20
     }
-   =20
+
+    /**
+    * Elimino el ciclo lectivo si es el actual=20
+    * el usuario debe quedar con ciclolectivo "No seleccionado"
+    */
+    public function executeDelete () {
+      =20
+        $this->ciclolectivo =3D CiclolectivoPeer::retrieveByPk($this->ge=
tRequestParameter('id'));
+        $this->forward404Unless($this->ciclolectivo);
+        =20
+        $this->deleteCiclolectivo($this->ciclolectivo);
+        if ($this->getUser()->getAttribute('fk_ciclolectivo_id') =3D=3D =
$this->getRequestParameter('id')) {
+            $this->getUser()->setAttribute('fk_ciclolectivo_id',0);
+            $this->getUser()->setAttribute('ciclolectivo_descripcion','N=
o seleccionado');
+        }
+        return $this->redirect('ciclolectivo/list');
+    }
 }
=20
-?>
+?>
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/t=
emplates/cambiarSuccess.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/ciclolectivo/templat=
es/cambiarSuccess.php	2007-02-23 16:09:55 UTC (rev 4284)
+++ prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/templat=
es/cambiarSuccess.php	2007-02-23 16:54:12 UTC (rev 4285)
@@ -1,12 +1,16 @@
 <?php use_helper('Object')?>
-<?php echo form_tag('ciclolectivo/actual')?>
+<?php if (count($cicloslectivos) !=3D 0) :?>
+    <?php echo form_tag('ciclolectivo/actual')?>
=20
-    <div align=3D"center">Seleccione el Ciclo Lectivo para administrar
-    <br><br>
-    <?php echo select_tag('ciclolectivo',objects_for_select($cicloslecti=
vos,'getId','getDescripcion',$sf_user->getAttribute('fk_ciclolectivo_id')=
))?>
-    <?php echo input_hidden_tag('referer', $referer) ?>
-    <br><br>
-    <?php echo submit_tag('Seleccionar')?>
-    </div>
-   =20
-</form>
\ No newline at end of file
+        <div align=3D"center">Seleccione el Ciclo Lectivo para administr=
ar
+        <br><br>
+        <?php echo select_tag('ciclolectivo',objects_for_select($ciclosl=
ectivos,'getId','getDescripcion',$sf_user->getAttribute('fk_ciclolectivo_=
id')))?>
+        <?php echo input_hidden_tag('referer', $referer) ?>
+        <br><br>
+        <?php echo submit_tag('Seleccionar')?>
+        </div>
+       =20
+    </form>
+<?php else: ?>
+    <div>Todav&iacute;a no ha creado un Ciclo Lectivo?. Haga click <?php=
 echo link_to('aqu&iacute;','ciclolectivo/list')?>.</div>
+<?php endif;?>
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/apps/principal/modules/seguridad/acti=
ons/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/seguridad/actions/ac=
tions.class.php	2007-02-23 16:09:55 UTC (rev 4284)
+++ prosistem/alba/trunk/alba/apps/principal/modules/seguridad/actions/ac=
tions.class.php	2007-02-23 16:54:12 UTC (rev 4285)
@@ -1,4 +1,4 @@
-<?php
+=EF=BB=BF<?php
 /**
  *    This file is part of Alba.
  *=20
@@ -22,8 +22,8 @@
  * Seguridad Acciones
  *
  * @package    alba
- * @author     Jos=E9 Luis Di Biase <josx en interorganic.com.ar>
- * @author     H=E9ctor Sanchez <hsanchez en pressenter.com.ar>
+ * @author     Jos=C3=A9 Luis Di Biase <josx en interorganic.com.ar>
+ * @author     H=C3=A9ctor Sanchez <hsanchez en pressenter.com.ar>
  * @author     Fernando Toledo <ftoledo en pressenter.com.ar>
  * @version    SVN: $Id$
  * @filesource
@@ -105,8 +105,10 @@
                 return sfView::SUCCESS;
             }
         }
-        else
+        else {
+            $this->referer =3D  $this->getRequest()->getReferer();  =20
             $this->getRequest()->getParameterHolder()->set('referer', $t=
his->getRequest()->getReferer());
+        }
     } =20
    =20
     /* cierre de session */

Modified: prosistem/alba/trunk/alba/apps/principal/modules/turnos/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/turnos/actions/actio=
ns.class.php	2007-02-23 16:09:55 UTC (rev 4284)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turnos/actions/actio=
ns.class.php	2007-02-23 16:54:12 UTC (rev 4285)
@@ -29,9 +29,7 @@
  * @filesource
  * @license GPL
  */
-
-class turnosActions extends autoturnosActions
-{
+class turnosActions extends autoturnosActions {
     public function preExecute() {
         $this->vista =3D $this->getRequestParameter('vista');
     }
@@ -43,7 +41,6 @@
     function saveTurnos($turno) {
         $turno->setFkCiclolectivoId($this->getUser()->getAttribute('fk_c=
iclolectivo_id'));
         $turno->save();
-   =20
     }
=20
     protected function updateTurnosFromRequest()  {
@@ -62,51 +59,14 @@
         }
        =20
         if (isset($turnos['hora_fin'])) {
-        $this->turnos->setHoraFin($turnos['hora_fin']);
+            $this->turnos->setHoraFin($turnos['hora_fin']);
         }
-  }
-
+    }
     function _add_zeros($string, $strlen) {
-        if ($strlen > strlen($string))  {
-            for ($x =3D strlen($string); $x < $strlen; $x++) {
+        if ($strlen > strlen($string))
+            for ($x =3D strlen($string); $x < $strlen; $x++)
                 $string =3D '0' . $string;
-            }
-        }
         return $string;
     }
-
- public function executeEdit ()
-  {
-    $this->turnos =3D $this->getTurnosOrCreate();
-    $this->turnos->setFkCiclolectivoId($this->getUser()->getAttribute('f=
k_ciclolectivo_id'));
-    if ($this->getRequest()->getMethod() =3D=3D sfRequest::POST)
-    {
-      $this->turnos =3D $this->getTurnosOrCreate();
-
-      $this->updateTurnosFromRequest();
-
-      $this->saveTurnos($this->turnos);
-
-      $this->setFlash('notice', 'Your modifications have been saved');
-
-      if ($this->getRequestParameter('save_and_add'))
-      {
-        return $this->redirect('turnos/create');
-      }
-      else
-      {
-        return $this->redirect('turnos/edit?id=3D'.$this->turnos->getId(=
));
-      }
-    }
-    else
-    {
-      // add javascripts
-      $this->getResponse()->addJavascript('/sf/js/prototype/prototype');
-      $this->getResponse()->addJavascript('/sf/js/sf_admin/collapse');
-    }
-  }
-
-
 }
-
 ?>
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/apps/principal/modules/turnos/config/=
generator.yml
=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/turnos/config/genera=
tor.yml	2007-02-23 16:09:55 UTC (rev 4284)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turnos/config/genera=
tor.yml	2007-02-23 16:54:12 UTC (rev 4285)
@@ -13,7 +13,6 @@
     list:
         title: Listado de Turnos
         display: [=3Ddescripcion, hora_inicio, hora_fin ]
-       =20
         object_actions:
-                         _edit:  -
-                         _delete: -
\ No newline at end of file
+            _edit:  -
+            _delete: -

Modified: prosistem/alba/trunk/alba/apps/principal/modules/turnos/templat=
es/_hora_fin.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/turnos/templates/_ho=
ra_fin.php	2007-02-23 16:09:55 UTC (rev 4284)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_ho=
ra_fin.php	2007-02-23 16:54:12 UTC (rev 4285)
@@ -1 +1 @@
-<?echo select_time_tag("turnos[hora_fin]", $turnos->getHoraFin(), array(=
'include_second' =3D> false, '12hour_time' =3D> true));?>
\ No newline at end of file
+<?php echo select_time_tag("turnos[hora_fin]", $turnos->getHoraFin(), ar=
ray('include_second' =3D> false, '12hour_time' =3D> true));?>
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/apps/principal/modules/turnos/templat=
es/_hora_inicio.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/turnos/templates/_ho=
ra_inicio.php	2007-02-23 16:09:55 UTC (rev 4284)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_ho=
ra_inicio.php	2007-02-23 16:54:12 UTC (rev 4285)
@@ -1 +1 @@
-<?echo select_time_tag("turnos[hora_inicio]", $turnos->getHoraInicio(), =
array('include_second' =3D> false, '12hour_time' =3D> true));?>
\ No newline at end of file
+<?php echo select_time_tag("turnos[hora_inicio]", $turnos->getHoraInicio=
(), array('include_second' =3D> false, '12hour_time' =3D> true));?>
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/apps/principal/modules/turnos/validat=
e/edit.yml
=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/turnos/validate/edit=
.yml	2007-02-23 16:09:55 UTC (rev 4284)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turnos/validate/edit=
.yml	2007-02-23 16:54:12 UTC (rev 4285)
@@ -28,5 +28,3 @@
     param:
         max: 255
         max_error: La maxima cantidad de caracteres permitida es de 255
-
-

Modified: prosistem/alba/trunk/alba/apps/principal/templates/layout.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/templates/layout.php	2007-02=
-23 16:09:55 UTC (rev 4284)
+++ prosistem/alba/trunk/alba/apps/principal/templates/layout.php	2007-02=
-23 16:54:12 UTC (rev 4285)
@@ -136,8 +136,11 @@
                     ?>
                     </div>
                     <?php if ($sf_user->isAuthenticated() && $sf_user->g=
etAttribute('fk_ciclolectivo_id') =3D=3D 0):?>
-                    <div class=3D"form-errors">No tiene un ciclo lectivo=
 seleccionado.<br/>
-                    &Eacute;ste valor es requerido para algunos m&oacute=
;dulos, por favor seleccione uno.
+                    <div class=3D"form-errors">
+                        <ul>
+                            <li>No tiene un ciclo lectivo seleccionado. =
&Eacute;ste valor es requerido para algunos m&oacute;dulos, por favor sel=
eccione uno.
+                            </li>
+                        </ul>
                     </div>
                     <?php endif;?>
                     <br/>




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