- Mejor login

- Comenzando 'Candidato'

git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_IntranetNueva/trunk@11 77cfc57b-8ef4-1849-9df6-4a38aa5da120
This commit is contained in:
David Arranz 2012-02-08 15:02:38 +00:00
parent 11bf30f06d
commit 937ab0610f
41 changed files with 12919 additions and 159 deletions

BIN
www/fotos/no_avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -5,6 +5,11 @@
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Console Application',
'commandMap' => array(
'fixture' => array(
'class'=>'application.extensions.fixtureHelper.FixtureHelperCommand',
),
),
// application components
'components'=>array(
/*'db'=>array(
@ -28,5 +33,8 @@ return array(
'charset' => 'utf8',
),
'fixture'=>array(
'class'=>'system.test.CDbFixtureManager',
),
),
);

View File

@ -0,0 +1,208 @@
<?php
class CandidatoController extends Controller
{
/**
* @var string the default layout for the views. Defaults to '//layouts/column2', meaning
* using two-column layout. See 'protected/views/layouts/column2.php'.
*/
public $layout='//layouts/default';
/**
* @return array action filters
*/
public function filters()
{
return array(
'accessControl', // perform access control for CRUD operations
);
}
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @return array access control rules
*/
public function accessRules()
{
return array(
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('index','view','create','update','delete'),
'users'=>array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions'=>array('admin'),
'users'=>array('admin'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id)
{
$this->render('view',array(
'model'=>$this->loadModel($id),
));
}
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model=new Candidato;
// Uncomment the following line if AJAX validation is needed
//$this->performAjaxValidation($model);
if(isset($_POST['Candidato']))
{
$model->attributes=$_POST['Candidato'];
$foto=CUploadedFile::getInstance($model,'foto');
if ($model->save()) {
$this->guardarFoto($model->id, $foto);
$this->redirect(array('view','id'=>$model->id));
}
}
$this->render('create',array(
'model'=>$model,
));
}
/**
* Updates a particular model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id the ID of the model to be updated
*/
public function actionUpdate($id)
{
$model=$this->loadModel($id);
// Uncomment the following line if AJAX validation is needed
//$this->performAjaxValidation($model);
if(isset($_POST['Candidato']))
{
$foto=CUploadedFile::getInstance($model,'foto');
$model->attributes=$_POST['Candidato'];
if($model->save()) {
$this->guardarFoto($model->id, $foto);
$this->redirect(array('view','id'=>$model->id));
}
}
$this->render('update',array(
'model'=>$model,
));
}
/**
* Deletes a particular model.
* If deletion is successful, the browser will be redirected to the 'admin' page.
* @param integer $id the ID of the model to be deleted
*/
public function actionDelete($id)
{
if(Yii::app()->request->isPostRequest)
{
// we only allow deletion via POST request
$this->loadModel($id)->delete();
$this->borrarFoto($id);
// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
if(!isset($_GET['ajax']))
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
}
else
throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
}
/**
* Lists all models.
*/
public function actionIndex()
{
$model=new Candidato('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Candidato']))
$model->attributes=$_GET['Candidato'];
$this->render('index',array(
'model'=>$model,
));
}
/**
* Manages all models.
*/
public function actionAdmin()
{
$model=new Candidato('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Candidato']))
$model->attributes=$_GET['Candidato'];
$this->render('admin',array(
'model'=>$model,
));
}
/**
* Returns the data model based on the primary key given in the GET variable.
* If the data model is not found, an HTTP exception will be raised.
* @param integer the ID of the model to be loaded
*/
public function loadModel($id)
{
$model=Candidato::model()->findByPk($id);
if($model===null)
throw new CHttpException(404,'The requested page does not exist.');
$model->foto = $this->buscarFoto($id);
return $model;
}
/**
* Performs the AJAX validation.
* @param CModel the model to be validated
*/
protected function performAjaxValidation($model)
{
if(isset($_POST['ajax']) && $_POST['ajax']==='candidato-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
}
private function guardarFoto($id, $foto) {
if (!is_null($foto)) {
$path = Yii::app()->basePath.'/../fotos/';
$fichero = $id.'.jpg';
$foto->saveAs($path.$fichero);
}
}
private function borrarFoto($id) {
$path = Yii::app()->basePath.'/../fotos/';
$fichero = $id.'.jpg';
if (file_exists($path.$fichero))
unlink($path.$fichero);
}
private function buscarFoto($id) {
$path = Yii::app()->basePath.'/../fotos/';
$fichero = $id.'.jpg';
$url = Yii::app()->request->baseUrl.'/fotos/';
return file_exists($path.$fichero) ? $url.$fichero : $url.'no_avatar.png';
}
}

View File

@ -2,11 +2,9 @@
class SiteController extends Controller
{
public $layout='//layouts/login';
//public $defaultAction='login';
public $layout='//layouts/default';
public $defaultAction='index';
/**
* @return array action filters
*/
@ -113,6 +111,7 @@ class SiteController extends Controller
*/
public function actionLogin()
{
$this->layout = '//layouts/login';
$model=new LoginForm;
// if it is ajax validation request

View File

@ -37,8 +37,14 @@ class UsuarioController extends Controller
*/
public function actionView($id)
{
$dataProvider=new CActiveDataProvider('Usuario', array(
'criteria'=>array(
'condition'=>'id=:id',
'params'=>array(':id' => $id),
),
));
$this->render('view',array(
'model'=>$this->loadModel($id),
'dataProvider'=>$dataProvider,
));
}

View File

@ -6,7 +6,6 @@ class m120127_152205_tbl_candidatos extends CDbMigration
{
$this->createTable('tbl_candidatos', array(
'id' => 'pk',
'foto' => 'string',
'dni' => 'string',
'nombre' => 'string',
'apellidos' => 'string',
@ -16,6 +15,7 @@ class m120127_152205_tbl_candidatos extends CDbMigration
'sexo' => 'string',
'fecha_nacimiento' => 'date',
'lugar_nacimiento' => 'string',
'localidad' => 'string',
'fecha_alta' => 'datetime',
'usuario_alta' => 'integer',
'fecha_modificacion' => 'datetime',

View File

@ -0,0 +1,28 @@
<?php
class m120203_101857_tbl_provincias extends CDbMigration
{
public function up()
{
$this->createTable('tbl_provincias', array(
'id' => 'pk',
'provincia' => 'string NOT NULL',
));
}
public function down()
{
$this->dropTable('tbl_provincias');
}
/*
// Use safeUp/safeDown to do migration with transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}

View File

@ -0,0 +1,32 @@
<?php
class m120203_101905_tbl_poblaciones extends CDbMigration
{
public function up()
{
$this->createTable('tbl_poblaciones', array(
'id' => 'pk',
'provincia_id' => 'integer NOT NULL',
'poblacion' => 'string NOT NULL',
));
$this->addForeignKey('fk_poblaciones_1', 'tbl_poblaciones', 'provincia_id', 'tbl_provincias', 'id', 'CASCADE', 'CASCADE');
}
public function down()
{
$this->dropForeignKey('fk_poblaciones_1', 'tbl_poblaciones');
$this->dropTable('tbl_poblaciones');
}
/*
// Use safeUp/safeDown to do migration with transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}

View File

@ -5,7 +5,6 @@
*
* 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
@ -25,6 +24,8 @@ class Candidato extends CActiveRecord
const GENERO_HOMBRE=0;
const GENERO_MUJER=1;
public $foto;
/**
* Devuelve la lista de géneros de un candidato.
* @return array lista de géneros permitidos
@ -78,11 +79,21 @@ class Candidato extends CActiveRecord
// 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('nombre, apellidos', 'required'),
array('email', 'unique'),
array('foto', 'file',
'types'=>'jpg',
'maxSize'=>1024 * 1024 * 1, // 1MB como máximo
'tooLarge'=>'The file was larger than 1MB. Please upload a smaller file.',
'wrongType'=>'Please upload only images in the format JPG.',
'tooMany'=>'You can upload only 1 user photo.',
'allowEmpty'=>'true',
),
array('dni, nombre, apellidos, email, telefono_fijo, telefono_movil, sexo, lugar_nacimiento, localidad', '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'),
array('id, dni, nombre, apellidos, email, telefono_fijo, telefono_movil, sexo, fecha_nacimiento, lugar_nacimiento, localidad', 'safe', 'on'=>'search'),
);
}
@ -108,15 +119,16 @@ class Candidato extends CActiveRecord
return array(
'id' => 'ID',
'foto' => 'Foto',
'dni' => 'Dni',
'dni' => 'DNI/Pasaporte',
'nombre' => 'Nombre',
'apellidos' => 'Apellidos',
'email' => 'Email',
'telefono_fijo' => 'Telefono Fijo',
'telefono_movil' => 'Telefono Movil',
'telefono_fijo' => 'Telefono fijo',
'telefono_movil' => 'Telefono vil',
'sexo' => 'Sexo',
'fecha_nacimiento' => 'Fecha Nacimiento',
'lugar_nacimiento' => 'Lugar Nacimiento',
'fecha_nacimiento' => 'Fecha de nacimiento',
'lugar_nacimiento' => 'Lugar de nacimiento',
'localidad' => 'Localidad',
);
}
@ -132,7 +144,6 @@ class Candidato extends CActiveRecord
$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);

View File

@ -0,0 +1,94 @@
<?php
/**
* This is the model class for table "tbl_poblaciones".
*
* The followings are the available columns in table 'tbl_poblaciones':
* @property integer $id
* @property integer $provincia_id
* @property string $poblacion
*
* The followings are the available model relations:
* @property Provincia $provincia
*/
class Poblacion extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Poblacion 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_poblaciones';
}
/**
* @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('provincia_id, poblacion', 'required'),
array('provincia_id', 'numerical', 'integerOnly'=>true),
array('poblacion', 'length', 'max'=>255),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, provincia_id, poblacion', '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(
'provincia' => array(self::BELONGS_TO, 'Provincia', 'provincia_id'),
);
}
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'id' => 'ID',
'provincia_id' => 'Provincia',
'poblacion' => 'Població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('provincia_id',$this->provincia_id);
$criteria->compare('poblacion',$this->poblacion,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
}

View File

@ -0,0 +1,90 @@
<?php
/**
* This is the model class for table "tbl_provincias".
*
* The followings are the available columns in table 'tbl_provincias':
* @property integer $id
* @property string $provincia
*
* The followings are the available model relations:
* @property Poblacion[] $poblaciones
*/
class Provincia extends CActiveRecord
{
/**
* Returns the static model of the specified AR class.
* @param string $className active record class name.
* @return Provincia 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_provincias';
}
/**
* @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('provincia', 'required'),
array('provincia', 'length', 'max'=>255),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, provincia', '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(
'poblaciones' => array(self::HAS_MANY, 'Poblacion', 'provincia_id'),
);
}
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'id' => 'ID',
'provincia' => 'Provincia',
);
}
/**
* 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('provincia',$this->provincia,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,58 @@
<?php
return array (
'15' => array('provincia'=>'La Coruña'),
'1' => array('provincia'=>'Alava'),
'2' => array('provincia'=>'Albacete'),
'3' => array('provincia'=>'Alicante'),
'4' => array('provincia'=>'Almería'),
'33' => array('provincia'=>'Asturias'),
'5' => array('provincia'=>'Ávila'),
'6' => array('provincia'=>'Badajoz'),
'8' => array('provincia'=>'Barcelona'),
'9' => array('provincia'=>'Burgos'),
'10' => array('provincia'=>'Cáceres'),
'11' => array('provincia'=>'Cádiz'),
'39' => array('provincia'=>'Cantabria'),
'12' => array('provincia'=>'Cástellón'),
'51' => array('provincia'=>'Ceuta'),
'13' => array('provincia'=>'Ciudad Real'),
'16' => array('provincia'=>'Cuenca'),
'14' => array('provincia'=>'Córdoba'),
'17' => array('provincia'=>'Gerona'),
'18' => array('provincia'=>'Granada'),
'19' => array('provincia'=>'Guadalajara'),
'20' => array('provincia'=>'Guipuzcoa'),
'21' => array('provincia'=>'Huelva'),
'22' => array('provincia'=>'Huesca'),
'7' => array('provincia'=>'Islas Baleares'),
'23' => array('provincia'=>'Jaén'),
'26' => array('provincia'=>'La Rioja'),
'35' => array('provincia'=>'Las Palmas'),
'24' => array('provincia'=>'León'),
'25' => array('provincia'=>'Lérida'),
'27' => array('provincia'=>'Lugo'),
'29' => array('provincia'=>'Málaga'),
'28' => array('provincia'=>'Madrid'),
'52' => array('provincia'=>'Melilla'),
'30' => array('provincia'=>'Murcia'),
'31' => array('provincia'=>'Navarra'),
'32' => array('provincia'=>'Orense'),
'34' => array('provincia'=>'Palencia'),
'36' => array('provincia'=>'Pontevedra'),
'37' => array('provincia'=>'Salamanca'),
'40' => array('provincia'=>'Segovia'),
'41' => array('provincia'=>'Sevilla'),
'42' => array('provincia'=>'Soria'),
'38' => array('provincia'=>'Santa Cruz de Tenerife'),
'43' => array('provincia'=>'Tarragona'),
'44' => array('provincia'=>'Teruel'),
'45' => array('provincia'=>'Toledo'),
'46' => array('provincia'=>'Valencia'),
'47' => array('provincia'=>'Valladolid'),
'48' => array('provincia'=>'Vizcaya'),
'49' => array('provincia'=>'Zamora'),
'50' => array('provincia'=>'Zaragoza'),
);
?>

View File

@ -0,0 +1,102 @@
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'candidato-form',
'enableAjaxValidation'=>false,
)); ?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<div class="row">
<?php echo $form->labelEx($model,'foto'); ?>
<?php echo $form->textField($model,'foto',array('size'=>60,'maxlength'=>255)); ?>
<?php echo $form->error($model,'foto'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'dni'); ?>
<?php echo $form->textField($model,'dni',array('size'=>60,'maxlength'=>255)); ?>
<?php echo $form->error($model,'dni'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'nombre'); ?>
<?php echo $form->textField($model,'nombre',array('size'=>60,'maxlength'=>255)); ?>
<?php echo $form->error($model,'nombre'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'apellidos'); ?>
<?php echo $form->textField($model,'apellidos',array('size'=>60,'maxlength'=>255)); ?>
<?php echo $form->error($model,'apellidos'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'email'); ?>
<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>255)); ?>
<?php echo $form->error($model,'email'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'telefono_fijo'); ?>
<?php echo $form->textField($model,'telefono_fijo',array('size'=>60,'maxlength'=>255)); ?>
<?php echo $form->error($model,'telefono_fijo'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'telefono_movil'); ?>
<?php echo $form->textField($model,'telefono_movil',array('size'=>60,'maxlength'=>255)); ?>
<?php echo $form->error($model,'telefono_movil'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'sexo'); ?>
<?php echo $form->textField($model,'sexo',array('size'=>60,'maxlength'=>255)); ?>
<?php echo $form->error($model,'sexo'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'fecha_nacimiento'); ?>
<?php echo $form->textField($model,'fecha_nacimiento'); ?>
<?php echo $form->error($model,'fecha_nacimiento'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'lugar_nacimiento'); ?>
<?php echo $form->textField($model,'lugar_nacimiento',array('size'=>60,'maxlength'=>255)); ?>
<?php echo $form->error($model,'lugar_nacimiento'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'fecha_alta'); ?>
<?php echo $form->textField($model,'fecha_alta'); ?>
<?php echo $form->error($model,'fecha_alta'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'usuario_alta'); ?>
<?php echo $form->textField($model,'usuario_alta'); ?>
<?php echo $form->error($model,'usuario_alta'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'fecha_modificacion'); ?>
<?php echo $form->textField($model,'fecha_modificacion'); ?>
<?php echo $form->error($model,'fecha_modificacion'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'usuario_modificacion'); ?>
<?php echo $form->textField($model,'usuario_modificacion'); ?>
<?php echo $form->error($model,'usuario_modificacion'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->

View 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>

View File

@ -0,0 +1,89 @@
<div class="wide form">
<?php $form=$this->beginWidget('CActiveForm', array(
'action'=>Yii::app()->createUrl($this->route),
'method'=>'get',
)); ?>
<div class="row">
<?php echo $form->label($model,'id'); ?>
<?php echo $form->textField($model,'id'); ?>
</div>
<div class="row">
<?php echo $form->label($model,'foto'); ?>
<?php echo $form->textField($model,'foto',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'dni'); ?>
<?php echo $form->textField($model,'dni',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'nombre'); ?>
<?php echo $form->textField($model,'nombre',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'apellidos'); ?>
<?php echo $form->textField($model,'apellidos',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'email'); ?>
<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'telefono_fijo'); ?>
<?php echo $form->textField($model,'telefono_fijo',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'telefono_movil'); ?>
<?php echo $form->textField($model,'telefono_movil',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'sexo'); ?>
<?php echo $form->textField($model,'sexo',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'fecha_nacimiento'); ?>
<?php echo $form->textField($model,'fecha_nacimiento'); ?>
</div>
<div class="row">
<?php echo $form->label($model,'lugar_nacimiento'); ?>
<?php echo $form->textField($model,'lugar_nacimiento',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'fecha_alta'); ?>
<?php echo $form->textField($model,'fecha_alta'); ?>
</div>
<div class="row">
<?php echo $form->label($model,'usuario_alta'); ?>
<?php echo $form->textField($model,'usuario_alta'); ?>
</div>
<div class="row">
<?php echo $form->label($model,'fecha_modificacion'); ?>
<?php echo $form->textField($model,'fecha_modificacion'); ?>
</div>
<div class="row">
<?php echo $form->label($model,'usuario_modificacion'); ?>
<?php echo $form->textField($model,'usuario_modificacion'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('Search'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- search-form -->

View File

@ -0,0 +1,66 @@
<div class="view">
<b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b>
<?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('foto')); ?>:</b>
<?php echo CHtml::encode($data->foto); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('dni')); ?>:</b>
<?php echo CHtml::encode($data->dni); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('nombre')); ?>:</b>
<?php echo CHtml::encode($data->nombre); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('apellidos')); ?>:</b>
<?php echo CHtml::encode($data->apellidos); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('email')); ?>:</b>
<?php echo CHtml::encode($data->email); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('telefono_fijo')); ?>:</b>
<?php echo CHtml::encode($data->telefono_fijo); ?>
<br />
<?php /*
<b><?php echo CHtml::encode($data->getAttributeLabel('telefono_movil')); ?>:</b>
<?php echo CHtml::encode($data->telefono_movil); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('sexo')); ?>:</b>
<?php echo CHtml::encode($data->sexo); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('fecha_nacimiento')); ?>:</b>
<?php echo CHtml::encode($data->fecha_nacimiento); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('lugar_nacimiento')); ?>:</b>
<?php echo CHtml::encode($data->lugar_nacimiento); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('fecha_alta')); ?>:</b>
<?php echo CHtml::encode($data->fecha_alta); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('usuario_alta')); ?>:</b>
<?php echo CHtml::encode($data->usuario_alta); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('fecha_modificacion')); ?>:</b>
<?php echo CHtml::encode($data->fecha_modificacion); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('usuario_modificacion')); ?>:</b>
<?php echo CHtml::encode($data->usuario_modificacion); ?>
<br />
*/ ?>
</div>

View File

@ -0,0 +1,66 @@
<?php
$this->breadcrumbs=array(
'Candidatos'=>array('index'),
'Manage',
);
$this->menu=array(
array('label'=>'List Candidato', 'url'=>array('index')),
array('label'=>'Create Candidato', 'url'=>array('create')),
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$.fn.yiiGridView.update('candidato-grid', {
data: $(this).serialize()
});
return false;
});
");
?>
<h1>Manage Candidatos</h1>
<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>
<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
'model'=>$model,
)); ?>
</div><!-- search-form -->
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'candidato-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'id',
'foto',
'dni',
'nombre',
'apellidos',
'email',
/*
'telefono_fijo',
'telefono_movil',
'sexo',
'fecha_nacimiento',
'lugar_nacimiento',
'fecha_alta',
'usuario_alta',
'fecha_modificacion',
'usuario_modificacion',
*/
array(
'class'=>'CButtonColumn',
),
),
)); ?>

View File

@ -0,0 +1,15 @@
<?php
$this->breadcrumbs=array(
'Candidatos'=>array('index'),
'Create',
);
$this->menu=array(
array('label'=>'List Candidato', 'url'=>array('index')),
array('label'=>'Manage Candidato', 'url'=>array('admin')),
);
?>
<h1>Create Candidato</h1>
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>

View File

@ -0,0 +1,17 @@
<?php
$this->breadcrumbs=array(
'Candidatos',
);
$this->menu=array(
array('label'=>'Create Candidato', 'url'=>array('create')),
array('label'=>'Manage Candidato', 'url'=>array('admin')),
);
?>
<h1>Candidatos</h1>
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
)); ?>

View File

@ -0,0 +1,18 @@
<?php
$this->breadcrumbs=array(
'Candidatos'=>array('index'),
$model->id=>array('view','id'=>$model->id),
'Update',
);
$this->menu=array(
array('label'=>'List Candidato', 'url'=>array('index')),
array('label'=>'Create Candidato', 'url'=>array('create')),
array('label'=>'View Candidato', 'url'=>array('view', 'id'=>$model->id)),
array('label'=>'Manage Candidato', 'url'=>array('admin')),
);
?>
<h1>Update Candidato <?php echo $model->id; ?></h1>
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>

View File

@ -0,0 +1,37 @@
<?php
$this->breadcrumbs=array(
'Candidatos'=>array('index'),
$model->id,
);
$this->menu=array(
array('label'=>'List Candidato', 'url'=>array('index')),
array('label'=>'Create Candidato', 'url'=>array('create')),
array('label'=>'Update Candidato', 'url'=>array('update', 'id'=>$model->id)),
array('label'=>'Delete Candidato', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
array('label'=>'Manage Candidato', 'url'=>array('admin')),
);
?>
<h1>View Candidato #<?php echo $model->id; ?></h1>
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'foto',
'dni',
'nombre',
'apellidos',
'email',
'telefono_fijo',
'telefono_movil',
'sexo',
'fecha_nacimiento',
'lugar_nacimiento',
'fecha_alta',
'usuario_alta',
'fecha_modificacion',
'usuario_modificacion',
),
)); ?>

View File

@ -1,49 +1,5 @@
<?php
$this->pageTitle=Yii::app()->name . ' - Login';
$this->breadcrumbs=array(
'Login',
);
?>
<h1>Login</h1>
<p>Please fill out the following form with your login credentials:</p>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'login-form',
'enableClientValidation'=>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
)); ?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<div class="row">
<?php echo $form->labelEx($model,'username'); ?>
<?php echo $form->textField($model,'username'); ?>
<?php echo $form->error($model,'username'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'password'); ?>
<?php echo $form->passwordField($model,'password'); ?>
<?php echo $form->error($model,'password'); ?>
<p class="hint">
Hint: You may login with <tt>demo/demo</tt> or <tt>admin/admin</tt>.
</p>
</div>
<div class="row rememberMe">
<?php echo $form->checkBox($model,'rememberMe'); ?>
<?php echo $form->label($model,'rememberMe'); ?>
<?php echo $form->error($model,'rememberMe'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('Login'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->
<?php echo $form; ?>
</div>

View File

@ -60,4 +60,5 @@ span.timestamp {
.form_default label {
color: #006699;
}
}

View File

@ -353,9 +353,9 @@ button.button:hover, .button:active { background-position: 0 -39px; }
.submenu li:first-child a { -moz-border-radius: 3px 0 0 3px; -webkit-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; border-left: 1px solid #bbb; }
/***MAIN CONTENT: FORM STYLING (forms.html)***/
.sf { width: 250px; }
.mf { width: 350px; }
.lf { width: 450px; }
.sf { width: 150px; }
.mf { width: 265px; }
.lf { width: 460px; }
textarea.mf { height: 100px; }
input[type=radio], input[type=checkbox] { margin: 0; padding: 0; vertical-align: middle; }
@ -598,5 +598,7 @@ input[type=radio], input[type=checkbox] { margin: 0; padding: 0; vertical-align:
.alignright { text-align: right; }
.bordertop { border-top: 1px solid #ccc; }
/***CUSTOM STYLES***/
.operations > ul {list-style: none;}
.operations > ul {list-style: none;}
.operations > ul > li { display: inline-block; }

View File

@ -1,37 +1,6 @@
jQuery.noConflict();
jQuery(document).ready(function(){
/**
* Color Picker
**/
jQuery('#colorpicker').ColorPicker({
onSubmit: function(hsb, hex, rgb, el) {
jQuery(el).val(hex);
jQuery(el).ColorPickerHide();
},
onBeforeShow: function () {
jQuery(this).ColorPickerSetColor(this.value);
}
})
.bind('keyup', function(){
jQuery(this).ColorPickerSetColor(this.value);
});
jQuery('#colorselector').ColorPicker({
color: '#0000ff',
onShow: function (colpkr) {
jQuery(colpkr).fadeIn(500);
return false;
},
onHide: function (colpkr) {
jQuery(colpkr).fadeOut(500);
return false;
},
onChange: function (hsb, hex, rgb) {
jQuery('#colorselector').css('backgroundColor', '#' + hex);
}
});
jQuery(document).ready(function(){
/**
* Date picker
**/

View File

@ -0,0 +1,38 @@
(function($){$.fn.editable=function(target,options){if('disable'==target){$(this).data('disabled.editable',true);return;}
if('enable'==target){$(this).data('disabled.editable',false);return;}
if('destroy'==target){$(this).unbind($(this).data('event.editable')).removeData('disabled.editable').removeData('event.editable');return;}
var settings=$.extend({},$.fn.editable.defaults,{target:target},options);var plugin=$.editable.types[settings.type].plugin||function(){};var submit=$.editable.types[settings.type].submit||function(){};var buttons=$.editable.types[settings.type].buttons||$.editable.types['defaults'].buttons;var content=$.editable.types[settings.type].content||$.editable.types['defaults'].content;var element=$.editable.types[settings.type].element||$.editable.types['defaults'].element;var reset=$.editable.types[settings.type].reset||$.editable.types['defaults'].reset;var callback=settings.callback||function(){};var onedit=settings.onedit||function(){};var onsubmit=settings.onsubmit||function(){};var onreset=settings.onreset||function(){};var onerror=settings.onerror||reset;if(settings.tooltip){$(this).attr('title',settings.tooltip);}
settings.autowidth='auto'==settings.width;settings.autoheight='auto'==settings.height;return this.each(function(){var self=this;var savedwidth=$(self).width();var savedheight=$(self).height();$(this).data('event.editable',settings.event);if(!$.trim($(this).html())){$(this).html(settings.placeholder);}
$(this).bind(settings.event,function(e){if(true===$(this).data('disabled.editable')){return;}
if(self.editing){return;}
if(false===onedit.apply(this,[settings,self])){return;}
e.preventDefault();e.stopPropagation();if(settings.tooltip){$(self).removeAttr('title');}
if(0==$(self).width()){settings.width=savedwidth;settings.height=savedheight;}else{if(settings.width!='none'){settings.width=settings.autowidth?$(self).width():settings.width;}
if(settings.height!='none'){settings.height=settings.autoheight?$(self).height():settings.height;}}
if($(this).html().toLowerCase().replace(/(;|")/g,'')==settings.placeholder.toLowerCase().replace(/(;|")/g,'')){$(this).html('');}
self.editing=true;self.revert=$(self).html();$(self).html('');var form=$('<form />');if(settings.cssclass){if('inherit'==settings.cssclass){form.attr('class',$(self).attr('class'));}else{form.attr('class',settings.cssclass);}}
if(settings.style){if('inherit'==settings.style){form.attr('style',$(self).attr('style'));form.css('display',$(self).css('display'));}else{form.attr('style',settings.style);}}
var input=element.apply(form,[settings,self]);var input_content;if(settings.loadurl){var t=setTimeout(function(){input.disabled=true;content.apply(form,[settings.loadtext,settings,self]);},100);var loaddata={};loaddata[settings.id]=self.id;if($.isFunction(settings.loaddata)){$.extend(loaddata,settings.loaddata.apply(self,[self.revert,settings]));}else{$.extend(loaddata,settings.loaddata);}
$.ajax({type:settings.loadtype,url:settings.loadurl,data:loaddata,async:false,success:function(result){window.clearTimeout(t);input_content=result;input.disabled=false;}});}else if(settings.data){input_content=settings.data;if($.isFunction(settings.data)){input_content=settings.data.apply(self,[self.revert,settings]);}}else{input_content=self.revert;}
content.apply(form,[input_content,settings,self]);input.attr('name',settings.name);buttons.apply(form,[settings,self]);$(self).append(form);plugin.apply(form,[settings,self]);$(':input:visible:enabled:first',form).focus();if(settings.select){input.select();}
input.keydown(function(e){if(e.keyCode==27){e.preventDefault();reset.apply(form,[settings,self]);}});var t;if('cancel'==settings.onblur){input.blur(function(e){t=setTimeout(function(){reset.apply(form,[settings,self]);},500);});}else if('submit'==settings.onblur){input.blur(function(e){t=setTimeout(function(){form.submit();},200);});}else if($.isFunction(settings.onblur)){input.blur(function(e){settings.onblur.apply(self,[input.val(),settings]);});}else{input.blur(function(e){});}
form.submit(function(e){if(t){clearTimeout(t);}
e.preventDefault();if(false!==onsubmit.apply(form,[settings,self])){if(false!==submit.apply(form,[settings,self])){if($.isFunction(settings.target)){var str=settings.target.apply(self,[input.val(),settings]);$(self).html(str);self.editing=false;callback.apply(self,[self.innerHTML,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder);}}else{var submitdata={};submitdata[settings.name]=input.val();submitdata[settings.id]=self.id;if($.isFunction(settings.submitdata)){$.extend(submitdata,settings.submitdata.apply(self,[self.revert,settings]));}else{$.extend(submitdata,settings.submitdata);}
if('PUT'==settings.method){submitdata['_method']='put';}
$(self).html(settings.indicator);var ajaxoptions={type:'POST',data:submitdata,dataType:'html',url:settings.target,success:function(result,status){if(ajaxoptions.dataType=='html'){$(self).html(result);}
self.editing=false;callback.apply(self,[result,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder);}},error:function(xhr,status,error){onerror.apply(form,[settings,self,xhr]);}};$.extend(ajaxoptions,settings.ajaxoptions);$.ajax(ajaxoptions);}}}
$(self).attr('title',settings.tooltip);return false;});});this.reset=function(form){if(this.editing){if(false!==onreset.apply(form,[settings,self])){$(self).html(self.revert);self.editing=false;if(!$.trim($(self).html())){$(self).html(settings.placeholder);}
if(settings.tooltip){$(self).attr('title',settings.tooltip);}}}};});};$.editable={types:{defaults:{element:function(settings,original){var input=$('<input type="hidden"></input>');$(this).append(input);return(input);},content:function(string,settings,original){$(':input:first',this).val(string);},reset:function(settings,original){original.reset(this);},buttons:function(settings,original){var form=this;if(settings.submit){if(settings.submit.match(/>$/)){var submit=$(settings.submit).click(function(){if(submit.attr("type")!="submit"){form.submit();}});}else{var submit=$('<button type="submit" />');submit.html(settings.submit);}
$(this).append(submit);}
if(settings.cancel){if(settings.cancel.match(/>$/)){var cancel=$(settings.cancel);}else{var cancel=$('<button type="cancel" />');cancel.html(settings.cancel);}
$(this).append(cancel);$(cancel).click(function(event){if($.isFunction($.editable.types[settings.type].reset)){var reset=$.editable.types[settings.type].reset;}else{var reset=$.editable.types['defaults'].reset;}
reset.apply(form,[settings,original]);return false;});}}},text:{element:function(settings,original){var input=$('<input />');if(settings.width!='none'){input.width(settings.width);}
if(settings.height!='none'){input.height(settings.height);}
input.attr('autocomplete','off');$(this).append(input);return(input);}},textarea:{element:function(settings,original){var textarea=$('<textarea />');if(settings.rows){textarea.attr('rows',settings.rows);}else if(settings.height!="none"){textarea.height(settings.height);}
if(settings.cols){textarea.attr('cols',settings.cols);}else if(settings.width!="none"){textarea.width(settings.width);}
$(this).append(textarea);return(textarea);}},select:{element:function(settings,original){var select=$('<select />');$(this).append(select);return(select);},content:function(data,settings,original){if(String==data.constructor){eval('var json = '+data);}else{var json=data;}
for(var key in json){if(!json.hasOwnProperty(key)){continue;}
if('selected'==key){continue;}
var option=$('<option />').val(key).append(json[key]);$('select',this).append(option);}
$('select',this).children().each(function(){if($(this).val()==json['selected']||$(this).text()==$.trim(original.revert)){$(this).attr('selected','selected');}});}}},addInputType:function(name,input){$.editable.types[name]=input;}};$.fn.editable.defaults={name:'value',id:'id',type:'text',width:'auto',height:'auto',event:'click.editable',onblur:'cancel',loadtype:'GET',loadtext:'Loading...',placeholder:'Click to edit',loaddata:{},submitdata:{},ajaxoptions:{}};})(jQuery);

View File

@ -0,0 +1,168 @@
<?php
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/custom/elements.js');
?>
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'candidato-form',
'enableAjaxValidation'=>false,
'htmlOptions'=>array('enctype' => 'multipart/form-data'),
)); ?>
<div class="two_third last">
<div class="notification msginfo">
<a class="close"></a>
<p>Los campos marcados con <span class="required">*</span> son obligatorios.</p>
</div><!-- notification msginfo -->
<?php echo $form->errorSummary($model, "<a class='close'></a>", "", array('class'=>"notification msgerror")); ?>
</div>
<br clear="all" />
<div class="widgetbox two_third last form_default">
<h3>
<span>
<legend>Datos personales</legend>
</span>
</h3>
<div class="content nopadding">
<div class="padding1020">
<?php echo $form->labelEx($model,'foto', array('class'=>'nopadding')); ?>
<div class="marginleft150">
<?php
echo CHtml::image($model->foto, $model->nombre,
array("title" => $model->nombre, "width"=>"120", "height"=>"120")
); ?>
<?php echo CHtml::activeFileField($model, 'foto'); ?>
<?php echo $form->error($model,'foto', array('class'=>'error')); ?>
</div>
</div>
<div class="padding1020 ">
<?php echo $form->labelEx($model,'nombre'); ?>
<div class="marginleft150">
<?php echo $form->textField($model,'nombre',array('maxlength'=>255,'class'=>'mf')); ?>
<?php echo $form->error($model,'nombre', array('class'=>'error')); ?>
</div>
</div>
<div class="padding1020">
<?php echo $form->labelEx($model,'apellidos'); ?>
<div class="marginleft150">
<?php echo $form->textField($model,'apellidos',array('maxlength'=>255,'class'=>'lf')); ?>
<?php echo $form->error($model,'apellidos', array('class'=>'error')); ?>
</div>
</div>
<div class="padding1020">
<?php echo $form->labelEx($model,'sexo', array('class'=>'nopadding')); ?>
<div class="marginleft150">
<?php
$cadena = CHtml::radioButtonList('sexo',
$model->sexo,
$model->OpcionesGenero,
array('separator'=>'&nbsp;&nbsp;&nbsp;&nbsp;'));
echo strip_tags($cadena, '<input>');
?>
<?php echo $form->error($model,'sexo', array('class'=>'error')); ?>
</div>
</div>
<div class="padding1020">
<?php echo $form->labelEx($model,'dni'); ?>
<div class="marginleft150">
<?php echo $form->textField($model,'dni',array('maxlength'=>255,'class'=>'sf')); ?>
<?php echo $form->error($model,'dni', array('class'=>'error')); ?>
</div>
</div>
<div class="padding1020">
<?php echo $form->labelEx($model,'fecha_nacimiento'); ?>
<div class="marginleft150">
<?php echo $form->textField($model,'fecha_nacimiento',array('class'=>'sf','id'=>'datepicker')); ?>
<?php echo $form->error($model,'fecha_nacimiento', array('class'=>'error')); ?>
</div>
</div>
<div class="padding1020">
<?php echo $form->labelEx($model,'lugar_nacimiento'); ?>
<div class="marginleft150">
<?php echo $form->textField($model,'lugar_nacimiento',array('maxlength'=>255,'class'=>'lf')); ?>
<?php echo $form->error($model,'lugar_nacimiento', array('class'=>'error')); ?>
</div>
</div>
<br clear="all" />
</div>
</div>
<br clear="all" />
<div class="widgetbox two_third last form_default">
<h3>
<span>
<legend>Datos de contacto</legend>
</span>
</h3>
<div class="content nopadding">
<div class="padding1020">
<?php echo $form->labelEx($model,'telefono_fijo'); ?>
<div class="marginleft150">
<?php echo $form->textField($model,'telefono_fijo',array('maxlength'=>255,'class'=>'sf')); ?>
<?php echo $form->error($model,'telefono_fijo', array('class'=>'error')); ?>
</div>
</div>
<div class="padding1020 borderbottom">
<?php echo $form->labelEx($model,'telefono_movil'); ?>
<div class="marginleft150">
<?php echo $form->textField($model,'telefono_movil',array('maxlength'=>255,'class'=>'sf')); ?>
<?php echo $form->error($model,'telefono_movil', array('class'=>'error')); ?>
</div>
</div>
<div class="padding1020 borderbottom">
<?php echo $form->labelEx($model,'email'); ?>
<div class="marginleft150">
<?php echo $form->textField($model,'email',array('maxlength'=>255,'class'=>'mf')); ?>
<?php echo $form->error($model,'email', array('class'=>'error')); ?>
</div>
</div>
<div class="padding1020">
<?php echo $form->labelEx($model,'localidad'); ?>
<div class="marginleft150">
<?php
$lista = CHtml::listData(Poblacion::model()->findAll(),'id', 'poblacion', 'provincia_id');
$provincias = Provincia::model()->findAll();
foreach ($provincias as $provincia) {
if (array_key_exists($provincia->id, $lista)) {
$lista[$provincia->provincia] = $lista[$provincia->id];
unset($lista[$provincia->id]);
}
}
echo CHtml::dropDownList(
'localidad',
$model->localidad,
$lista,
array(
'empty'=>'<Seleccionar>',
'class'=>'mf',
));
?>
<?php echo $form->error($model,'localidad', array('class'=>'error')); ?>
</div>
</div>
<br clear="all" />
</div>
</div>
<br clear="all" />
<div class="widgetbox two_third last form_default">
<h3>
<span>
<legend>Datos académicos</legend>
</span>
</h3>
</div>
<br clear="all" />
<div class="form_default">
<button type="submit"><?php echo $model->isNewRecord ? 'Crear' : 'Guardar'; ?></button>
</div>
<?php $this->endWidget(); ?>

View File

@ -0,0 +1,89 @@
<div class="wide form">
<?php $form=$this->beginWidget('CActiveForm', array(
'action'=>Yii::app()->createUrl($this->route),
'method'=>'get',
)); ?>
<div class="row">
<?php echo $form->label($model,'id'); ?>
<?php echo $form->textField($model,'id'); ?>
</div>
<div class="row">
<?php echo $form->label($model,'foto'); ?>
<?php echo $form->textField($model,'foto',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'dni'); ?>
<?php echo $form->textField($model,'dni',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'nombre'); ?>
<?php echo $form->textField($model,'nombre',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'apellidos'); ?>
<?php echo $form->textField($model,'apellidos',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'email'); ?>
<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'telefono_fijo'); ?>
<?php echo $form->textField($model,'telefono_fijo',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'telefono_movil'); ?>
<?php echo $form->textField($model,'telefono_movil',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'sexo'); ?>
<?php echo $form->textField($model,'sexo',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'fecha_nacimiento'); ?>
<?php echo $form->textField($model,'fecha_nacimiento'); ?>
</div>
<div class="row">
<?php echo $form->label($model,'lugar_nacimiento'); ?>
<?php echo $form->textField($model,'lugar_nacimiento',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'fecha_alta'); ?>
<?php echo $form->textField($model,'fecha_alta'); ?>
</div>
<div class="row">
<?php echo $form->label($model,'usuario_alta'); ?>
<?php echo $form->textField($model,'usuario_alta'); ?>
</div>
<div class="row">
<?php echo $form->label($model,'fecha_modificacion'); ?>
<?php echo $form->textField($model,'fecha_modificacion'); ?>
</div>
<div class="row">
<?php echo $form->label($model,'usuario_modificacion'); ?>
<?php echo $form->textField($model,'usuario_modificacion'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('Search'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- search-form -->

View File

@ -0,0 +1,66 @@
<div class="view">
<b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b>
<?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('foto')); ?>:</b>
<?php echo CHtml::encode($data->foto); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('dni')); ?>:</b>
<?php echo CHtml::encode($data->dni); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('nombre')); ?>:</b>
<?php echo CHtml::encode($data->nombre); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('apellidos')); ?>:</b>
<?php echo CHtml::encode($data->apellidos); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('email')); ?>:</b>
<?php echo CHtml::encode($data->email); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('telefono_fijo')); ?>:</b>
<?php echo CHtml::encode($data->telefono_fijo); ?>
<br />
<?php /*
<b><?php echo CHtml::encode($data->getAttributeLabel('telefono_movil')); ?>:</b>
<?php echo CHtml::encode($data->telefono_movil); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('sexo')); ?>:</b>
<?php echo CHtml::encode($data->sexo); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('fecha_nacimiento')); ?>:</b>
<?php echo CHtml::encode($data->fecha_nacimiento); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('lugar_nacimiento')); ?>:</b>
<?php echo CHtml::encode($data->lugar_nacimiento); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('fecha_alta')); ?>:</b>
<?php echo CHtml::encode($data->fecha_alta); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('usuario_alta')); ?>:</b>
<?php echo CHtml::encode($data->usuario_alta); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('fecha_modificacion')); ?>:</b>
<?php echo CHtml::encode($data->fecha_modificacion); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('usuario_modificacion')); ?>:</b>
<?php echo CHtml::encode($data->usuario_modificacion); ?>
<br />
*/ ?>
</div>

View File

@ -0,0 +1,66 @@
<?php
$this->breadcrumbs=array(
'Candidatos'=>array('index'),
'Manage',
);
$this->menu=array(
array('label'=>'List Candidato', 'url'=>array('index')),
array('label'=>'Create Candidato', 'url'=>array('create')),
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$.fn.yiiGridView.update('candidato-grid', {
data: $(this).serialize()
});
return false;
});
");
?>
<h1>Manage Candidatos</h1>
<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>
<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
'model'=>$model,
)); ?>
</div><!-- search-form -->
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'candidato-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'id',
'foto',
'dni',
'nombre',
'apellidos',
'email',
/*
'telefono_fijo',
'telefono_movil',
'sexo',
'fecha_nacimiento',
'lugar_nacimiento',
'fecha_alta',
'usuario_alta',
'fecha_modificacion',
'usuario_modificacion',
*/
array(
'class'=>'CButtonColumn',
),
),
)); ?>

View File

@ -0,0 +1,18 @@
<?php
$this->breadcrumbs=array(
'Candidatos'=>array('index'),
'Nuevo candidato',
);
$this->menu=array(
array(
'label'=>'<img class="mgright5" alt="Lista de candidatos" src="' . Yii::app()->theme->baseUrl . '/images/icons/small/white/user.png"/>Lista de candidatos',
'url'=>array('index'),
'linkOptions'=>array('class'=>'iconlink'),
),
);
$this->pageTitle='Nuevo candidato';
?>
<?php echo $this->renderPartial('_form', array(
'model'=>$model,
)); ?>

View File

@ -0,0 +1,68 @@
<?php
$this->breadcrumbs=array(
'Candidatos',
);
$this->menu=array(
array(
'label'=>'<img class="mgright5" alt="Nuevo candidato" src="' . Yii::app()->theme->baseUrl . '/images/icons/small/white/user.png"/>Nuevo candidato',
'url'=>array('create'),
'linkOptions'=>array('class'=>'iconlink'),
),
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$.fn.yiiGridView.update('candidato-grid', {
data: $(this).serialize()
});
return false;
});
");
$this->pageTitle='Gestión de candidatos';
?>
<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>
<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
'model'=>$model,
)); ?>
</div><!-- search-form -->
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'candidato-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'id',
'foto',
'dni',
'nombre',
'apellidos',
'email',
/*
'telefono_fijo',
'telefono_movil',
'sexo',
'fecha_nacimiento',
'lugar_nacimiento',
'fecha_alta',
'usuario_alta',
'fecha_modificacion',
'usuario_modificacion',
*/
array(
'class'=>'CButtonColumn',
),
),
)); ?>

View File

@ -0,0 +1,18 @@
<?php
$this->breadcrumbs=array(
'Candidatos'=>array('index'),
$model->id=>array('view','id'=>$model->id),
'Update',
);
$this->menu=array(
array('label'=>'List Candidato', 'url'=>array('index')),
array('label'=>'Create Candidato', 'url'=>array('create')),
array('label'=>'View Candidato', 'url'=>array('view', 'id'=>$model->id)),
array('label'=>'Manage Candidato', 'url'=>array('admin')),
);
?>
<h1>Update Candidato <?php echo $model->id; ?></h1>
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>

View File

@ -0,0 +1,37 @@
<?php
$this->breadcrumbs=array(
'Candidatos'=>array('index'),
$model->id,
);
$this->menu=array(
array('label'=>'List Candidato', 'url'=>array('index')),
array('label'=>'Create Candidato', 'url'=>array('create')),
array('label'=>'Update Candidato', 'url'=>array('update', 'id'=>$model->id)),
array('label'=>'Delete Candidato', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
array('label'=>'Manage Candidato', 'url'=>array('admin')),
);
?>
<h1>View Candidato #<?php echo $model->id; ?></h1>
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'foto',
'dni',
'nombre',
'apellidos',
'email',
'telefono_fijo',
'telefono_movil',
'sexo',
'fecha_nacimiento',
'lugar_nacimiento',
'fecha_alta',
'usuario_alta',
'fecha_modificacion',
'usuario_modificacion',
),
)); ?>

View File

@ -1,6 +1,6 @@
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'usuario-form',
'enableAjaxValidation'=>true,
'enableAjaxValidation'=>false,
)); ?>
@ -24,7 +24,7 @@
<div class="padding1020 ">
<?php echo $form->labelEx($model,'name'); ?>
<div class="marginleft150">
<?php echo $form->textField($model,'name',array('maxlength'=>255,'class'=>'lf')); ?>
<?php echo $form->textField($model,'name',array('maxlength'=>255,'class'=>'mf')); ?>
<?php echo $form->error($model,'name', array('class'=>'error')); ?>
</div>
</div>
@ -32,7 +32,7 @@
<div class="padding1020 borderbottom">
<?php echo $form->labelEx($model,'email'); ?>
<div class="marginleft150">
<?php echo $form->textField($model,'email',array('maxlength'=>255,'class'=>'lf')); ?>
<?php echo $form->textField($model,'email',array('maxlength'=>255,'class'=>'mf')); ?>
<?php echo $form->error($model,'email', array('class'=>'error')); ?>
</div>
</div>
@ -40,7 +40,7 @@
<div class="padding1020 borderbottom">
<?php echo $form->labelEx($model,'username'); ?>
<div class="marginleft150">
<?php echo $form->textField($model,'username',array('maxlength'=>255,'class'=>'lf')); ?>
<?php echo $form->textField($model,'username',array('maxlength'=>255,'class'=>'mf')); ?>
<?php echo $form->error($model,'username', array('class'=>'error')); ?>
</div>

View File

@ -1,28 +1,24 @@
<div class="view">
<div class="invoice three_fourth last">
<div class="invoice_inner">
<span>[Logo here]</span>
<h2 class="title">Usuario</h2>
<br clear="all" /><br />
<div class="one_fourth">
<strong>
<?php echo CHtml::encode($data->getAttributeLabel('name')); ?>: <br />
<?php echo CHtml::encode($data->getAttributeLabel('email')); ?>: <br />
<?php echo CHtml::encode($data->getAttributeLabel('username')); ?>: <br />
<?php echo CHtml::encode($data->getAttributeLabel('last_login_time')); ?>: <br />
</strong>
</div><!-- one_third -->
<b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b>
<?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>
<br />
<div class="three_fourth last">
<?php echo CHtml::encode($data->name); ?><br />
<?php echo CHtml::mailto(CHtml::encode($data->email)); ?><br/>
<?php echo CHtml::encode($data->username); ?>
<?php echo CHtml::encode($data->last_login_time); ?>
</div><!-- three_fourth last -->
<br clear="all" /><br />
</div>
</div>
<b><?php echo CHtml::encode($data->getAttributeLabel('email')); ?>:</b>
<?php echo CHtml::encode($data->email); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('name')); ?>:</b>
<?php echo CHtml::encode($data->name); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('username')); ?>:</b>
<?php echo CHtml::encode($data->username); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('password')); ?>:</b>
<?php echo CHtml::encode($data->password); ?>
<br />
<b><?php echo CHtml::encode($data->getAttributeLabel('last_login_time')); ?>:</b>
<?php echo CHtml::encode($data->last_login_time); ?>
<br />
</div>

View File

@ -17,9 +17,20 @@ $cs->registerCssFile(Yii::app()->baseUrl . '/js/star-rating/jquery.rating.css');
$this->pageTitle='Gestión de usuarios';
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$.fn.yiiGridView.update('usuario-grid', {
data: $(this).serialize()
});
return false;
});
");
?>
<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>

View File

@ -1,18 +1,26 @@
<?php
$this->breadcrumbs=array(
'Usuarios'=>array('index'),
$model->name=>array('view','id'=>$model->id),
'Update',
'Modificar usuario',
);
$this->menu=array(
array('label'=>'List Usuario', 'url'=>array('index')),
array('label'=>'Create Usuario', 'url'=>array('create')),
array('label'=>'View Usuario', 'url'=>array('view', 'id'=>$model->id)),
array('label'=>'Manage Usuario', 'url'=>array('admin')),
array(
'label'=>'<img class="mgright5" alt="Lista de usuarios" src="' . Yii::app()->theme->baseUrl . '/images/icons/small/white/user.png"/>Lista de usuarios',
'url'=>array('index'),
'linkOptions'=>array('class'=>'iconlink'),
),
array(
'label'=>'<img class="mgright5" alt="Nuevo usuario" src="' . Yii::app()->theme->baseUrl . '/images/icons/small/white/user.png"/>Nuevo usuario',
'url'=>array('create'),
'linkOptions'=>array('class'=>'iconlink2'),
),
array(
'label'=>'<img class="mgright5" alt="Ver usuario" src="' . Yii::app()->theme->baseUrl . '/images/icons/small/white/user.png"/>Ver usuario',
'url'=>array('view', 'id'=>$model->id),
'linkOptions'=>array('class'=>'iconlink2'),
),
);
$this->pageTitle='Modificar usuario ' . $model->username;
?>
<h1>Update Usuario <?php echo $model->id; ?></h1>
<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>

View File

@ -1,28 +1,44 @@
<?php
$this->breadcrumbs=array(
'Usuarios'=>array('index'),
$model->name,
//(count($dataProvider) == 1) ? $dataProvider->name : 'Ver usuarios',
'Ver usuarios',
);
$this->menu=array(
array('label'=>'List Usuario', 'url'=>array('index')),
array('label'=>'Create Usuario', 'url'=>array('create')),
array('label'=>'Update Usuario', 'url'=>array('update', 'id'=>$model->id)),
array('label'=>'Delete Usuario', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
array('label'=>'Manage Usuario', 'url'=>array('admin')),
array(
'label'=>'<img class="mgright5" alt="Lista de usuarios" src="' . Yii::app()->theme->baseUrl . '/images/icons/small/white/user.png"/>Lista de usuarios',
'url'=>array('index'),
'linkOptions'=>array('class'=>'iconlink'),
),
array(
'label'=>'<img class="mgright5" alt="Nuevo usuario" src="' . Yii::app()->theme->baseUrl . '/images/icons/small/white/user.png"/>Nuevo usuario',
'url'=>array('create'),
'linkOptions'=>array('class'=>'iconlink2'),
),
array(
'label'=>'<img class="mgright5" alt="Modificar usuario" src="' . Yii::app()->theme->baseUrl . '/images/icons/small/white/user.png"/>Modificar usuario',
//'url'=>array('view', 'id'=>$model->id),
'linkOptions'=>array('class'=>'iconlink2'),
),
array(
'label'=>'<img class="mgright5" alt="Eliminar usuario" src="' . Yii::app()->theme->baseUrl . '/images/icons/small/white/user.png"/>Eliminar usuario',
'url'=>'#',
'linkOptions'=>array(
'class'=>'iconlink2',
//'submit'=>array('delete','id'=>$model->id),
'confirm'=>'Are you sure you want to delete this item?',
),
),
);
//$this->pageTitle='Usuario ' . $model->name . ' (' . $model->username . ')';
?>
<h1>View Usuario #<?php echo $model->id; ?></h1>
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'email',
'name',
'username',
'password',
'last_login_time',
),
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
'enablePagination'=>false,
'summaryText'=>'',
)); ?>