Compare commits

...

No commits in common. "master" and "1.1.2@95" have entirely different histories.

284 changed files with 2976 additions and 10387 deletions

View File

@ -12,66 +12,6 @@ include_once("BD.php");
include_once("Persona.php"); include_once("Persona.php");
include_once("Automata.php"); include_once("Automata.php");
include_once("ListaCapacidadesProfesionales.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 { class Candidato extends Persona {
@ -103,35 +43,11 @@ class Candidato extends Persona {
*/ */
$sesion = $this->usuario->getValor("oid"); $sesion = $this->usuario->getValor("oid");
if ($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) { if ($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) {
$viejo = $this->getValor($nombre); return parent::setCampo($nombre, $valor);
$resultado = parent::setCampo($nombre, $valor);
///////////////////////////////////////////////////
//SOLO ACTUALIZA EL HISTORIAL LOS CAMBIOS DE ESTADO
///////////////////////////////////////////////////
if ($nombre == "estado") {
$estado_viejo = $this->darNombreEstado($viejo, "sp");
$estado_nuevo = $this->darNombreEstado($valor, "sp");
$historial = "Cambio de estado (". $estado_viejo ." a ". $estado_nuevo .")";
$this->actualizarHistorial($historial);
}
return $resultado;
} else { } else {
//Campos que se pueden editar por el gerente, ya sea directamente o mediante una transición. //Campos que se pueden editar por el gerente, ya sea directamente o mediante una transición.
if (($nombre == "observaciones" || $nombre == "msgEstado" || $nombre = "diasEspera" || $nombre == "estado") && $this->usuario->tieneRol(3)) { if (($nombre == "observaciones" || $nombre == "msgEstado" || $nombre = "diasEspera" || $nombre == "estado") && $this->usuario->tieneRol(3)) {
$viejo = $this->getValor($nombre); return parent::setCampo($nombre, $valor);
$resultado = parent::setCampo($nombre, $valor);
///////////////////////////////////////////////////
//SOLO ACTUALIZA EL HISTORIAL LOS CAMBIOS DE ESTADO
///////////////////////////////////////////////////
if ($nombre == "estado") {
$estado_viejo = $this->darNombreEstado($viejo, "sp");
$estado_nuevo = $this->darNombreEstado($valor, "sp");
$historial = "Cambio de estado (". $estado_viejo ." a ". $estado_nuevo .")";
$this->actualizarHistorial($historial);
}
return $resultado;
} else { } else {
$error = "El usuario no tiene permisos para editar al candidato."; $error = "El usuario no tiene permisos para editar al candidato.";
throw new Exception($error); throw new Exception($error);
@ -141,13 +57,7 @@ return $resultado;
} }
} }
function darNombreEstado($cod, $idioma) { function addCurriculum($fichero) {
$consulta = "SELECT NOMBRE from candidatos_estados WHERE cod=\"" . $cod . "\" AND idioma=\"" . $idioma . "\"";
$bd = new BD();
return $bd->getCampo($consulta);
}
function addCurriculum($fichero, $tipo) {
//PERMISOS: //PERMISOS:
/* /*
* Admin (1) - Todos * Admin (1) - Todos
@ -156,7 +66,7 @@ return $resultado;
*/ */
$sesion = $this->usuario->getValor("oid"); $sesion = $this->usuario->getValor("oid");
if ($this->usuario->tieneRol(3) || $this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) { 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 { } else {
$error = "El usuario no tiene permisos para asociar CV al candidato."; $error = "El usuario no tiene permisos para asociar CV al candidato.";
throw new Exception($error); throw new Exception($error);
@ -173,6 +83,8 @@ return $resultado;
* Otro - Excepción * Otro - Excepción
*/ */
$sesion = $this->usuario->getValor("oid"); $sesion = $this->usuario->getValor("oid");
echo $this->usuario->tieneRol(1);
echo $this->usuario->tieneRol(4);
if ($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) { if ($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) {
parent::removeCurriculum($curriculum, $fecha, $this->usuario->getValor("nombre")); parent::removeCurriculum($curriculum, $fecha, $this->usuario->getValor("nombre"));
} else { } else {
@ -213,8 +125,8 @@ return $resultado;
* Otro - Excepción * Otro - Excepción
*/ */
$sesion = $this->usuario->getValor("oid"); $sesion = $this->usuario->getValor("oid");
//Nos declaramos un array de estados eliminables: se cambia a los nuevos estados #723 Peticion //Nos declaramos un array de estados eliminables:
$estados_eliminables = array("510","511","520","600"); $estados_eliminables = array("510","521","522","523","540");
if ($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) { if ($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) {
$estado = $this->getValor("estado"); $estado = $this->getValor("estado");
if (in_array($estado, $estados_eliminables)) { if (in_array($estado, $estados_eliminables)) {

View File

@ -0,0 +1,85 @@
<?php
/*
* Clase Capacidad Profesional
*
* Contiene toda la informaci<EFBFBD>n relativa a la capacidad.
*
*
*/
include_once("BD.php");
class Capacidad_profesional{
private $tipo_capacidad; /* Esta propiedad de la clase nos informará si estamos ante una capadidad profesional de candidato o de solicitud*/
public $campos = array();
private $listaTecnologias = array();
function Capacidad_profesional($campos_nuevos){
$this->campos = $campos_nuevos;
}
/**
* Inserta una nueva capacidad profesional a la lista de capacidades.
* @param campos - datos de la capacidad.
*/
function addCapacidad($campos) {
$inserto = "";//,id_solicitud,id_perfil_tecnico, id_perfil_funcional, meses_tecnico, meses_funcional, observaciones";
$valores = ""; //, $fecha, $fecha";
//Procesamos los datos
$i=1;
foreach($campos as $key => $value){
if ($i>1) {
$inserto .= ",";
$valores .= ",";
}
$inserto .= " $key";
$valores .= " '$value'";
$i++;
}
//Insertamos en la BD
$consulta = "INSERT INTO capacidades ($inserto) VALUES ($valores)";
$bd = new BD();
if(!$bd->execQuery($consulta)){
$error = "Campos de la capacidad incorrectos. Por favor, avise al webmaster de este error.";
throw new Exception($error);
return false;
}
$id = mysql_insert_id();
return $id;
}
}
class Lista_capacidad_profesional{
public $capacidad = array();
function Lista_capacidad_profesional($id, $tipo){
$bd = new BD();
$consulta = "";
$tipo_capacidad = $tipo;
$consulta = "select C.id, C.id_usuario, C.id_solicitud, C.id_perfil_tecnico, C.id_perfil_funcional, C.meses_tecnico, C.meses_funcional, C.observaciones, ";
$consulta = $consulta . "PT.id as perfil_tecnico, PT.abrev, PF.id as perfil_funcional, PF.abrev ";
$consulta = $consulta . "from capacidades as C left join perfil as PT on (PT.oid = C.id_perfil_tecnico) ";
$consulta = $consulta . "left join perfil_funcional as PF on (PF.oid = C.id_perfil_funcional) ";
switch ($tipo_capacidad) {
case "candidato": $consulta = $consulta. "WHERE id_usuario = ".$id; break;
case "solicitud": $consulta = $consulta. "WHERE id_solicitud = ".$id; break;
}
$resultado = $bd->execQuery($consulta);
//Procesamos las capacidades
if (mysql_num_rows($resultado) != 0) {
while ($row = mysql_fetch_array($resultado)) {
$this->capacidad[] = new Capacidad_profesional($row);
}
}
return $this->capacidad;
}
}
?>

View File

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

View File

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

View File

@ -46,28 +46,16 @@ class ListaCandidatos extends ListaPersonas {
return $bd->keyValueQuery($consulta, "cod", "nombre"); 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. * Inserta un nuevo candidato en la lista de candidatos.
* @param campos - datos del candidato. * @param campos - datos del candidato.
*/ */
function addCandidato($campos) { function addCandidato($campos) {
$campos["estado"] = 510; //Borrador se cambia a los nuevos estados #723 Peticion $campos["estado"] = 510;
$id = parent::addPersona($campos); $id = parent::addPersona($campos);
$candidato = new Candidato($this->usuario, $id); $candidato = new Candidato($this->usuario, $id);
$mensaje = "Nuevo candidato"; $mensaje = "Nuevo candidato";
$candidato->actualizarHistorial($mensaje); $candidato->actualizarHistorial($mensaje);
$mensaje = "Estado inicial ( ". $candidato->darNombreEstado($campos["estado"],"sp") ." )";
$candidato->actualizarHistorial($mensaje);
return $id; return $id;
} }

View File

@ -41,14 +41,7 @@ class ListaOfertas {
function getOfertas() { function getOfertas() {
// sacado de http://patrickallaert.blogspot.com/2007/09/building-dynamic-sql-queries-elegant.html // sacado de http://patrickallaert.blogspot.com/2007/09/building-dynamic-sql-queries-elegant.html
// $consulta = "SELECT * FROM candidato_pedido"; $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";
if (count($this->condiciones)) { if (count($this->condiciones)) {
$consulta .= ' WHERE ' . implode(' AND ', $this->condiciones); $consulta .= ' WHERE ' . implode(' AND ', $this->condiciones);
@ -60,7 +53,6 @@ LEFT JOIN pedidos on pedidos.oid = candidato_pedido.pedido";
$bd = new BD(); $bd = new BD();
$resultado = $bd->execQuery($consulta); $resultado = $bd->execQuery($consulta);
//echo $consulta;
// Procesamos las ofertas. // Procesamos las ofertas.
if (mysql_num_rows($resultado) == 0) { if (mysql_num_rows($resultado) == 0) {
$this->ofertas = array(); $this->ofertas = array();

View File

@ -72,7 +72,7 @@ include_once("Objects/Pedido.php");
$estado = $this->tipo; $estado = $this->tipo;
if($this->pedidos == null){ if($this->pedidos == null){
//Modificamos la consulta en función del rol. //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 != ""){ if($this->sql != ""){
// metemos el tipo si es >0 // metemos el tipo si es >0
if($estado > 0){ if($estado > 0){
@ -94,23 +94,9 @@ include_once("Objects/Pedido.php");
$consulta = $sqlNueva." ".$this->order_by; $consulta = $sqlNueva." ".$this->order_by;
}else{ }else{
if($estado > 0){ if($estado > 0){
$consulta = "SELECT * from pedidos WHERE estado='".$estado."'"; $consulta = "SELECT * from pedidos WHERE estado='".$estado."'".$this->orden ;
//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;
}else{ }else{
$consulta = "SELECT * from pedidos "; $consulta = "SELECT * from pedidos ".$this->orden."";
//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;
} }
} }
}else if($this->gestor->tieneRol(3)){ }else if($this->gestor->tieneRol(3)){
@ -146,7 +132,6 @@ include_once("Objects/Pedido.php");
} }
$bd=new BD(); $bd=new BD();
$resultado = $bd->execQuery($consulta); $resultado = $bd->execQuery($consulta);
//Procesamos los pedidos. //Procesamos los pedidos.
if(mysql_num_rows($resultado) == 0){ if(mysql_num_rows($resultado) == 0){
@ -211,8 +196,6 @@ include_once("Objects/Pedido.php");
$p = new Pedido($id, $this->gestor); $p = new Pedido($id, $this->gestor);
$mensaje = "Nueva solicitud de oferta"; $mensaje = "Nueva solicitud de oferta";
$p->actualizarHistorial($mensaje); $p->actualizarHistorial($mensaje);
$mensaje = "Estado inicial ( ". $p->darNombreEstado($campos["estado"],"sp") ." )";
$p->actualizarHistorial($mensaje);
} }
return $id; return $id;
} }

View File

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

View File

@ -30,13 +30,7 @@ class Oferta {
} }
} }
function esEliminable() {
return ($oferta->getValor("estado") == 100);
}
function eliminar() { 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 //Antes de nada quitamos el candidato asociado a la oferta para que se haga la lógica que corresponda
$idCand = $this->getValor("candidato"); $idCand = $this->getValor("candidato");
if (!empty($idCand)) { if (!empty($idCand)) {
@ -47,6 +41,7 @@ class Oferta {
// eliminamos en la oferta de la BD // eliminamos en la oferta de la BD
$consulta = "DELETE FROM candidato_pedido WHERE oid = ".$this->campos['oid']; $consulta = "DELETE FROM candidato_pedido WHERE oid = ".$this->campos['oid'];
$bd = new BD(); $bd = new BD();
if (!$bd->execQuery($consulta)) { if (!$bd->execQuery($consulta)) {
return false; return false;
@ -56,7 +51,6 @@ class Oferta {
return true; return true;
} }
} }
}
function actualizarHistorial($mensaje) { function actualizarHistorial($mensaje) {
$oid = $this->getValor("oid"); $oid = $this->getValor("oid");
@ -66,22 +60,12 @@ class Oferta {
return $bd->execQuery($consulta); return $bd->execQuery($consulta);
} }
function darNombreEstado($cod, $idioma) {
$consulta = "SELECT NOMBRE from candidaturas_estados WHERE cod=\"" . $cod . "\" AND idioma=\"" . $idioma . "\"";
$bd = new BD();
return $bd->getCampo($consulta);
}
function getValor($nombre) { function getValor($nombre) {
if (array_key_exists($nombre, $this->campos)) { if (array_key_exists($nombre, $this->campos)) {
// El campo ya lo habíamos recuperamos, lo mostramos // El campo ya lo habíamos recuperamos, lo mostramos
return $this->campos[$nombre]; return $this->campos[$nombre];
} else { } else {
switch ($nombre) { switch ($nombre) {
case "nombre_gerente":$idGerente = $this->getValor("gerente");
$consulta = "SELECT CONCAT(nombre,\" \",apellidos) FROM usuarios WHERE oid=\"" . $idGerente . "\"";
break;
case "nombre_estado": case "nombre_estado":
$idEstado = $this->getValor("estado"); $idEstado = $this->getValor("estado");
$idioma = $this->usuario->getValor("idioma"); $idioma = $this->usuario->getValor("idioma");
@ -164,9 +148,9 @@ class Oferta {
} }
/** /**
* En proceso -> presentada * En configuración -> Configurada
*/ */
private function ejecutar100120() { private function ejecutar110120() {
// Comprobamos que haya un candidato asignado. // Comprobamos que haya un candidato asignado.
$candidato = $this->getValor("candidato"); $candidato = $this->getValor("candidato");
if (!empty($candidato)) { if (!empty($candidato)) {
@ -179,7 +163,6 @@ class Oferta {
} }
} }
function setCampo($nombre, $valor) { function setCampo($nombre, $valor) {
// PERMISOS: // PERMISOS:
/* /*
@ -187,9 +170,9 @@ class Oferta {
* Gestor (3) - Los suyos * Gestor (3) - Los suyos
* Otro - Excepción * Otro - Excepción
*/ */
$gerente = $this->getValor("gerente"); $gerente = $this->getValor("gerente");
$sesion = $this->usuario->getValor("oid"); $sesion = $this->usuario->getValor("oid");
if ($this->usuario->tieneRol(1) || ($this->usuario->tieneRol(3) && $sesion == $gerente) || $this->setAutomatico) { if ($this->usuario->tieneRol(1) || ($this->usuario->tieneRol(3) && $sesion == $gerente) || $this->setAutomatico) {
$viejo = $this->getValor($nombre); $viejo = $this->getValor($nombre);
if ($viejo != $valor) { if ($viejo != $valor) {
@ -200,31 +183,19 @@ class Oferta {
$consulta = "UPDATE candidato_pedido SET $nombre = '$valor' WHERE oid='$oid'"; $consulta = "UPDATE candidato_pedido SET $nombre = '$valor' WHERE oid='$oid'";
$bd = new BD(); $bd = new BD();
if ($bd->execQuery($consulta)) { if ($bd->execQuery($consulta)) {
// Guardar en el historial // Guardar en el historial
$valor = $this->getValorMulti($nombre, $valor); $valor = $this->getValorMulti($nombre, $valor);
if ($viejo == "" && $valor != "") {
//////////////////////////////////////////////////////////////////////////////// $historial = "$nombre (de - a $valor)";
//SOLO ACTUALIZA EL HISTORIAL LOS CAMBIOS DE ESTADO Y ASIGNACIONES DE CANDIDATOS } else {
//////////////////////////////////////////////////////////////////////////////// $historial = "$nombre (de $viejo a $valor)";
if ($nombre == "estado") { }
$estado_viejo = $this->darNombreEstado($viejo, "sp"); if ($nombre = "estado") {
$estado_nuevo = $this->darNombreEstado($valor, "sp");
$historial = "Cambio de estado (". $estado_viejo ." a ". $estado_nuevo .")";
$this->actualizarHistorial($historial); $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;
} }
} }
} }
}
}
}
} else { } else {
$error = "El usuario no tiene permisos para editar la solicitud de oferta."; $error = "El usuario no tiene permisos para editar la solicitud de oferta.";
throw new Exception($error); throw new Exception($error);
@ -256,10 +227,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() { function getCandidatosDisponibles() {
return $this->getCandidatos("520,530,540,560,600"); return $this->getCandidatos("510,521,522,523,540,550,560");
} }
/** /**
@ -274,7 +245,7 @@ if ($nombre == "estado") {
$historial = ""; $historial = "";
$oid = $this->getValor("oid"); $oid = $this->getValor("oid");
$consulta = "SELECT * FROM historial_oferta WHERE oid_h='$oid' ORDER BY id DESC"; $consulta = "SELECT * FROM historial_oferta WHERE oid_h='$oid' ORDER BY fecha_h DESC";
$bd = new BD(); $bd = new BD();
$resultado = $bd->execQuery($consulta); $resultado = $bd->execQuery($consulta);
@ -295,43 +266,29 @@ if ($nombre == "estado") {
return $resultado; 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() { function quitarCandidato() {
$idCand = $this->getValor("candidato"); $idCand = $this->getValor("candidato");
$this->setCampo("candidato", "");
if (!empty($idCand)) { if (!empty($idCand)) {
$candidato = new Candidato($this->usuario, $idCand); $candidato = new Candidato($this->usuario, $idCand);
$estadoCand = $candidato->getValor("estado"); $estadoCand = $candidato->getValor("estado");
$numOfertasCandidato = $this->getNumOfertasCandidato($idCand); $numOfertasCandidato = $this->getOfertasCandidato($idCand);
switch ($estadoCand) { 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, //Disponible asignado exclusivo, Disponible asignado, No disponible.
//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 //El estado del candidato no cambia si está asociado a alguna otra oferta, sino pasará a Disponible
case 600:; case "560":
case 560:; case "550":
case 510:; case "530":
case 511:; if (count($numOfertasCandidato) <= 1) {
case 520:;
case 530:;
case 540:
//Modificamos historial de candidato
$mensaje = "Se quita en oferta ". $this->getValor("referencia");
$candidato->actualizarHistorial($mensaje);
//Modificamos historial de la oferta
$nombre_candidato = $candidato->getValor("nombre") . " " . $candidato->getValor("apellidos");
$mensaje = "El candidato ".$nombre_candidato." se quita de la oferta";
$this->actualizarHistorial($mensaje);
//Cambiamos de estado al candidato
if ($numOfertasCandidato < 1) {
$candidato->transita("540", ""); $candidato->transita("540", "");
$nombre_candidato = $candidato->getValor("nombre") . " " . $candidato->getValor("apellidos");
$mensaje = "El candidato ".$nombre_candidato." pasa a estado Disponible";
$this->actualizarHistorial($mensaje);
} }
return true; return true;
break; break;
//Pendiente de clasificar, Rechazados tipo1, tipo2, tipo3, Disponible.
//No podrá darse el caso ya que todo candidato asociado a una oferta debe estar Disponible asignado, Disponible asignado exclusivo, o no disponible
default: default:
$error = "[quitarCandidato]. El candidato tiene un estado no permitido ('" . $estadoCand . "')"; $error = "[quitarCandidato]. El candidato tiene un estado no permitido ('" . $estadoCand . "')";
throw new Exception($error); throw new Exception($error);
@ -340,48 +297,36 @@ if ($nombre == "estado") {
} }
function asignarCandidato($idCandidato) { function asignarCandidato($idCandidato) {
//Lo primero es tratar el candidato asociado actualmente antes de asignar el pasado por parametro /*
$idCand = $this->getValor("candidato"); $idCand = $this->getValor("candidato");
if (!empty($idCand)) { if (!empty($idCand)) {
if (!$this->quitarCandidato()) { if (!$this->quitarCandidato()) {
return false; return false;
} }
} }
*/
$candidato = new Candidato($this->usuario, $idCandidato); $candidato = new Candidato($this->usuario, $idCandidato);
$estadoCand = $candidato->getValor("estado"); $estadoCand = $candidato->getValor("estado");
$numOfertasCandidato = $this->getNumOfertasCandidato($idCand); $numOfertasCandidato = $this->getOfertasCandidato($idCand);
switch ($estadoCand) { 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: case 560:
$this->setCampo("candidato", $idCandidato); $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; return true;
break; break;
//Rechazado, Sin más adelante, En proceso:Disponible, Otras provincias. se cambia a los nuevos estados #723 Peticion //Pendiente de clasificar, Rechazados tipo1, tipo2, tipo3, Disponible. Todos los candidatos con alguno de estos estados cambiarán a Disponible asignado (560)
//Todos los candidatos con alguno de estos estados cambiarán a En proceso:Disponible asignado (560) case 510:;
case 600:; case 521:;
case 520:; case 522:;
case 530:; case 523:;
case 540: case 540:
$this->setCampo("candidato", $idCandidato); $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);
//Cambiamos el estado del candidato
if ($candidato->transita("560", "")){ if ($candidato->transita("560", "")){
$nombre_candidato = $candidato->getValor("nombre") . " " . $candidato->getValor("apellidos");
$mensaje = "Asignado el candidato ".$nombre_candidato. "-->".$candidato->getValor("estado");
$this->actualizarHistorial($mensaje);
return true; return true;
} }
else { else {
@ -390,9 +335,9 @@ if ($nombre == "estado") {
} }
break; break;
//("") //("550")Disponible asignado exclusivo,u otro que no exista
default: default:
$error = "El candidato tiene un estado no permitido ('" . $candidato->getValor("nombre_estado") . "')"; $error = "El candidato tiene un estado no permitido ('" . $candidato->getValor("estado") . "')";
throw new Exception($error); throw new Exception($error);
} }
} }

View File

@ -12,7 +12,6 @@ include_once("Objects/Afinidad.php");
include_once("Objects/Automata.php"); include_once("Objects/Automata.php");
include_once("Objects/Oferta.php"); include_once("Objects/Oferta.php");
include_once("ListaCapacidadesProfesionales.php"); include_once("ListaCapacidadesProfesionales.php");
include_once("Objects/ListaOfertas.php");
class Pedido { class Pedido {
@ -23,7 +22,6 @@ class Pedido {
/* Contiene una lista con todos los atributos y su valor */ /* Contiene una lista con todos los atributos y su valor */
private $campos = array(); private $campos = array();
private $listaOfertas = null; private $listaOfertas = null;
private $totalOfertas = 0;
/* Lista de perfiles */ /* Lista de perfiles */
@ -179,14 +177,6 @@ class Pedido {
return $this->campos; return $this->campos;
} }
function darNombreEstado($cod, $idioma) {
$consulta = "SELECT NOMBRE from pedidos_estados WHERE cod=\"" . $cod . "\" AND idioma=\"" . $idioma . "\"";
$bd = new BD();
echo $consulta;
return $bd->getCampo($consulta);
}
/** /**
* Asigna un nuevo campo al pedido. * Asigna un nuevo campo al pedido.
* *
@ -214,14 +204,12 @@ class Pedido {
if ($bd->execQuery($consulta)) { if ($bd->execQuery($consulta)) {
// Comprobamos multivaluado y casos especiales: // Comprobamos multivaluado y casos especiales:
$valor = $this->getValorMulti($nombre, $valor); $valor = $this->getValorMulti($nombre, $valor);
if ($viejo == "" && $valor != "") {
/////////////////////////////////////////////////// $historial = "$nombre (de - a $valor)";
//SOLO ACTUALIZA EL HISTORIAL LOS CAMBIOS DE ESTADO } else {
/////////////////////////////////////////////////// $historial = "$nombre (de $viejo a $valor)";
if ($nombre == "estado") { }
$historial = "Cambio de estado (". $viejo ." a ". $valor .")"; //$this->actualizarHistorial($historial);
$this->actualizarHistorial($historial);
}
} }
} }
} else { } else {
@ -275,19 +263,6 @@ if ($nombre == "estado") {
* Gestor (3) - Los suyos * Gestor (3) - Los suyos
* Otro - Excepción * 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"); $gerente = $this->getValor("gerente");
$sesion = $this->usuario->getValor("oid"); $sesion = $this->usuario->getValor("oid");
if ($this->usuario->tieneRol(1) || ($this->usuario->tieneRol(3) && $sesion == $gerente)) { if ($this->usuario->tieneRol(1) || ($this->usuario->tieneRol(3) && $sesion == $gerente)) {
@ -299,7 +274,6 @@ if ($nombre == "estado") {
return false; return false;
} }
} }
}
/** /**
* Calcula una lista de candidatos de un estado. * Calcula una lista de candidatos de un estado.
@ -915,7 +889,7 @@ if ($nombre == "estado") {
$pesoPerfil = $this->getValor("pesoPerfil"); $pesoPerfil = $this->getValor("pesoPerfil");
// Eliminamos a los usuario de la tabla de candidatos en pedido que se encuentren // Eliminamos a los usuario de la tabla de candidatos en pedido que se encuentren
// en proceso para este pedido. // 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 = new BD();
$bd->execQuery($consulta); $bd->execQuery($consulta);
// Si el pedido no está cerrado calculamos su afinidad para los usuarios: // Si el pedido no está cerrado calculamos su afinidad para los usuarios:
@ -945,7 +919,7 @@ if ($nombre == "estado") {
$afi = $afinidad->calculaAfinidad($pesoIdioma, $pesoPerfil, $pesoTecno); $afi = $afinidad->calculaAfinidad($pesoIdioma, $pesoPerfil, $pesoTecno);
echo $afi . "<br/>"; echo $afi . "<br/>";
if ($afi > 0) { 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 = new BD();
$bd->execQuery($consulta); $bd->execQuery($consulta);
@ -969,7 +943,7 @@ if ($nombre == "estado") {
$historial = ""; $historial = "";
$oid = $this->getValor("oid"); $oid = $this->getValor("oid");
$consulta = "SELECT * FROM historial_pedido WHERE oid_h='$oid' ORDER BY id DESC"; $consulta = "SELECT * FROM historial_pedido WHERE oid_h='$oid' ORDER BY fecha_h DESC";
$bd = new BD(); $bd = new BD();
$resultado = $bd->execQuery($consulta); $resultado = $bd->execQuery($consulta);
@ -1141,18 +1115,6 @@ if ($nombre == "estado") {
return $resultado; 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("BD.php");
include_once("Rol.php"); include_once("Rol.php");
include_once("Objects/Administracion.php"); include_once("Objects/Administracion.php");
include_once("functions_solr.php");
class Persona{ class Persona{
@ -243,6 +242,19 @@
// if($bd->execQuery($consulta)){ // if($bd->execQuery($consulta)){
//Comprobamos multivaluado y casos especiales: //Comprobamos multivaluado y casos especiales:
$valor = $this->getValorMulti($nombre, $valor); $valor = $this->getValorMulti($nombre, $valor);
if(($nombre == "observaciones") || ($nombre == "descripcion")){
$historial = $nombre;
}else if($viejo == "" && $valor != ""){
$historial = "$nombre (de - a $valor)";
}else{
$historial = "$nombre (de $viejo a $valor)";
}
//Hay campos que no actualizan el historial
if(($nombre != "msgEstado") && ($nombre != "diasEspera")){
//$this->actualizarHistorial($historial);
}
// }
return $dato; return $dato;
}else{ }else{
return ""; return "";
@ -692,12 +704,11 @@
/** /**
* A<EFBFBD>ade un nuevo curr<EFBFBD>culum a la persona. * 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; $cv = $this->getValor("cv") + 1;
$oid = $this->getValor("oid"); $oid = $this->getValor("oid");
$nombre_archivo = $oid."-".$cv; $nombre_archivo = $oid."-".$cv;
$tipo_curriculum = $tipo;
$directorio = constante("srcDocs").SLASH."cv".SLASH; $directorio = constante("srcDocs").SLASH."cv".SLASH;
if (!@file_exists($directorio)){ if (!@file_exists($directorio)){
@ -718,13 +729,11 @@
if($fichero_subido){ if($fichero_subido){
$bd = new BD(); $bd = new BD();
$consulta = "INSERT INTO curriculum_usuario (oid, curriculum, fecha, tipo_curriculum) values ('".$oid."', '".$nombre_ruta_tabla."', now(), ".$tipo_curriculum.")"; $consulta = "INSERT INTO curriculum_usuario (oid, curriculum, fecha) values ('".$oid."', '".$nombre_ruta_tabla."', now())";
$bd->execQuery($consulta); $bd->execQuery($consulta);
//$this->actualizarHistorial("Nuevo CV", $usuario); //$this->actualizarHistorial("Nuevo CV", $usuario);
$consulta = "update usuarios set cv=cv+1 where oid='$oid'"; $consulta = "update usuarios set cv=cv+1 where oid='$oid'";
$bd->execQuery($consulta); $bd->execQuery($consulta);
solr_anadir_cv($oid, $destino);
return true; return true;
} }
@ -736,20 +745,21 @@
$consulta = "DELETE FROM curriculum_usuario WHERE oid = '".$oid."' and curriculum = '".$curriculum."' and fecha = '".$fecha."'"; $consulta = "DELETE FROM curriculum_usuario WHERE oid = '".$oid."' and curriculum = '".$curriculum."' and fecha = '".$fecha."'";
$bd = new BD(); $bd = new BD();
$resultado = $bd->execQuery($consulta); $resultado = $bd->execQuery($consulta);
if ($resultado){ if ($resultado){
$consulta = "update usuarios set cv=cv-1 where oid='$oid'"; $consulta = "update usuarios set cv=cv-1 where oid='$oid'";
$bd->execQuery($consulta); $bd->execQuery($consulta);
$cambios = "CV eliminado";
//$this->actualizarHistorial($cambios, $usuario);
$cambios = "CV eliminado";
//$this->actualizarHistorial($cambios, $usuario);
$ruta = constante("srcDocs")."\\".$curriculum; $ruta = constante("srcDocs")."\\".$curriculum;
if (is_file($ruta) && unlink($ruta)) if (!@unlink($ruta)){
{
solr_eliminar_cv($ruta);
return true;
} else {
return false; return false;
}else{
return true;
} }
} }
return false; return false;
@ -1022,7 +1032,7 @@
$historial = ""; $historial = "";
$oid = $this->getValor("oid"); $oid = $this->getValor("oid");
$consulta = "SELECT * FROM historial_usuario WHERE oid_h='$oid' ORDER BY id desc"; $consulta = "SELECT * FROM historial_usuario WHERE oid_h='$oid' ORDER BY fecha_h DESC";
$bd = new BD(); $bd = new BD();
$resultado = $bd->execQuery($consulta); $resultado = $bd->execQuery($consulta);

View File

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

View File

@ -27,6 +27,12 @@ if(stripinput($_POST['action'])=="add"){
$errores[]="22"; $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"); include_once("verificar_candidato.php");
if(count($errores)==0){ if(count($errores)==0){
@ -54,7 +60,6 @@ if(stripinput($_POST['action'])=="add"){
$camposQuitar["titulaciones"]=$_POST['titulaciones']; $camposQuitar["titulaciones"]=$_POST['titulaciones'];
$camposQuitar["provincia_deseada"]=$_POST['provincia_deseada']; $camposQuitar["provincia_deseada"]=$_POST['provincia_deseada'];
$camposQuitar["provincias_no_deseadas"]=$_POST['provincias_no_deseadas']; $camposQuitar["provincias_no_deseadas"]=$_POST['provincias_no_deseadas'];
$camposQuitar["tipo_curriculum"]=$_POST['tipo_curriculum'];
$camposQuitar["perfil"]=$_POST['perfil']; $camposQuitar["perfil"]=$_POST['perfil'];
$camposQuitar["action"]=stripinput($_POST['action']); $camposQuitar["action"]=stripinput($_POST['action']);
$camposQuitar["diaentre"]=stripinput($_POST['diaentre']); $camposQuitar["diaentre"]=stripinput($_POST['diaentre']);
@ -100,10 +105,7 @@ if(stripinput($_POST['action'])=="add"){
$candidatoNew->addPerfiles($_POST['perfil']); $candidatoNew->addPerfiles($_POST['perfil']);
$candidatoNew->addCurriculum($_FILES['userfile'], $_POST['tipo_curriculum']); $candidatoNew->addCurriculum($_FILES['userfile']);
//Subimos la foto
uploadImagenCandidato($idCandidatoNew, 250, 250, 150, 150);
header("Location: detalle_candidato.php?oid=".$idCandidatoNew); header("Location: detalle_candidato.php?oid=".$idCandidatoNew);
} else { } else {
$tipomsg="error"; $tipomsg="error";
@ -222,8 +224,6 @@ echo '</td>';
//CAMPO FOTO //CAMPO FOTO
echo '<td '; echo '<td ';
echo ' width="25%" '.$ett.' textalign="right">'; 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'</td>';
echo '</tr>'; echo '</tr>';
@ -387,12 +387,12 @@ echo '<div class="encabezado">'.$locale['1549'].'</div>';
echo '<table align="center" width="100%">'; echo '<table align="center" width="100%">';
echo '<tr><td colspan="6">'; echo '<tr><td colspan="6">';
menu_curriculums($_GET['oid'], "candidato"); menu_curriculums($_GET['oid'], "candidato");
echo '</td></tr><td colspan="6" textalign="right">'; echo '</td></tr><tr>';
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000">'.$locale['125'].'&nbsp;&nbsp;'; echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000"><td colspan="6" textalign="right">'.$locale['125'].'<br>';
echo '<input name="userfile" type="file">&nbsp;&nbsp;'.$locale['00208']. '&nbsp;&nbsp;'; echo '<input name="userfile" type="file">';
rellena_desplegable_select_oidCol("tipo_curriculum","oid","tipo","tipo_curriculum","","0"); echo '<input value="Subir" type="submit">';
echo '&nbsp;&nbsp;<input value="Subir" type="submit">';
echo '</td></tr></table>'; echo '</td></tr></table>';
echo '<input type="submit" value="'.$locale['802'].'" class="button">';
echo "</form>"; echo "</form>";
include_once("html/pie.php"); include_once("html/pie.php");

View File

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

View File

@ -8,14 +8,14 @@ include_once("Objects/Pedido.php");
include_once("Objects/HTML.php"); include_once("Objects/HTML.php");
$html = new HTML($locale); $html = new HTML($locale);
$errores = array(); $errores = array();
$usuario = $_SESSION["usuario"];
$solicitud=$_GET['solicitud'];
// Todas las variables // Todas las variables
if (!empty($_POST)) { if (!empty($_POST)) {
print_r($_POST); print_r($_POST);
$solicitud = "";
if (!empty($_POST['solicitud'])) { if (!empty($_POST['solicitud'])) {
$solicitud = $_POST['solicitud'][0]; $solicitud = $_POST['solicitud'][0];
} }
@ -34,8 +34,6 @@ if (!empty($_POST)) {
$idiomas=$_POST['idiomas']; $idiomas=$_POST['idiomas'];
$provincias=$_POST['provincias']; */ $provincias=$_POST['provincias']; */
$observaciones = $_POST['observaciones']; $observaciones = $_POST['observaciones'];
$salario_ofertado = $_POST['salario_ofertado'];
$gerente=$usuario->getValor("oid");
/* $pesoTec=$_POST['pesoTec']; /* $pesoTec=$_POST['pesoTec'];
$pesoIdi=$_POST['pesoIdi']; $pesoIdi=$_POST['pesoIdi'];
$pesoPer=$_POST['pesoPer']; $pesoPer=$_POST['pesoPer'];
@ -44,7 +42,7 @@ if (!empty($_POST)) {
if($usuario->tieneRol("1")){ if($usuario->tieneRol("1")){
$gerente=$_POST['gerente']; $gerente=$_POST['gerente'];
} else { } else {
$gerente=$usuario->getValor("oid");
} }
*/ */
if ($_POST['action'] == "add") { if ($_POST['action'] == "add") {
@ -60,19 +58,18 @@ if (!empty($_POST)) {
$arrayInsert = array(); $arrayInsert = array();
$arrayInsert["pedido"] = $solicitud; $arrayInsert["pedido"] = $solicitud;
$arrayInsert["obsGerente"] = $observaciones; $arrayInsert["obsGerente"] = $observaciones;
$arrayInsert["estado"] = "100"; $arrayInsert["estado"] = "110";
$arrayInsert["gerente"]=$gerente;
$arrayInsert["salario_ofertado"] = $salario_ofertado;
/* $arrayInsert["prioridad"]= $prioridad; /* $arrayInsert["prioridad"]= $prioridad;
$arrayInsert["empleados"]=$empleados; $arrayInsert["empleados"]=$empleados;
$arrayInsert["duracion"]=$duracion; $arrayInsert["duracion"]=$duracion;
$arrayInsert["gerente"]=$gerente;
$arrayInsert["cliente"]=$clientes; $arrayInsert["cliente"]=$clientes;
$arrayInsert["salario_min"]=$salario_min; $arrayInsert["salario_min"]=$salario_min;
$arrayInsert["salario_max"]=$salario_max; $arrayInsert["salario_max"]=$salario_max;
$arrayInsert["procedencia"]=$procedencia; $arrayInsert["procedencia"]=$procedencia;
$arrayInsert["estado"]="100"; $arrayInsert["estado"]="110";
$arrayInsert["pesoIdioma"]=$pesoIdi; $arrayInsert["pesoIdioma"]=$pesoIdi;
$arrayInsert["pesoPerfil"]=$pesoPer; $arrayInsert["pesoPerfil"]=$pesoPer;
$arrayInsert["pesoTecno"]=$pesoTec; */ $arrayInsert["pesoTecno"]=$pesoTec; */
@ -101,7 +98,7 @@ if (!empty($_POST)) {
} }
} else { } else {
$referencia = ""; $referencia = "";
$gerente = $usuario->getValor("oid"); $solicitud = "";
$observaciones = ""; $observaciones = "";
} }
@ -124,6 +121,7 @@ if (in_array("1", $errores))
echo " class=\"errorcampo\""; echo " class=\"errorcampo\"";
echo ">" . $locale['1025'] . ":<br/>"; echo ">" . $locale['1025'] . ":<br/>";
rellena_desplegable_pedidos_estado("solicitud", "130, 140", array($solicitud)); rellena_desplegable_pedidos_estado("solicitud", "130, 140", array($solicitud));
echo " </td>"; echo " </td>";
@ -136,10 +134,6 @@ echo '<tr>' .
'<td colspan="3" align="center">' . $locale['135'] . '<td colspan="3" align="center">' . $locale['135'] .
'<br><textarea name="observaciones" rows="10" cols="120" style="overflow: auto; width:100%;">' . nl2br($observaciones) . '</textarea></td>' . '<br><textarea name="observaciones" rows="10" cols="120" style="overflow: auto; width:100%;">' . nl2br($observaciones) . '</textarea></td>' .
'</tr>'; '</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 // Botones de guardar y restablecer
echo "<tr><td colspan=\"3\" align=\"center\">"; echo "<tr><td colspan=\"3\" align=\"center\">";
echo '<input type="submit" value="' . $locale['gu'] . '" onclick="return comprobar_registro(this)" class="button">'; 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=""; $denominacion_cliente="";
$prioridad=""; $prioridad="";
$empleados=""; $empleados="";
$duracion="12"; $duracion="";
$clientes="2"; $clientes="";
$perfiles=array(); $perfiles=array();
$salario_min=""; $salario_min="";
$salario_max=""; $salario_max="";
@ -129,10 +129,10 @@ if(!empty($_POST)) {
$viajar=""; $viajar="";
$internacional=""; $internacional="";
$direccion_solicitud=""; $direccion_solicitud="";
$fecha_solicitud_cliente = date("Y-m-d", time()); $fecha_solicitud_cliente="";
$fecha_inicio_servicio=""; $fecha_inicio_servicio="";
$fecha_fin_servicio = date("Y-12-31", time()); $fecha_fin_servicio="";
$fecha_recepcion_solicitud = date("Y-m-d", time()); $fecha_recepcion_solicitud="";
} }

View File

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

View File

@ -5,7 +5,7 @@ include("functions.php");
include_once("Objects/Candidato.php"); include_once("Objects/Candidato.php");
$oid = stripinput($_GET["oid"]); $oid = stripinput($_GET["oid"]);
$curriculum = $_GET["curriculum"]; $curriculum = stripinput($_GET["curriculum"]);
$fecha = stripinput($_GET["fecha"]); $fecha = stripinput($_GET["fecha"]);
$tipo = stripinput($_GET["tipo"]); $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, $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, 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 FROM usuarios U,pedidos P,candidato_pedido CP,candidaturas_estados CE
WHERE U.oid='".$persona->getValor("oid")."' WHERE U.oid='".$persona->getValor("oid")."'
AND CP.candidato=U.oid AND CP.candidato=U.oid
@ -35,13 +35,11 @@ if ($resultado = consultar($consulta)){
$oidOferta = $row["idOferta"]; $oidOferta = $row["idOferta"];
$obsRRHH = $row["obsRRHH"]; $obsRRHH = $row["obsRRHH"];
$obsGerente = $row["obsGerente"]; $obsGerente = $row["obsGerente"];
$salario_ofertado = $row["salario_ofertado"];
$idCandidato = $row["idCandidato"]; $idCandidato = $row["idCandidato"];
echo "<li>"; echo "<li>";
echo "Oferta <a href=\"oferta.php?idOferta=".$oidOferta."\" target=\"_blank\" />$referenciaOferta</a> "; echo "Oferta <a href=\"oferta.php?idOferta=".$oidOferta."\" target=\"_blank\" />$referenciaOferta</a> ";
echo "($estado) "; echo "($estado) ";
echo "- Solicitud \"<a href=\"pedido.php?idPedido=".$oid."\" target=\"_blank\" />$pedido</a>"; echo "- Solicitud \"<a href=\"pedido.php?idPedido=".$oid."\" target=\"_blank\" />$pedido</a>\"</li>";
echo " - Salario ofertado: ". $salario_ofertado. "</li>";
// desactivar el comentario por ahora // desactivar el comentario por ahora
if (false) { //if($usuario->tieneRol("4")){ 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

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