Primeras pruebas con candidatos.

git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_IntranetNueva/trunk@8 77cfc57b-8ef4-1849-9df6-4a38aa5da120
This commit is contained in:
David Arranz 2012-01-31 17:42:47 +00:00
parent c22a83761f
commit d74960182b
37 changed files with 1981 additions and 1 deletions

142
www/protected/EMenu.php Normal file
View File

@ -0,0 +1,142 @@
<?php
Yii::import('zii.widgets.CMenu');
/**
* Extension of CMenu. EMenu can render
* some one level of nesting.
* Exemple:
* $menuStruct = array(...);
*
* render only 1 level of menu
* $this->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 <theBuCeFaL@gmail.com>
* @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);
}
}

View File

@ -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',
),
),
);

View File

View File

@ -0,0 +1,96 @@
<?php
/**
* Fextures generator
* @author denis <thebucefal@gmail.com>
* @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);
}
}
}

View File

@ -0,0 +1 @@
<?php class FixtureGenerator extends CCodeGenerator { public $codeModel='application.gii.fixture.FixtureCode'; }

View File

@ -0,0 +1,19 @@
<?php
$n = 0;
echo '<?php' . PHP_EOL;
echo 'return array(' . PHP_EOL;
if(isset($models))
foreach ($models as $model){
echo '\''.get_class($model).'_'. ++$n . '\' => 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 ');';

View File

@ -0,0 +1,84 @@
<?php
$class=get_class($model);
Yii::app()->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)!='*');
");
?>
<h1>Fixture Generator</h1>
<p>This generator generates a fixtures for the specified database table.</p>
<?php $form=$this->beginWidget('CCodeForm', array('model'=>$model)); ?>
<div class="row">
<?php
echo $form->labelEx($model,'modelPath');
echo $form->textField($model,'modelPath', array('size'=>65));
?>
<div class="tooltip">
This refers to the table name that a new model class should be generated for
(e.g. <code>tbl_user</code>). It can contain schema name, if needed (e.g. <code>public.tbl_post</code>).
You may also enter <code>*</code> (or <code>schemaName.*</code> for a particular DB schema)
to generate a model class for EVERY table.
</div>
<?php echo $form->error($model,'modelPath'); ?>
</div>
<div class="row">
<?php
echo $form->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' ,
));
?>
<div class="tooltip">
Generate <b>n</b> or <b>all</b> rows.
</div>
<?php echo $form->error($model,'modelPath'); ?>
</div>
<div class="row sticky">
<?php echo $form->labelEx($model,'fixturePath'); ?>
<?php echo $form->textField($model,'fixturePath', array('size'=>65)); ?>
<div class="tooltip">
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, <code>application.models</code>.
</div>
<?php echo $form->error($model,'fixturePath'); ?>
</div>
<?php $this->endWidget();

View File

@ -0,0 +1,32 @@
<?php
class m120127_152158_tbl_usuarios extends CDbMigration
{
public function up()
{
$this->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()
{
}
*/
}

View File

@ -0,0 +1,37 @@
<?php
class m120127_152205_tbl_candidatos extends CDbMigration
{
public function up()
{
$this->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()
{
}
*/
}

View File

@ -0,0 +1,35 @@
<?php
class m120130_120027_tbl_perfiles extends CDbMigration
{
public function up()
{
$this->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()
{
}
*/
}

View File

@ -0,0 +1,28 @@
<?php
class m120130_120742_tbl_tecnologias extends CDbMigration
{
public function up()
{
$this->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()
{
}
*/
}

View File

@ -0,0 +1,28 @@
<?php
class m120130_120838_tbl_idiomas extends CDbMigration
{
public function up()
{
$this->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()
{
}
*/
}

View File

@ -0,0 +1,57 @@
<?php
class m120130_120941_tbl_candidatos_capacidades extends CDbMigration
{
public function up()
{
$this->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()
{
}
*/
}

View File

@ -0,0 +1,34 @@
<?php
class m120130_183758_tbl_candidatos_idiomas extends CDbMigration
{
public function up()
{
$this->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()
{
}
*/
}

View File

@ -0,0 +1,150 @@
<?php
/**
* This is the model class for table "tbl_candidatos".
*
* The followings are the available columns in table 'tbl_candidatos':
* @property integer $id
* @property string $foto
* @property string $dni
* @property string $nombre
* @property string $apellidos
* @property string $email
* @property string $telefono_fijo
* @property string $telefono_movil
* @property string $sexo
* @property string $fecha_nacimiento
* @property string $lugar_nacimiento
*
* The followings are the available model relations:
* @property CapacidadProfesional[] $capacidades
* @property CandidatoIdioma[] $idiomas
*/
class Candidato extends CActiveRecord
{
const GENERO_HOMBRE=0;
const GENERO_MUJER=1;
/**
* Devuelve la lista de géneros de un candidato.
* @return array lista de géneros permitidos
*/
public function getOpcionesGenero() {
return array(
self::GENERO_HOMBRE => '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,
));
}
}

View File

@ -0,0 +1,114 @@
<?php
/**
* This is the model class for table "tbl_candidatos_idiomas".
*
* The followings are the available columns in table 'tbl_candidatos_idiomas':
* @property integer $id
* @property integer $candidato_id
* @property integer $idioma
* @property string $conversacion
* @property string $lectura_traduccion
*
* The followings are the available model relations:
* @property Candidato $candidato
*/
class CandidatoIdioma extends CActiveRecord
{
const NIVEL_BAJO=0;
const NIVEL_MEDIO=1;
const NIVEL_ALTO=2;
/**
* Devuelve la lista de niveles de idioma.
* @return array lista de niveles permitidos
*/
public function getOpcionesNivel() {
return array(
self::NIVEL_BAJO => '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,
));
}
}

View File

@ -0,0 +1,111 @@
<?php
/**
* This is the model class for table "tbl_candidatos_capacidades".
*
* The followings are the available columns in table 'tbl_candidatos_capacidades':
* @property integer $id
* @property integer $candidato_id
* @property integer $perfil_tecnico_id
* @property integer $meses_perfil_tecnico
* @property integer $perfil_funcional_id
* @property integer $meses_perfil_funcional
* @property string $observaciones
*
* The followings are the available model relations:
* @property PerfilFuncional $perfilFuncional
* @property Candidato $candidato
* @property PerfilTecnico $perfilTecnico
* @property CapacidadProfesionalTecnologia[] $tecnologias
*/
class CapacidadProfesional extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return CapacidadProfesional 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_capacidades';
}
/**
* @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('meses_perfil_tecnico, meses_perfil_funcional', 'numerical', 'integerOnly'=>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,
));
}
}

View File

@ -0,0 +1,98 @@
<?php
/**
* This is the model class for table "tbl_candidatos_capacidades_tecnologias".
*
* The followings are the available columns in table 'tbl_candidatos_capacidades_tecnologias':
* @property integer $id
* @property integer $id_capacidad
* @property integer $id_tecnologia
* @property integer $meses_tecnologia
*
* The followings are the available model relations:
* @property Tecnologias $idTecnologia
* @property CandidatosCapacidades $idCapacidad
*/
class CapacidadProfesionalTecnologia extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return CapacidadProfesionalTecnologia 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_capacidades_tecnologias';
}
/**
* @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('id_capacidad, id_tecnologia', 'required'),
array('id_capacidad, id_tecnologia, meses_tecnologia', 'numerical', 'integerOnly'=>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,
));
}
}

View File

@ -0,0 +1,96 @@
<?php
/**
* This is the model class for table "tbl_idiomas".
*
* The followings are the available columns in table 'tbl_idiomas':
* @property integer $id
* @property string $idioma
* @property string $conversacion
* @property string $lectura_traduccion
*
*/
class Idioma extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Idioma 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_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', 'required'),
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('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,
));
}
}

View File

@ -0,0 +1,86 @@
<?php
/**
* This is the model class for table "tbl_perfiles_funcionales".
*
* The followings are the available columns in table 'tbl_perfiles_funcionales':
* @property integer $id
* @property string $perfil
*/
class PerfilFuncional extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return PerfilFuncional 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_perfiles_funcionales';
}
/**
* @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('perfil', 'required'),
array('perfil', 'length', 'max'=>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,
));
}
}

View File

@ -0,0 +1,86 @@
<?php
/**
* This is the model class for table "tbl_perfiles_tecnicos".
*
* The followings are the available columns in table 'tbl_perfiles_tecnicos':
* @property integer $id
* @property string $perfil
*/
class PerfilTecnico extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return PerfilTecnico 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_perfiles_tecnicos';
}
/**
* @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('perfil', 'required'),
array('perfil', 'length', 'max'=>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,
));
}
}

View File

@ -0,0 +1,90 @@
<?php
/**
* This is the model class for table "tbl_tecnologias".
*
* The followings are the available columns in table 'tbl_tecnologias':
* @property integer $id
* @property string $tecnologia
*
* The followings are the available model relations:
* @property CandidatosCapacidadesTecnologias[] $candidatosCapacidadesTecnologiases
*/
class Tecnologia extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Tecnologia 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_tecnologias';
}
/**
* @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('tecnologia', 'required'),
array('tecnologia', 'length', 'max'=>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,
));
}
}

View File

@ -0,0 +1,99 @@
<?php
/**
* This is the model class for table "tbl_usuarios".
*
* The followings are the available columns in table 'tbl_usuarios':
* @property integer $id
* @property string $email
* @property string $name
* @property string $username
* @property string $password
* @property string $last_login_time
*/
class Usuario extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Usuario 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_usuarios';
}
/**
* @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('username, password', 'required'),
array('email, name, username, password', 'length', 'max'=>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,
));
}
}

View File

@ -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)

View File

@ -0,0 +1,4 @@
<?php
return array (
'template' => 'default',
);

View File

@ -0,0 +1,8 @@
<?php
return array (
'template' => 'default',
'tablePrefix' => 'tbl',
'modelPath' => 'application.models',
'baseClass' => 'CActiveRecord',
'buildRelations' => '1',
);

View File

@ -0,0 +1,41 @@
<?php
return array(
'candidato1' => 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',
),
);
?>

View File

@ -0,0 +1,24 @@
<?php
return array(
'fila1' => 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',
),
);
?>

View File

@ -0,0 +1,17 @@
<?php
return array(
'idioma1' => 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')
);
?>

View File

@ -0,0 +1,113 @@
<?php
return array (
'funcional4' => 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'),
);
?>

View File

@ -0,0 +1,66 @@
<?php
/**/
return array (
'tecnico1' => 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'),
);
?>

View File

@ -0,0 +1,20 @@
<?php
return array(
'user1' => 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,
),
);
?>

View File

@ -6,7 +6,6 @@
stopOnFailure="false">
<selenium>
<browser name="Internet Explorer" browser="*iexplore" />
<browser name="Firefox" browser="*firefox" />
</selenium>

View File

@ -0,0 +1,66 @@
<?php
class CandidatoTest extends CDbTestCase {
public $fixtures = array(
'datos_candidatos' => '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));
}
}
?>

View File

@ -0,0 +1,62 @@
<?php
class CapacidadIdiomaTest extends CDbTestCase {
public $fixtures = array(
'datos_candidatos' => '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);
}
}
?>

View File

@ -0,0 +1,11 @@
<?php
class DbTest extends CTestCase
{
public function testConnection() {
$this->assertNotEquals(NULL, Yii::app()->db);
}
}
?>

View File

@ -0,0 +1,14 @@
<?php
class UsuarioTest extends CDbTestCase {
public $fixtures = array(
'datos_usuarios' => 'Usuario',
);
public function testRead() {
$usu = $this->datos_usuarios('user1');
$this->assertTrue($usu instanceof Usuario);
}
}
?>