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

commits en pressenter.com.ar commits en pressenter.com.ar
Mie Feb 21 20:04:25 CET 2007


Author: josx
Date: 2007-02-21 16:04:06 -0300 (Wed, 21 Feb 2007)
New Revision: 4258

Added:
   prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_buscarCuenta.php
   prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_verCuenta.php
   prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/buscarSuccess.php
   prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarCuentaSuccess.php
   prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/seleccionarCuentaSuccess.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
Log:
Busqueda para dar de alta la Cuenta en el usuario

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-02-21 18:24:11 UTC (rev 4257)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/actions/actions.class.php	2007-02-21 19:04:06 UTC (rev 4258)
@@ -23,8 +23,8 @@
  * alumno actions.
  *
  * @package    alba
- * @author     José Luis Di Biase <josx en interorganic.com.ar>
- * @author     Héctor Sanchez <hsanchez en pressenter.com.ar>
+ * @author     Jos? Luis Di Biase <josx en interorganic.com.ar>
+ * @author     H?ctor Sanchez <hsanchez en pressenter.com.ar>
  * @author     Fernando Toledo <ftoledo en pressenter.com.ar>
  * @version    SVN: $Id$
  * @filesource
@@ -137,5 +137,33 @@
     }
   }
 
+
+    public function executeBuscar() {
+        $aCuentas = array();
+
+        $txt_cuenta = $this->getRequestParameter("txt_cuenta");
+        
+        $criteria = new Criteria();
+        $cton1 = $criteria->getNewCriterion(CuentaPeer::NOMBRE, "%$txt_cuenta%", Criteria::LIKE);
+        $cton2 = $criteria->getNewCriterion(CuentaPeer::RAZON_SOCIAL, "%$txt_cuenta%", Criteria::LIKE);
+        $cton1->addOr($cton2);
+        $criteria->add($cton1);
+        $aCuentas = CuentaPeer::doSelect($criteria);
+
+        $this->txt_cuenta = $txt_cuenta;
+        $this->aCuentas = $aCuentas;
+    }
+
+    public function executeSeleccionarCuenta() {
+
+        $id_cuenta = $this->getRequestParameter("id");
+        $this->cuenta = CuentaPeer::retrieveByPk($id_cuenta);
+    }
+
+
+    public function executeCambiarCuenta() {
+
+    }
+
 }
-?>
+?>
\ No newline at end of file

Added: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_buscarCuenta.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_buscarCuenta.php	2007-02-21 18:24:11 UTC (rev 4257)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_buscarCuenta.php	2007-02-21 19:04:06 UTC (rev 4258)
@@ -0,0 +1,4 @@
+<?php use_helper('Javascript') ?>  
+<?php echo input_tag('txt_cuenta') ?>
+<?php echo submit_to_remote('ajax_submit', 'Buscar cuenta', array('update'   => 'item_list', 'url'      => 'alumno/buscar?vista=noMuestraMenu',)) ?>
+<div id="item_list"></div>
\ No newline at end of file


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

Added: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_verCuenta.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_verCuenta.php	2007-02-21 18:24:11 UTC (rev 4257)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/_verCuenta.php	2007-02-21 19:04:06 UTC (rev 4258)
@@ -0,0 +1,8 @@
+<?php use_helper('Javascript') ?>
+<?php echo input_hidden_tag('alumno[fk_cuenta_id]',$cuenta_id);?>
+<table cellspacing="0" width="30%">
+    <tr class="sf_admin_row_1">
+        <td><?php echo $cuenta_nombre; ?></td>
+        <td><?php echo link_to_remote('Cambiar', array('update' => 'cuenta', 'url' => 'alumno/cambiarCuenta?vista=noMuestraMenu' )); ?></td>
+    </tr>
+</table>
\ No newline at end of file


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

Added: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/buscarSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/buscarSuccess.php	2007-02-21 18:24:11 UTC (rev 4257)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/buscarSuccess.php	2007-02-21 19:04:06 UTC (rev 4258)
@@ -0,0 +1,40 @@
+<?php
+    if(strlen($txt_cuenta) > 3) {
+?>
+<?php use_helper('Javascript') ?>
+
+<?php
+        $tr_class = true;
+        if(count($aCuentas) > 0) {
+
+?>
+    <table cellspacing="0" class="sf_admin_list">
+    <thead>
+        <tr>
+            <th id="sf_admin_list_th_cuenta">Cuenta</th>
+            <th id="sf_admin_list_th_seleccionar">Seleccionar</th>
+        </tr>
+    </thead>
+    <tbody>
+<?
+            foreach($aCuentas as $cuenta) {
+                $tr_class = ! $tr_class;
+                $numero = ($tr_class)?1:0; 
+?>
+    <tr class="sf_admin_row_<?php echo $numero;?>">
+      <td><?php echo label_for('cuenta', __("Cuenta :".$cuenta->getNombre()), ''); ?></td>
+      <td><?php echo link_to_remote('Seleccionar', array ( 'update' => 'cuenta', 'url' => 'alumno/seleccionarCuenta?vista=noMuestraMenu&id='.$cuenta->getId()));?></td>
+    </tr>
+<?php
+            }
+?>
+    </tbody>
+</table>
+<?php
+        } else {
+            echo "No existe";
+        }
+    } else {
+        echo "Debe buscar con mas de 3 caracteres";
+    }
+?>
\ No newline at end of file


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

Added: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarCuentaSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarCuentaSuccess.php	2007-02-21 18:24:11 UTC (rev 4257)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/cambiarCuentaSuccess.php	2007-02-21 19:04:06 UTC (rev 4258)
@@ -0,0 +1 @@
+<?php echo include_partial('buscarCuenta'); ?>
\ No newline at end of file


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

Modified: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php	2007-02-21 18:24:11 UTC (rev 4257)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/editSuccess.php	2007-02-21 19:04:06 UTC (rev 4258)
@@ -322,7 +322,7 @@
 <h2><?php echo __('Otros') ?></h2>
 
 <div class="form-row">
-  <?php echo label_for('alumno[certificado_medico]', __('¿Trajo el certificado m&eacute;dico?:'), 'class="required" ') ?>
+  <?php echo label_for('alumno[certificado_medico]', __('Trajo el certificado m&eacute;dico?:'), 'class="required" ') ?>
   <div class="content<?php if ($sf_request->hasError('alumno{certificado_medico}')): ?> form-error<?php endif; ?>">
   <?php if ($sf_request->hasError('alumno{certificado_medico}')): ?>
     <?php echo form_error('alumno{certificado_medico}', array('class' => 'form-error-msg')) ?>
@@ -334,17 +334,23 @@
     </div>
 </div>
 
+
 <div class="form-row">
-  <?php echo label_for('alumno[fk_cuenta_id]', __('Cuenta:'), 'class="required" ') ?>
-  <div class="content<?php if ($sf_request->hasError('alumno{fk_cuenta_id}')): ?> form-error<?php endif; ?>">
-  <?php if ($sf_request->hasError('alumno{fk_cuenta_id}')): ?>
-    <?php echo form_error('alumno{fk_cuenta_id}', array('class' => 'form-error-msg')) ?>
-  <?php endif; ?>
+    <?php echo label_for('alumno[fk_cuenta_id]', __('Cuenta:'), 'class="required" ') ?>
+    <div class="content<?php if ($sf_request->hasError('alumno{fk_cuenta_id}')): ?> form-error<?php endif; ?>">  
+        <div id="cuenta">
+            <?php if($alumno->getFkCuentaId()) { ?>
+                <?php echo include_partial('verCuenta', array('cuenta_nombre' => $alumno->getCuenta()->getNombre(), 'cuenta_id' => $alumno->getCuenta()->getId()) ); ?>
+            <?php } else { ?>
+                <?php echo include_partial('buscarCuenta'); ?>  
+            <? } ?>
 
-  <?php echo include_partial('fk_cuenta_id', array('type' => 'edit', 'alumno' => $alumno)) ?>
+        </div>
     </div>
 </div>
 
+
+
 </fieldset>
 
 <?php echo include_partial('edit_actions', array('alumno' => $alumno)) ?>

Added: prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/seleccionarCuentaSuccess.php
===================================================================
--- prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/seleccionarCuentaSuccess.php	2007-02-21 18:24:11 UTC (rev 4257)
+++ prosistem/alba/trunk/alba/apps/principal/modules/alumno/templates/seleccionarCuentaSuccess.php	2007-02-21 19:04:06 UTC (rev 4258)
@@ -0,0 +1 @@
+<?php echo include_partial('verCuenta', array('cuenta_nombre' => $cuenta->getNombre(), 'cuenta_id' => $cuenta->getId()) ); ?>
\ No newline at end of file


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




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