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
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/templates/cambiarSuccess.php prosistem/alba/trunk/alba/apps/principal/modules/seguridad/actions/actions.class.php prosistem/alba/trunk/alba/apps/principal/modules/turnos/actions/actions.class.php prosistem/alba/trunk/alba/apps/principal/modules/turnos/config/generator.yml prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_hora_fin.php prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_hora_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/actions/actions.class.php =================================================================== --- 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', '@homepage')); } - + + /** + * Elimino el ciclo lectivo si es el actual + * el usuario debe quedar con ciclolectivo "No seleccionado" + */ + public function executeDelete () { + + $this->ciclolectivo = CiclolectivoPeer::retrieveByPk($this->getRequestParameter('id')); + $this->forward404Unless($this->ciclolectivo); + + $this->deleteCiclolectivo($this->ciclolectivo); + if ($this->getUser()->getAttribute('fk_ciclolectivo_id') == $this->getRequestParameter('id')) { + $this->getUser()->setAttribute('fk_ciclolectivo_id',0); + $this->getUser()->setAttribute('ciclolectivo_descripcion','No seleccionado'); + } + return $this->redirect('ciclolectivo/list'); + } } -?> +?> \ No newline at end of file Modified: prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/templates/cambiarSuccess.php =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/templates/cambiarSuccess.php 2007-02-23 16:09:55 UTC (rev 4284) +++ prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/templates/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) != 0) :?> + <?php echo form_tag('ciclolectivo/actual')?> - <div align="center">Seleccione el Ciclo Lectivo para administrar - <br><br> - <?php echo select_tag('ciclolectivo',objects_for_select($cicloslectivos,'getId','getDescripcion',$sf_user->getAttribute('fk_ciclolectivo_id')))?> - <?php echo input_hidden_tag('referer', $referer) ?> - <br><br> - <?php echo submit_tag('Seleccionar')?> - </div> - -</form> \ No newline at end of file + <div align="center">Seleccione el Ciclo Lectivo para administrar + <br><br> + <?php echo select_tag('ciclolectivo',objects_for_select($cicloslectivos,'getId','getDescripcion',$sf_user->getAttribute('fk_ciclolectivo_id')))?> + <?php echo input_hidden_tag('referer', $referer) ?> + <br><br> + <?php echo submit_tag('Seleccionar')?> + </div> + + </form> +<?php else: ?> + <div>Todavía no ha creado un Ciclo Lectivo?. Haga click <?php echo link_to('aquí','ciclolectivo/list')?>.</div> +<?php endif;?> \ No newline at end of file Modified: prosistem/alba/trunk/alba/apps/principal/modules/seguridad/actions/actions.class.php =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/seguridad/actions/actions.class.php 2007-02-23 16:09:55 UTC (rev 4284) +++ prosistem/alba/trunk/alba/apps/principal/modules/seguridad/actions/actions.class.php 2007-02-23 16:54:12 UTC (rev 4285) @@ -1,4 +1,4 @@ -<?php +<?php /** * This file is part of Alba. * @@ -22,8 +22,8 @@ * Seguridad Acciones * * @package alba - * @author Jos� Luis Di Biase <[email protected]> - * @author H�ctor Sanchez <[email protected]> + * @author José Luis Di Biase <[email protected]> + * @author Héctor Sanchez <[email protected]> * @author Fernando Toledo <[email protected]> * @version SVN: $Id$ * @filesource @@ -105,8 +105,10 @@ return sfView::SUCCESS; } } - else + else { + $this->referer = $this->getRequest()->getReferer(); $this->getRequest()->getParameterHolder()->set('referer', $this->getRequest()->getReferer()); + } } /* cierre de session */ Modified: prosistem/alba/trunk/alba/apps/principal/modules/turnos/actions/actions.class.php =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/turnos/actions/actions.class.php 2007-02-23 16:09:55 UTC (rev 4284) +++ prosistem/alba/trunk/alba/apps/principal/modules/turnos/actions/actions.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 = $this->getRequestParameter('vista'); } @@ -43,7 +41,6 @@ function saveTurnos($turno) { $turno->setFkCiclolectivoId($this->getUser()->getAttribute('fk_ciclolectivo_id')); $turno->save(); - } protected function updateTurnosFromRequest() { @@ -62,51 +59,14 @@ } 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 = strlen($string); $x < $strlen; $x++) { + if ($strlen > strlen($string)) + for ($x = strlen($string); $x < $strlen; $x++) $string = '0' . $string; - } - } return $string; } - - public function executeEdit () - { - $this->turnos = $this->getTurnosOrCreate(); - $this->turnos->setFkCiclolectivoId($this->getUser()->getAttribute('fk_ciclolectivo_id')); - if ($this->getRequest()->getMethod() == sfRequest::POST) - { - $this->turnos = $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='.$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 =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/turnos/config/generator.yml 2007-02-23 16:09:55 UTC (rev 4284) +++ prosistem/alba/trunk/alba/apps/principal/modules/turnos/config/generator.yml 2007-02-23 16:54:12 UTC (rev 4285) @@ -13,7 +13,6 @@ list: title: Listado de Turnos display: [=descripcion, hora_inicio, hora_fin ] - object_actions: - _edit: - - _delete: - \ No newline at end of file + _edit: - + _delete: - Modified: prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_hora_fin.php =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_hora_fin.php 2007-02-23 16:09:55 UTC (rev 4284) +++ prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_hora_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' => false, '12hour_time' => true));?> \ No newline at end of file +<?php echo select_time_tag("turnos[hora_fin]", $turnos->getHoraFin(), array('include_second' => false, '12hour_time' => true));?> \ No newline at end of file Modified: prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_hora_inicio.php =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_hora_inicio.php 2007-02-23 16:09:55 UTC (rev 4284) +++ prosistem/alba/trunk/alba/apps/principal/modules/turnos/templates/_hora_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' => false, '12hour_time' => true));?> \ No newline at end of file +<?php echo select_time_tag("turnos[hora_inicio]", $turnos->getHoraInicio(), array('include_second' => false, '12hour_time' => true));?> \ No newline at end of file Modified: prosistem/alba/trunk/alba/apps/principal/modules/turnos/validate/edit.yml =================================================================== --- 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 =================================================================== --- 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->getAttribute('fk_ciclolectivo_id') == 0):?> - <div class="form-errors">No tiene un ciclo lectivo seleccionado.<br/> - Éste valor es requerido para algunos módulos, por favor seleccione uno. + <div class="form-errors"> + <ul> + <li>No tiene un ciclo lectivo seleccionado. Éste valor es requerido para algunos módulos, por favor seleccione uno. + </li> + </ul> </div> <?php endif;?> <br/>
participants (1)
-
commits@pressenter.com.ar