[Alba-desarrollo] SVN Alba r4501 - in prosistem/alba/trunk/alba: apps/principal/modules/alumno/actions apps/principal/modules/alumno/templates lib/model

commits en pressenter.com.ar commits en pressenter.com.ar
Lun Mar 19 20:33:45 CET 2007


Author: ftoledo
Date: 2007-03-19 16:33:43 -0300 (Mon, 19 Mar 2007)
New Revision: 4501

Modified:
   prosistem/alba/trunk/alba/apps/principal/modules/alumno/actions/actions.class.php
   prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_pais_id.php
   prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarPaisSuccess.php
   prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php
   prosistem/alba/trunk/alba/lib/model/Pais.php
Log:
provincia + pais con ajax en alumno

metodo por defecto en pais es Pais::getNombreLargo()



Modified: prosistem/alba/trunk/alba/apps/principal/modules/alumno/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/actions/actions.class.php	2007-03-19 19:01:46 UTC (rev 4500)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/actions/actions.class.php	2007-03-19 19:33:43 UTC (rev 4501)
@@ -237,9 +237,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/alumno/templates/_pais_id.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_pais_id.php	2007-03-19 19:01:46 UTC (rev 4500)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_pais_id.php	2007-03-19 19:33:43 UTC (rev 4501)
@@ -5,8 +5,10 @@
     $paises = PaisPeer::doSelect($c);
     if ($alumno->getFkProvinciaId()) {
         $pais_selected = $alumno->getProvincia()->getPais()->getId();
+        $provincia_id = $alumno->getFkProvinciaId();
     } else {
-        $pais_selected = 0;
+        $pais_selected = $paises[0]->getId();
+        $provincia_id = 0;
     }
         
     echo select_tag('pais_id',objects_for_select($paises,'getId','getNombreLargo',$pais_selected));
@@ -15,4 +17,12 @@
         'update'   => 'item_provincia',
         'url'      => 'alumno/cambiarPais?vista=noMuestraMenu',
         'with'     => "'pais_id=' + value"));
+        
+    echo javascript_tag(
+        remote_function( array(
+        'update'  => 'item_provincia',
+        'url'     => 'alumno/cambiarPais?vista=noMuestraMenu&pais_id='. $pais_selected . '&provincia_id=' . $provincia_id,
+        ))
+    );
+                                               
 ?>

Modified: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarPaisSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarPaisSuccess.php	2007-03-19 19:01:46 UTC (rev 4500)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarPaisSuccess.php	2007-03-19 19:33:43 UTC (rev 4501)
@@ -3,6 +3,6 @@
 ?>
 <div id="item_provincia">
 <?php 
-    echo select_tag('alumno[fk_provincia_id]', objects_for_select($provincias, 'getId','getNombreLargo'), array('control_name' => 'alumno[fk_provincia_id]'));
+    echo select_tag('alumno[fk_provincia_id]', objects_for_select($provincias, 'getId','getNombreLargo',$provincia_id), array('control_name' => 'alumno[fk_provincia_id]'));
 ?>
 </div>
\ No newline at end of file

Modified: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php	2007-03-19 19:01:46 UTC (rev 4500)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php	2007-03-19 19:33:43 UTC (rev 4501)
@@ -226,6 +226,12 @@
                 </div>
             </div>
 
+               <div class="form-row">
+                   <?php echo label_for('pais_id]', __('Pa&iacute;s:'), 'class="required" ') ?>
+                   <?php echo include_partial('pais_id', array('type' => 'edit', 'alumno' => $alumno)) ?>
+               </div>
+            
+
             <div class="form-row">
               <?php echo label_for('alumno[fk_provincia_id]', __('Provincia:'), 'class="required" ') ?>
               <div class="content<?php if ($sf_request->hasError('alumno{fk_provincia_id}')): ?> form-error<?php endif; ?>">
@@ -233,25 +239,12 @@
                 <?php echo form_error('alumno{fk_provincia_id}', array('class' => 'form-error-msg')) ?>
               <?php endif; ?>
 
-            <div id="item_provincia">
-              <?php echo object_select_tag($alumno, 'getFkProvinciaId', array (
-              'related_class' => 'Provincia',
-              'peer_method' => 'getEnOrden',
-              'control_name' => 'alumno[fk_provincia_id]',
-              'include_custom' => '--Seleccione una Provincia--',
-            )) ?>
-            
+                 <div id="item_provincia">
+                 </div>
+              </div>
             </div>
-                </div>
-            </div>
             
             
-               <div class="form-row">
-               <?php echo label_for('pais_id]', __('Pa&iacute;s:'), 'class="required" ') ?>
-               <?php echo include_partial('pais_id', array('type' => 'edit', 'alumno' => $alumno)) ?>
-               </div>
-            
-
             <div class="form-row">
               <?php echo label_for('alumno[codigo_postal]', __('CP:'), 'class="required" ') ?>
               <div class="content<?php if ($sf_request->hasError('alumno{codigo_postal}')): ?> form-error<?php endif; ?>">

Modified: prosistem/alba/trunk/alba/lib/model/Pais.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/Pais.php	2007-03-19 19:01:46 UTC (rev 4500)
+++ prosistem/alba/trunk/alba/lib/model/Pais.php	2007-03-19 19:33:43 UTC (rev 4501)
@@ -17,7 +17,7 @@
 class Pais extends BasePais {
 
    public function __toString() {
-       return $this->getNombreCorto();
+       return $this->getNombreLargo();
    }
                
 




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