diff --git a/www/protected/models/Candidato.php b/www/protected/models/Candidato.php index 5e9e575..8fe137b 100644 --- a/www/protected/models/Candidato.php +++ b/www/protected/models/Candidato.php @@ -243,14 +243,17 @@ class Candidato extends CActiveRecord { // should not be searched. $criteria = new CDbCriteria; - - $criteria->with = array('estado'); - $criteria->together = true; - + + if ($this->descripcionEstado) { + $criteria->together = true; + $criteria->with = array('estado'); + $criteria->compare('estado.id', $this->id_estado, true); + $criteria->compare('estado.descripcion', $this->descripcionEstado, true); + } + $criteria->compare('t.id', $this->id); $criteria->compare('t.id_estado', $this->id_estado); - $criteria->compare('estado.descripcion', $this->descripcionEstado, true); $criteria->compare('t.n_identificacion', $this->n_identificacion, true); $criteria->compare('t.nombre', $this->nombre, true); diff --git a/www/themes/profind/views/candidato/sidebars/_candidatos.php b/www/themes/profind/views/candidato/sidebars/_candidatos.php index 6867431..43df096 100644 --- a/www/themes/profind/views/candidato/sidebars/_candidatos.php +++ b/www/themes/profind/views/candidato/sidebars/_candidatos.php @@ -18,21 +18,26 @@
+clientScript->registerScript('filtro_candidatos', " + candidatos_grid = { + update: function() { + $('#candidato-grid .filters select').trigger('change.yiiGridView'); + }, + + setEstado: function(idEstado) { + $('#candidato-grid .filters select option[value=' + idEstado + ']').attr('selected',true); + this.update(); + } + } + "); +?> + endClip(); ?> \ No newline at end of file