diff --git a/www/protected/EMenu.php b/www/protected/EMenu.php new file mode 100644 index 0000000..97ee15c --- /dev/null +++ b/www/protected/EMenu.php @@ -0,0 +1,142 @@ +widget('zii.widgets.EMenu',array( + * 'items'=>$menuStruct, + * 'level' => 1 + * )); + * + * render only 2 level of menu + * $this->widget('zii.widgets.EMenu',array( + * 'items'=>$menuStruct, + * 'level' => 2 + * )); + * + * work as old CMenu: + * $this->widget('zii.widgets.EMenu',array( + * 'items'=>$menuStruct + * )); + + * @author denis + * @link https://bitbucket.org/BuCeFaL/ext4yii/src + */ +class EMenu extends CMenu +{ + /** + * default is 0 - render all levels + * @var integer + */ + public $level = 0; + /** + * nesting level + * @var integer + */ + protected $_nestingLvl = 0; + /** + * if @property $level is not 0 + * method offset parents menu item and + * not rander childs + * @see CMenu::renderMenuRecursive() + */ + protected function renderMenuRecursive($items) + { + if($this->level>0){ + ++$this->_nestingLvl; + if($this->_nestingLvl < $this->level){ + foreach ($items as $item) + if(isset($item['items']) && count($item['items'])) + $this->renderMenuRecursive($item['items']); + }else if($this->_nestingLvl === $this->level){ + $count=0; + $n=count($items); + foreach($items as $item) + { + $count++; + $options=isset($item['itemOptions']) ? $item['itemOptions'] : array(); + $class=array(); + if($item['active'] && $this->activeCssClass!='') + $class[]=$this->activeCssClass; + if($count===1 && $this->firstItemCssClass!='') + $class[]=$this->firstItemCssClass; + if($count===$n && $this->lastItemCssClass!='') + $class[]=$this->lastItemCssClass; + if($class!==array()) + { + if(empty($options['class'])) + $options['class']=implode(' ',$class); + else + $options['class'].=' '.implode(' ',$class); + } + if($this->_nestingLvl === 1 || ( isset($item['parentIsActive']) && $item['parentIsActive'] )){ + echo CHtml::openTag('li', $options); + + $menu=$this->renderMenuItem($item); + if(isset($this->itemTemplate) || isset($item['template'])) + { + $template=isset($item['template']) ? $item['template'] : $this->itemTemplate; + echo strtr($template,array('{menu}'=>$menu)); + } + else + echo $menu; + + if(isset($item['items']) && count($item['items'])) + $this->renderMenuRecursive($item['items']); + + echo CHtml::closeTag('li')."\n"; + } + } + } + --$this->_nestingLvl; + }else + parent::renderMenuRecursive($items); + } + /** + * show items only of it's first level + * of parent active + * @see CMenu::normalizeItems() + */ + protected function normalizeItems($items,$route,&$active) + { + if($this->level > 0){ + foreach($items as $i=>$item) + { + if(isset($item['visible']) && !$item['visible']) + { + unset($items[$i]); + continue; + } + if($this->encodeLabel) + $items[$i]['label']=CHtml::encode($item['label']); + $hasActiveChild=false; + $isActive=$this->isItemActive($item,$route); + if(isset($item['items'])) + { + $items[$i]['items']=$this->normalizeItems($item['items'],$route,$hasActiveChild); + if(empty($items[$i]['items']) && $this->hideEmptyItems) + unset($items[$i]['items']); + } + if($hasActiveChild && !empty($items[$i]['items'])) + foreach ($items[$i]['items'] as &$subItem) + $subItem['parentIsActive']=true; + + if(!isset($item['active'])) + { + if($this->activateParents && $hasActiveChild || $this->activateItems && $this->isItemActive($item,$route)) + $active=$items[$i]['active']=true; + else + $items[$i]['active']=false; + } + else if($item['active']) + $active=true; + } + return array_values($items); + }else + parent::normalizeItems($items,$route,$active); + } +} \ No newline at end of file diff --git a/www/protected/config/console.php b/www/protected/config/console.php index 1db393e..200adf8 100644 --- a/www/protected/config/console.php +++ b/www/protected/config/console.php @@ -19,6 +19,14 @@ return array( 'password' => '', 'charset' => 'utf8', ), + 'testdb'=>array( + 'class' => 'CDbConnection', + 'connectionString' => 'mysql:host=localhost;dbname=intranet_test', + 'emulatePrepare' => true, + 'username' => 'root', + 'password' => '', + 'charset' => 'utf8', + ), ), ); \ No newline at end of file diff --git a/www/protected/gii/.hidden b/www/protected/gii/.hidden new file mode 100644 index 0000000..e69de29 diff --git a/www/protected/gii/fixture/FixtureCode.php b/www/protected/gii/fixture/FixtureCode.php new file mode 100644 index 0000000..1c25c64 --- /dev/null +++ b/www/protected/gii/fixture/FixtureCode.php @@ -0,0 +1,96 @@ + + * @link https://bitbucket.org/BuCeFaL/ext4yii/src + */ +class FixtureCode extends CCodeModel +{ + public $modelPath = 'application.models'; + public $fixturePath = 'application.tests.fixtures'; + + public $rowsLimit = null; + + protected $_models = array(); + + public function rules() + { + return array_merge(parent::rules(), array( + array('modelPath, fixturePath', 'filter', 'filter'=>'trim'), + array('modelPath, fixturePath', 'required'), + array('rowsLimit', 'numerical','allowEmpty' => true), + )); + } + + public function attributeLabels() + { + return array_merge(parent::attributeLabels(), array( + 'modelPath'=>'Models Path', + 'fixturePath'=>'Fixtures Path', + )); + } + /** + * @see CCodeModel::requiredTemplates() + */ + public function requiredTemplates() + { + return array( + 'fixture.php' + ); + } + /** + * @see CCodeModel::prepare() + */ + public function prepare() + { + Yii::import($this->modelPath); + $path = Yii::getPathOfAlias($this->modelPath); + $this->scandir($path); + $templatePath = Yii::getPathOfAlias('application.gii.fixture.templates.default'); + $tableNames = array(); + foreach ($this->_models as $modelName) + { + $class = pathinfo($modelName,PATHINFO_FILENAME); + $obj = new $class; + if ($obj instanceof CActiveRecord) + { + //fix issues #6 reported by "oceatoon" + $prefix = $obj->getDbConnection()->tablePrefix; + $tableName = str_replace(array('{{','}}'), array($prefix,''),$obj->tableName()); + $writeTo = Yii::getPathOfAlias($this->fixturePath).DIRECTORY_SEPARATOR.$tableName.'.php'; + if (!in_array($tableName, $tableNames) && !file_exists($writeTo)) + { + $tableNames[] = $tableName; + if (!empty($this->rowsLimit)) + { + $criteria = new CDbCriteria(); + $criteria->limit = intval($this->rowsLimit); + + $models = $class::model()->findAll($criteria); + } else + $models = $class::model()->findAll(); + + $this->files[] = new CCodeFile( + $writeTo, + $this->render($templatePath . DIRECTORY_SEPARATOR . 'fixture.php', array('models' => $models)) + ); + } + } + } + } + /** + * Scan directory and sub directory + * @param string $path + */ + protected function scanDir($path){ + foreach (scandir($path) as $file) + if ('.' !== $file && '..' !== $file) + if (is_file($filename = $path . DIRECTORY_SEPARATOR . $file) && 'php' === pathinfo($file,PATHINFO_EXTENSION)) + $this->_models[] = $file; + else if (is_dir($filename)) + { + Yii::import($this->modelPath . '.' . $file . '.*'); + $this->scanDir($filename); + } + } +} \ No newline at end of file diff --git a/www/protected/gii/fixture/FixtureGenerator.php b/www/protected/gii/fixture/FixtureGenerator.php new file mode 100644 index 0000000..2db1931 --- /dev/null +++ b/www/protected/gii/fixture/FixtureGenerator.php @@ -0,0 +1 @@ + array(' . PHP_EOL ; + foreach ($model->attributes as $attr => $value){ + echo "\t'" . str_replace("'", "\'", $attr) . "' =>"; + if(isset($value)){ + echo "'" . str_replace("'", "\'", $value) . "',\n"; + }else{ + echo "NULL,\n"; + } + } + echo '),'.PHP_EOL; + } + +echo ');'; diff --git a/www/protected/gii/fixture/views/index.php b/www/protected/gii/fixture/views/index.php new file mode 100644 index 0000000..ce6627a --- /dev/null +++ b/www/protected/gii/fixture/views/index.php @@ -0,0 +1,84 @@ +clientScript->registerScript('gii.model'," +$('#{$class}_modelClass').change(function(){ + $(this).data('changed',$(this).val()!=''); +}); +$('#{$class}_tableName').bind('keyup change', function(){ + var model=$('#{$class}_modelClass'); + var tableName=$(this).val(); + if(tableName.substring(tableName.length-1)!='*') { + $('.form .row.model-class').show(); + } + else { + $('#{$class}_modelClass').val(''); + $('.form .row.model-class').hide(); + } + if(!model.data('changed')) { + var i=tableName.lastIndexOf('.'); + if(i>=0) + tableName=tableName.substring(i+1); + var tablePrefix=$('#{$class}_tablePrefix').val(); + if(tablePrefix!='' && tableName.indexOf(tablePrefix)==0) + tableName=tableName.substring(tablePrefix.length); + var modelClass=''; + $.each(tableName.split('_'), function() { + if(this.length>0) + modelClass+=this.substring(0,1).toUpperCase()+this.substring(1); + }); + model.val(modelClass); + } +}); +$('.form .row.model-class').toggle($('#{$class}_tableName').val().substring($('#{$class}_tableName').val().length-1)!='*'); +"); +?> +

Fixture Generator

+ +

This generator generates a fixtures for the specified database table.

+ +beginWidget('CCodeForm', array('model'=>$model)); ?> + +
+ labelEx($model,'modelPath'); + echo $form->textField($model,'modelPath', array('size'=>65)); + ?> +
+ This refers to the table name that a new model class should be generated for + (e.g. tbl_user). It can contain schema name, if needed (e.g. public.tbl_post). + You may also enter * (or schemaName.* for a particular DB schema) + to generate a model class for EVERY table. +
+ error($model,'modelPath'); ?> +
+
+ labelEx($model,'rowsLimit'); + echo $form->dropDownList($model,'rowsLimit',array( + '' => 'All', + '10' => '10' , + '20' => '20' , + '30' => '30' , + '40' => '40' , + '50' => '50' , + '60' => '30' , + '70' => '70' , + '80' => '80' , + )); + ?> +
+ Generate n or all rows. +
+ error($model,'modelPath'); ?> +
+
+ labelEx($model,'fixturePath'); ?> + textField($model,'fixturePath', array('size'=>65)); ?> +
+ This refers to the directory that the new model class file should be generated under. + It should be specified in the form of a path alias, for example, application.models. +
+ error($model,'fixturePath'); ?> +
+ +endWidget(); \ No newline at end of file diff --git a/www/protected/migrations/m120127_152158_tbl_usuarios.php b/www/protected/migrations/m120127_152158_tbl_usuarios.php new file mode 100644 index 0000000..847ec75 --- /dev/null +++ b/www/protected/migrations/m120127_152158_tbl_usuarios.php @@ -0,0 +1,32 @@ +createTable('tbl_usuarios', array( + 'id' => 'pk', + 'email' => 'string', + 'name' => 'string', + 'username' => 'string NOT NULL', + 'password' => 'string NOT NULL', + 'last_login_time' => 'datetime', + )); + } + + public function down() + { + $this->dropTable('tbl_usuarios'); + } + + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} \ No newline at end of file diff --git a/www/protected/migrations/m120127_152205_tbl_candidatos.php b/www/protected/migrations/m120127_152205_tbl_candidatos.php new file mode 100644 index 0000000..13573fe --- /dev/null +++ b/www/protected/migrations/m120127_152205_tbl_candidatos.php @@ -0,0 +1,37 @@ +createTable('tbl_candidatos', array( + 'id' => 'pk', + 'foto' => 'string', + 'dni' => 'string', + 'nombre' => 'string', + 'apellidos' => 'string', + 'email' => 'string', + 'telefono_fijo' => 'string', + 'telefono_movil' => 'string', + 'sexo' => 'string', + 'fecha_nacimiento' => 'date', + 'lugar_nacimiento' => 'string', + )); + } + + public function down() + { + $this->dropTable('tbl_candidatos'); + } + + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} \ No newline at end of file diff --git a/www/protected/migrations/m120130_120027_tbl_perfiles.php b/www/protected/migrations/m120130_120027_tbl_perfiles.php new file mode 100644 index 0000000..6a90986 --- /dev/null +++ b/www/protected/migrations/m120130_120027_tbl_perfiles.php @@ -0,0 +1,35 @@ +createTable('tbl_perfiles_tecnicos', array( + 'id' => 'pk', + 'perfil' => 'string NOT NULL', + )); + + $this->createTable('tbl_perfiles_funcionales', array( + 'id' => 'pk', + 'perfil' => 'string NOT NULL', + )); + + } + + public function down() + { + $this->dropTable('tbl_perfiles_funcionales'); + $this->dropTable('tbl_perfiles_tecnicos'); + } + + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} \ No newline at end of file diff --git a/www/protected/migrations/m120130_120742_tbl_tecnologias.php b/www/protected/migrations/m120130_120742_tbl_tecnologias.php new file mode 100644 index 0000000..d570a87 --- /dev/null +++ b/www/protected/migrations/m120130_120742_tbl_tecnologias.php @@ -0,0 +1,28 @@ +createTable('tbl_tecnologias', array( + 'id' => 'pk', + 'tecnologia' => 'string NOT NULL', + )); + } + + public function down() + { + $this->dropTable('tbl_tecnologias'); + } + + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} \ No newline at end of file diff --git a/www/protected/migrations/m120130_120838_tbl_idiomas.php b/www/protected/migrations/m120130_120838_tbl_idiomas.php new file mode 100644 index 0000000..a7d18b6 --- /dev/null +++ b/www/protected/migrations/m120130_120838_tbl_idiomas.php @@ -0,0 +1,28 @@ +createTable('tbl_idiomas', array( + 'id' => 'pk', + 'idioma' => 'string NOT NULL', + )); + } + + public function down() + { + $this->dropTable('tbl_idiomas'); + } + + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} \ No newline at end of file diff --git a/www/protected/migrations/m120130_120941_tbl_candidatos_capacidades.php b/www/protected/migrations/m120130_120941_tbl_candidatos_capacidades.php new file mode 100644 index 0000000..14bfd9b --- /dev/null +++ b/www/protected/migrations/m120130_120941_tbl_candidatos_capacidades.php @@ -0,0 +1,57 @@ +createTable('tbl_candidatos_capacidades', array( + 'id' => 'pk', + 'candidato_id' => 'integer NOT NULL', + 'perfil_tecnico_id' => 'integer NOT NULL', + 'meses_perfil_tecnico' => 'integer', + 'perfil_funcional_id' => 'integer NOT NULL', + 'meses_perfil_funcional' => 'integer', + 'observaciones' => 'text', + )); + + $this->addForeignKey('fk_candidatos_capacidades_1', 'tbl_candidatos_capacidades', 'candidato_id', 'tbl_candidatos', 'id', 'CASCADE', 'CASCADE'); + $this->addForeignKey('fk_candidatos_capacidades_2', 'tbl_candidatos_capacidades', 'perfil_tecnico_id', 'tbl_perfiles_tecnicos', 'id', 'CASCADE', 'RESTRICT'); + $this->addForeignKey('fk_candidatos_capacidades_3', 'tbl_candidatos_capacidades', 'perfil_funcional_id', 'tbl_perfiles_funcionales', 'id', 'CASCADE', 'RESTRICT'); + + + $this->createTable('tbl_candidatos_capacidades_tecnologias', array( + 'id' => 'pk', + 'capacidad_id' => 'integer NOT NULL', + 'tecnologia_id' => 'integer NOT NULL', + 'meses_tecnologia' => 'integer', + )); + + $this->addForeignKey('tbl_candidatos_capacidades_tecnologias_1', 'tbl_candidatos_capacidades_tecnologias', 'capacidad_id', 'tbl_candidatos_capacidades', 'id', 'CASCADE', 'CASCADE'); + $this->addForeignKey('tbl_candidatos_capacidades_tecnologias_2', 'tbl_candidatos_capacidades_tecnologias', 'tecnologia_id', 'tbl_tecnologias', 'id', 'CASCADE', 'RESTRICT'); + + } + + public function down() + { + + $this->dropForeignKey('tbl_candidatos_capacidades_tecnologias_2', 'tbl_candidatos_capacidades_tecnologias'); + $this->dropForeignKey('tbl_candidatos_capacidades_tecnologias_1', 'tbl_candidatos_capacidades_tecnologias'); + $this->dropTable('tbl_candidatos_capacidades_tecnologias'); + + $this->dropForeignKey('fk_candidatos_capacidades_3', 'tbl_candidatos_capacidades'); + $this->dropForeignKey('fk_candidatos_capacidades_2', 'tbl_candidatos_capacidades'); + $this->dropForeignKey('fk_candidatos_capacidades_1', 'tbl_candidatos_capacidades'); + $this->dropTable('tbl_candidatos_capacidades'); + } + + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} diff --git a/www/protected/migrations/m120130_183758_tbl_candidatos_idiomas.php b/www/protected/migrations/m120130_183758_tbl_candidatos_idiomas.php new file mode 100644 index 0000000..ff7f1d4 --- /dev/null +++ b/www/protected/migrations/m120130_183758_tbl_candidatos_idiomas.php @@ -0,0 +1,34 @@ +createTable('tbl_candidatos_idiomas', array( + 'id' => 'pk', + 'candidato_id' => 'integer NOT NULL', + 'idioma' => 'string NOT NULL', + 'conversacion' => 'string', + 'lectura_traduccion' => 'string', + )); + + $this->addForeignKey('fk_candidatos_idiomas_1', 'tbl_candidatos_idiomas', 'candidato_id', 'tbl_candidatos', 'id', 'CASCADE', 'CASCADE'); + } + + public function down() + { + $this->dropForeignKey('fk_candidatos_idiomas_1', 'tbl_candidatos_idiomas'); + $this->dropTable('tbl_candidatos_idiomas'); + } + + /* + // Use safeUp/safeDown to do migration with transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} \ No newline at end of file diff --git a/www/protected/models/Candidato.php b/www/protected/models/Candidato.php new file mode 100644 index 0000000..61c8af2 --- /dev/null +++ b/www/protected/models/Candidato.php @@ -0,0 +1,150 @@ + 'Hombre', + self::GENERO_MUJER => 'Mujer' + ); + } + + /** + * Devuelve la lista de estados permitidos para un candidato. + * @return array lista de estados permitidos + */ + public function getOpcionesEstado() { + return array( + 0 => 'Pendiente de clasificar', + 1 => 'Rechazado por antecedentes', + 2 => 'Rechazado por no cumplir requisitos mínimos', + 3 => 'Rechazado por perfil no demandado', + 4 => 'Disponible', + 5 => 'Disponible asignado exclusivo', + 6 => 'No disponible', + ); + } + + /** + * Returns the static model of the specified AR class. + * @param string $className active record class name. + * @return Candidato the static model class + */ + public static function model($className=__CLASS__) + { + return parent::model($className); + } + + /** + * @return string the associated database table name + */ + public function tableName() + { + return 'tbl_candidatos'; + } + + /** + * @return array validation rules for model attributes. + */ + public function rules() + { + // NOTE: you should only define rules for those attributes that + // will receive user inputs. + return array( + array('foto, dni, nombre, apellidos, email, telefono_fijo, telefono_movil, sexo, lugar_nacimiento', 'length', 'max'=>255), + array('fecha_nacimiento', 'safe'), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('id, foto, dni, nombre, apellidos, email, telefono_fijo, telefono_movil, sexo, fecha_nacimiento, lugar_nacimiento', 'safe', 'on'=>'search'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + 'capacidades' => array(self::HAS_MANY, 'CapacidadProfesional', 'candidato_id'), + 'idiomas' => array(self::HAS_MANY, 'CandidatoIdioma', 'candidato_id'), + 'idiomasCount' => array(self::STAT, 'CandidatoIdioma', 'candidato_id'), + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'foto' => 'Foto', + 'dni' => 'Dni', + 'nombre' => 'Nombre', + 'apellidos' => 'Apellidos', + 'email' => 'Email', + 'telefono_fijo' => 'Telefono Fijo', + 'telefono_movil' => 'Telefono Movil', + 'sexo' => 'Sexo', + 'fecha_nacimiento' => 'Fecha Nacimiento', + 'lugar_nacimiento' => 'Lugar Nacimiento', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // should not be searched. + + $criteria=new CDbCriteria; + + $criteria->compare('id',$this->id); + $criteria->compare('foto',$this->foto,true); + $criteria->compare('dni',$this->dni,true); + $criteria->compare('nombre',$this->nombre,true); + $criteria->compare('apellidos',$this->apellidos,true); + $criteria->compare('email',$this->email,true); + $criteria->compare('telefono_fijo',$this->telefono_fijo,true); + $criteria->compare('telefono_movil',$this->telefono_movil,true); + $criteria->compare('sexo',$this->sexo,true); + $criteria->compare('fecha_nacimiento',$this->fecha_nacimiento,true); + $criteria->compare('lugar_nacimiento',$this->lugar_nacimiento,true); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } +} \ No newline at end of file diff --git a/www/protected/models/CandidatoIdioma.php b/www/protected/models/CandidatoIdioma.php new file mode 100644 index 0000000..d1d24a2 --- /dev/null +++ b/www/protected/models/CandidatoIdioma.php @@ -0,0 +1,114 @@ + 'Bajo', + self::NIVEL_MEDIO => 'Medio', + self::NIVEL_ALTO => 'Alto', + ); + } + + /** + * Returns the static model of the specified AR class. + * @param string $className active record class name. + * @return CandidatoIdioma the static model class + */ + public static function model($className=__CLASS__) + { + return parent::model($className); + } + + /** + * @return string the associated database table name + */ + public function tableName() + { + return 'tbl_candidatos_idiomas'; + } + + /** + * @return array validation rules for model attributes. + */ + public function rules() + { + // NOTE: you should only define rules for those attributes that + // will receive user inputs. + return array( + array('idioma, conversacion, lectura_traduccion', 'length', 'max'=>255), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('idioma, conversacion, lectura_traduccion', 'safe', 'on'=>'search'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + 'candidato' => array(self::BELONGS_TO, 'Candidato', 'candidato_id'), + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'candidato_id' => 'Id Candidato', + 'idioma' => 'Idioma', + 'conversacion' => 'Conversación', + 'lectura_traduccion' => 'Lectura/traduccion', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // should not be searched. + + $criteria=new CDbCriteria; + + $criteria->compare('id',$this->id); + $criteria->compare('candidato_id',$this->candidato_id); + $criteria->compare('idioma',$this->idioma); + $criteria->compare('conversacion',$this->conversacion,true); + $criteria->compare('lectura_traduccion',$this->lectura_traduccion,true); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } +} \ No newline at end of file diff --git a/www/protected/models/CapacidadProfesional.php b/www/protected/models/CapacidadProfesional.php new file mode 100644 index 0000000..66940e4 --- /dev/null +++ b/www/protected/models/CapacidadProfesional.php @@ -0,0 +1,111 @@ +true), + array('observaciones', 'safe'), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('id, candidato_id, id_perfil_tecnico, meses_perfil_tecnico, id_perfil_funcional, meses_perfil_funcional, observaciones', 'safe', 'on'=>'search'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + 'perfilFuncional' => array(self::BELONGS_TO, 'PerfilFuncional', 'perfil_funcional_id'), + 'candidato' => array(self::BELONGS_TO, 'Candidatos', 'candidato_id'), + 'perfilTecnico' => array(self::BELONGS_TO, 'PerfilesTecnicos', 'perfil_tecnico_id'), + 'tecnologias' => array(self::HAS_MANY, 'CapacidadProfesionalTecnologia', 'capacidad_id'), + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'candidato_id' => 'Id Candidato', + 'id_perfil_tecnico' => 'Id Perfil Tecnico', + 'meses_perfil_tecnico' => 'Meses Perfil Tecnico', + 'id_perfil_funcional' => 'Id Perfil Funcional', + 'meses_perfil_funcional' => 'Meses Perfil Funcional', + 'observaciones' => 'Observaciones', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // should not be searched. + + $criteria=new CDbCriteria; + + $criteria->compare('id',$this->id); + $criteria->compare('candidato_id',$this->candidato_id); + $criteria->compare('id_perfil_tecnico',$this->id_perfil_tecnico); + $criteria->compare('meses_perfil_tecnico',$this->meses_perfil_tecnico); + $criteria->compare('id_perfil_funcional',$this->id_perfil_funcional); + $criteria->compare('meses_perfil_funcional',$this->meses_perfil_funcional); + $criteria->compare('observaciones',$this->observaciones,true); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } +} \ No newline at end of file diff --git a/www/protected/models/CapacidadProfesionalTecnologia.php b/www/protected/models/CapacidadProfesionalTecnologia.php new file mode 100644 index 0000000..4742e9c --- /dev/null +++ b/www/protected/models/CapacidadProfesionalTecnologia.php @@ -0,0 +1,98 @@ +true), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('id, id_capacidad, id_tecnologia, meses_tecnologia', 'safe', 'on'=>'search'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + 'idTecnologia' => array(self::BELONGS_TO, 'Tecnologias', 'id_tecnologia'), + 'idCapacidad' => array(self::BELONGS_TO, 'CandidatosCapacidades', 'id_capacidad'), + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'id_capacidad' => 'Id Capacidad', + 'id_tecnologia' => 'Id Tecnologia', + 'meses_tecnologia' => 'Meses Tecnologia', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // should not be searched. + + $criteria=new CDbCriteria; + + $criteria->compare('id',$this->id); + $criteria->compare('id_capacidad',$this->id_capacidad); + $criteria->compare('id_tecnologia',$this->id_tecnologia); + $criteria->compare('meses_tecnologia',$this->meses_tecnologia); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } +} \ No newline at end of file diff --git a/www/protected/models/Idioma.php b/www/protected/models/Idioma.php new file mode 100644 index 0000000..d7eadc5 --- /dev/null +++ b/www/protected/models/Idioma.php @@ -0,0 +1,96 @@ +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'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'idioma' => 'Idioma', + 'conversacion' => 'Conversacion', + 'lectura_traduccion' => 'Lectura Traduccion', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // 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); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } + + +} \ No newline at end of file diff --git a/www/protected/models/PerfilFuncional.php b/www/protected/models/PerfilFuncional.php new file mode 100644 index 0000000..15e30f8 --- /dev/null +++ b/www/protected/models/PerfilFuncional.php @@ -0,0 +1,86 @@ +255), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('id, perfil', 'safe', 'on'=>'search'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'perfil' => 'Perfil', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // should not be searched. + + $criteria=new CDbCriteria; + + $criteria->compare('id',$this->id); + $criteria->compare('perfil',$this->perfil,true); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } +} \ No newline at end of file diff --git a/www/protected/models/PerfilTecnico.php b/www/protected/models/PerfilTecnico.php new file mode 100644 index 0000000..6404d97 --- /dev/null +++ b/www/protected/models/PerfilTecnico.php @@ -0,0 +1,86 @@ +255), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('id, perfil', 'safe', 'on'=>'search'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'perfil' => 'Perfil', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // should not be searched. + + $criteria=new CDbCriteria; + + $criteria->compare('id',$this->id); + $criteria->compare('perfil',$this->perfil,true); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } +} \ No newline at end of file diff --git a/www/protected/models/Tecnologia.php b/www/protected/models/Tecnologia.php new file mode 100644 index 0000000..338a67e --- /dev/null +++ b/www/protected/models/Tecnologia.php @@ -0,0 +1,90 @@ +255), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('id, tecnologia', 'safe', 'on'=>'search'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + 'candidatosCapacidadesTecnologiases' => array(self::HAS_MANY, 'CandidatosCapacidadesTecnologias', 'id_tecnologia'), + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'tecnologia' => 'Tecnologia', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // should not be searched. + + $criteria=new CDbCriteria; + + $criteria->compare('id',$this->id); + $criteria->compare('tecnologia',$this->tecnologia,true); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } +} \ No newline at end of file diff --git a/www/protected/models/Usuario.php b/www/protected/models/Usuario.php new file mode 100644 index 0000000..e0b98ac --- /dev/null +++ b/www/protected/models/Usuario.php @@ -0,0 +1,99 @@ +255), + array('last_login_time', 'safe'), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('id, email, name, username, password, last_login_time', 'safe', 'on'=>'search'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'email' => 'Email', + 'name' => 'Nombre', + 'username' => 'Usuario', + 'password' => 'Contraseña', + 'last_login_time' => 'Último acceso', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // should not be searched. + + $criteria=new CDbCriteria; + + $criteria->compare('id',$this->id); + $criteria->compare('email',$this->email,true); + $criteria->compare('name',$this->name,true); + $criteria->compare('username',$this->username,true); + $criteria->compare('password',$this->password,true); + $criteria->compare('last_login_time',$this->last_login_time,true); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } +} \ No newline at end of file diff --git a/www/protected/runtime/application.log b/www/protected/runtime/application.log new file mode 100644 index 0000000..ddba2a0 --- /dev/null +++ b/www/protected/runtime/application.log @@ -0,0 +1,4 @@ +2012/01/30 11:56:09 [error] [system.db.CDbCommand] CDbCommand::fetchAll() failed: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'intranet_dev.tbl_capacidadescandidatos' doesn't exist. The SQL statement executed was: SHOW COLUMNS FROM `tbl_capacidadesCandidatos`. +in C:\Intranet\www\index.php (13) +2012/01/30 11:56:20 [error] [system.db.CDbCommand] CDbCommand::fetchAll() failed: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'intranet_dev.tbl_capacidades_candidatos' doesn't exist. The SQL statement executed was: SHOW COLUMNS FROM `tbl_capacidades_candidatos`. +in C:\Intranet\www\index.php (13) diff --git a/www/protected/runtime/gii-1.1.10-dev/FixtureCode.php b/www/protected/runtime/gii-1.1.10-dev/FixtureCode.php new file mode 100644 index 0000000..5eb4cc9 --- /dev/null +++ b/www/protected/runtime/gii-1.1.10-dev/FixtureCode.php @@ -0,0 +1,4 @@ + 'default', +); diff --git a/www/protected/runtime/gii-1.1.10-dev/ModelCode.php b/www/protected/runtime/gii-1.1.10-dev/ModelCode.php new file mode 100644 index 0000000..99aff35 --- /dev/null +++ b/www/protected/runtime/gii-1.1.10-dev/ModelCode.php @@ -0,0 +1,8 @@ + 'default', + 'tablePrefix' => 'tbl', + 'modelPath' => 'application.models', + 'baseClass' => 'CActiveRecord', + 'buildRelations' => '1', +); diff --git a/www/protected/tests/fixtures/tbl_candidatos.php b/www/protected/tests/fixtures/tbl_candidatos.php new file mode 100644 index 0000000..f28ee31 --- /dev/null +++ b/www/protected/tests/fixtures/tbl_candidatos.php @@ -0,0 +1,41 @@ + array( + 'foto' => '', + 'dni' => '', + 'nombre' => 'José', + 'apellidos' => 'García Pérez', + 'email' => 'usuario1@gmail.com', + 'telefono_fijo' => '938765500', + 'telefono_movil' => '666892345', + 'sexo' => 'Hombre', + 'fecha_nacimiento' => '01-01-1982', + 'lugar_nacimiento' => 'Barcelona', + ), + 'candidato2' => array( + 'foto' => '', + 'dni' => '', + 'nombre' => 'Manolo', + 'apellidos' => 'Sánchez Díaz', + 'email' => 'usuario2@gmail.com', + 'telefono_fijo' => '', + 'telefono_movil' => '615923415', + 'sexo' => 'Hombre', + 'fecha_nacimiento' => '01-01-1981', + 'lugar_nacimiento' => 'Madrid', + ), + 'candidato3' => array( + 'foto' => '', + 'dni' => '', + 'nombre' => 'Rosa', + 'apellidos' => 'Ruiz Gutierrez', + 'email' => 'usuario3@gmail.com', + 'telefono_fijo' => '', + 'telefono_movil' => '645123438', + 'sexo' => 'Hombre', + 'fecha_nacimiento' => '01-01-1980', + 'lugar_nacimiento' => 'Sevilla', + ), + ); + +?> diff --git a/www/protected/tests/fixtures/tbl_candidatos_idiomas.php b/www/protected/tests/fixtures/tbl_candidatos_idiomas.php new file mode 100644 index 0000000..3d418a9 --- /dev/null +++ b/www/protected/tests/fixtures/tbl_candidatos_idiomas.php @@ -0,0 +1,24 @@ + array( + 'candidato_id'=>'1', + 'idioma'=>'Francés', + 'conversacion'=>'medio', + 'lectura_traduccion'=>'medio', + ), + 'fila2' => array( + 'candidato_id'=>'1', + 'idioma'=>'Inglés', + 'conversacion'=>'bajo', + 'lectura_traduccion'=>'alto', + ), + 'fila3' => array( + 'candidato_id'=>'2', + 'idioma'=>'Alemán', + 'conversacion'=>'alto', + 'lectura_traduccion'=>'alto', + ), + ); + +?> diff --git a/www/protected/tests/fixtures/tbl_idiomas.php b/www/protected/tests/fixtures/tbl_idiomas.php new file mode 100644 index 0000000..60e58bb --- /dev/null +++ b/www/protected/tests/fixtures/tbl_idiomas.php @@ -0,0 +1,17 @@ + array('idioma'=>'Alemán Conversación'), + 'idioma2' => array('idioma'=>'Francés Leer/Traducción'), + 'idioma3' => array('idioma'=>'Inglés Conversación'), + 'idioma4' => array('idioma'=>'Italiano Conversación'), + 'idioma5' => array('idioma'=>'Portugués Conversación'), + 'idioma6' => array('idioma'=>'--'), + 'idioma7' => array('idioma'=>'Francés Conversación'), + 'idioma8' => array('idioma'=>'Alemán Leer/Tradución'), + 'idioma9' => array('idioma'=>'Inglés Leer/Traducción'), + 'idioma10' => array('idioma'=>'Italiano Leer/Traducción'), + 'idioma11' => array('idioma'=>'Portugués Leer/Traducción') +); + +?> diff --git a/www/protected/tests/fixtures/tbl_perfiles_funcionales.php b/www/protected/tests/fixtures/tbl_perfiles_funcionales.php new file mode 100644 index 0000000..735eef6 --- /dev/null +++ b/www/protected/tests/fixtures/tbl_perfiles_funcionales.php @@ -0,0 +1,113 @@ + array('perfil'=>'ALHAMBRA-AGENTS '), + 'funcional5' => array('perfil'=>'ALHAMBRA-ALHAMBRA '), + 'funcional6' => array('perfil'=>'ALHAMBRA-BRANCHES '), + 'funcional7' => array('perfil'=>'ALHAMBRA-CHANNELS '), + 'funcional8' => array('perfil'=>'ALHAMBRA-CONTACT CENTER'), + 'funcional9' => array('perfil'=>'ALHAMBRA-INTERMEDIARIOS'), + 'funcional10' => array('perfil'=>'ALHAMBRA-INTERNET'), + 'funcional11' => array('perfil'=>'ALHAMBRA-PORTALS'), + 'funcional12' => array('perfil'=>'ALHAMBRA-SELF SERVICES'), + 'funcional13' => array('perfil'=>'ASSET MANAGEMENT'), + 'funcional14' => array('perfil'=>'ASSET MANAGEMENT-GEST.DISCR.CAR'), + 'funcional15' => array('perfil'=>'BANCA PRIVADA '), + 'funcional16' => array('perfil'=>'BANCA PRIVADA-COMUNIC.CLIENT'), + 'funcional17' => array('perfil'=>'BANCA PRIVADA-CRIS(SIST.COME'), + 'funcional18' => array('perfil'=>'BANCA PRIVADA-DWH/MIS'), + 'funcional19' => array('perfil'=>'BANCA PRIVADA-GEST.CARTERAS'), + 'funcional20' => array('perfil'=>'CANALES-BROKER CANALS'), + 'funcional21' => array('perfil'=>'CANALES-CONTACT CENTER'), + 'funcional22' => array('perfil'=>'CANALES-CROSS CANALS'), + 'funcional23' => array('perfil'=>'CANALES-INTERNET'), + 'funcional24' => array('perfil'=>'CANALES-MOVILIDAD'), + 'funcional25' => array('perfil'=>'CANALES-CIRCUIT.CONTR.'), + 'funcional26' => array('perfil'=>'CANALES-OFICINA'), + 'funcional27' => array('perfil'=>'COMP-GLOB.PAGOS -COMP. DE PAGOS'), + 'funcional28' => array('perfil'=>'COMP-GLOB.PAGOS-COMP. GENERALES '), + 'funcional29' => array('perfil'=>'COMP-GLOB.PAGOS-COMP. DE INVERS '), + 'funcional30' => array('perfil'=>'CONSUMER FINANCE '), + 'funcional31' => array('perfil'=>'CONTROL DE CALIDAD-CALIDAD TECNICA '), + 'funcional32' => array('perfil'=>'CONTROL DE CALIDAD-CALIDAD FUNCIONAL'), + 'funcional33' => array('perfil'=>'CRM-AGENDAS'), + 'funcional34' => array('perfil'=>'CRM-CAMPAÑAS'), + 'funcional35' => array('perfil'=>'CRM-CRM'), + 'funcional36' => array('perfil'=>'CRM-GEST.INF.COMERCI'), + 'funcional37' => array('perfil'=>'CRM-INTEL.COMERCIAL'), + 'funcional41' => array('perfil'=>'CUENTAS PERSONALES-CAJA '), + 'funcional42' => array('perfil'=>'CUENTAS PERSONALES-CTAS PERSONALES '), + 'funcional43' => array('perfil'=>'CUENTAS PERSONALES-LIQ.PASIVO '), + 'funcional44' => array('perfil'=>'CUENTAS PERSONALES-SGO '), + 'funcional45' => array('perfil'=>'CUENTAS PERSONALES-PLANES '), + 'funcional46' => array('perfil'=>'CUENTAS PERSONALES-CASH POOLINGES-'), + 'funcional47' => array('perfil'=>'CUENTAS PERSONALES-FONDOS'), + 'funcional48' => array('perfil'=>'CUENTAS PERSONALES-DESCUB Y CREDITO '), + 'funcional49' => array('perfil'=>'CUENTAS PERSONALES-DEP.PL.FIJO Y LI '), + 'funcional50' => array('perfil'=>'CUENTAS PERSONALES-CAJA ALQUILER'), + 'funcional51' => array('perfil'=>'MIS(SIST.INF.GESTIÓN)-AUDITORIA'), + 'funcional52' => array('perfil'=>'MIS(SIST.INF.GESTIÓN-CUMPLIMIENTO) '), + 'funcional53' => array('perfil'=>'MIS(SIST.INF.GESTIÓN)-SATAMARTS '), + 'funcional54' => array('perfil'=>'MIS(SIST.INF.GESTIÓN-GEST ACT Y PAS) '), + 'funcional55' => array('perfil'=>'MIS(SIST.INF.GESTIÓN)-INTERVENCION '), + 'funcional56' => array('perfil'=>'MIS(SIST.INF.GESTIÓN-POS RIEGO CLIENTE) '), + 'funcional57' => array('perfil'=>'NEGOCIOS GLOBALES-BANCA Y MERC GLOBAL '), + 'funcional58' => array('perfil'=>'NEGOCIOS GLOBALES-GEST ACTIVOS '), + 'funcional59' => array('perfil'=>'NEGOCIOS GLOBALES-SEGUROS '), + 'funcional60' => array('perfil'=>'OTRAS FINANCIACIONES-TITULIZACIONES '), + 'funcional61' => array('perfil'=>'OTRAS FINANCIACIONES-LEASING RENTING '), + 'funcional62' => array('perfil'=>'OTRAS FINANCIACIONES-GEST. TITULIZACIONES '), + 'funcional63' => array('perfil'=>'OTRAS FINANCIACIONES-FACTORING'), + 'funcional64' => array('perfil'=>'OTRAS FINANCIACIONES-CREDITOS EURIBOR '), + 'funcional65' => array('perfil'=>'OTRAS FINANCIACIONES-CONFIRMING '), + 'funcional66' => array('perfil'=>'OTRAS FINANCIACION-AVALES '), + 'funcional67' => array('perfil'=>'OTRAS FINANCIACIONES '), + 'funcional69' => array('perfil'=>'PAGOS TRADICIONALES-TRASF NACIONALES '), + 'funcional70' => array('perfil'=>'PAGOS TRADICIONALES-CARTERA '), + 'funcional71' => array('perfil'=>'PAGOS TRADICIONALES-DOMICILIACIONES '), + 'funcional72' => array('perfil'=>'PAGOS TRADICIONALES-TRASF. INTERNACIONALES '), + 'funcional73' => array('perfil'=>'PAGOS Y COBROS ELECTRONICOS-EBA '), + 'funcional74' => array('perfil'=>'PAGOS Y COBROS ELECTRONICOS-SEG. CAMBIO '), + 'funcional75' => array('perfil'=>'PAGOS Y COBROS ELECTRONICOS '), + 'funcional76' => array('perfil'=>'PRESTAMOS'), + 'funcional77' => array('perfil'=>'PROCESOS'), + 'funcional78' => array('perfil'=>'PROCESOS-PROC.PRESTAMOS'), + 'funcional79' => array('perfil'=>'PROCESOS-PROC.EXTRANJERO '), + 'funcional80' => array('perfil'=>'PROCESOS-PROC.BANCA Y AHO '), + 'funcional81' => array('perfil'=>'PROCESOS-PROC.FAC.LEA'), + 'funcional82' => array('perfil'=>'PROCESOS-PROC. VENTAS '), + 'funcional83' => array('perfil'=>'RIESGOS-ADMISION'), + 'funcional84' => array('perfil'=>'RIESGOS-GEST. COBRO'), + 'funcional85' => array('perfil'=>'RIESGOS-SEGUIMIENTO '), + 'funcional86' => array('perfil'=>'RIESGOS IRREGULARES-CIRBE '), + 'funcional87' => array('perfil'=>'RIESGOS IRREGULARES'), + 'funcional88' => array('perfil'=>'SEGUROS'), + 'funcional89' => array('perfil'=>'SIST. ESTRUCTURALES-ARQ. GESTION '), + 'funcional90' => array('perfil'=>'SIST. ESTRUCTURALES-CATAL. PRODUCTOS '), + 'funcional91' => array('perfil'=>'SIST. ESTRUCTURALES-RIESGO DE CAMBIO '), + 'funcional92' => array('perfil'=>'SIST. ESTRUCTURALES-TABLAS GENERALES '), + 'funcional93' => array('perfil'=>'SIST. ESTRUCTURALES-SIST. COM CLIENTE '), + 'funcional94' => array('perfil'=>'SIST. ESTRUCTURALES-BIENES Y GARANTIAS'), + 'funcional95' => array('perfil'=>'SIST. ESTRUCTURALES-CONTROL OPERATIVO '), + 'funcional96' => array('perfil'=>'SIST. ESTRUCTURALES-CONTABILIDAD'), + 'funcional97' => array('perfil'=>'SIST. ESTRUCTURALES-COMP. GENERALES '), + 'funcional98' => array('perfil'=>'SIST. ESTRUCTURALES-BD PERDONAS'), + 'funcional99' => array('perfil'=>'SIST. INTERNOS-ACTIVOS'), + 'funcional100' => array('perfil'=>'SIST. INTERNOS-REC HUMANOS '), + 'funcional101' => array('perfil'=>'SIST. INTERNOS'), + 'funcional102' => array('perfil'=>'SIST. INTERNOS-REMUNERACIONES'), + 'funcional103' => array('perfil'=>'TARJETAS-ACQUIRANCE '), + 'funcional104' => array('perfil'=>'TARJETAS-SIST. ADMON '), + 'funcional105' => array('perfil'=>'TARJETAS-WITCHER PCAS '), + 'funcional106' => array('perfil'=>'TARJETAS'), + 'funcional107' => array('perfil'=>'MEDIOS DE PAGO-CENTRO AUTORIZADOR '), + 'funcional108' => array('perfil'=>'MEDIOS DE PAGO-TARJETAS '), + 'funcional109' => array('perfil'=>'MEDIOS DE PAGO'), + 'funcional110' => array('perfil'=>'PAGOS Y COBROS DOCUMENTARIOS-AUTORIZACION'), + 'funcional111' => array('perfil'=>'VALORES Y ACT FINANCIEROS-BROKER'), + 'funcional112' => array('perfil'=>'VALORES Y ACT FINANCIEROS-ACT. FINANCIEROS '), + 'funcional113' => array('perfil'=>'VALORES Y ACT FINANCIEROS-VALORES'), + 'funcional114' => array('perfil'=>'SWIFT'), + 'funcional115' => array('perfil'=>'0.- sin especialidad funcional'), + ); +?> diff --git a/www/protected/tests/fixtures/tbl_perfiles_tecnicos.php b/www/protected/tests/fixtures/tbl_perfiles_tecnicos.php new file mode 100644 index 0000000..f147103 --- /dev/null +++ b/www/protected/tests/fixtures/tbl_perfiles_tecnicos.php @@ -0,0 +1,66 @@ + array('perfil'=>'T.-Administrador de Sistemas Host '), + 'tecnico2' => array('perfil'=>'D.-AF Plat WEB '), + 'tecnico3' => array('perfil'=>'D.-AP Plat Host '), + 'tecnico4' => array('perfil'=>'T.-Administrador de Base de Datos '), + 'tecnico5' => array('perfil'=>'D.-JP Plat Host'), + 'tecnico6' => array('perfil'=>'E.-Jefe de Sala '), + 'tecnico7' => array('perfil'=>'E.-Operador '), + 'tecnico9' => array('perfil'=>'D.-PGJR Plat Host '), + 'tecnico10' => array('perfil'=>'P.-Diseño Técnico de Pruebas '), + 'tecnico12' => array('perfil'=>'T.-Técnico de Redes '), + 'tecnico14' => array('perfil'=>'C.-Consultor Calidad y Metodología '), + 'tecnico17' => array('perfil'=>'T.-Técnico de Soporte '), + 'tecnico18' => array('perfil'=>'C.-Consultor Sectorial Mercado (Banca) '), + 'tecnico19' => array('perfil'=>'C.-Consultor'), + 'tecnico20' => array('perfil'=>'C.-Consultor Sectorial Mercado Telecom '), + 'tecnico21' => array('perfil'=>'S.-Soporte a Desarrollo Plat Host Tradicional'), + 'tecnico22' => array('perfil'=>'D.-AO Plat Host '), + 'tecnico23' => array('perfil'=>'P.-Ejecución de Pruebas'), + 'tecnico24' => array('perfil'=>'D.-AF Plat Host '), + 'tecnico25' => array('perfil'=>'D.-AO Plat WEB '), + 'tecnico26' => array('perfil'=>'D.-AP Plat WEB '), + 'tecnico27' => array('perfil'=>'D.-JP Plat WEB '), + 'tecnico28' => array('perfil'=>'S.-Soporte a Desarrollo Plat WEB '), + 'tecnico31' => array('perfil'=>'D.-AP Plat Unix '), + 'tecnico33' => array('perfil'=>'D.-PG Plat Host Tradicional'), + 'tecnico34' => array('perfil'=>'D.-PG Plat WEB '), + 'tecnico59' => array('perfil'=>'D.-PGSR Plat Host '), + 'tecnico61' => array('perfil'=>'E.- Inst. y Mantº Micro'), + 'tecnico62' => array('perfil'=>'E.- Help-Desk'), + 'tecnico63' => array('perfil'=>'T.-Técnico Seguridad'), + 'tecnico64' => array('perfil'=>'T.- Integrador'), + 'tecnico65' => array('perfil'=>'C.-Consultor Tecnología'), + 'tecnico66' => array('perfil'=>'C.-Consultor Producto'), + 'tecnico67' => array('perfil'=>'C.-Consultor Soporte a Desarrollo'), + 'tecnico68' => array('perfil'=>'C.-Consultor Seguridad'), + 'tecnico69' => array('perfil'=>'S.- Gestión Configuración'), + 'tecnico70' => array('perfil'=>'D.-JP Plat Host Unix '), + 'tecnico72' => array('perfil'=>'D.-AF Plat Unix '), + 'tecnico73' => array('perfil'=>'D.-AO Plat Unix '), + 'tecnico75' => array('perfil'=>'D.-PG Plat Unix '), + 'tecnico76' => array('perfil'=>'D.-PGSR Plat Unix '), + 'tecnico78' => array('perfil'=>'D.-PGSR Plat WEB '), + 'tecnico79' => array('perfil'=>'D.-PGJR Plat UNIX '), + 'tecnico81' => array('perfil'=>'D.-PGJR Plat WEB'), + 'tecnico83' => array('perfil'=>'E.- Planificador'), + 'tecnico84' => array('perfil'=>'P.-Analista Pruebas Host '), + 'tecnico85' => array('perfil'=>'s.-Soporte a Desarrollo Plat. Unix'), + 'tecnico87' => array('perfil'=>'P.-Analista de Pruebas Host Solaris'), + 'tecnico89' => array('perfil'=>'P.-Analista de Pruebas Web'), + 'tecnico92' => array('perfil'=>'P.-Diseño Técnico de Pruebas Host'), + 'tecnico95' => array('perfil'=>'P.-Diseño Técnico de Pruebas WEB'), + 'tecnico101' => array('perfil'=>'P.-Ejecución de Pruebas Web'), + 'tecnico104' => array('perfil'=>'A.- Sin experiencia'), + 'tecnico105' => array('perfil'=>'B.- Becario '), + 'tecnico106' => array('perfil'=>'T.-Técnico Sistemas Windows'), + 'tecnico107' => array('perfil'=>'JP - JEFE DE PROYECTO '), + 'tecnico108' => array('perfil'=>'D.-Maquetador WEB'), + 'tecnico109' => array('perfil'=>'A.- Arquitecto'), +); + +?> diff --git a/www/protected/tests/fixtures/tbl_usuarios.php b/www/protected/tests/fixtures/tbl_usuarios.php new file mode 100644 index 0000000..0605f3a --- /dev/null +++ b/www/protected/tests/fixtures/tbl_usuarios.php @@ -0,0 +1,20 @@ + array( + 'id' => '1', + 'email' => 'test1@notanaddress.com', + 'name' => 'Fulanito de Tal', + 'username' => 'Test_User_One', + 'password' => 'MD5(`test1`)', + 'last_login_time' => NULL, + ), + 'user2' => array( + 'id' => '2', + 'email' => 'test2@notanaddress.com', + 'name' => 'Menganito de Tal', + 'username' => 'Test_User_Two', + 'password' => 'MD5(`test2`)', + 'last_login_time' => NULL, + ), + ); +?> \ No newline at end of file diff --git a/www/protected/tests/phpunit.xml b/www/protected/tests/phpunit.xml index 22c96ff..fb46498 100644 --- a/www/protected/tests/phpunit.xml +++ b/www/protected/tests/phpunit.xml @@ -6,7 +6,6 @@ stopOnFailure="false"> - diff --git a/www/protected/tests/unit/CandidatoTest.php b/www/protected/tests/unit/CandidatoTest.php new file mode 100644 index 0000000..bed9b7c --- /dev/null +++ b/www/protected/tests/unit/CandidatoTest.php @@ -0,0 +1,66 @@ + 'Candidato', + ); + + + public function testRead() { + $fila = $this->datos_candidatos('candidato1'); + $this->assertTrue($fila instanceof Candidato); + $this->assertEquals('José', $fila->nombre); + } + + public function testCreate() { + $candidato = $this->datos_candidatos('candidato1'); + + $this->assertTrue($candidato instanceof Candidato); + $this->assertTrue($candidato->save()); + + $guardado = Candidato::model()->findByPk($candidato->id); + + $this->assertTrue($guardado instanceof Candidato); + $this->assertEmpty(array_diff($guardado->attributes, $candidato->attributes)); + } + + public function testUpdate() { + $candidato = Candidato::model()->findByPk($this->datos_candidatos['candidato1']['id']); + $this->assertTrue($candidato instanceof Candidato); + $candidato->apellidos = $this->datos_candidatos['candidato2']['apellidos']; + $this->assertTrue($candidato->save()); + $candidato = Candidato::model()->findByPk($this->datos_candidatos['candidato1']['id']); + $this->assertEquals($this->datos_candidatos['candidato2']['apellidos'], $candidato->apellidos); + } + + public function testDelete() { + $candidato = Candidato::model()->findByPk($this->datos_candidatos['candidato2']['id']); + $this->assertTrue($candidato instanceof Candidato); + $this->assertTrue($candidato->delete()); + $this->assertNull(Candidato::model()->findByPk($this->datos_candidatos['candidato2']['id'])); + } + + public function testOpcionesGenero() { + $options = Candidato::model()->OpcionesGenero; + $this->assertTrue(is_array($options)); + $this->assertEquals(2, count($options)); + $this->assertTrue(in_array('Hombre', $options)); + $this->assertTrue(in_array('Mujer', $options)); + } + + public function testOpcionesEstado() { + $options = Candidato::model()->OpcionesEstado; + $this->assertTrue(is_array($options)); + $this->assertEquals(7, count($options)); + $this->assertTrue(in_array('Pendiente de clasificar', $options)); + $this->assertTrue(in_array('Rechazado por antecedentes', $options)); + $this->assertTrue(in_array('Rechazado por no cumplir requisitos mínimos', $options)); + $this->assertTrue(in_array('Rechazado por perfil no demandado', $options)); + $this->assertTrue(in_array('Disponible', $options)); + $this->assertTrue(in_array('Disponible asignado exclusivo', $options)); + $this->assertTrue(in_array('No disponible', $options)); + } + +} +?> diff --git a/www/protected/tests/unit/CapacidadIdiomaTest.php b/www/protected/tests/unit/CapacidadIdiomaTest.php new file mode 100644 index 0000000..3256ada --- /dev/null +++ b/www/protected/tests/unit/CapacidadIdiomaTest.php @@ -0,0 +1,62 @@ + 'Candidato', + 'datos_idiomas' => 'Idioma', + ); + + public function testCreate() { + $id = $this->datos_candidatos['candidato3']['id']; + $niveles = CandidatoIdioma::model()->OpcionesNivel; + + $candidato = Candidato::model()->findByPk($id); + $this->assertTrue($candidato instanceof Candidato); + + $idioma = new CandidatoIdioma(); + $idioma->idioma = $this->datos_idiomas['idioma1']['idioma']; + $idioma->candidato_id = $candidato->id; + $idioma->conversacion = $niveles[0]; + $idioma->lectura_traduccion = $niveles[1]; + + $this->assertTrue($idioma->save()); + + $candidato = Candidato::model()->findByPk($id); + $idiomas = $candidato->idiomas; + $this->assertEquals(1, $candidato->idiomasCount); + $idioma = $idiomas[0]; + $this->assertTrue($idioma instanceof CandidatoIdioma); + + $this->assertEquals($this->datos_idiomas['idioma1']['idioma'], $idioma->idioma); + $this->assertEquals($niveles[0], $idioma->conversacion); + $this->assertEquals($niveles[1], $idioma->lectura_traduccion); + } + + public function testDelete() { + $id = $this->datos_candidatos['candidato1']['id']; + + $candidato = Candidato::model()->findByPk($id); + $this->assertTrue($candidato instanceof Candidato); + $this->assertEquals(2, $candidato->idiomasCount); + + $this->assertTrue($candidato->delete()); + $this->assertNull(Candidato::model()->findByPk($id)); + } + + public function testUpdate() { + $id = $this->datos_candidatos['candidato3']['id']; + + $idiomas = CandidatoIdioma::model()->findAll('(candidato_id = :candidato_id)', array(':candidato_id' => $id)); + $this->assertEquals(1, count($idiomas)); + $this->assertEquals($this->datos_idiomas['idioma1']['idioma'], $idiomas[0]->idioma); + + $idiomas[0]->idioma = $this->datos_idiomas['idioma2']['idioma']; + $this->assertTrue($idiomas[0]->save()); + + $idiomas = CandidatoIdioma::model()->findAll('(candidato_id = :candidato_id)', array(':candidato_id' => $id)); + $this->assertEquals(1, count($idiomas)); + $this->assertEquals($this->datos_idiomas['idioma2']['idioma'], $idiomas[0]->idioma); + } +} +?> diff --git a/www/protected/tests/unit/DbTest.php b/www/protected/tests/unit/DbTest.php new file mode 100644 index 0000000..ff46b6e --- /dev/null +++ b/www/protected/tests/unit/DbTest.php @@ -0,0 +1,11 @@ +assertNotEquals(NULL, Yii::app()->db); + } +} + + +?> diff --git a/www/protected/tests/unit/UsuarioTest.php b/www/protected/tests/unit/UsuarioTest.php new file mode 100644 index 0000000..6d0cf03 --- /dev/null +++ b/www/protected/tests/unit/UsuarioTest.php @@ -0,0 +1,14 @@ + 'Usuario', + ); + + public function testRead() { + $usu = $this->datos_usuarios('user1'); + $this->assertTrue($usu instanceof Usuario); + } +} +?>