Se cambia relacion 1:1 de estado para arreglar las busquedas
git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_IntranetNueva/trunk@75 77cfc57b-8ef4-1849-9df6-4a38aa5da120
This commit is contained in:
parent
55c92a4595
commit
269f004b08
@ -48,7 +48,8 @@ class Candidato extends CActiveRecord
|
||||
|
||||
public $capacidad_tecnica_search;
|
||||
public $capacidad_funcional_search;
|
||||
|
||||
public $nombre_estado_search;
|
||||
|
||||
/**
|
||||
* Devuelve el nombre completo de un candidato.
|
||||
* @return string $nombreCompleto
|
||||
@ -80,12 +81,6 @@ class Candidato extends CActiveRecord
|
||||
public function getNombreLocalidad() {
|
||||
return Poblacion::model()->findByPk($this->localidad)->poblacion;
|
||||
}
|
||||
|
||||
public function getEstado() {
|
||||
$_estado = EstadoCandidato::model()->findByPk($this->id_estado);
|
||||
if ($_estado != null)
|
||||
return $_estado->descripcion;
|
||||
}
|
||||
|
||||
public function getNombreCompletoLocalidad() {
|
||||
$nombre = '';
|
||||
@ -186,7 +181,9 @@ class Candidato extends CActiveRecord
|
||||
|
||||
// The following rule is used by search().
|
||||
// Please remove those attributes that should not be searched.
|
||||
array('id, id_estado, estado, dni, nombre, apellidos, email, telefono_fijo,
|
||||
array('id, id_estado,
|
||||
nombre_estado_search,
|
||||
dni, nombre, apellidos, email, telefono_fijo,
|
||||
telefono_movil, sexo, fecha_nacimiento, lugar_nacimiento,
|
||||
localidad, fecha_alta, usuario_alta, fecha_modificacion,
|
||||
usuario_modificacion, carnet_conducir, vehiculo_propio,
|
||||
@ -214,6 +211,7 @@ class Candidato extends CActiveRecord
|
||||
'titulacionesCount' => array(self::STAT, 'CandidatoTitulacion', 'candidato_id'),
|
||||
'documentos' => array(self::HAS_MANY, 'CandidatoDocumento', 'candidato_id'),
|
||||
'documentosCount' => array(self::STAT, 'CandidatoDocumento', 'candidato_id'),
|
||||
'estados'=>array( self::BELONGS_TO, 'EstadoCandidato', 'id_estado' ),
|
||||
);
|
||||
}
|
||||
|
||||
@ -225,7 +223,7 @@ class Candidato extends CActiveRecord
|
||||
return array(
|
||||
'id' => 'ID',
|
||||
'id_estado' => 'ID estado',
|
||||
'estado' => 'Estado',
|
||||
'nombre_estado_search' => 'Estado',
|
||||
'nombreApellidos' => 'Candidato',
|
||||
'foto' => 'Foto',
|
||||
'dni' => 'DNI/Pasaporte',
|
||||
@ -266,13 +264,13 @@ class Candidato extends CActiveRecord
|
||||
// should not be searched.
|
||||
|
||||
$criteria=new CDbCriteria;
|
||||
|
||||
$criteria->with = array('capacidades');//, 'capacidades.capacidadesFuncionales');
|
||||
$criteria->with = array('capacidades', 'estados');//, 'capacidades.capacidadesFuncionales');
|
||||
$criteria->together = true;
|
||||
|
||||
$criteria->compare('t.id',$this->id);
|
||||
$criteria->compare('t.id_estado',$this->id_estado);
|
||||
$criteria->compare('t.estado',$this->estado);
|
||||
$criteria->compare( 'estados.descripcion', $this->nombre_estado_search, true );
|
||||
|
||||
$criteria->compare('t.dni',$this->dni,true);
|
||||
$criteria->compare('t.nombre',$this->nombre,true);
|
||||
$criteria->compare('t.apellidos',$this->apellidos,true);
|
||||
@ -287,10 +285,10 @@ class Candidato extends CActiveRecord
|
||||
$sort = new CSort();
|
||||
$sort->attributes = array(
|
||||
'defaultOrder' => '',
|
||||
'estado' => array(
|
||||
'asc' => 't.id_estado',
|
||||
'desc' => 't.id_estado desc',
|
||||
),
|
||||
'nombre_estado_search'=>array(
|
||||
'asc'=>'estados.descripcion',
|
||||
'desc'=>'estados.descripcion DESC',
|
||||
),
|
||||
'fecha_modificacion' => array(
|
||||
'asc' => 't.fecha_modificacion',
|
||||
'desc' => 't.fecha_modificacion desc',
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
</div>
|
||||
<div class="one_half last">
|
||||
<h2><?php echo CHtml::encode($data->nombreCompleto); ?></h2>
|
||||
<?php echo CHtml::link(CHtml::encode($data->estado), "#", array("class" => $data->cssClassEstado)); ?><br/>
|
||||
<?php echo CHtml::link(CHtml::encode($data->estados->descripcion), "#", array("class" => $data->cssClassEstado)); ?><br/>
|
||||
<strong><?php echo CHtml::encode($data->getAttributeLabel('sexo')); ?>:</strong> <?php echo CHtml::encode($data->sexo); ?><br/>
|
||||
<strong><?php echo CHtml::encode($data->getAttributeLabel('fecha_nacimiento')); ?>:</strong> <?php echo CHtml::encode($data->fecha_nacimiento); ?><br/>
|
||||
<strong><?php echo CHtml::encode($data->getAttributeLabel('lugar_nacimiento')); ?>:</strong> <?php echo CHtml::encode($data->lugar_nacimiento); ?><br/>
|
||||
|
||||
@ -163,13 +163,13 @@ $this->endWidget('zii.widgets.jui.CJuiDialog');
|
||||
|
||||
array(
|
||||
'type'=>'raw',
|
||||
'name' => 'estado',
|
||||
'name' => 'nombre_estado_search',
|
||||
'headerHtmlOptions'=>array(
|
||||
'class' => 'head0 sorting',
|
||||
),
|
||||
'cssClassExpression' => '"con0"',
|
||||
'value'=> 'CHtml::ajaxLink(
|
||||
CHtml::encode($data->estado),
|
||||
CHtml::encode($data->estados->descripcion),
|
||||
array("candidato/updateEstado"),
|
||||
array(
|
||||
"data" => array("id" => $data->id),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user