[Alba-desarrollo] SVN Alba r4401 - in prosistem/alba/trunk/alba:
apps/principal/modules/alumno/actions
apps/principal/modules/alumno/templates
apps/principal/modules/ciclolectivo/templates
apps/principal/modules/cuenta/actions
apps/principal/modules/cuenta/templates
apps/principal/modules/docente/actions
apps/principal/modules/docente/config
apps/principal/modules/docente/templates lib/model
commits en pressenter.com.ar
commits en pressenter.com.ar
Mie Mar 7 21:04:33 CET 2007
Author: josx
Date: 2007-03-07 17:04:24 -0300 (Wed, 07 Mar 2007)
New Revision: 4401
Added:
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/docente/templates/_fk_provincia_id.php
prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/_pais_id.php
prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/cambiarPaisSuccess.php
Modified:
prosistem/alba/trunk/alba/apps/principal/modules/alumno/actions/actions.class.php
prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php
prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/nuevaCuentaSuccess.php
prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/templates/agregarTurnosYPeriodosSuccess.php
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
prosistem/alba/trunk/alba/apps/principal/modules/docente/actions/actions.class.php
prosistem/alba/trunk/alba/apps/principal/modules/docente/config/generator.yml
prosistem/alba/trunk/alba/lib/model/Provincia.php
prosistem/alba/trunk/alba/lib/model/ProvinciaPeer.php
Log:
Agregue Orden y ajax para los combos de pais, provincia (Ticket #146 #147 #151)
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-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/actions/actions.class.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -236,6 +236,12 @@
$this->cuenta = new Cuenta();
}
+ public function executeCambiarPais() {
+ $pais_id = $this->getRequestParameter('pais_id');
+ $c = new Criteria();
+ $c->add(ProvinciaPeer::FK_PAIS_ID, $pais_id);
+ $this->provincias = ProvinciaPeer::getEnOrden($c);
+ }
}
?>
\ No newline at end of file
Added: 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-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_pais_id.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -0,0 +1,18 @@
+<?php
+ use_helper('Javascript');
+
+ $c = new Criteria();
+ $paises = PaisPeer::doSelect($c);
+ if ($alumno->getFkProvinciaId()) {
+ $pais_selected = $alumno->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' => 'alumno/cambiarPais?vista=noMuestraMenu',
+ 'with' => "'pais_id=' + value"));
+?>
Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_pais_id.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
Added: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarPaisSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarPaisSuccess.php 2007-03-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarPaisSuccess.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -0,0 +1,8 @@
+<?php
+ use_helper("Object");
+?>
+<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]'));
+?>
+</div>
\ No newline at end of file
Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarPaisSuccess.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
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-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -151,10 +151,12 @@
<?php echo form_error('alumno{fk_pais_id}', array('class' => 'form-error-msg')) ?>
<?php endif; ?>
- <?php echo object_select_tag($alumno, 'getFkPaisId', array (
- 'related_class' => 'Pais',
- 'control_name' => 'alumno[fk_pais_id]',
- )) ?>
+<?php $value = object_select_tag($alumno, 'getFkPaisId', array (
+ 'related_class' => 'Pais',
+ 'control_name' => 'alumno[fk_pais_id]',
+ )); echo $value ? $value : ' ' ?>
+
+
</div>
</div>
@@ -230,13 +232,24 @@
<?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>
</div>
</div>
+
+
+ <div class="form-row">
+ <?php echo label_for('pais_id]', __('Paí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" ') ?>
Modified: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/nuevaCuentaSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/nuevaCuentaSuccess.php 2007-03-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/nuevaCuentaSuccess.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -93,12 +93,13 @@
<?php echo form_error('cuenta{fk_provincia_id}', array('class' => 'form-error-msg')) ?>
<?php endif; ?>
-
- <?php echo object_select_tag($cuenta, 'getFkProvinciaId', array (
+<div id="item_provincia">
+ <?php echo object_select_tag($alumno, 'getFkProvinciaId', array (
'related_class' => 'Provincia',
+ 'peer_method' => 'getEnOrden',
'control_name' => 'cuenta[fk_provincia_id]',
)) ?>
- </td>
+</div> </td>
<td></td>
<td></td>
Modified: prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/templates/agregarTurnosYPeriodosSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/templates/agregarTurnosYPeriodosSuccess.php 2007-03-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/ciclolectivo/templates/agregarTurnosYPeriodosSuccess.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -9,10 +9,10 @@
</script>
+<div id="sf_admin_container">
+
<? echo form_tag('ciclolectivo/grabarTurnosYPeriodos', 'onSubmit="selectItem()"'); ?>
-
-
<div id="content">
<br>
<h1>Ciclo Lectivo <?php echo select_tag('id', options_for_select($optionsCiclolectivo, $sf_params->get('id')), 'onChange=linkTo()'); ?></h1>
@@ -188,3 +188,4 @@
</div>
</form>
+</div>
\ No newline at end of file
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-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/actions/actions.class.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -74,8 +74,8 @@
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);
+ $c->add(ProvinciaPeer::FK_PAIS_ID, $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-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_fk_provincia_id.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -1,8 +1,7 @@
<div id="item_provincia">
-<?php
- echo object_select_tag($cuenta, 'getFkProvinciaId', array (
- 'related_class' => 'Provincia',
- 'control_name' => 'cuenta[fk_provincia_id]',
- ))
-?>
+<?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-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/_pais_id.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -14,4 +14,4 @@
'update' => 'item_provincia',
'url' => 'cuenta/cambiarPais?vista=noMuestraMenu',
'with' => "'pais_id=' + value"));
-?>
\ 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-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/cuenta/templates/cambiarPaisSuccess.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -3,7 +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'), array('control_name' => 'cuenta[fk_provincia_id]'));
?>
</div>
\ No newline at end of file
Modified: prosistem/alba/trunk/alba/apps/principal/modules/docente/actions/actions.class.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/docente/actions/actions.class.php 2007-03-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/docente/actions/actions.class.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -74,7 +74,12 @@
$c->add(RelDocenteEstablecimientoPeer::FK_ESTABLECIMIENTO_ID, $this->getUser()->getAttribute('fk_establecimiento_id'));
}
-
+ public function executeCambiarPais() {
+ $pais_id = $this->getRequestParameter('pais_id');
+ $c = new Criteria();
+ $c->add(ProvinciaPeer::FK_PAIS_ID, $pais_id);
+ $this->provincias = ProvinciaPeer::getEnOrden($c);
+ }
}
?>
\ No newline at end of file
Modified: prosistem/alba/trunk/alba/apps/principal/modules/docente/config/generator.yml
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/docente/config/generator.yml 2007-03-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/docente/config/generator.yml 2007-03-07 20:04:24 UTC (rev 4401)
@@ -28,7 +28,7 @@
title: Editar Docente
display:
"Informacion general": [apellido, nombre, fecha_nacimiento, _sexo, fk_tipodocumento_id, nro_documento ]
- "Donde vive": [direccion, ciudad, fk_provincia_id, codigo_postal]
+ "Donde vive": [direccion, ciudad, _fk_provincia_id, _pais_id, codigo_postal]
"Otros": [ email, telefono, telefono_movil, libreta_sanitaria, psicofisico, titulo, activo ]
Added: prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/_fk_provincia_id.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/_fk_provincia_id.php 2007-03-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/_fk_provincia_id.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -0,0 +1,8 @@
+<div id="item_provincia">
+<?php echo object_select_tag($docente, 'getFkProvinciaId', array (
+ 'related_class' => 'Provincia',
+ 'peer_method' => 'getEnOrden',
+ 'control_name' => 'docente[fk_provincia_id]',
+ 'include_custom' => '>>Seleccione una Provincia<<',
+ )) ?>
+</div>
\ No newline at end of file
Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/_fk_provincia_id.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
Added: prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/_pais_id.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/_pais_id.php 2007-03-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/_pais_id.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -0,0 +1,18 @@
+<?php
+ use_helper('Javascript');
+
+ $c = new Criteria();
+ $paises = PaisPeer::doSelect($c);
+ if ($docente->getFkProvinciaId()) {
+ $pais_selected = $docente->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' => 'docente/cambiarPais?vista=noMuestraMenu',
+ 'with' => "'pais_id=' + value"));
+?>
Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/_pais_id.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
Added: prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/cambiarPaisSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/cambiarPaisSuccess.php 2007-03-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/cambiarPaisSuccess.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -0,0 +1,8 @@
+<?php
+ use_helper("Object");
+?>
+<div id="item_provincia">
+<?php
+ echo select_tag('docente[fk_provincia_id]', objects_for_select($provincias, 'getId','getNombreLargo'), array('control_name' => 'docente[fk_provincia_id]'));
+?>
+</div>
\ No newline at end of file
Property changes on: prosistem/alba/trunk/alba/apps/principal/modules/docente/templates/cambiarPaisSuccess.php
___________________________________________________________________
Name: svn:keywords
+ "Id Author URL Date Rev"
Modified: prosistem/alba/trunk/alba/lib/model/Provincia.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/Provincia.php 2007-03-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/lib/model/Provincia.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -16,6 +16,6 @@
*/
class Provincia extends BaseProvincia {
public function __toString() {
- return $this->getNombreCorto();
+ return $this->getNombreLargo();
}
} // Provincia
Modified: prosistem/alba/trunk/alba/lib/model/ProvinciaPeer.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/ProvinciaPeer.php 2007-03-07 19:49:31 UTC (rev 4400)
+++ prosistem/alba/trunk/alba/lib/model/ProvinciaPeer.php 2007-03-07 20:04:24 UTC (rev 4401)
@@ -20,4 +20,22 @@
*/
class ProvinciaPeer extends BaseProvinciaPeer {
+
+ public static function getEnOrden($criteria = NULL) {
+
+ if((!($criteria instanceof Criteria)) OR is_null($criteria)) {
+ $criteria = new Criteria();
+ }
+
+// $criteria->add(ProvinciaPeer::ESTA_BORRADO, false); Pensado para borrado logico
+
+ $criteria->addAscendingOrderByColumn(ProvinciaPeer::ORDEN);
+ $criteria->addAscendingOrderByColumn(ProvinciaPeer::NOMBRE_CORTO);
+ $criteria->addAscendingOrderByColumn(ProvinciaPeer::NOMBRE_LARGO);
+ $provincias = ProvinciaPeer::doSelect($criteria);
+
+ return $provincias;
+ }
+
+
} // ProvinciaPeer
Más información sobre la lista de distribución Alba-desarrollo