SVN Alba r4918 - in prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar: actions templates validate
Author: josx Date: 2007-08-06 15:33:21 -0300 (Mon, 06 Aug 2007) New Revision: 4918 Modified: prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/templates/_edit_form.php prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml Log: Mejora en la validacion del evento en los horarios escolares, aun existe error por bug en symfony ( igual a #203 ) Modified: prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php 2007-08-06 17:52:35 UTC (rev 4917) +++ prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/actions/actions.class.php 2007-08-06 18:33:21 UTC (rev 4918) @@ -142,7 +142,29 @@ 'horarioescolar{fk_horarioescolartipo_id}' => 'Tipo Horario Escolar:', 'horarioescolar{fk_turno_id}' => 'Turno:', 'horarioescolar{fk_evento_id}' => 'Evento:', + 'evento{fecha_inicio}' => 'Fecha inicio:', + 'evento{fecha_fin}' => 'Fecha fin:', + + ); } + + + public function handleErrorEdit() { + $this->preExecute(); + $this->horarioescolar = $this->getHorarioescolarOrCreate(); + $evento_generico = new miEvento(); + $this->evento = $evento_generico->getEventoOrCreate($this->horarioescolar->getFkEventoId()); + $this->evento = $evento_generico->updateEventoFromRequest($this->evento, $this->getRequestParameter('evento'), $this->getUser()->getCulture()); + $this->updateHorarioescolarFromRequest($this->evento->getId()); +//print_R($this->evento); + $this->labels = $this->getLabels(); + return sfView::SUCCESS; + } + + + + + } ?> Modified: prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/templates/_edit_form.php =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/templates/_edit_form.php 2007-08-06 17:52:35 UTC (rev 4917) +++ prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/templates/_edit_form.php 2007-08-06 18:33:21 UTC (rev 4918) @@ -2,7 +2,7 @@ // auto-generated by sfPropelAdmin // date: 2007/07/18 17:55:34 ?> -<?php echo form_tag('horarioescolar/save', array( +<?php echo form_tag('horarioescolar/edit', array( 'id' => 'sf_admin_edit_form', 'name' => 'sf_admin_edit_form', 'multipart' => true, Modified: prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml =================================================================== --- prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml 2007-08-06 17:52:35 UTC (rev 4917) +++ prosistem/alba/trunk/alba/apps/principal/modules/horarioescolar/validate/edit.yml 2007-08-06 18:33:21 UTC (rev 4918) @@ -4,7 +4,9 @@ - "horarioescolar{descripcion}" - "horarioescolar{fk_turno_id}" - "horarioescolar{fk_horarioescolartipo_id}" - + - "evento{fecha_inicio}" + - "evento{fecha_fin}" + fillin: enabled: on @@ -26,6 +28,16 @@ required: Yes required_msg: El campo tipo de horario escolar es obligatorio + evento{fecha_inicio}: + required: no + validators: firstDay + + evento{fecha_fin}: + required: no + validators: lastDay + + + caracteresMaximos255: class: sfStringValidator @@ -51,7 +63,7 @@ class: albaHorasValidator param: hora_error: El campo debe ser una hora - compare: horarioescolar[hora_fin] + compare: evento[hora_fin] operator: < compare_error: La hora de inicio debe ser anterior a la hora de fin @@ -59,6 +71,23 @@ class: albaHorasValidator param: hora_error: EL campo debe ser una hora - compare: horarioescolar[hora_inicio] + compare: evento[hora_inicio] operator: > compare_error: La hora de fin debe ser posterior a la hora de inicio + +firstDay: + class: albaDateValidator + param: + date_error: El campo debe ser una fecha + compare: evento[fecha_fin] + operator: <= + compare_error: La fecha inicio debe ser anterior a la fecha fin + +lastDay: + class: albaDateValidator + param: + date_error: EL campo debe ser una fecha + compare: evento[fecha_inicio] + operator: >= + compare_error: La fecha fin debe ser posterior a la fecha inicio +
participants (1)
-
commits@pressenter.com.ar