[Alba-desarrollo] SVN Alba r4498 - in prosistem/alba/trunk/alba/apps/principal/modules/responsable: actions config templates

commits en pressenter.com.ar commits en pressenter.com.ar
Lun Mar 19 19:48:34 CET 2007


Author: ftoledo
Date: 2007-03-19 15:48:33 -0300 (Mon, 19 Mar 2007)
New Revision: 4498

Added:
   prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/_pais_id.php
   prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/cambiarPaisSuccess.php
Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/responsable/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/responsable/config/generator.yml
   prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/editSuccess.php
Log:
provincia + pais enlazados con ajax



Modified: prosistem/alba/trunk/alba/apps/principal/modules/responsable/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/responsable/actions/actions.class.php	2007-03-19 18:36:28 UTC (rev 4497)
+++ prosistem/alba/trunk/alba/apps/principal/modules/responsable/actions/actions.class.php	2007-03-19 18:48:33 UTC (rev 4498)
@@ -147,7 +147,7 @@
     $this->responsable->setAutorizacionRetiro(isset($responsable['autorizacion_retiro']) ? $responsable['autorizacion_retiro'] : 0);
   }
   
-    function executeIrCuenta() {
+    public function executeIrCuenta() {
         //Obtener el id de cuenta.
   
         $c = new Criteria();
@@ -155,6 +155,14 @@
         $Resp = ResponsablePeer::doSelectOne($c);
         return $this->redirect('cuenta/verCompleta?id='.$Resp->getFkCuentaId());
     }   
+
+    public function executeCambiarPais() {
+        $this->pais_id = $this->getRequestParameter('pais_id');
+        $this->provincia_id = $this->getRequestParameter('provincia_id');
+        $c = new Criteria();
+        $c->add(ProvinciaPeer::FK_PAIS_ID, $this->pais_id);
+        $this->provincias = ProvinciaPeer::getEnOrden($c);
+    }                                      
 }  
 
-?>
+?>
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/apps/principal/modules/responsable/config/generator.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/responsable/config/generator.yml	2007-03-19 18:36:28 UTC (rev 4497)
+++ prosistem/alba/trunk/alba/apps/principal/modules/responsable/config/generator.yml	2007-03-19 18:48:33 UTC (rev 4498)
@@ -31,11 +31,11 @@
       edit:
         title: Editar Responsable
         fields:
-            fk_cuenta_id:   { params: include_custom=--Selecciones un Cuenta--}
+            fk_cuenta_id:   { params: include_custom=>>Selecciones un Cuenta<<}
             fk_provincia_id:   { params: include_custom=--Selecciones una Provincia--}
         display:
                 "Informaci&oacute;n general":  [apellido, nombre, _sexo, fk_tipodocumento_id, nro_documento]
-                "Donde vive": [direccion, ciudad, fk_provincia_id, codigo_postal ]
+                "Donde vive": [direccion, ciudad, _pais_id, _fk_provincia_id, codigo_postal ]
                 "Otros":  [ telefono, telefono_movil, email, relacion, observacion,  autorizacion_retiro]
         actions:
           _delete: -

Added: prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/_pais_id.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/_pais_id.php	2007-03-19 18:36:28 UTC (rev 4497)
+++ prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/_pais_id.php	2007-03-19 18:48:33 UTC (rev 4498)
@@ -0,0 +1,28 @@
+<?php
+    use_helper('Javascript');
+    
+    $c = new Criteria();
+    $paises = PaisPeer::doSelect($c);
+    if ($responsable->getFkProvinciaId()) {
+        $pais_selected = $responsable->getProvincia()->getPais()->getId();
+        $provincia_id = $responsable->getFkProvinciaId();
+    } else {
+        $pais_selected = $paises[0]->getId();
+        $provincia_id = 0;
+    }
+        
+    echo select_tag('pais_id',objects_for_select($paises,'getId','getNombreLargo',$pais_selected));
+    
+    echo observe_field('pais_id', array(
+        'update'   => 'item_provincia',
+        'url'      => 'responsable/cambiarPais?vista=noMuestraMenu',
+        'with'     => "'pais_id=' + value"));
+        
+        echo javascript_tag(
+            remote_function( array(
+            'update'  => 'item_provincia',
+            'url'     => 'responsable/cambiarPais?vista=noMuestraMenu&pais_id='. $pais_selected . '&provincia_id=' . $provincia_id,
+            ))
+         ); 
+    
+?>
\ No newline at end of file


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

Added: prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/cambiarPaisSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/cambiarPaisSuccess.php	2007-03-19 18:36:28 UTC (rev 4497)
+++ prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/cambiarPaisSuccess.php	2007-03-19 18:48:33 UTC (rev 4498)
@@ -0,0 +1,8 @@
+<?php
+    use_helper("Object");
+?>
+<div id="item_provincia">
+<?php 
+    echo select_tag('responsable[fk_provincia_id]', objects_for_select($provincias, 'getId','getNombreLargo',$provincia_id), array('control_name' => 'responsable[fk_provincia_id]'));
+?>
+</div>
\ No newline at end of file


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

Modified: prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/editSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/editSuccess.php	2007-03-19 18:36:28 UTC (rev 4497)
+++ prosistem/alba/trunk/alba/apps/principal/modules/responsable/templates/editSuccess.php	2007-03-19 18:48:33 UTC (rev 4498)
@@ -160,18 +160,19 @@
     </div>
 </div>
 
+
 <div class="form-row">
+    <?php echo label_for('responsable[fk_pais_id]', __('Pais:'), 'class="required" ') ?>
+    <?php include_partial('pais_id',array('responsable' => $responsable))?>
+</div>
+
+<div class="form-row">
   <?php echo label_for('responsable[fk_provincia_id]', __('Provincia:'), 'class="required" ') ?>
   <div class="content<?php if ($sf_request->hasError('responsable{fk_provincia_id}')): ?> form-error<?php endif; ?>">
   <?php if ($sf_request->hasError('responsable{fk_provincia_id}')): ?>
     <?php echo form_error('responsable{fk_provincia_id}', array('class' => 'form-error-msg')) ?>
   <?php endif; ?>
-
-  <?php echo object_select_tag($responsable, 'getFkProvinciaId', array (
-  'related_class' => 'Provincia',
-  'control_name' => 'responsable[fk_provincia_id]',
-  'include_custom' => '--Selecciones una Provincia--',
-)) ?>
+    <div id="item_provincia"></div>
     </div>
 </div>
 




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