From 619cbf05e35c1220d7a893a357b29aa504c6004b Mon Sep 17 00:00:00 2001 From: roberto Date: Thu, 19 Apr 2012 11:51:42 +0000 Subject: [PATCH] =?UTF-8?q?Se=20a=C3=B1ade=20la=20gesti=C3=B3n=20de=20idio?= =?UTF-8?q?mas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_IntranetNueva/trunk@46 77cfc57b-8ef4-1849-9df6-4a38aa5da120 --- www/protected/models/Idioma.php | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/www/protected/models/Idioma.php b/www/protected/models/Idioma.php index fdd78a0..82e7a7f 100644 --- a/www/protected/models/Idioma.php +++ b/www/protected/models/Idioma.php @@ -5,9 +5,7 @@ * * The followings are the available columns in table 'tbl_idiomas': * @property integer $id - * @property string $idioma - * @property string $conversacion - * @property string $lectura_traduccion + * @property string descripcion * */ class Idioma extends CActiveRecord @@ -39,11 +37,11 @@ class Idioma extends CActiveRecord // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( - array('idioma', 'required'), - array('idioma, conversacion, lectura_traduccion', 'length', 'max'=>255), + array('descripcion', 'required'), + array('descripcion', 'length', 'max'=>255), // The following rule is used by search(). // Please remove those attributes that should not be searched. - array('id, idioma, conversacion, lectura_traduccion', 'safe', 'on'=>'search'), + array('id, descripcion', 'safe', 'on'=>'search'), ); } @@ -65,9 +63,7 @@ class Idioma extends CActiveRecord { return array( 'id' => 'ID', - 'idioma' => 'Idioma', - 'conversacion' => 'Conversación', - 'lectura_traduccion' => 'Lectura / Traducción', + 'descripcion' => 'Descripción', ); } @@ -81,14 +77,15 @@ class Idioma extends CActiveRecord // should not be searched. $criteria=new CDbCriteria; - $criteria->compare('id',$this->id); - $criteria->compare('idioma',$this->idioma,true); - $criteria->compare('conversacion',$this->conversacion,true); - $criteria->compare('lectura_traduccion',$this->lectura_traduccion,true); + $criteria->compare('descripcion',$this->descripcion,true); + + $sort = new CSort; + $sort->defaultOrder = 'descripcion ASC'; return new CActiveDataProvider($this, array( 'criteria'=>$criteria, + 'sort' => $sort, )); }