[Alba-desarrollo] SVN Alba r4897 - in prosistem/alba/trunk/alba/apps/principal/modules: . turno turno/actions turno/config turno/templates turno/validate

commits en pressenter.com.ar commits en pressenter.com.ar
Mie Ago 1 21:48:58 CEST 2007


Author: sabino
Date: 2007-08-01 16:48:57 -0300 (Wed, 01 Aug 2007)
New Revision: 4897

Added:
   prosistem/alba/trunk/alba/apps/principal/modules/turno/
   prosistem/alba/trunk/alba/apps/principal/modules/turno/actions/
   prosistem/alba/trunk/alba/apps/principal/modules/turno/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/turno/config/
   prosistem/alba/trunk/alba/apps/principal/modules/turno/config/generator.yml
   prosistem/alba/trunk/alba/apps/principal/modules/turno/config/security.yml
   prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/
   prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_hora_fin.php
   prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_hora_inicio.php
   prosistem/alba/trunk/alba/apps/principal/modules/turno/validate/
   prosistem/alba/trunk/alba/apps/principal/modules/turno/validate/edit.yml
Removed:
   prosistem/alba/trunk/alba/apps/principal/modules/turnos/
Log:
cambio de nibre del drectorio turnos a turno


Added: prosistem/alba/trunk/alba/apps/principal/modules/turno/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/turno/actions/actions.class.php	2007-08-01 19:48:03 UTC (rev 4896)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turno/actions/actions.class.php	2007-08-01 19:48:57 UTC (rev 4897)
@@ -0,0 +1,74 @@
+<?php
+/**
+ *    This file is part of Alba.
+ * 
+ *    Alba is free software; you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation; either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    Alba is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with Alba; if not, write to the Free Software
+ *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+
+/**
+ * Turno Acciones
+ *
+ * @package    alba
+ * @author     José Luis Di Biase <josx en interorganic.com.ar>
+ * @author     Héctor Sanchez <hsanchez en pressenter.com.ar>
+ * @author     Fernando Toledo <ftoledo en pressenter.com.ar>
+ * @version    SVN: $Id: actions.class.php 4346 2007-02-28 20:20:23Z ftoledo $
+ * @filesource
+ * @license GPL
+ */
+class turnoActions extends autoturnoActions {
+    public function preExecute() {
+        $this->vista = $this->getRequestParameter('vista');
+    }
+    
+    function addFiltersCriteria($c) {
+        $c->add(TurnoPeer::FK_CICLOLECTIVO_ID,$this->getUser()->getAttribute('fk_ciclolectivo_id'));
+    }
+    
+    function saveTurno($turno) {
+        $turno->setFkCiclolectivoId($this->getUser()->getAttribute('fk_ciclolectivo_id'));
+        $turno->save();
+    }
+
+    protected function updateTurnoFromRequest()  {
+    
+        $turno = $this->getRequestParameter('turno');
+    
+        $turno['hora_inicio'] = $this->_add_zeros($turno['hora_inicio']['hour'],2).":".$this->_add_zeros($turno['hora_inicio']['minute'],2)." ".$turno['hora_inicio']['ampm'];
+        $turno['hora_fin']= $this->_add_zeros($turno['hora_fin']['hour'],2).":".$this->_add_zeros($turno['hora_fin']['minute'],2)." ".$turno['hora_fin']['ampm'];
+
+        if (isset($turno['descripcion']))    {
+            $this->turno->setDescripcion($turno['descripcion']);
+        }
+    
+        if (isset($turno['hora_inicio'])) {
+            $this->turno->setHoraInicio($turno['hora_inicio']);
+        }
+        
+        if (isset($turno['hora_fin'])) {
+            $this->turno->setHoraFin($turno['hora_fin']);
+        }
+    }
+    function _add_zeros($string, $strlen) {
+        if ($strlen > strlen($string)) {
+            for ($x = strlen($string); $x < $strlen; $x++) {
+                $string = '0' . $string;
+            }
+        }
+        return $string;
+    }
+}
+?>
\ No newline at end of file

Added: prosistem/alba/trunk/alba/apps/principal/modules/turno/config/generator.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/turno/config/generator.yml	2007-08-01 19:48:03 UTC (rev 4896)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turno/config/generator.yml	2007-08-01 19:48:57 UTC (rev 4897)
@@ -0,0 +1,18 @@
+generator:
+    class: sfPropelAdminGenerator
+    param:
+        model_class:      Turno
+        theme:            default
+        fields:
+            descripcion: { name: Descripcion , params: size=64}
+            hora_inicio: { name: Hora Inicio }
+            hora_fin: { name: Hora Fin }
+        edit:
+            title: Turno
+            display: [descripcion, _hora_inicio, _hora_fin ]
+        list:
+            title: Listado de Turnos
+            display: [=descripcion, hora_inicio, hora_fin ]
+            object_actions:
+                _edit: -
+                _delete: -

Added: prosistem/alba/trunk/alba/apps/principal/modules/turno/config/security.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/turno/config/security.yml	2007-08-01 19:48:03 UTC (rev 4896)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turno/config/security.yml	2007-08-01 19:48:57 UTC (rev 4897)
@@ -0,0 +1,3 @@
+all:
+    is_secure: on
+    credentials: turno
\ No newline at end of file

Added: prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_hora_fin.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_hora_fin.php	2007-08-01 19:48:03 UTC (rev 4896)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_hora_fin.php	2007-08-01 19:48:57 UTC (rev 4897)
@@ -0,0 +1,3 @@
+<?php use_helper('DateForm') ?>
+
+<?php echo select_time_tag("turno[hora_fin]", $turno->getHoraFin(), array('include_second' => false, '12hour_time' => true));?>
\ No newline at end of file

Added: prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_hora_inicio.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_hora_inicio.php	2007-08-01 19:48:03 UTC (rev 4896)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_hora_inicio.php	2007-08-01 19:48:57 UTC (rev 4897)
@@ -0,0 +1,3 @@
+<?php use_helper('DateForm') ?>
+
+<?php echo select_time_tag("turno[hora_inicio]", $turno->getHoraInicio(), array('include_second' => false, '12hour_time' => true));?>
\ No newline at end of file

Added: prosistem/alba/trunk/alba/apps/principal/modules/turno/validate/edit.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/turno/validate/edit.yml	2007-08-01 19:48:03 UTC (rev 4896)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turno/validate/edit.yml	2007-08-01 19:48:57 UTC (rev 4897)
@@ -0,0 +1,47 @@
+methods:
+    post:       
+        - "turno{hora_inicio}"
+        - "turno{hora_fin}"
+        - "turno{descripcion}"    
+    
+fillin:
+    enabled:       on
+
+names:
+
+    turno{hora_inicio}:
+        required:     Yes
+        required_msg: El campo hora inicio es obligatorio
+        validators: horaInicio
+
+    turno{hora_fin}:
+        required:     Yes
+        required_msg: El campo hora fin  es obligatorio
+        validators: horaFin
+        
+    turno{descripcion}:
+        required:     Yes
+        required_msg: El campo descripci&oacute;n es obligatorio
+        validators: caracteresMaximos255
+
+caracteresMaximos255:
+    class:  sfStringValidator
+    param:
+        max: 255
+        max_error: La maxima cantidad de caracteres permitida es de 255
+
+horaInicio:
+    class:           albaHorasValidator
+    param:
+      hora_error:    El campo debe ser una hora
+      compare:       turno[hora_fin]
+      operator:      <
+      compare_error: La hora de inicio debe ser anterior a la hora de fin
+                    
+horaFin:
+    class:           albaHorasValidator
+    param:
+        hora_error:    EL campo debe ser una hora
+        compare:       turno[hora_inicio]
+        operator:      >
+        compare_error: La hora de fin debe ser posterior a la hora de inicio




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