Candidatos -> idioma y titulaciones (sin terminar)
git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_IntranetNueva/trunk@16 77cfc57b-8ef4-1849-9df6-4a38aa5da120
This commit is contained in:
parent
3713ff3c51
commit
9aeaaa3164
@ -57,94 +57,25 @@ class CandidatoController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function actionCreate()
|
public function actionCreate()
|
||||||
{
|
{
|
||||||
Yii::import('ext.multimodelform.MultiModelForm');
|
$model=new Candidato;
|
||||||
|
|
||||||
$model = new Candidato;
|
// Uncomment the following line if AJAX validation is needed
|
||||||
$idioma = new CandidatoIdioma();
|
//$this->performAjaxValidation($model);
|
||||||
$titulacion = new CandidatoTitulacion();
|
|
||||||
|
|
||||||
$idiomasValidos = array();
|
if(isset($_POST['Candidato']))
|
||||||
$titulacionesValidas = array();
|
{
|
||||||
|
$model->attributes=$_POST['Candidato'];
|
||||||
|
$foto=CUploadedFile::getInstance($model,'foto');
|
||||||
|
|
||||||
// Uncomment the following line if AJAX validation is needed
|
if ($model->save()) {
|
||||||
//$this->performAjaxValidation($model);
|
$this->guardarFoto($model->id, $foto);
|
||||||
|
$this->redirect(array('view','id'=>$model->id));
|
||||||
/*if(isset($_POST['Candidato']))
|
|
||||||
{
|
|
||||||
$model->attributes=$_POST['Candidato'];
|
|
||||||
$foto=CUploadedFile::getInstance($model,'foto');
|
|
||||||
|
|
||||||
if ($model->validate())
|
|
||||||
{
|
|
||||||
$foundInvalidChild = false;
|
|
||||||
$arrayIdiomas = array();
|
|
||||||
if(isset($_POST['CandidatoIdioma']))
|
|
||||||
{
|
|
||||||
foreach ($_POST['CandidatoIdioma'] as $idioma)
|
|
||||||
{
|
|
||||||
$CandidatoIdioma = new CandidatoIdioma;
|
|
||||||
$CandidatoIdioma->attributes = $idioma;
|
|
||||||
|
|
||||||
if ($model->id)
|
|
||||||
$CandidatoIdioma->candidato_id = $model->id;
|
|
||||||
|
|
||||||
if (!$CandidatoIdioma->validate())
|
|
||||||
$foundInvalidChild = true;
|
|
||||||
|
|
||||||
$arrayIdiomas[] = $CandidatoIdioma;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$foundInvalidChild && $model->save()) {
|
$this->render('create',array(
|
||||||
$this->guardarFoto($model->id, $foto);
|
'model'=>$model,
|
||||||
|
));
|
||||||
// Guardar los idiomas
|
|
||||||
foreach($arrayIdiomas as $CandidatoIdioma)
|
|
||||||
{
|
|
||||||
$CandidatoIdioma->candidato_id = $model->id;
|
|
||||||
$CandidatoIdioma->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
Yii::app()->user->setFlash('success', "Candidato dado de alta correctamente.");
|
|
||||||
$this->redirect(array('index'));
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (isset($_POST['Candidato'])) {
|
|
||||||
$model->attributes=$_POST['Candidato'];
|
|
||||||
$foto=CUploadedFile::getInstance($model,'foto');
|
|
||||||
|
|
||||||
$foundInvalidChild = false;
|
|
||||||
|
|
||||||
if ($model->validate()) {
|
|
||||||
if (!MultiModelForm::validate($model, $idiomasValidos, $idiomasBorrados))
|
|
||||||
$foundInvalidChild = true;
|
|
||||||
|
|
||||||
if (!MultiModelForm::validate($model, $titulacionesValidas, $titulacionesBorradas))
|
|
||||||
$foundInvalidChild = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$foundInvalidChild && $model->save() ) {
|
|
||||||
$masterValues = array ('candidato_id'=>$model->id);
|
|
||||||
|
|
||||||
if (MultiModelForm::save($model, $idiomasValidos, $idiomasBorrados, $masterValues) &&
|
|
||||||
MultiModelForm::save($model, $titulacionesValidas, $titulacionesBorradas, $masterValues))
|
|
||||||
{
|
|
||||||
$this->guardarFoto($model->id, $foto);
|
|
||||||
Yii::app()->user->setFlash('success', "Candidato dado de alta correctamente.");
|
|
||||||
$this->redirect(array('index'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->render('create',array(
|
|
||||||
'model'=>$model,
|
|
||||||
'idioma'=>$idioma,
|
|
||||||
'titulacion'=>$titulacion,
|
|
||||||
'idiomasValidos'=>$idiomasValidos,
|
|
||||||
'titulacionesValidas'=>$titulacionesValidas,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -154,85 +85,24 @@ class CandidatoController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function actionUpdate($id)
|
public function actionUpdate($id)
|
||||||
{
|
{
|
||||||
Yii::import('ext.multimodelform.MultiModelForm');
|
$model=$this->loadModel($id);
|
||||||
|
|
||||||
$model=$this->loadModel($id);
|
// Uncomment the following line if AJAX validation is needed
|
||||||
$idioma=new CandidatoIdioma();
|
//$this->performAjaxValidation($model);
|
||||||
$titulacion = new CandidatoTitulacion();
|
|
||||||
|
|
||||||
$idiomasValidos = array();
|
if(isset($_POST['Candidato']))
|
||||||
$titulacionesValidas = array();
|
{
|
||||||
|
$foto=CUploadedFile::getInstance($model,'foto');
|
||||||
// Uncomment the following line if AJAX validation is needed
|
$model->attributes=$_POST['Candidato'];
|
||||||
//$this->performAjaxValidation($model);
|
if($model->save()) {
|
||||||
|
$this->guardarFoto($model->id, $foto);
|
||||||
/*if(isset($_POST['Candidato']))
|
$this->redirect(array('view','id'=>$model->id));
|
||||||
{
|
|
||||||
$foto=CUploadedFile::getInstance($model,'foto');
|
|
||||||
$model->attributes=$_POST['Candidato'];
|
|
||||||
|
|
||||||
if ($model->validate())
|
|
||||||
{
|
|
||||||
$foundInvalidChild = false;
|
|
||||||
$arrayIdiomas = array();
|
|
||||||
if(isset($_POST['CandidatoIdioma']))
|
|
||||||
{
|
|
||||||
foreach ($_POST['CandidatoIdioma'] as $idioma)
|
|
||||||
{
|
|
||||||
//$CandidatoIdioma = CandidatoIdioma::model()->findB;
|
|
||||||
//CandidatoIdioma::model()->deleteAllByAttributes($arrayIdiomas)
|
|
||||||
|
|
||||||
$CandidatoIdioma->attributes = $idioma;
|
|
||||||
|
|
||||||
|
|
||||||
if ($model->id)
|
|
||||||
$CandidatoIdioma->candidato_id = $model->id;
|
|
||||||
|
|
||||||
if (!$CandidatoIdioma->validate())
|
|
||||||
$foundInvalidChild = true;
|
|
||||||
|
|
||||||
$arrayIdiomas[] = $CandidatoIdioma;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$foundInvalidChild && $model->save()) {
|
$this->render('update',array(
|
||||||
$this->guardarFoto($model->id, $foto);
|
'model'=>$model,
|
||||||
|
));
|
||||||
// Guardar los idiomas
|
|
||||||
foreach($arrayIdiomas as $CandidatoIdioma)
|
|
||||||
{
|
|
||||||
$CandidatoIdioma->candidato_id = $model->id;
|
|
||||||
$CandidatoIdioma->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
Yii::app()->user->setFlash('success', "Candidato actualizado correctamente.");
|
|
||||||
//$this->redirect(array('view','id'=>$model->id));
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if(isset($_POST['Candidato'])) {
|
|
||||||
$foto=CUploadedFile::getInstance($model,'foto');
|
|
||||||
$model->attributes=$_POST['Candidato'];
|
|
||||||
|
|
||||||
//the value for the foreign key 'candidato_id'
|
|
||||||
$masterValues = array ('candidato_id'=>$model->id);
|
|
||||||
|
|
||||||
//Save the master model after saving valid members
|
|
||||||
if (MultiModelForm::save($idioma, $validatedIdiomas, $deleteIdiomas, $masterValues) && $model->save() ) {
|
|
||||||
$this->guardarFoto($model->id, $foto);
|
|
||||||
Yii::app()->user->setFlash('success', "Candidato actualizado correctamente.");
|
|
||||||
//$this->redirect(array('view','id'=>$model->id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->render('update',array(
|
|
||||||
'model'=>$model,
|
|
||||||
'idioma'=>$idioma,
|
|
||||||
'titulacion'=>$titulacion,
|
|
||||||
'idiomasValidos'=>$idiomasValidos,
|
|
||||||
'titulacionesValidas'=>$titulacionesValidas,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class m120130_120838_tbl_idiomas extends CDbMigration
|
|||||||
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
$this->dropTable('tbl_idiomas');
|
$this->dropTable('tbl_idiomas');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class m120221_093555_tbl_candidatos_titulaciones extends CDbMigration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$this->createTable('tbl_candidatos_titulaciones', array(
|
||||||
|
'id' => 'pk',
|
||||||
|
'candidato_id' => 'integer NOT NULL',
|
||||||
|
'titulacion' => 'string NOT NULL',
|
||||||
|
));
|
||||||
|
|
||||||
|
$this->addForeignKey('fk_candidatos_titulacion_1', 'tbl_candidatos_titulaciones', 'candidato_id', 'tbl_candidatos', 'id', 'CASCADE', 'CASCADE');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$this->dropForeignKey('fk_candidatos_titulacion_1', 'tbl_candidatos_titulaciones');
|
||||||
|
$this->dropTable('tbl_candidatos_titulaciones');
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Use safeUp/safeDown to do migration with transaction
|
||||||
|
public function safeUp()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function safeDown()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
28
www/protected/migrations/m120221_104416_tbl_titulaciones.php
Normal file
28
www/protected/migrations/m120221_104416_tbl_titulaciones.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class m120221_104416_tbl_titulaciones extends CDbMigration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$this->createTable('tbl_titulaciones', array(
|
||||||
|
'id' => 'pk',
|
||||||
|
'titulacion' => 'string NOT NULL',
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$this->dropTable('tbl_titulaciones');
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Use safeUp/safeDown to do migration with transaction
|
||||||
|
public function safeUp()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function safeDown()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
94
www/protected/models/CandidatoTitulacion.php
Normal file
94
www/protected/models/CandidatoTitulacion.php
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the model class for table "tbl_candidatos_titulaciones".
|
||||||
|
*
|
||||||
|
* The followings are the available columns in table 'tbl_candidatos_titulaciones':
|
||||||
|
* @property integer $id
|
||||||
|
* @property integer $candidato_id
|
||||||
|
* @property string $titulacion
|
||||||
|
*
|
||||||
|
* The followings are the available model relations:
|
||||||
|
* @property Candidatos $candidato
|
||||||
|
*/
|
||||||
|
class CandidatoTitulacion extends CActiveRecord
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Returns the static model of the specified AR class.
|
||||||
|
* @param string $className active record class name.
|
||||||
|
* @return CandidatoTitulacion 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_titulaciones';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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('candidato_id, titulacion', 'required'),
|
||||||
|
array('candidato_id', 'numerical', 'integerOnly'=>true),
|
||||||
|
array('titulacion', 'length', 'max'=>255),
|
||||||
|
// The following rule is used by search().
|
||||||
|
// Please remove those attributes that should not be searched.
|
||||||
|
array('id, candidato_id, titulacion', '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, 'Candidatos', 'candidato_id'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array customized attribute labels (name=>label)
|
||||||
|
*/
|
||||||
|
public function attributeLabels()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'id' => 'ID',
|
||||||
|
'candidato_id' => 'Candidato',
|
||||||
|
'titulacion' => 'Titulación',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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('titulacion',$this->titulacion,true);
|
||||||
|
|
||||||
|
return new CActiveDataProvider($this, array(
|
||||||
|
'criteria'=>$criteria,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
86
www/protected/models/Titulacion.php
Normal file
86
www/protected/models/Titulacion.php
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the model class for table "tbl_titulaciones".
|
||||||
|
*
|
||||||
|
* The followings are the available columns in table 'tbl_titulaciones':
|
||||||
|
* @property integer $id
|
||||||
|
* @property string $titulacion
|
||||||
|
*/
|
||||||
|
class Titulacion extends CActiveRecord
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Returns the static model of the specified AR class.
|
||||||
|
* @param string $className active record class name.
|
||||||
|
* @return Titulacion 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_titulaciones';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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('titulacion', 'required'),
|
||||||
|
array('titulacion', 'length', 'max'=>255),
|
||||||
|
// The following rule is used by search().
|
||||||
|
// Please remove those attributes that should not be searched.
|
||||||
|
array('id, titulacion', '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',
|
||||||
|
'titulacion' => 'Titulacion',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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('titulacion',$this->titulacion,true);
|
||||||
|
|
||||||
|
return new CActiveDataProvider($this, array(
|
||||||
|
'criteria'=>$criteria,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
31
www/protected/tests/fixtures/tbl_titulaciones.php
vendored
Normal file
31
www/protected/tests/fixtures/tbl_titulaciones.php
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'titulacion1' => array('titulacion'=>'Ciclo G.Sup. Administración Sistemas Informático'),
|
||||||
|
'titulacion2' => array('titulacion'=>'Diplomado en Estadística'),
|
||||||
|
'titulacion4' => array('titulacion'=>'FPII Téc. Especialista Administrativo Comercial'),
|
||||||
|
'titulacion5' => array('titulacion'=>'FPIII Administración de Empresas'),
|
||||||
|
'titulacion6' => array('titulacion'=>'Informática Gestión y Sistemas (No homologado)'),
|
||||||
|
'titulacion9' => array('titulacion'=>'Ingeniería Superior en Electrónica'),
|
||||||
|
'titulacion10' => array('titulacion'=>'Ingeniería Superior Informática'),
|
||||||
|
'titulacion12' => array('titulacion'=>'Ingeniería Técnica Informática Sistemas'),
|
||||||
|
'titulacion13' => array('titulacion'=>'Ingeniería Técnica Telecomunicaciones'),
|
||||||
|
'titulacion14' => array('titulacion'=>'Ingenieria Superior Telecomunicaciones'),
|
||||||
|
'titulacion15' => array('titulacion'=>'Ingenieria Técnica Informática Gestión'),
|
||||||
|
'titulacion16' => array('titulacion'=>'Licenciado en Físicas'),
|
||||||
|
'titulacion17' => array('titulacion'=>'Licenciado en Informática'),
|
||||||
|
'titulacion18' => array('titulacion'=>'Licenciatura C. Químicas'),
|
||||||
|
'titulacion19' => array('titulacion'=>'Ciclo G.Sup. Desarrollo Aplicaciones'),
|
||||||
|
'titulacion20' => array('titulacion'=>'Licenciatura Publicidad y RRPP'),
|
||||||
|
'titulacion21' => array('titulacion'=>'Diseño Grafico (No homologado)'),
|
||||||
|
'titulacion22' => array('titulacion'=>'FPII Informática'),
|
||||||
|
'titulacion23' => array('titulacion'=>'ESO'),
|
||||||
|
'titulacion24' => array('titulacion'=>'Licenciatura en Matemáticas'),
|
||||||
|
'titulacion25' => array('titulacion'=>'Ingeniería Superior Industriales'),
|
||||||
|
'titulacion26' => array('titulacion'=>'FPII Electrónica'),
|
||||||
|
'titulacion27' => array('titulacion'=>'FPIII Informática y/o Electrónica'),
|
||||||
|
'titulacion28' => array('titulacion'=>'BUP'),
|
||||||
|
'titulacion29' => array('titulacion'=>'Licenciatura Otros'),
|
||||||
|
'titulacion30' => array('titulacion'=>'Licenciatura en Economía'),
|
||||||
|
);
|
||||||
|
?>
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class CapacidadIdiomaTest extends CDbTestCase {
|
class CandidatoIdiomaTest extends CDbTestCase {
|
||||||
|
|
||||||
public $fixtures = array(
|
public $fixtures = array(
|
||||||
'datos_candidatos' => 'Candidato',
|
'datos_candidatos' => 'Candidato',
|
||||||
30
www/protected/views/candidato/_formCandidatoIdioma.php
Normal file
30
www/protected/views/candidato/_formCandidatoIdioma.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<?php echo $form->textField($model,"[$id]idioma"); ?>
|
||||||
|
<?php echo $form->error($model,"idioma"); ?>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?php echo $form->textField($model,"[$id]conversacion"); ?>
|
||||||
|
<?php echo $form->error($model,"conversacion"); ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?php echo $form->textField($model,"[$id]lectura_traduccion"); ?>
|
||||||
|
<?php echo $form->error($model,"lectura_traduccion"); ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
<td><?php echo CHtml::link(
|
||||||
|
'delete',
|
||||||
|
'#',
|
||||||
|
array(
|
||||||
|
'submit'=>'',
|
||||||
|
'params'=>array(
|
||||||
|
'CandidatoIdioma[command]'=>'delete',
|
||||||
|
'CandidatoIdioma[id]'=>$id,
|
||||||
|
'noValidate'=>true)
|
||||||
|
));?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
@ -62,34 +62,3 @@ span.timestamp {
|
|||||||
color: #006699;
|
color: #006699;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button.plain {
|
|
||||||
background: none repeat scroll 0 0 #F2F2F2;
|
|
||||||
border: 1px solid #DDDDDD;
|
|
||||||
border-radius: 0 0 0 0;
|
|
||||||
box-shadow: none;
|
|
||||||
color: #666;
|
|
||||||
height: 22px;
|
|
||||||
line-height: 22px;
|
|
||||||
margin: -4px -4px -4px 0;
|
|
||||||
padding: 0 14px;
|
|
||||||
text-decoration: none;
|
|
||||||
text-shadow: 0 1px 0 #FFFFFF;
|
|
||||||
font-weight: bold;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button.plain:hover {
|
|
||||||
color: #333;
|
|
||||||
background: none repeat scroll 0 0 #E2E2E2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button.plain:first-child {
|
|
||||||
border-bottom-left-radius: 2px;
|
|
||||||
border-top-left-radius: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button.plain:last-child {
|
|
||||||
border-bottom-right-radius: 2px;
|
|
||||||
border-top-right-radius: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@ -362,7 +362,7 @@ input[type=radio], input[type=checkbox] { margin: 0; padding: 0; vertical-align:
|
|||||||
.form_default fieldset { border: 1px solid #ccc; padding: 20px; background: #f7f7f7; }
|
.form_default fieldset { border: 1px solid #ccc; padding: 20px; background: #f7f7f7; }
|
||||||
.form_default legend { text-transform: uppercase; }
|
.form_default legend { text-transform: uppercase; }
|
||||||
.form_default p { margin: 20px 0 !important; }
|
.form_default p { margin: 20px 0 !important; }
|
||||||
.form_default label { width: 130px; float: left; text-align: right; padding-top: 5px; margin-right: 20px; }
|
.form_default label { width: 150px; float: left; text-align: right; padding-top: 5px; margin-right: 20px; }
|
||||||
|
|
||||||
.form_default input[type=text], .form_default input[type=password] { font-size: 12px; padding: 8px 5px; border: 1px solid #ccc; background: #fcfcfc; outline: none; }
|
.form_default input[type=text], .form_default input[type=password] { font-size: 12px; padding: 8px 5px; border: 1px solid #ccc; background: #fcfcfc; outline: none; }
|
||||||
.form_default input[type=text], .form_default input[type=password] { -moz-box-shadow: inset 1px 1px 3px #ccc; -webkit-box-shadow: inset 1px 1px 3px #ccc; box-shadow: inset 1px 1px 3px #ccc; }
|
.form_default input[type=text], .form_default input[type=password] { -moz-box-shadow: inset 1px 1px 3px #ccc; -webkit-box-shadow: inset 1px 1px 3px #ccc; box-shadow: inset 1px 1px 3px #ccc; }
|
||||||
@ -450,7 +450,7 @@ input[type=radio], input[type=checkbox] { margin: 0; padding: 0; vertical-align:
|
|||||||
.sTable2 tbody tr.even td { background: #fcfcfc; }
|
.sTable2 tbody tr.even td { background: #fcfcfc; }
|
||||||
|
|
||||||
.sTable3 { border-collapse: collapse; }
|
.sTable3 { border-collapse: collapse; }
|
||||||
.sTable3 thead td, .sTable3 thead th { padding: 5px 10px; background: #eee url(../images/thead.png) repeat-x top left; border-bottom: 1px solid #ccc; }
|
.sTable3 thead td { padding: 5px 10px; background: #eee url(../images/thead.png) repeat-x top left; border-bottom: 1px solid #ccc; }
|
||||||
.sTable3 tbody tr td { padding: 10px; background: #fff; border-top: 1px solid #eee; border-left: 1px solid #eee; }
|
.sTable3 tbody tr td { padding: 10px; background: #fff; border-top: 1px solid #eee; border-left: 1px solid #eee; }
|
||||||
.sTable3 tbody tr.even td { background: #fcfcfc; }
|
.sTable3 tbody tr.even td { background: #fcfcfc; }
|
||||||
|
|
||||||
@ -578,7 +578,6 @@ input[type=radio], input[type=checkbox] { margin: 0; padding: 0; vertical-align:
|
|||||||
.loaders img { vertical-align: middle; display: inline-block; margin-right: 10px; }
|
.loaders img { vertical-align: middle; display: inline-block; margin-right: 10px; }
|
||||||
.padding15 { padding: 15px; overflow: hidden; }
|
.padding15 { padding: 15px; overflow: hidden; }
|
||||||
.padding1020 { padding: 10px 20px; }
|
.padding1020 { padding: 10px 20px; }
|
||||||
.padding020 { padding: 0px 20px; }
|
|
||||||
.padding20 { padding: 20px; overflow: hidden; }
|
.padding20 { padding: 20px; overflow: hidden; }
|
||||||
.borderbottom { border-bottom: 1px solid #eee; }
|
.borderbottom { border-bottom: 1px solid #eee; }
|
||||||
.floatleft { float: left; }
|
.floatleft { float: left; }
|
||||||
@ -598,7 +597,7 @@ input[type=radio], input[type=checkbox] { margin: 0; padding: 0; vertical-align:
|
|||||||
.inlineblock { display: inline-block; }
|
.inlineblock { display: inline-block; }
|
||||||
.alignright { text-align: right; }
|
.alignright { text-align: right; }
|
||||||
.bordertop { border-top: 1px solid #ccc; }
|
.bordertop { border-top: 1px solid #ccc; }
|
||||||
.fullwidth { width: 100%; }
|
|
||||||
|
|
||||||
/***CUSTOM STYLES***/
|
/***CUSTOM STYLES***/
|
||||||
.operations > ul {list-style: none;}
|
.operations > ul {list-style: none;}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
//Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/custom/elements.js');
|
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/custom/elements.js');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php $form=$this->beginWidget('CActiveForm', array(
|
<?php $form=$this->beginWidget('CActiveForm', array(
|
||||||
@ -14,7 +14,7 @@
|
|||||||
<p>Los campos marcados con <span class="required">*</span> son obligatorios.</p>
|
<p>Los campos marcados con <span class="required">*</span> son obligatorios.</p>
|
||||||
</div><!-- notification msginfo -->
|
</div><!-- notification msginfo -->
|
||||||
|
|
||||||
<?php echo $form->errorSummary(array_merge(array($model), $idiomasValidos, $titulacionesValidas), "<a class='close'></a>", "", array('class'=>"notification msgerror")); ?>
|
<?php echo $form->errorSummary($model, "<a class='close'></a>", "", array('class'=>"notification msgerror")); ?>
|
||||||
</div>
|
</div>
|
||||||
<br clear="all" />
|
<br clear="all" />
|
||||||
<div class="widgetbox two_third last form_default">
|
<div class="widgetbox two_third last form_default">
|
||||||
@ -135,8 +135,9 @@
|
|||||||
unset($lista[$provincia->id]);
|
unset($lista[$provincia->id]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo CHtml::activeDropDownList($model,
|
echo CHtml::dropDownList(
|
||||||
'localidad',
|
'localidad',
|
||||||
|
$model->localidad,
|
||||||
$lista,
|
$lista,
|
||||||
array(
|
array(
|
||||||
'empty'=>'<Seleccionar>',
|
'empty'=>'<Seleccionar>',
|
||||||
@ -151,28 +152,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br clear="all" />
|
<br clear="all" />
|
||||||
|
|
||||||
<div class="widgetbox two_third last form_default">
|
<div class="widgetbox two_third last form_default">
|
||||||
<h3>
|
<h3>
|
||||||
<span>
|
<span>
|
||||||
<legend>Datos académicos</legend>
|
<legend>Datos académicos</legend>
|
||||||
</span>
|
</span>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<?php $this->renderPartial('_idiomas', array(
|
|
||||||
'model'=>$model,
|
|
||||||
'idioma'=>$idioma,
|
|
||||||
'idiomasValidos'=>$idiomasValidos,
|
|
||||||
)); ?>
|
|
||||||
|
|
||||||
<?php $this->renderPartial('_titulaciones', array(
|
|
||||||
'model'=>$model,
|
|
||||||
'titulacion'=>$titulacion,
|
|
||||||
'titulacionesValidas'=>$titulacionesValidas,
|
|
||||||
)); ?>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<br clear="all" />
|
<br clear="all" />
|
||||||
|
|
||||||
<div class="form_default">
|
<div class="form_default">
|
||||||
<button type="submit"><?php echo $model->isNewRecord ? 'Crear' : 'Guardar'; ?></button>
|
<button type="submit"><?php echo $model->isNewRecord ? 'Crear' : 'Guardar'; ?></button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
81
www/themes/intranet/views/candidato/_idiomas.php
Normal file
81
www/themes/intranet/views/candidato/_idiomas.php
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$idiomaFormConfig = array(
|
||||||
|
'elements'=>array(
|
||||||
|
'idioma'=>array(
|
||||||
|
'type'=>'dropdownlist',
|
||||||
|
'layout'=>'{input}',
|
||||||
|
'class'=>'fullwidth',
|
||||||
|
'items'=>array_merge(
|
||||||
|
array(''=>'-'),
|
||||||
|
CHtml::listData(Idioma::model()->findAll(), 'idioma', 'idioma')
|
||||||
|
),
|
||||||
|
|
||||||
|
),
|
||||||
|
'conversacion'=>array(
|
||||||
|
'type'=>'dropdownlist',
|
||||||
|
'layout'=>'{input}',
|
||||||
|
'class'=>'fullwidth',
|
||||||
|
'items'=>array_merge(
|
||||||
|
array(''=>'-'),
|
||||||
|
$idioma->OpcionesNivel
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'lectura_traduccion'=>array(
|
||||||
|
'type'=>'dropdownlist',
|
||||||
|
'layout'=>'{input}',
|
||||||
|
'class'=>'fullwidth',
|
||||||
|
'items'=>array_merge(
|
||||||
|
array(''=>'-'),
|
||||||
|
$idioma->OpcionesNivel
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="content nopadding ohidden">
|
||||||
|
<div class="padding1020">
|
||||||
|
<label><?php echo Yii::t('intranet', 'Idiomas'); ?></label>
|
||||||
|
|
||||||
|
<div class="marginleft150">
|
||||||
|
<?php $this->widget('ext.multimodelform.MultiModelForm',array(
|
||||||
|
'id' => 'id_idioma', //the unique widget id
|
||||||
|
'addItemText' => '', // no quiero mostrar el enlace de añadir
|
||||||
|
'removeText' => 'Eliminar',
|
||||||
|
'removeConfirm' => '¿Desea eliminar este idioma?',
|
||||||
|
'tableHtmlOptions' => array(
|
||||||
|
'class' => 'sTable2',
|
||||||
|
'width' => '100%',
|
||||||
|
),
|
||||||
|
'tableView' => true,
|
||||||
|
'formConfig' => $idiomaFormConfig, //the form configuration array
|
||||||
|
'model' => $idioma, //instance of the form model
|
||||||
|
|
||||||
|
//if submitted not empty from the controller,
|
||||||
|
//the form will be rendered with validation errors
|
||||||
|
'validatedItems' => $idiomasValidos,
|
||||||
|
|
||||||
|
//array of member instances loaded from db
|
||||||
|
'data' => $idioma->findAll('candidato_id=:candidato_id', array(':candidato_id'=>$model->id)),
|
||||||
|
|
||||||
|
'removeHtmlOptions' => array(
|
||||||
|
'class' => 'button plain',
|
||||||
|
),
|
||||||
|
));
|
||||||
|
?>
|
||||||
|
<br clear="all" />
|
||||||
|
<div class="mmf_addlink">
|
||||||
|
<?php
|
||||||
|
echo CHtml::link('Añadir idioma', '#', array(
|
||||||
|
'class' => 'button plain',
|
||||||
|
'rel' => '.id_idioma_copy',
|
||||||
|
'id' => 'id_idioma',
|
||||||
|
));
|
||||||
|
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<br clear="all" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
63
www/themes/intranet/views/candidato/_titulaciones.php
Normal file
63
www/themes/intranet/views/candidato/_titulaciones.php
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$titulacionFormConfig = array(
|
||||||
|
'elements'=>array(
|
||||||
|
'titulacion'=>array(
|
||||||
|
'type'=>'dropdownlist',
|
||||||
|
'layout'=>'{input}',
|
||||||
|
'class'=>'fullwidth',
|
||||||
|
'items'=>array_merge(
|
||||||
|
array(''=>'-'),
|
||||||
|
CHtml::listData(Titulacion::model()->findAll(), 'titulacion', 'titulacion')
|
||||||
|
),
|
||||||
|
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="content nopadding ohidden">
|
||||||
|
<div class="padding1020">
|
||||||
|
<label><?php echo Yii::t('intranet', 'Titulaciones'); ?></label>
|
||||||
|
|
||||||
|
<div class="marginleft150">
|
||||||
|
<?php $this->widget('ext.multimodelform.MultiModelForm',array(
|
||||||
|
'id' => 'id_titulacion', //the unique widget id
|
||||||
|
'addItemText' => '', // no quiero mostrar el enlace de añadir
|
||||||
|
'removeText' => 'Eliminar',
|
||||||
|
'removeConfirm' => '¿Desea eliminar esta titulación?',
|
||||||
|
'tableHtmlOptions' => array(
|
||||||
|
'class' => 'sTable2 lf',
|
||||||
|
),
|
||||||
|
'tableView' => true,
|
||||||
|
'formConfig' => $titulacionFormConfig, //the form configuration array
|
||||||
|
'model' => $titulacion, //instance of the form model
|
||||||
|
|
||||||
|
//if submitted not empty from the controller,
|
||||||
|
//the form will be rendered with validation errors
|
||||||
|
'validatedItems' => $titulacionesValidas,
|
||||||
|
|
||||||
|
//array of member instances loaded from db
|
||||||
|
'data' => $titulacion->findAll('candidato_id=:candidato_id', array(':candidato_id'=>$model->id)),
|
||||||
|
|
||||||
|
'removeHtmlOptions' => array(
|
||||||
|
'class' => 'button plain',
|
||||||
|
),
|
||||||
|
));
|
||||||
|
?>
|
||||||
|
<br clear="all" />
|
||||||
|
<div class="mmf_addlink">
|
||||||
|
<?php
|
||||||
|
echo CHtml::link('Añadir titulación', '#', array(
|
||||||
|
'class' => 'button plain',
|
||||||
|
'rel' => '.id_titulacion_copy',
|
||||||
|
'id' => 'id_titulacion',
|
||||||
|
));
|
||||||
|
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<br clear="all" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@ -14,11 +14,5 @@ $this->pageTitle='Nuevo candidato';
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<?php echo $this->renderPartial('_form', array(
|
<?php echo $this->renderPartial('_form', array(
|
||||||
'model'=>$model,
|
'model'=>$model,
|
||||||
'idioma'=>$idioma,
|
)); ?>
|
||||||
'titulacion'=>$titulacion,
|
|
||||||
'idiomasValidos'=>$idiomasValidos,
|
|
||||||
'titulacionesValidas'=>$titulacionesValidas,
|
|
||||||
));
|
|
||||||
?>
|
|
||||||
|
|
||||||
@ -27,9 +27,6 @@ $('.search-form form').submit(function(){
|
|||||||
$this->pageTitle='Gestión de candidatos';
|
$this->pageTitle='Gestión de candidatos';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b>
|
You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b>
|
||||||
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
|
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
|
||||||
|
|||||||
@ -11,17 +11,8 @@ $this->menu=array(
|
|||||||
array('label'=>'View Candidato', 'url'=>array('view', 'id'=>$model->id)),
|
array('label'=>'View Candidato', 'url'=>array('view', 'id'=>$model->id)),
|
||||||
array('label'=>'Manage Candidato', 'url'=>array('admin')),
|
array('label'=>'Manage Candidato', 'url'=>array('admin')),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->pageTitle='Modificar candidato ' . $model->nombre . ' ' . $model->apellidos;
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h1>Update Candidato <?php echo $model->id; ?></h1>
|
<h1>Update Candidato <?php echo $model->id; ?></h1>
|
||||||
|
|
||||||
<?php echo $this->renderPartial('_form', array(
|
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
|
||||||
'model'=>$model,
|
|
||||||
'idioma'=>$idioma,
|
|
||||||
'titulacion'=>$titulacion,
|
|
||||||
'idiomasValidos'=>$idiomasValidos,
|
|
||||||
'titulacionesValidas'=>$titulacionesValidas,
|
|
||||||
));
|
|
||||||
?>
|
|
||||||
@ -16,13 +16,9 @@
|
|||||||
<!--[if IE 7]>
|
<!--[if IE 7]>
|
||||||
<link rel="stylesheet" media="screen" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/ie7.css"/>
|
<link rel="stylesheet" media="screen" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/ie7.css"/>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<?php
|
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/plugins/jquery-1.7.min.js"></script>
|
||||||
$base = Yii::app()->theme->baseUrl;
|
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/plugins/jquery-ui-1.8.16.custom.min.js"></script>
|
||||||
$cs = Yii::app()->getClientScript();
|
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/custom/general.js"></script>
|
||||||
$cs->registerCoreScript('jquery');
|
|
||||||
$cs->registerScriptFile($base.'/js/plugins/jquery-ui-1.8.16.custom.min.js', CClientScript::POS_HEAD);
|
|
||||||
$cs->registerScriptFile($base.'/js/custom/general.js', CClientScript::POS_HEAD);
|
|
||||||
?>
|
|
||||||
|
|
||||||
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
|
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user