diff --git a/Objects/ListaOfertas.php b/Objects/ListaOfertas.php
index 86d7cbd..72c9bfb 100644
--- a/Objects/ListaOfertas.php
+++ b/Objects/ListaOfertas.php
@@ -106,8 +106,11 @@ class ListaOfertas {
$valores = "$fecha, $referencia";
// Procesamos los datos
foreach ($campos as $key => $value) {
- $inserto .= ", $key";
- $valores .= ", '$value'";
+ // Metemos todos los valores excepto el candidato, que se hace despus
+ if ($key != "candidato") {
+ $inserto .= ", $key";
+ $valores .= ", '$value'";
+ }
}
// Insertamos en la BD
$consulta = "INSERT INTO candidato_pedido ($inserto) VALUES ($valores)";
@@ -117,9 +120,14 @@ class ListaOfertas {
return "-1";
} else {
$id = mysql_insert_id();
- $p = new Oferta($id, $this->gestor);
+ $ofertaNueva = new Oferta($id, $this->gestor);
$mensaje = "Nueva oferta";
- $p->actualizarHistorial($mensaje);
+ $ofertaNueva->actualizarHistorial($mensaje);
+
+ // Si viene ya el candidato indicado, hay que cambiarlo de estado
+ if (array_key_exists("candidato", $campos)) {
+ $ofertaNueva->colocarCandidato($campos["candidato"]);
+ }
}
return $id;
}
@@ -130,9 +138,6 @@ class ListaOfertas {
if ($resultado = $bd->execQuery($consulta)) {
$rows = mysql_fetch_array($resultado);
- echo "########################
";
- print_r($rows);
- echo "########################
";
$num = 1;
if (!empty($rows[0])) {
diff --git a/Objects/Oferta.php b/Objects/Oferta.php
index 0116f60..bc0f979 100644
--- a/Objects/Oferta.php
+++ b/Objects/Oferta.php
@@ -262,6 +262,11 @@ class Oferta {
function colocarCandidato($idCandidato) {
$idCand = $this->getValor("candidato");
+
+ dbug($idCand);
+ echo dbug('print');
+
+
if (!empty($idCand)) {
if (!$this->quitarCandidato()) {
return false;
@@ -270,6 +275,10 @@ class Oferta {
$candidato = new Candidato($this->usuario, $idCandidato);
$estadoCand = $candidato->getValor("estado");
+
+ dbug($estadoCand);
+ echo dbug('print');
+
switch ($estadoCand) {
case "540":
@@ -281,16 +290,21 @@ class Oferta {
$this->actualizarHistorial($mensaje);
return true;
}
- else {
- dbug("error");
- }
+ break;
+
+ case "560":
+ $this->setCampo("candidato", $idCandidato);
+
+ $nombre_candidato = $candidato->getValor("nombre") . " " . $candidato->getValor("apellidos");
+ $mensaje = "Asignado el candidato ".$nombre_candidato;
+ $this->actualizarHistorial($mensaje);
+ return true;
break;
default:
$error = "El candidato tiene un estado no permitido ('" . $candidato->getValor("estado") . "')";
throw new Exception($error);
}
- echo dbug('print');
}
}
diff --git a/candidaturas.php b/candidaturas.php
index 020c5b8..a673177 100644
--- a/candidaturas.php
+++ b/candidaturas.php
@@ -7,14 +7,16 @@ if(!$_SESSION["oid"]){
//Mostramos al candidato
//$consulta = "select usuarios.nombre as nombre,usuarios.apellidos as apellidos, pedidos.nombre as pedido, estado_candidatura.id as estado from usuarios,candidato_pedido,pedidos,estado_candidatura where usuarios.oid='".$persona->getValor("oid")."' and candidato_pedido.candidato='".$persona->getValor("oid")."' and candidato_pedido.pedido = pedidos.oid and candidato_pedido.estado <> 6 ";
-$consulta = "SELECT U.oid as idCandidato,P.oid as idPedido, U.nombre,U.apellidos,P.nombre AS pedido, CE.nombre AS estado, P.oid,CP.obsRRHH,CP.obsGerente
+$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
FROM usuarios U,pedidos P,candidato_pedido CP,candidaturas_estados CE
WHERE U.oid='".$persona->getValor("oid")."'
AND CP.candidato=U.oid
AND P.oid=CP.pedido
AND CE.cod=CP.estado
-AND CE.idioma=U.idioma
-AND CP.estado <> '30'";
+AND CE.idioma=U.idioma";
+
if ($resultado = consultar($consulta)){
$num = mysql_num_rows($resultado);
if($num == 0){
@@ -28,12 +30,19 @@ if ($resultado = consultar($consulta)){
do{
$estado = $row["estado"];
$pedido = $row["pedido"];
- $oid = $row["oid"];
+ $oid = $row["idPedido"];
+ $referenciaOferta = $row["referencia"];
+ $oidOferta = $row["idOferta"];
$obsRRHH = $row["obsRRHH"];
$obsGerente = $row["obsGerente"];
$idCandidato = $row["idCandidato"];
- echo "
| getValor("nombre")." ".$persona->getValor("apellidos"); ?> | -getValor("fecha_nacimiento"); ?> | -getValor("dni"); ?> | -|||||||||||||||||||||
| getValor("t_movil"); ?> | -getValor("t_casa"); ?> | -getValor("tipo")=="usuario"){
- echo "".$locale['109']."".$persona->getValor("t_trabajo")."";
- }
- ?>
+
+
+
+
| + | + getValor("tipo_via")." ".$persona->getValor("direccion")." ".$persona->getValor("numero").", ".$persona->getValor("piso")." ".$persona->getValor("puerta"); ?> + | getValor("cp"); ?> | + */ ?> +||||||||||||||||||
| + | + getValor("localidad")); ?> + | getValor("localidad"))); ?> | + */ ?> + + + +getValor("tipo") == "usuario") { + echo $locale['1905'] . ": " . $persona->getValor("extension"); + } else { + echo ""; + } + ?> | +||||||||||||||||||||
getValor("descripcion")); ?> |
+ |||||||||||||||||||||||
+if (in_array("laborables", $mostrarDetalle)) { ?>
+
+
+
getValor("observaciones")); + } ?> |
+ |||||||||||||||||||||||||||||||||||||||||||||||
- getValor("oid")); - if(gettype($titulaciones)!="NULL"){ - foreach($titulaciones as $tecno){ - echo $tecno." "; - } +if (in_array("curriculum", $mostrarDetalle)) { ?> + + +
|
+ ||||||||
| + addCurriculum($_FILES['userfile']); + } ?> + getValor("oid"), $tipo); ?> + | +||||||||
|
-
-
- tieneRol("1") || $usuario->tieneRol("4")){
- ?>
- - - |
+
| + | ||
| + + | +