[Alba-desarrollo] SVN Alba r5120 - in
prosistem/alba/trunk/alba/apps/principal/modules/turno:
actions templates validate
commits en pressenter.com.ar
commits en pressenter.com.ar
Lun Sep 17 22:48:47 CEST 2007
Author: josx
Date: 2007-09-17 17:48:43 -0300 (Mon, 17 Sep 2007)
New Revision: 5120
Added:
prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_edit_actions.php
Modified:
prosistem/alba/trunk/alba/apps/principal/modules/turno/actions/actions.class.php
prosistem/alba/trunk/alba/apps/principal/modules/turno/validate/edit.yml
Log:
Saca botones para borrar si cuando no hay ciclo lectivo y se da un turno de alta. Ademas evito que grabe desde el codigo.
Modified: 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-09-17 20:47:58 UTC (rev 5119)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turno/actions/actions.class.php 2007-09-17 20:48:43 UTC (rev 5120)
@@ -30,17 +30,17 @@
* @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();
+ if($this->getUser()->getAttribute('fk_ciclolectivo_id') != 0) {
+ $turno->setFkCiclolectivoId($this->getUser()->getAttribute('fk_ciclolectivo_id'));
+ $turno->save();
+ }
}
protected function updateTurnoFromRequest() {
@@ -62,6 +62,7 @@
$this->turno->setHoraFin($turno['hora_fin']);
}
}
+
function _add_zeros($string, $strlen) {
if ($strlen > strlen($string)) {
for ($x = strlen($string); $x < $strlen; $x++) {
Added: prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_edit_actions.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_edit_actions.php 2007-09-17 20:47:58 UTC (rev 5119)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_edit_actions.php 2007-09-17 20:48:43 UTC (rev 5120)
@@ -0,0 +1,21 @@
+<?php
+// auto-generated by sfPropelAdmin
+// date: 2007/09/17 17:05:20
+?>
+<ul class="sf_admin_actions">
+ <li><?php echo button_to(__('list'), 'turno/list?id='.$turno->getId(), array (
+ 'class' => 'sf_admin_action_list',
+)) ?></li>
+
+<?php if ($sf_user->isAuthenticated() && $sf_user->getAttribute('fk_ciclolectivo_id') != 0):?>
+ <li><?php echo submit_tag(__('save'), array (
+ 'name' => 'save',
+ 'class' => 'sf_admin_action_save',
+)) ?></li>
+ <li><?php echo submit_tag(__('save and add'), array (
+ 'name' => 'save_and_add',
+ 'class' => 'sf_admin_action_save_and_add',
+)) ?></li>
+<?php endif;?>
+
+</ul>
Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/turno/templates/_edit_actions.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
Modified: prosistem/alba/trunk/alba/apps/principal/modules/turno/validate/edit.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/turno/validate/edit.yml 2007-09-17 20:47:58 UTC (rev 5119)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turno/validate/edit.yml 2007-09-17 20:48:43 UTC (rev 5120)
@@ -24,6 +24,7 @@
required_msg: El campo descripción es obligatorio
validators: caracteresMaximos255
+
caracteresMaximos255:
class: sfStringValidator
param:
Más información sobre la lista de distribución Alba-desarrollo