[Alba-desarrollo] SVN Alba r4500 - in prosistem/alba/trunk/alba/apps/principal/modules/cuenta: actions templates

commits en pressenter.com.ar commits en pressenter.com.ar
Lun Mar 19 20:01:47 CET 2007


Author: ftoledo
Date: 2007-03-19 16:01:46 -0300 (Mon, 19 Mar 2007)
New Revision: 4500

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/cuenta/actions/actions.class.php
   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
Log:
provincia + pais con ajax en las cuentas


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-03-19 18:50:58 UTC (rev 4499)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/actions/actions.class.php	2007-03-19 19:01:46 UTC (rev 4500)
@@ -72,9 +72,10 @@
   }
 
     public function executeCambiarPais() {
-        $pais_id = $this->getRequestParameter('pais_id');
+        $this->pais_id = $this->getRequestParameter('pais_id');
+        $this->provincia_id = $this->getRequestParameter('provincia_id'); 
         $c = new Criteria();
-        $c->add(ProvinciaPeer::FK_PAIS_ID, $pais_id);
+        $c->add(ProvinciaPeer::FK_PAIS_ID, $this->pais_id);
         $this->provincias = ProvinciaPeer::getEnOrden($c);
     }
 }

Modified: 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-03-19 18:50:58 UTC (rev 4499)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_fk_provincia_id.php	2007-03-19 19:01:46 UTC (rev 4500)
@@ -1,7 +1,2 @@
 <div id="item_provincia">
-<?php  echo object_select_tag($cuenta, 'getFkProvinciaId', array (
-                             'related_class' => 'Provincia',
-                             'peer_method' => 'getEnOrden',
-                             'control_name' => 'cuenta[fk_provincia_id]',
-                             'include_custom' => '--Seleccione una Provincia--',)) ?>
 </div>
\ No newline at end of file

Modified: 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-03-19 18:50:58 UTC (rev 4499)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_pais_id.php	2007-03-19 19:01:46 UTC (rev 4500)
@@ -3,15 +3,25 @@
     
     $c = new Criteria();
     $paises = PaisPeer::doSelect($c);
-    if ($cuenta->getFkProvinciaId())
+    if ($cuenta->getFkProvinciaId()) {
         $pais_selected = $cuenta->getProvincia()->getPais()->getId();
-    else
-        $pais_selected = 0;
-        
+        $provincia_id = $cuenta->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'      => 'cuenta/cambiarPais?vista=noMuestraMenu',
         'with'     => "'pais_id=' + value"));
-?>
+        
+    echo javascript_tag(
+        remote_function( array(
+        'update'  => 'item_provincia',
+        'url'     => 'cuenta/cambiarPais?vista=noMuestraMenu&pais_id='. $pais_selected . '&provincia_id=' . $provincia_id,
+        ))
+    );                                                             
+?>
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/cambiarPaisSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/cambiarPaisSuccess.php	2007-03-19 18:50:58 UTC (rev 4499)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/cambiarPaisSuccess.php	2007-03-19 19:01:46 UTC (rev 4500)
@@ -3,6 +3,6 @@
 ?>
 <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]'));
+    echo select_tag('cuenta[fk_provincia_id]', objects_for_select($provincias, 'getId','getNombreLargo',$provincia_id), array('control_name' => 'cuenta[fk_provincia_id]'));
 ?>
 </div>
\ No newline at end of file




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