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_tecnica_search;
|
||||||
public $capacidad_funcional_search;
|
public $capacidad_funcional_search;
|
||||||
|
public $nombre_estado_search;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Devuelve el nombre completo de un candidato.
|
* Devuelve el nombre completo de un candidato.
|
||||||
* @return string $nombreCompleto
|
* @return string $nombreCompleto
|
||||||
@ -80,12 +81,6 @@ class Candidato extends CActiveRecord
|
|||||||
public function getNombreLocalidad() {
|
public function getNombreLocalidad() {
|
||||||
return Poblacion::model()->findByPk($this->localidad)->poblacion;
|
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() {
|
public function getNombreCompletoLocalidad() {
|
||||||
$nombre = '';
|
$nombre = '';
|
||||||
@ -186,7 +181,9 @@ class Candidato extends CActiveRecord
|
|||||||
|
|
||||||
// The following rule is used by search().
|
// The following rule is used by search().
|
||||||
// Please remove those attributes that should not be searched.
|
// 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,
|
telefono_movil, sexo, fecha_nacimiento, lugar_nacimiento,
|
||||||
localidad, fecha_alta, usuario_alta, fecha_modificacion,
|
localidad, fecha_alta, usuario_alta, fecha_modificacion,
|
||||||
usuario_modificacion, carnet_conducir, vehiculo_propio,
|
usuario_modificacion, carnet_conducir, vehiculo_propio,
|
||||||
@ -214,6 +211,7 @@ class Candidato extends CActiveRecord
|
|||||||
'titulacionesCount' => array(self::STAT, 'CandidatoTitulacion', 'candidato_id'),
|
'titulacionesCount' => array(self::STAT, 'CandidatoTitulacion', 'candidato_id'),
|
||||||
'documentos' => array(self::HAS_MANY, 'CandidatoDocumento', 'candidato_id'),
|
'documentos' => array(self::HAS_MANY, 'CandidatoDocumento', 'candidato_id'),
|
||||||
'documentosCount' => array(self::STAT, '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(
|
return array(
|
||||||
'id' => 'ID',
|
'id' => 'ID',
|
||||||
'id_estado' => 'ID estado',
|
'id_estado' => 'ID estado',
|
||||||
'estado' => 'Estado',
|
'nombre_estado_search' => 'Estado',
|
||||||
'nombreApellidos' => 'Candidato',
|
'nombreApellidos' => 'Candidato',
|
||||||
'foto' => 'Foto',
|
'foto' => 'Foto',
|
||||||
'dni' => 'DNI/Pasaporte',
|
'dni' => 'DNI/Pasaporte',
|
||||||
@ -266,13 +264,13 @@ class Candidato extends CActiveRecord
|
|||||||
// should not be searched.
|
// should not be searched.
|
||||||
|
|
||||||
$criteria=new CDbCriteria;
|
$criteria=new CDbCriteria;
|
||||||
|
$criteria->with = array('capacidades', 'estados');//, 'capacidades.capacidadesFuncionales');
|
||||||
$criteria->with = array('capacidades');//, 'capacidades.capacidadesFuncionales');
|
|
||||||
$criteria->together = true;
|
$criteria->together = true;
|
||||||
|
|
||||||
$criteria->compare('t.id',$this->id);
|
$criteria->compare('t.id',$this->id);
|
||||||
$criteria->compare('t.id_estado',$this->id_estado);
|
$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.dni',$this->dni,true);
|
||||||
$criteria->compare('t.nombre',$this->nombre,true);
|
$criteria->compare('t.nombre',$this->nombre,true);
|
||||||
$criteria->compare('t.apellidos',$this->apellidos,true);
|
$criteria->compare('t.apellidos',$this->apellidos,true);
|
||||||
@ -287,10 +285,10 @@ class Candidato extends CActiveRecord
|
|||||||
$sort = new CSort();
|
$sort = new CSort();
|
||||||
$sort->attributes = array(
|
$sort->attributes = array(
|
||||||
'defaultOrder' => '',
|
'defaultOrder' => '',
|
||||||
'estado' => array(
|
'nombre_estado_search'=>array(
|
||||||
'asc' => 't.id_estado',
|
'asc'=>'estados.descripcion',
|
||||||
'desc' => 't.id_estado desc',
|
'desc'=>'estados.descripcion DESC',
|
||||||
),
|
),
|
||||||
'fecha_modificacion' => array(
|
'fecha_modificacion' => array(
|
||||||
'asc' => 't.fecha_modificacion',
|
'asc' => 't.fecha_modificacion',
|
||||||
'desc' => 't.fecha_modificacion desc',
|
'desc' => 't.fecha_modificacion desc',
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="one_half last">
|
<div class="one_half last">
|
||||||
<h2><?php echo CHtml::encode($data->nombreCompleto); ?></h2>
|
<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('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('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/>
|
<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(
|
array(
|
||||||
'type'=>'raw',
|
'type'=>'raw',
|
||||||
'name' => 'estado',
|
'name' => 'nombre_estado_search',
|
||||||
'headerHtmlOptions'=>array(
|
'headerHtmlOptions'=>array(
|
||||||
'class' => 'head0 sorting',
|
'class' => 'head0 sorting',
|
||||||
),
|
),
|
||||||
'cssClassExpression' => '"con0"',
|
'cssClassExpression' => '"con0"',
|
||||||
'value'=> 'CHtml::ajaxLink(
|
'value'=> 'CHtml::ajaxLink(
|
||||||
CHtml::encode($data->estado),
|
CHtml::encode($data->estados->descripcion),
|
||||||
array("candidato/updateEstado"),
|
array("candidato/updateEstado"),
|
||||||
array(
|
array(
|
||||||
"data" => array("id" => $data->id),
|
"data" => array("id" => $data->id),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user