[Alba-desarrollo] SVN Alba r4257 - in prosistem/alba/trunk/alba/apps/principal/modules: cuenta/actions cuenta/config cuenta/templates cuenta/validate relAlumnoDivision/templates turnos/actions

commits en pressenter.com.ar commits en pressenter.com.ar
Mie Feb 21 19:24:29 CET 2007


Author: ftoledo
Date: 2007-02-21 15:24:11 -0300 (Wed, 21 Feb 2007)
New Revision: 4257

Added:
   prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_fk_provincia_id.php
   prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_pais_id.php
   prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/cambiarPaisSuccess.php
   prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_filtro_fk_alumno_id.php
   prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_filtro_fk_division_id.php
Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/cuenta/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/cuenta/config/generator.yml
   prosistem/alba/trunk/alba/apps/principal/modules/cuenta/validate/edit.yml
   prosistem/alba/trunk/alba/apps/principal/modules/turnos/actions/actions.class.php
Log:
select likeados con ajax en cuenta pais+provincia


Modified: prosistem/alba/trunk/alba/apps/principal/modules/cuenta/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/cuenta/actions/actions.class.php	2007-02-21 15:08:12 UTC (rev 4256)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/actions/actions.class.php	2007-02-21 18:24:11 UTC (rev 4257)
@@ -71,6 +71,12 @@
     }                                                                                     
   }
 
+    public function executeCambiarPais() {
+        $pais_id = $this->getRequestParameter('pais_id');
+        $c = new Criteria();
+        $c->add(ProvinciaPeer::FK_PAIS_ID,$pais_id);
+        $this->provincias = ProvinciaPeer::doSelect($c);
+    }
 }
 
 ?>

Modified: prosistem/alba/trunk/alba/apps/principal/modules/cuenta/config/generator.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/cuenta/config/generator.yml	2007-02-21 15:08:12 UTC (rev 4256)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/config/generator.yml	2007-02-21 18:24:11 UTC (rev 4257)
@@ -25,9 +25,9 @@
                 
       edit:
             title: " "
-            fields:
-                 fk_provincia_id:   { params: include_custom=>>Seleccione una Provincia<<}
-                 fk_tipoiva_id:   { params: include_custom=>>Seleccione una Categoia de IVA<<}
+            fields: 
+                pais_id: {name: País }
+            display: [ nombre, razon_social, cuit, direccion, ciudad, codigo_postal, _pais_id, _fk_provincia_id,  fk_tipoiva_id, telefono ]
             actions:
                 _delete: -
                 _save: -

Added: prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_fk_provincia_id.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_fk_provincia_id.php	2007-02-21 15:08:12 UTC (rev 4256)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_fk_provincia_id.php	2007-02-21 18:24:11 UTC (rev 4257)
@@ -0,0 +1,8 @@
+<div id="item_provincia">
+<?php 
+    echo object_select_tag($cuenta, 'getFkProvinciaId', array (
+    'related_class' => 'Provincia',
+    'control_name' => 'cuenta[fk_provincia_id]',
+    )) 
+?>
+</div>
\ No newline at end of file


Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_fk_provincia_id.php
___________________________________________________________________
Name: svn:keywords
   + Id Date Author Rev URL

Added: prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_pais_id.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_pais_id.php	2007-02-21 15:08:12 UTC (rev 4256)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_pais_id.php	2007-02-21 18:24:11 UTC (rev 4257)
@@ -0,0 +1,17 @@
+<?php
+    use_helper('Javascript');
+    
+    $c = new Criteria();
+    $paises = PaisPeer::doSelect($c);
+    if ($cuenta->getFkProvinciaId())
+        $pais_selected = $cuenta->getProvincia()->getPais()->getId();
+    else
+        $pais_selected = 0;
+        
+    echo select_tag('pais_id',objects_for_select($paises,'getId','getNombreLargo',$pais_selected));
+    
+    echo observe_field('pais_id', array(
+        'update'   => 'item_provincia',
+        'url'      => 'cuenta/cambiarPais?vista=noMuestraMenu',
+        'with'     => "'pais_id=' + value"));
+?>
\ No newline at end of file


Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_pais_id.php
___________________________________________________________________
Name: svn:keywords
   + Id Date Author Rev URL

Added: prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/cambiarPaisSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/cambiarPaisSuccess.php	2007-02-21 15:08:12 UTC (rev 4256)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/cambiarPaisSuccess.php	2007-02-21 18:24:11 UTC (rev 4257)
@@ -0,0 +1,9 @@
+<?php
+    use_helper("Object");
+?>
+<div id="item_provincia">
+<?php 
+    echo select_tag('cuenta[fk_provincia_id]',objects_for_select($provincias,'getId','getNombreLargo'),array(
+    'control_name' => 'cuenta[fk_provincia_id]'));
+?>
+</div>
\ No newline at end of file


Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/cambiarPaisSuccess.php
___________________________________________________________________
Name: svn:keywords
   + Id Date Author Rev URL

Modified: prosistem/alba/trunk/alba/apps/principal/modules/cuenta/validate/edit.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/cuenta/validate/edit.yml	2007-02-21 15:08:12 UTC (rev 4256)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/validate/edit.yml	2007-02-21 18:24:11 UTC (rev 4257)
@@ -7,6 +7,7 @@
     - "cuenta{ciudad}"    
     - "cuenta{codigo_postal}"
     - "cuenta{telefono}"    
+    - "cuenta{fk_provincia_id}"    
     
 fillin:
     enabled:       on
@@ -46,6 +47,11 @@
     cuenta{telefono}:
         required:     No
         validators: caracteresMaximos20
+
+    cuenta{fk_provincia_id}:
+        required:     Yes
+        required_msg: El campo provincia es obligatorio
+        validators: validar_fk_provincia_id
         
         
 caracteresMaximos20:
@@ -61,4 +67,10 @@
         max: 128
         max_error: La maxima cantidad de caracteres permitida es de 128
         
+validar_fk_provincia_id:
+    class:  sfNumberValidator
+    param:
+        nan_error: Seleccione una provincia v&aacute;lida
+        min: 1
+        min_error: Seleccione una provincia v&aacute;lida
         
\ No newline at end of file

Added: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_filtro_fk_alumno_id.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_filtro_fk_alumno_id.php	2007-02-21 15:08:12 UTC (rev 4256)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_filtro_fk_alumno_id.php	2007-02-21 18:24:11 UTC (rev 4257)
@@ -0,0 +1,13 @@
+<?php 
+    $c = new Criteria(); 
+    $c->add(AlumnoPeer::FK_ESTABLECIMIENTO_ID, $sf_user->getAttribute('fk_establecimiento_id'));    
+    $c->addAscendingOrderByColumn(AlumnoPeer::APELLIDO);
+    $c->addAscendingOrderByColumn(AlumnoPeer::NOMBRE);
+    $alumnos = AlumnoPeer::doSelect($c);
+    $optionsAlumnos = array();
+    $optionsAlumnos[""] = "";   
+    foreach ($alumnos as $alumno) {
+        $optionsAlumnos[$alumno->getId()] = $alumno->getApellido() . ", " . $alumno->getNombre();
+    }
+    echo select_tag('filters[fk_alumno_id]', options_for_select($optionsAlumnos,isset($filters['fk_alunmo_id']) ? $filters['fk_alumno_id'] : ''));
+?>


Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_filtro_fk_alumno_id.php
___________________________________________________________________
Name: svn:keywords
   + Id Date Author Rev URL

Added: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_filtro_fk_division_id.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_filtro_fk_division_id.php	2007-02-21 15:08:12 UTC (rev 4256)
+++ prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_filtro_fk_division_id.php	2007-02-21 18:24:11 UTC (rev 4257)
@@ -0,0 +1,17 @@
+<?php 
+    $c = new Criteria(); 
+    $c->add(AnioPeer::FK_ESTABLECIMIENTO_ID, $sf_user->getAttribute('fk_establecimiento_id'));    
+    $c->add(TurnosPeer::FK_CICLOLECTIVO_ID, $sf_user->getAttribute('fk_ciclolectivo_id'));
+    $c->addJoin(AnioPeer::ID,DivisionPeer::FK_ANIO_ID);
+    $c->addJoin(TurnosPeer::ID,DivisionPeer::FK_TURNOS_ID);
+    
+    //$c->addAscendingOrderByColumn(AlumnoPeer::APELLIDO);
+    //$c->addAscendingOrderByColumn(AlumnoPeer::NOMBRE);
+    $divisiones = DivisionPeer::doSelect($c);
+    $optionsDivisiones = array();
+    $optionsDivisiones[""] = "";   
+    foreach ($divisiones as $division) {
+        $optionsDivisiones[$division->getId()] = $division->getAnio()->getDescripcion(). " / " . $division->getDescripcion();
+    }
+    echo select_tag('filters[fk_division_id]', options_for_select($optionsDivisiones)) ;
+?>


Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/relAlumnoDivision/templates/_filtro_fk_division_id.php
___________________________________________________________________
Name: svn:keywords
   + Id Date Author Rev URL

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-21 15:08:12 UTC (rev 4256)
+++ prosistem/alba/trunk/alba/apps/principal/modules/turnos/actions/actions.class.php	2007-02-21 18:24:11 UTC (rev 4257)
@@ -1,4 +1,4 @@
-<?php
+<?php
 /**
  *    This file is part of Alba.
  * 
@@ -46,7 +46,6 @@
     
     }
 
-
     protected function updateTurnosFromRequest()  {
     
         $turnos = $this->getRequestParameter('turnos');
@@ -54,9 +53,6 @@
         $turnos['hora_inicio'] = $this->_add_zeros($turnos['hora_inicio']['hour'],2).":".$this->_add_zeros($turnos['hora_inicio']['minute'],2)." ".$turnos['hora_inicio']['ampm'];
         $turnos['hora_fin']= $this->_add_zeros($turnos['hora_fin']['hour'],2).":".$this->_add_zeros($turnos['hora_fin']['minute'],2)." ".$turnos['hora_fin']['ampm'];
 
-
-
-
         if (isset($turnos['descripcion']))    {
             $this->turnos->setDescripcion($turnos['descripcion']);
         }
@@ -79,7 +75,38 @@
         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




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