diff --git a/www/protected/config/mode_production.php b/www/protected/config/mode_production.php index 6a27d56..427fd14 100644 --- a/www/protected/config/mode_production.php +++ b/www/protected/config/mode_production.php @@ -28,6 +28,7 @@ $configSpecific = array( 'connectionString' => 'mysql:host=PRODUCTION_HOST;dbname=PRODUCTION_DBNAME', 'username' => 'USERNAME', 'password' => 'PASSWORD', + 'charset'=>'utf8', ), // Application Log diff --git a/www/protected/config/mode_stage.php b/www/protected/config/mode_stage.php index ac5a571..00030ce 100644 --- a/www/protected/config/mode_stage.php +++ b/www/protected/config/mode_stage.php @@ -28,6 +28,7 @@ $configSpecific = array( 'connectionString' => 'mysql:host=maquetaweb.ws;dbname=maqueta_intranet_stage', 'username' => 'maqueta_intranet', 'password' => 'intranet', + 'charset'=>'utf8', ), // Application Log @@ -43,7 +44,11 @@ $configSpecific = array( ), ), - + + 'params'=>array( + // Ruta de los currículums de los candidatos + 'curriculumPath' => dirname(__FILE__) . '/../../public_html/intranet/documentos/', + ), ); ?> \ No newline at end of file diff --git a/www/protected/models/Candidato.php b/www/protected/models/Candidato.php index fc16abf..b0d8aac 100644 --- a/www/protected/models/Candidato.php +++ b/www/protected/models/Candidato.php @@ -13,7 +13,7 @@ * @property string $telefono_fijo * @property string $telefono_movil * @property string $sexo - * @property string $fecha_nacimiento + * @property date $fecha_nacimiento * @property string $lugar_nacimiento * @property datetime $fecha_alta * @property datetime $fecha_modificacion @@ -306,8 +306,8 @@ class Candidato extends CActiveRecord //PHP dates are displayed as dd/mm/yyyy //MYSQL dates are stored as yyyy-mm-dd if ($this->fecha_nacimiento != '') { - $unafecha = DateTime::createFromFormat('d/m/Y', $this->fecha_nacimiento); - $this->fecha_nacimiento = $unafecha->format('Y-m-d'); + $dateToMySQL=date('Y-m-d', CDateTimeParser::parse($this->fecha_nacimiento, Yii::app()->locale->dateFormat)); + $this->fecha_nacimiento = $dateToMySQL; } parent::beforeSave(); @@ -317,8 +317,9 @@ class Candidato extends CActiveRecord protected function afterFind() { //PHP dates are displayed as dd/mm/yyyy //MYSQL dates are stored as yyyy-mm-dd - $unafecha = DateTime::createFromFormat('Y-m-d', $this->fecha_nacimiento); - $this->fecha_nacimiento = $unafecha->format('d/m/Y'); + + $dateToLocale=Yii::app()->dateFormatter->formatDateTime(CDateTimeParser::parse($this->fecha_nacimiento, 'yyyy-MM-dd'),'medium',null); + $this->fecha_nacimiento = $dateToLocale; parent::afterFind(); return true; diff --git a/www/protected/models/CandidatoCapacidad.php b/www/protected/models/CandidatoCapacidad.php index 2fbc9e7..50ca72e 100644 --- a/www/protected/models/CandidatoCapacidad.php +++ b/www/protected/models/CandidatoCapacidad.php @@ -103,4 +103,10 @@ class CandidatoCapacidad extends CActiveRecord 'criteria'=>$criteria, )); } + + public function behaviors() { + return array( + 'LoggableBehavior'=> 'application.modules.auditTrail.behaviors.LoggableBehavior', + ); + } } \ No newline at end of file diff --git a/www/protected/models/CandidatoDocumento.php b/www/protected/models/CandidatoDocumento.php index 0b03217..6f63931 100644 --- a/www/protected/models/CandidatoDocumento.php +++ b/www/protected/models/CandidatoDocumento.php @@ -142,4 +142,9 @@ class CandidatoDocumento extends CActiveRecord )); } + public function behaviors() { + return array( + 'LoggableBehavior'=> 'application.modules.auditTrail.behaviors.LoggableBehavior', + ); + } } \ No newline at end of file