Compare commits

..

No commits in common. "master" and "1.1.4@100" have entirely different histories.

283 changed files with 2854 additions and 10247 deletions

View File

@ -12,66 +12,6 @@ include_once("BD.php");
include_once("Persona.php");
include_once("Automata.php");
include_once("ListaCapacidadesProfesionales.php");
include_once("upload.class.php");
function limpia($imagen){
if(file_exists($imagen)) {
unlink($imagen);
}
}
function tieneImagen($OID){
$cadena = 'imagenes/' . $OID . '_150.jpg';
return file_exists($cadena);
}
function rutaImagen($OID){
$cadena = 'imagenes/' . $OID . '_150.jpg';
return $cadena;
}
function uploadImagenCandidato($OID, $size1_w, $size1_h, $size2_w=0, $size2_h=0, $mascara='') {
$path = "imagenes/"; // este directorio tiene que tener chmod 777
$upload_file_name = "candidato_imagen"; // el nombre del campo tipo file de nuestro formulario
$acceptable_file_types = "image/gif|image/jpeg|image/pjpeg"; // acepta GIF et JPEG
$default_extension = "";
$mode = 1; // OPTIONS:
// 1 = overwrite mode
// 2 = create new with incremental extention
// 3 = do nothing if exists, highest protection
// un poco de limpieza previa
// este es el temporal
$glob = glob($path . $OID, '_tmp');
limpia($glob);
limpia($path . '_' . $size1_w . '.jpg');
limpia($path . '_' . $size2_w . '.jpg');
// fin de la limpia
if(strlen($_FILES['candidato_imagen']['name'])) {
$my_uploader = new uploader('es'); // Create a new instance of the class
$my_uploader->max_filesize(1500000); // OPTIONAL: set the max filesize of uploadable files in bytes
$my_uploader->max_image_size(1600, 1600); // OPTIONAL: if you're uploading images, you can set the max pixel dimensions
// UPLOAD the file
if ($my_uploader->upload($upload_file_name, $acceptable_file_types, $default_extension)) {
$my_uploader->save_file($path, $OID . '_tmp', $mode);
if (!$my_uploader->error) {
$my_uploader->resize($OID . '_' . $size1_w . '.jpg', $size1_w, $size1_h, 60);
if($size2_w) {
$my_uploader->resize($OID . '_' . $size2_w . '.jpg', $size2_w, $size2_h, 60);
}
$my_uploader->delete_file;
}
}
if ($my_uploader->error) {
echo $my_uploader->error;
}
$glob = glob($path . $OID, '_tmp');
limpia($glob);
}
}
class Candidato extends Persona {
@ -147,7 +87,7 @@ return $resultado;
return $bd->getCampo($consulta);
}
function addCurriculum($fichero, $tipo) {
function addCurriculum($fichero) {
//PERMISOS:
/*
* Admin (1) - Todos
@ -156,7 +96,7 @@ return $resultado;
*/
$sesion = $this->usuario->getValor("oid");
if ($this->usuario->tieneRol(3) || $this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) {
return parent::addCurriculum($fichero, $tipo, $this->usuario->getValor("nombre"));
return parent::addCurriculum($fichero, $this->usuario->getValor("nombre"));
} else {
$error = "El usuario no tiene permisos para asociar CV al candidato.";
throw new Exception($error);
@ -173,6 +113,8 @@ return $resultado;
* Otro - Excepción
*/
$sesion = $this->usuario->getValor("oid");
echo $this->usuario->tieneRol(1);
echo $this->usuario->tieneRol(4);
if ($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) {
parent::removeCurriculum($curriculum, $fecha, $this->usuario->getValor("nombre"));
} else {
@ -213,8 +155,8 @@ return $resultado;
* Otro - Excepción
*/
$sesion = $this->usuario->getValor("oid");
//Nos declaramos un array de estados eliminables: se cambia a los nuevos estados #723 Peticion
$estados_eliminables = array("510","511","520","600");
//Nos declaramos un array de estados eliminables:
$estados_eliminables = array("510","521","522","523","540");
if ($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) {
$estado = $this->getValor("estado");
if (in_array($estado, $estados_eliminables)) {

View File

@ -73,7 +73,7 @@
}
}
function addCurriculum($fichero, $tipo){
function addCurriculum($fichero){
//PERMISOS:
/*
* Admin (1) - Todos
@ -82,7 +82,7 @@
*/
$sesion = $this->usuario->getValor("oid");
if($this->usuario->tieneRol(3) || $this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)){
return parent::addCurriculum($fichero, $tipo, $this->usuario->getValor("nombre"));
return parent::addCurriculum($fichero, $this->usuario->getValor("nombre"));
}else{
$error = "El usuario no tiene permisos para asociar CV al empleado.";
throw new Exception($error);

View File

@ -66,8 +66,7 @@
if($usuario->tieneRol("3") ||$usuario->tieneRol("1")){
echo '<a href="addPedido.php" class="menuOption" style="color:#000000">'.$this->locale['1008'].'</a>';
}
//echo '<a href="buscar_pedido.php" class="menuOption" style="color:#000000">'.$this->locale['1009'].'</a>';
echo '<a href="buscar_pedido.php" class="menuOption" style="color:#000000">'.$this->locale['1009'].'</a>';
// Buscar candidatos
/*if(substr_count($_SERVER['REQUEST_URI'],"/pedido.php?idPedido")==1){
echo '<a href="buscar.php" class="menuOption" target="_blank" style="color:#000000">'.$this->locale['820'].'</a>';
@ -94,20 +93,10 @@
} else {
$opcionesThis = $opciones;
}
echo '<a href="lista_ofertas.php" class="menuOption" style="color:#000000">'.$this->locale['5100'].'</a>';
if((!$usuario->tieneRol("7")) && (substr_count($_SERVER['REQUEST_URI'],"/oferta.php?idOferta")==1)){
echo '<a href="gestion_oferta.php?idOferta='.$_GET['idOferta'].'" class="menuOption" style="color:#000000">'.$this->locale['ed'].'</a>';
}
if(substr_count($_SERVER['REQUEST_URI'],"/gestion_oferta.php?idOferta")==1){
echo '<a href="oferta.php?idOferta='.$_GET['idOferta'].'" class="menuOption" style="color:#000000">'.$this->locale['im'].'</a>';
}
// if($usuario->tieneRol("3") ||$usuario->tieneRol("1")){
// echo '<a href="addOferta.php" class="menuOption" style="color:#000000">'.$this->locale['5101'].'</a>';
// }
echo '<a href="lista_ofertas.php" class="menuOption" style="color:#000000">'.$this->locale['5100'].'</a>';
if($usuario->tieneRol("3") ||$usuario->tieneRol("1")){
echo '<a href="addOferta.php" class="menuOption" style="color:#000000">'.$this->locale['5101'].'</a>';
}
/*echo '<a href="buscar_oferta.php" class="menuOption" style="color:#000000">'.$this->locale['5102'].'</a>';*/
/*
if(!in_array("gestionar", $opcionesThis)){

View File

@ -46,22 +46,12 @@ class ListaCandidatos extends ListaPersonas {
return $bd->keyValueQuery($consulta, "cod", "nombre");
}
/**
* Devuelve una lista de los campos por los que buscar del candidato.
*/
function getCamposBusqueda() {
$consulta = "SHOW FIELDS FROM usuarios";
$bd = new BD();
$resultado = $bd->execQuery($consulta);
return $resultado;
}
/**
* Inserta un nuevo candidato en la lista de candidatos.
* @param campos - datos del candidato.
*/
function addCandidato($campos) {
$campos["estado"] = 510; //Borrador se cambia a los nuevos estados #723 Peticion
$campos["estado"] = 510; //Pendiente de clasificar
$id = parent::addPersona($campos);
$candidato = new Candidato($this->usuario, $id);
$mensaje = "Nuevo candidato";

View File

@ -41,14 +41,7 @@ class ListaOfertas {
function getOfertas() {
// sacado de http://patrickallaert.blogspot.com/2007/09/building-dynamic-sql-queries-elegant.html
// $consulta = "SELECT * FROM candidato_pedido";
$consulta = "SELECT
candidato_pedido.`oid`, candidato_pedido.`referencia`, candidato_pedido.`candidato`, CONCAT(usuarios.nombre, ' ', usuarios.apellidos) as nombre_candidato, candidato_pedido.`pedido`, pedidos.nombre as nombre_solicitud,
candidato_pedido.`afinidad`, candidato_pedido.`estado`, candidato_pedido.`RRHH`, candidato_pedido.`fecha`,
candidato_pedido.`obsGerente`, candidato_pedido.`obsRRHH`, candidato_pedido.`gerente`, candidato_pedido.`salario_ofertado`
FROM candidato_pedido
LEFT JOIN usuarios on usuarios.oid = candidato_pedido.candidato
LEFT JOIN pedidos on pedidos.oid = candidato_pedido.pedido";
$consulta = "SELECT * FROM candidato_pedido";
if (count($this->condiciones)) {
$consulta .= ' WHERE ' . implode(' AND ', $this->condiciones);
@ -60,7 +53,6 @@ LEFT JOIN pedidos on pedidos.oid = candidato_pedido.pedido";
$bd = new BD();
$resultado = $bd->execQuery($consulta);
//echo $consulta;
// Procesamos las ofertas.
if (mysql_num_rows($resultado) == 0) {
$this->ofertas = array();

View File

@ -72,7 +72,7 @@ include_once("Objects/Pedido.php");
$estado = $this->tipo;
if($this->pedidos == null){
//Modificamos la consulta en función del rol.
if($this->gestor->tieneRol(4) || $this->gestor->tieneRol(1) || $this->gestor->tieneRol(7)){
if($this->gestor->tieneRol(4) || $this->gestor->tieneRol(1)){
if($this->sql != ""){
// metemos el tipo si es >0
if($estado > 0){
@ -94,23 +94,9 @@ include_once("Objects/Pedido.php");
$consulta = $sqlNueva." ".$this->order_by;
}else{
if($estado > 0){
$consulta = "SELECT * from pedidos WHERE estado='".$estado."'";
//En el caso de ser un usuario de cliente para ver sus pedidos filtramos por cliente
if (($this->gestor->tieneRol(7)) && ($this->gestor->getValor("cliente_actual")>0)){
$consulta .= " and cliente = ". $this->gestor->getValor("cliente_actual") . " ";
}
$consulta .= $this->orden;
$consulta = "SELECT * from pedidos WHERE estado='".$estado."'".$this->orden ;
}else{
$consulta = "SELECT * from pedidos ";
//En el caso de ser un usuario de cliente para ver sus pedidos filtramos por cliente
if (($this->gestor->tieneRol(7)) && ($this->gestor->getValor("cliente_actual")>0)){
$consulta .= " where cliente = ". $this->gestor->getValor("cliente_actual") . " ";
}
$consulta .= $this->orden;
$consulta = "SELECT * from pedidos ".$this->orden."";
}
}
}else if($this->gestor->tieneRol(3)){
@ -146,7 +132,6 @@ include_once("Objects/Pedido.php");
}
$bd=new BD();
$resultado = $bd->execQuery($consulta);
//Procesamos los pedidos.
if(mysql_num_rows($resultado) == 0){

View File

@ -94,8 +94,8 @@ include_once("Empleado.php");
}else{
if($estado > 0){
$consulta = "SELECT * from usuarios where tipo = '".$this->tipo."' and estado='".$estado."' ".$this->orden;
} else{ //se cambia a los nuevos estados #723 Peticion
$consulta = "SELECT * from usuarios where tipo = '".$this->tipo."' and estado in ('510', '511', '520', '530', '540', '560', '600')$this->orden";
} else{
$consulta = "SELECT * from usuarios where tipo = '".$this->tipo."' and estado in ('510', '520', '521', '522', '523','530', '540', '550', '560')$this->orden";
}
}
@ -105,7 +105,6 @@ include_once("Empleado.php");
}
$bd=new BD();
$resultado = $bd->execQuery($consulta);
//Procesamos los candidatos.
if(mysql_num_rows($resultado) == 0){
$this->personas = array();

View File

@ -30,32 +30,26 @@ class Oferta {
}
}
function esEliminable() {
return ($oferta->getValor("estado") == 100);
}
function eliminar() {
return false;
if ($this->esEliminable()) {
//Antes de nada quitamos el candidato asociado a la oferta para que se haga la lógica que corresponda
$idCand = $this->getValor("candidato");
if (!empty($idCand)) {
if (!$this->quitarCandidato()) {
return false;
}
}
//Antes de nada quitamos el candidato asociado a la oferta para que se haga la lógica que corresponda
$idCand = $this->getValor("candidato");
if (!empty($idCand)) {
if (!$this->quitarCandidato()) {
return false;
}
}
// eliminamos en la oferta de la BD
$consulta = "DELETE FROM candidato_pedido WHERE oid = ".$this->campos['oid'];
$bd = new BD();
if (!$bd->execQuery($consulta)) {
return false;
} else {
$mensaje = "Oferta eliminada";
$this->actualizarHistorial($mensaje);
return true;
}
}
// eliminamos en la oferta de la BD
$consulta = "DELETE FROM candidato_pedido WHERE oid = ".$this->campos['oid'];
$bd = new BD();
if (!$bd->execQuery($consulta)) {
return false;
} else {
$mensaje = "Oferta eliminada";
$this->actualizarHistorial($mensaje);
return true;
}
}
function actualizarHistorial($mensaje) {
@ -78,10 +72,6 @@ class Oferta {
return $this->campos[$nombre];
} else {
switch ($nombre) {
case "nombre_gerente":$idGerente = $this->getValor("gerente");
$consulta = "SELECT CONCAT(nombre,\" \",apellidos) FROM usuarios WHERE oid=\"" . $idGerente . "\"";
break;
case "nombre_estado":
$idEstado = $this->getValor("estado");
$idioma = $this->usuario->getValor("idioma");
@ -164,9 +154,9 @@ class Oferta {
}
/**
* En proceso -> presentada
* En configuración -> Configurada
*/
private function ejecutar100120() {
private function ejecutar110120() {
// Comprobamos que haya un candidato asignado.
$candidato = $this->getValor("candidato");
if (!empty($candidato)) {
@ -179,7 +169,6 @@ class Oferta {
}
}
function setCampo($nombre, $valor) {
// PERMISOS:
/*
@ -187,9 +176,9 @@ class Oferta {
* Gestor (3) - Los suyos
* Otro - Excepción
*/
$gerente = $this->getValor("gerente");
$sesion = $this->usuario->getValor("oid");
if ($this->usuario->tieneRol(1) || ($this->usuario->tieneRol(3) && $sesion == $gerente) || $this->setAutomatico) {
$viejo = $this->getValor($nombre);
if ($viejo != $valor) {
@ -200,6 +189,7 @@ class Oferta {
$consulta = "UPDATE candidato_pedido SET $nombre = '$valor' WHERE oid='$oid'";
$bd = new BD();
if ($bd->execQuery($consulta)) {
// Guardar en el historial
$valor = $this->getValorMulti($nombre, $valor);
@ -211,16 +201,6 @@ if ($nombre == "estado") {
$estado_nuevo = $this->darNombreEstado($valor, "sp");
$historial = "Cambio de estado (". $estado_viejo ." a ". $estado_nuevo .")";
$this->actualizarHistorial($historial);
//Una vez cambiado de estado la oferta, si el nuevo estado es Rechazado o Retirada, liberamos al candidato
if (($valor=='160')||($valor=='170')) {
$idCand = $this->getValor("candidato");
if (!empty($idCand)) {
if (!$this->quitarCandidato()) {
return false;
}
}
}
}
}
@ -256,10 +236,10 @@ if ($nombre == "estado") {
}
/**
* Devuelve una lista de candidatos disponibles para una oferta, se cambia a los nuevos estados #723 Peticion
* Devuelve una lista de candidatos disponibles para una oferta, que son todos menos los no disponibles #679 Peticion
*/
function getCandidatosDisponibles() {
return $this->getCandidatos("520,530,540,560,600");
return $this->getCandidatos("510,521,522,523,540,550,560");
}
/**
@ -295,30 +275,25 @@ if ($nombre == "estado") {
return $resultado;
}
function getNumOfertasCandidato($oid) {
$consulta = "SELECT * FROM candidato_pedido WHERE candidato='$oid' and estado not in (160,170) ORDER BY fecha DESC";
$bd = new BD();
$resultado = $bd->execQuery($consulta);
return mysql_num_rows($resultado);
}
function quitarCandidato() {
$idCand = $this->getValor("candidato");
$this->setCampo("candidato", "");
if (!empty($idCand)) {
$candidato = new Candidato($this->usuario, $idCand);
$estadoCand = $candidato->getValor("estado");
$numOfertasCandidato = $this->getNumOfertasCandidato($idCand);
$numOfertasCandidato = $this->getOfertasCandidato($idCand);
switch ($estadoCand) {
//TODO CANDIDATO ASOCIADO A UNA OFERTA (este como este su situación) pasará a En proceso:disponible si no tiene alguna otra oferta distinta de Rechazada 160 o Retirada 170,
//el estado del candidato no cambia si está asociado a alguna otra oferta que no sea Rechazada 160 o Retirada 170. se cambia a los nuevos estados #723 Peticion
case 600:;
//TODO CANDIDATO ASOCIADO A UNA OFERTA (este como este su situación) pasará a disponible si no tiene alguna otra oferta,
//si tiene alguna otra oferta asociada se deja tal cual esta su situación
//El estado del candidato no cambia si está asociado a alguna otra oferta, sino pasará a Disponible
case 560:;
case 510:;
case 511:;
case 520:;
case 521:;
case 522:;
case 523:;
case 530:;
case 540:
case 540:;
case 550:
//Modificamos historial de candidato
$mensaje = "Se quita en oferta ". $this->getValor("referencia");
$candidato->actualizarHistorial($mensaje);
@ -327,7 +302,7 @@ if ($nombre == "estado") {
$mensaje = "El candidato ".$nombre_candidato." se quita de la oferta";
$this->actualizarHistorial($mensaje);
//Cambiamos de estado al candidato
if ($numOfertasCandidato < 1) {
if (count($numOfertasCandidato) <= 1) {
$candidato->transita("540", "");
}
return true;
@ -350,10 +325,10 @@ if ($nombre == "estado") {
$candidato = new Candidato($this->usuario, $idCandidato);
$estadoCand = $candidato->getValor("estado");
$numOfertasCandidato = $this->getNumOfertasCandidato($idCand);
$numOfertasCandidato = $this->getOfertasCandidato($idCand);
switch ($estadoCand) {
//En proceso:Disponible asignado, el estado del candidato no cambia, solo se asigna a la oferta y ya está.
//Disponible asignado, el estado del candidato no cambia, solo se asigna a la oferta y ya está.
case 560:
$this->setCampo("candidato", $idCandidato);
//Modificamos historial de candidato
@ -364,13 +339,13 @@ if ($nombre == "estado") {
$mensaje = "Asignado el candidato ".$nombre_candidato;
$this->actualizarHistorial($mensaje);
return true;
break;
break;
//Rechazado, Sin más adelante, En proceso:Disponible, Otras provincias. se cambia a los nuevos estados #723 Peticion
//Todos los candidatos con alguno de estos estados cambiarán a En proceso:Disponible asignado (560)
case 600:;
case 520:;
case 530:;
//Pendiente de clasificar, Rechazados tipo1, tipo2, tipo3, Disponible. Todos los candidatos con alguno de estos estados cambiarán a Disponible asignado (560)
case 510:;
case 521:;
case 522:;
case 523:;
case 540:
$this->setCampo("candidato", $idCandidato);
//Modificamos historial de candidato
@ -390,7 +365,25 @@ if ($nombre == "estado") {
}
break;
//("")
//Asignado exlusivo sin ofertas asociada se asigna y ya esta
case 550: if ($numOfertasCandidato > 0) {
$error = "El candidato tiene un estado no permitido ('" . $candidato->getValor("estado") . "')";
throw new Exception($error);
}
else {
$this->setCampo("candidato", $idCandidato);
//Modificamos historial de candidato
$mensaje = "Asignado en oferta ". $this->getValor("referencia");
$candidato->actualizarHistorial($mensaje);
//Modificamos historial de oferta
$nombre_candidato = $candidato->getValor("nombre") . " " . $candidato->getValor("apellidos");
$mensaje = "Asignado el candidato ".$nombre_candidato;
$this->actualizarHistorial($mensaje);
return true;
}
break;
//("530") No Disponible
default:
$error = "El candidato tiene un estado no permitido ('" . $candidato->getValor("nombre_estado") . "')";
throw new Exception($error);

View File

@ -12,7 +12,6 @@ include_once("Objects/Afinidad.php");
include_once("Objects/Automata.php");
include_once("Objects/Oferta.php");
include_once("ListaCapacidadesProfesionales.php");
include_once("Objects/ListaOfertas.php");
class Pedido {
@ -23,7 +22,6 @@ class Pedido {
/* Contiene una lista con todos los atributos y su valor */
private $campos = array();
private $listaOfertas = null;
private $totalOfertas = 0;
/* Lista de perfiles */
@ -275,29 +273,15 @@ if ($nombre == "estado") {
* Gestor (3) - Los suyos
* Otro - Excepción
*/
//Recogemos todas las ofertas del pedido para proceder a eliminarlas y dejar su candidato libre
$cond = array();
$cond[] = "pedido = '".$this->getValor("oid")."'";
$orden = array();
$orden[] = "referencia";
$listaOfertas = new ListaOfertas($this->usuario, $cond, $orden);
$ofertas = $listaOfertas->getOfertas();
$totalOfertas = count($ofertas);
for ($i = 0; $i < $totalOfertas; $i++)
$ofertas[$i]->eliminar();
if (count($listaOfertas->getOfertas()) == 0) {
$gerente = $this->getValor("gerente");
$sesion = $this->usuario->getValor("oid");
if ($this->usuario->tieneRol(1) || ($this->usuario->tieneRol(3) && $sesion == $gerente)) {
$oid = $this->getValor("oid");
$consulta = "DELETE FROM pedidos WHERE oid='$oid'";
$bd = new BD();
return $bd->execQuery($consulta);
} else {
return false;
}
$gerente = $this->getValor("gerente");
$sesion = $this->usuario->getValor("oid");
if ($this->usuario->tieneRol(1) || ($this->usuario->tieneRol(3) && $sesion == $gerente)) {
$oid = $this->getValor("oid");
$consulta = "DELETE FROM pedidos WHERE oid='$oid'";
$bd = new BD();
return $bd->execQuery($consulta);
} else {
return false;
}
}
@ -915,7 +899,7 @@ if ($nombre == "estado") {
$pesoPerfil = $this->getValor("pesoPerfil");
// Eliminamos a los usuario de la tabla de candidatos en pedido que se encuentren
// en proceso para este pedido.
$consulta = "DELETE FROM candidato_pedido WHERE pedido='$id' AND estado='100'";
$consulta = "DELETE FROM candidato_pedido WHERE pedido='$id' AND estado='110'";
$bd = new BD();
$bd->execQuery($consulta);
// Si el pedido no está cerrado calculamos su afinidad para los usuarios:
@ -945,7 +929,7 @@ if ($nombre == "estado") {
$afi = $afinidad->calculaAfinidad($pesoIdioma, $pesoPerfil, $pesoTecno);
echo $afi . "<br/>";
if ($afi > 0) {
$consulta = "INSERT INTO candidato_pedido (candidato, pedido, afinidad, estado, fecha) VALUES('$idUsuario', '$id', '$afi', '100', curdate())";
$consulta = "INSERT INTO candidato_pedido (candidato, pedido, afinidad, estado, fecha) VALUES('$idUsuario', '$id', '$afi', '110', curdate())";
$bd = new BD();
$bd->execQuery($consulta);
@ -1141,18 +1125,6 @@ if ($nombre == "estado") {
return $resultado;
}
function getListaOfertas() {
//Recogemos todas las ofertas del pedido para proceder a eliminarlas y dejar su candidato libre
$cond = array();
$cond[] = "pedido = '".$this->getValor("oid")."'";
$orden = array();
$orden[] = "referencia";
$Ofertas = new ListaOfertas($this->usuario, $cond, $orden);
$listaOfertas = $Ofertas->getOfertas();
$totalOfertas = count($ofertas);
return $listaOfertas;
}
}
?>

View File

@ -10,7 +10,6 @@
include_once("BD.php");
include_once("Rol.php");
include_once("Objects/Administracion.php");
include_once("functions_solr.php");
class Persona{
@ -692,12 +691,11 @@
/**
* A<EFBFBD>ade un nuevo curr<EFBFBD>culum a la persona.
*/
protected function addCurriculum($archivo, $tipo, $usuario){
protected function addCurriculum($archivo, $usuario){
$cv = $this->getValor("cv") + 1;
$oid = $this->getValor("oid");
$nombre_archivo = $oid."-".$cv;
$tipo_curriculum = $tipo;
$directorio = constante("srcDocs").SLASH."cv".SLASH;
if (!@file_exists($directorio)){
@ -717,15 +715,13 @@
$nombre_ruta_tabla=addslashes($nombre_ruta_tabla);
if($fichero_subido){
$bd = new BD();
$consulta = "INSERT INTO curriculum_usuario (oid, curriculum, fecha, tipo_curriculum) values ('".$oid."', '".$nombre_ruta_tabla."', now(), ".$tipo_curriculum.")";
$bd->execQuery($consulta);
$bd = new BD();
$consulta = "INSERT INTO curriculum_usuario (oid, curriculum, fecha) values ('".$oid."', '".$nombre_ruta_tabla."', now())";
$bd->execQuery($consulta);
//$this->actualizarHistorial("Nuevo CV", $usuario);
$consulta = "update usuarios set cv=cv+1 where oid='$oid'";
$bd->execQuery($consulta);
solr_anadir_cv($oid, $destino);
return true;
$consulta = "update usuarios set cv=cv+1 where oid='$oid'";
$bd->execQuery($consulta);
return true;
}
return false;
@ -736,20 +732,21 @@
$consulta = "DELETE FROM curriculum_usuario WHERE oid = '".$oid."' and curriculum = '".$curriculum."' and fecha = '".$fecha."'";
$bd = new BD();
$resultado = $bd->execQuery($consulta);
if ($resultado){
$consulta = "update usuarios set cv=cv-1 where oid='$oid'";
$bd->execQuery($consulta);
$cambios = "CV eliminado";
//$this->actualizarHistorial($cambios, $usuario);
$ruta = constante("srcDocs")."\\".$curriculum;
if (is_file($ruta) && unlink($ruta))
{
solr_eliminar_cv($ruta);
return true;
} else {
return false;
}
if ($resultado){
$consulta = "update usuarios set cv=cv-1 where oid='$oid'";
$bd->execQuery($consulta);
$cambios = "CV eliminado";
//$this->actualizarHistorial($cambios, $usuario);
$ruta = constante("srcDocs")."\\".$curriculum;
if (!@unlink($ruta)){
return false;
}else{
return true;
}
}
return false;

View File

@ -19,7 +19,7 @@
}
public function getRutaCV($id){
if($this->tieneRol(4) || $this->tieneRol(3) || $this->tieneRol(7)){
if($this->tieneRol(4) || $this->tieneRol(3)){
$consulta = "SELECT curriculum FROM curriculum_usuario WHERE cod = '".$id."'";
$bd = new BD();
$ruta = $bd->getCampo($consulta);
@ -41,7 +41,7 @@
}
public function getNombreCV($id){
if($this->tieneRol(4) || $this->tieneRol(3) || $this->tieneRol(7)){
if($this->tieneRol(4) || $this->tieneRol(3)){
$ruta = $this->getRutaCV($id);
$consulta="SELECT CONCAT(nombre,\" \",apellidos,\" (\",fecha,\")\") FROM usuarios, curriculum_usuario WHERE curriculum_usuario.cod=\"".$id."\" AND curriculum_usuario.oid = usuarios.oid";
$bd = new BD();

View File

@ -27,6 +27,12 @@ if(stripinput($_POST['action'])=="add"){
$errores[]="22";
}
/*NO se valida el perfil para candidatos nuevos con estado 510 (pendiente de clasificacion) que es el por defecto
if((count($perfil)==1) && ($perfil["0"]=="")){
$errores_persona .= $locale['1705']."<br />";
$errores[]="23";
}
*/
include_once("verificar_candidato.php");
if(count($errores)==0){
@ -54,7 +60,6 @@ if(stripinput($_POST['action'])=="add"){
$camposQuitar["titulaciones"]=$_POST['titulaciones'];
$camposQuitar["provincia_deseada"]=$_POST['provincia_deseada'];
$camposQuitar["provincias_no_deseadas"]=$_POST['provincias_no_deseadas'];
$camposQuitar["tipo_curriculum"]=$_POST['tipo_curriculum'];
$camposQuitar["perfil"]=$_POST['perfil'];
$camposQuitar["action"]=stripinput($_POST['action']);
$camposQuitar["diaentre"]=stripinput($_POST['diaentre']);
@ -100,10 +105,7 @@ if(stripinput($_POST['action'])=="add"){
$candidatoNew->addPerfiles($_POST['perfil']);
$candidatoNew->addCurriculum($_FILES['userfile'], $_POST['tipo_curriculum']);
//Subimos la foto
uploadImagenCandidato($idCandidatoNew, 250, 250, 150, 150);
$candidatoNew->addCurriculum($_FILES['userfile']);
header("Location: detalle_candidato.php?oid=".$idCandidatoNew);
} else {
$tipomsg="error";
@ -222,8 +224,6 @@ echo '</td>';
//CAMPO FOTO
echo '<td ';
echo ' width="25%" '.$ett.' textalign="right">';
echo $locale['Candidato006'] .':<br>';
echo '<input name="candidato_imagen" type="file" style="width:250px" class="data">';
echo'</td>';
echo '</tr>';
@ -387,12 +387,12 @@ echo '<div class="encabezado">'.$locale['1549'].'</div>';
echo '<table align="center" width="100%">';
echo '<tr><td colspan="6">';
menu_curriculums($_GET['oid'], "candidato");
echo '</td></tr><td colspan="6" textalign="right">';
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000">'.$locale['125'].'&nbsp;&nbsp;';
echo '<input name="userfile" type="file">&nbsp;&nbsp;'.$locale['00208']. '&nbsp;&nbsp;';
rellena_desplegable_select_oidCol("tipo_curriculum","oid","tipo","tipo_curriculum","","0");
echo '&nbsp;&nbsp;<input value="Subir" type="submit">';
echo '</td></tr><tr>';
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000"><td colspan="6" textalign="right">'.$locale['125'].'<br>';
echo '<input name="userfile" type="file">';
echo '<input value="Subir" type="submit">';
echo '</td></tr></table>';
echo '<input type="submit" value="'.$locale['802'].'" class="button">';
echo "</form>";
include_once("html/pie.php");

View File

@ -79,7 +79,7 @@ if(stripinput($_POST['action'])=="add"){
}
$empleadoNew->addProvinciasDeseadas($_POST['provincia_deseada']);
$empleadoNew->addPerfiles($_POST['perfil']);
$empleadoNew->addCurriculum($_FILES['userfile'], $_POST['tipo_curriculum']);
$empleadoNew->addCurriculum($_FILES['userfile']);
header("Location: detalle_empleado.php?oid=".$idEmpleadoNew);
} else {
$tipomsg="error";
@ -251,11 +251,10 @@ echo $html->listaSelect("titulaciones","oid","id","titulaciones",array("",$local
</tr>';
echo '<tr><td colspan="6">';
menu_curriculums($_GET['oid'], "candidato");
echo '</td></tr><td colspan="6" textalign="right">';
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000">'.$locale['125'].'&nbsp;&nbsp;';
echo '<input name="userfile" type="file">&nbsp;&nbsp;'.$locale['00208']. '&nbsp;&nbsp;';
rellena_desplegable_select_oidCol("tipo_curriculum","oid","tipo","tipo_curriculum","","0");
echo '&nbsp;&nbsp;<input value="Subir" type="submit">';
echo '</td></tr><tr>';
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000">
<td colspan="6" textalign="right">'.$locale['125'].'<br>';
echo '<input name="userfile" type="file">';
echo '</td></tr></table>';
echo '</table>';

View File

@ -8,14 +8,14 @@ include_once("Objects/Pedido.php");
include_once("Objects/HTML.php");
$html = new HTML($locale);
$errores = array();
$usuario = $_SESSION["usuario"];
$solicitud=$_GET['solicitud'];
// Todas las variables
if (!empty($_POST)) {
print_r($_POST);
$solicitud = "";
if (!empty($_POST['solicitud'])) {
$solicitud = $_POST['solicitud'][0];
}
@ -34,8 +34,6 @@ if (!empty($_POST)) {
$idiomas=$_POST['idiomas'];
$provincias=$_POST['provincias']; */
$observaciones = $_POST['observaciones'];
$salario_ofertado = $_POST['salario_ofertado'];
$gerente=$usuario->getValor("oid");
/* $pesoTec=$_POST['pesoTec'];
$pesoIdi=$_POST['pesoIdi'];
$pesoPer=$_POST['pesoPer'];
@ -44,7 +42,7 @@ if (!empty($_POST)) {
if($usuario->tieneRol("1")){
$gerente=$_POST['gerente'];
} else {
$gerente=$usuario->getValor("oid");
}
*/
if ($_POST['action'] == "add") {
@ -61,18 +59,17 @@ if (!empty($_POST)) {
$arrayInsert["pedido"] = $solicitud;
$arrayInsert["obsGerente"] = $observaciones;
$arrayInsert["estado"] = "100";
$arrayInsert["gerente"]=$gerente;
$arrayInsert["salario_ofertado"] = $salario_ofertado;
/* $arrayInsert["prioridad"]= $prioridad;
$arrayInsert["empleados"]=$empleados;
$arrayInsert["duracion"]=$duracion;
$arrayInsert["gerente"]=$gerente;
$arrayInsert["cliente"]=$clientes;
$arrayInsert["salario_min"]=$salario_min;
$arrayInsert["salario_max"]=$salario_max;
$arrayInsert["procedencia"]=$procedencia;
$arrayInsert["estado"]="100";
$arrayInsert["estado"]="110";
$arrayInsert["pesoIdioma"]=$pesoIdi;
$arrayInsert["pesoPerfil"]=$pesoPer;
$arrayInsert["pesoTecno"]=$pesoTec; */
@ -101,7 +98,7 @@ if (!empty($_POST)) {
}
} else {
$referencia = "";
$gerente = $usuario->getValor("oid");
$solicitud = "";
$observaciones = "";
}
@ -124,6 +121,7 @@ if (in_array("1", $errores))
echo " class=\"errorcampo\"";
echo ">" . $locale['1025'] . ":<br/>";
rellena_desplegable_pedidos_estado("solicitud", "130, 140", array($solicitud));
echo " </td>";
@ -136,10 +134,6 @@ echo '<tr>' .
'<td colspan="3" align="center">' . $locale['135'] .
'<br><textarea name="observaciones" rows="10" cols="120" style="overflow: auto; width:100%;">' . nl2br($observaciones) . '</textarea></td>' .
'</tr>';
echo '<tr><td>'.$locale['Ofertas010'].'<br><input type="text" name="salario_ofertado" value="'.$salario_ofertado.'" size="15" maxlength="20"></td>';
// Botones de guardar y restablecer
echo "<tr><td colspan=\"3\" align=\"center\">";
echo '<input type="submit" value="' . $locale['gu'] . '" onclick="return comprobar_registro(this)" class="button">';

View File

@ -112,8 +112,8 @@ if(!empty($_POST)) {
$denominacion_cliente="";
$prioridad="";
$empleados="";
$duracion="12";
$clientes="2";
$duracion="";
$clientes="";
$perfiles=array();
$salario_min="";
$salario_max="";
@ -129,10 +129,10 @@ if(!empty($_POST)) {
$viajar="";
$internacional="";
$direccion_solicitud="";
$fecha_solicitud_cliente = date("Y-m-d", time());
$fecha_solicitud_cliente="";
$fecha_inicio_servicio="";
$fecha_fin_servicio = date("Y-12-31", time());
$fecha_recepcion_solicitud = date("Y-m-d", time());
$fecha_fin_servicio="";
$fecha_recepcion_solicitud="";
}

View File

@ -9,12 +9,7 @@ include_once("html/cabecera.php");
echo "<h2>".$locale['002']."</h2>";
if(!$usuario->tieneRol("7")) {
include("tablero.php");
}
else {
header("Location: lista_pedidos.php");
}
include("tablero.php");
if($_SESSION["oid"]){
include_once("alarmas.php");

View File

@ -5,7 +5,7 @@ include("functions.php");
include_once("Objects/Candidato.php");
$oid = stripinput($_GET["oid"]);
$curriculum = $_GET["curriculum"];
$curriculum = stripinput($_GET["curriculum"]);
$fecha = stripinput($_GET["fecha"]);
$tipo = stripinput($_GET["tipo"]);

38
buscar_candidato.php Normal file
View File

@ -0,0 +1,38 @@
<?php
include("seguridad.php");
include("functions.php");
// Sólo los administradores y rrhh pueden buscar
if(!$usuario->tieneRol("1")
&& !$usuario->tieneRol("4")){
header("Location: aplicacion.php?e=permiso");
exit;
}
include_once("html/cabecera.php");
/* BUSCAR.PHP */
include_once("Objects/HTML.php");
$html=new HTML($locale);
echo $html->menuCandidatos();
$tipobusqueda="candidato";
?>
<h2><?php echo $locale['820']; ?></h2>
<div id="ContTabul">
<form action="busqueda_candidato_multiple.php" method="POST" name="form_busqueda_multiple">
<?php include_once("formulario_buscar_persona.php"); ?>
<table align="center" width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td class="sinborde" align="center">
<input type="submit" name="enviar" value="Buscar" class="button" onclick="return comprobar_busqueda_multiple(this)">
<input type="reset" name="borrar" value="Borrar" class="button" >
</td>
</tr>
</form>
</table>
</div>
<?php
include_once("html/pie.php");
?>

View File

@ -9,7 +9,7 @@ if(!$_SESSION["oid"]){
$consulta = "SELECT U.oid as idCandidato,CP.oid as idOferta, CP.referencia,
P.oid as idPedido, U.nombre,U.apellidos,P.nombre AS pedido, CE.nombre AS estado,
CP.obsRRHH,CP.obsGerente, CP.salario_ofertado
CP.obsRRHH,CP.obsGerente
FROM usuarios U,pedidos P,candidato_pedido CP,candidaturas_estados CE
WHERE U.oid='".$persona->getValor("oid")."'
AND CP.candidato=U.oid
@ -35,13 +35,11 @@ if ($resultado = consultar($consulta)){
$oidOferta = $row["idOferta"];
$obsRRHH = $row["obsRRHH"];
$obsGerente = $row["obsGerente"];
$salario_ofertado = $row["salario_ofertado"];
$idCandidato = $row["idCandidato"];
echo "<li>";
echo "Oferta <a href=\"oferta.php?idOferta=".$oidOferta."\" target=\"_blank\" />$referenciaOferta</a> ";
echo "($estado) ";
echo "- Solicitud \"<a href=\"pedido.php?idPedido=".$oid."\" target=\"_blank\" />$pedido</a>";
echo " - Salario ofertado: ". $salario_ofertado. "</li>";
echo "- Solicitud \"<a href=\"pedido.php?idPedido=".$oid."\" target=\"_blank\" />$pedido</a>\"</li>";
// desactivar el comentario por ahora
if (false) { //if($usuario->tieneRol("4")){

View File

Before

Width:  |  Height:  |  Size: 71 B

After

Width:  |  Height:  |  Size: 71 B

View File

Before

Width:  |  Height:  |  Size: 71 B

After

Width:  |  Height:  |  Size: 71 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 367 B

View File

Before

Width:  |  Height:  |  Size: 368 B

After

Width:  |  Height:  |  Size: 368 B

View File

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 213 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Some files were not shown because too many files have changed in this diff Show More