Tarea #647 -> Nueva entrada de menú para ver la lista de ofertas
Tarea #646 -> Crear la acción "Creación de oferta" que cree una oferta relacionada con la solicitud de oferta que se está mostrando. Tarea #607 -> Nueva entidad 'Oferta' con estados nuevos Tarea #606 -> Nuevos estados y transiciones para una solicitud de oferta Tarea #601 -> Nuevos estados y transiciones para un candidato Tarea #599 -> Repasar los registros que se meten en el historial de cambios Tarea #586 -> Cuando una solicitud tiene varios perfiles, hay que visualizarlos ocupando las menos filas posibles Tarea #585 -> Cuando un candidato tiene varios perfiles, hay que visualizarlos ocupando las menos filas posibles git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk@65 e2b1556b-49f8-d141-9351-52d6861a72d9
This commit is contained in:
parent
13330f65b9
commit
fa8b5a8714
@ -29,7 +29,7 @@
|
||||
function getSiguientes($estado){
|
||||
$consulta = "SELECT final, nombre, rol FROM ".$this->objeto."_transiciones, ".$this->objeto."_estados WHERE inicial='$estado' AND idioma='$this->idioma'" .
|
||||
" AND ".$this->objeto."_transiciones.final = ".$this->objeto."_estados.cod AND ".$this->objeto."_transiciones.rol <> ''";
|
||||
$bd = new BD();
|
||||
$bd = new BD();
|
||||
$resultado = $bd->execQuery($consulta);
|
||||
|
||||
|
||||
|
||||
@ -15,12 +15,14 @@ include_once("Conexion.php");
|
||||
$this->conexion = new Conexion();
|
||||
}
|
||||
|
||||
function execQuery($query){
|
||||
function execQuery($query){
|
||||
$res = mysql_query($query);
|
||||
//$mensaje = $query." - ".$res."\r\n";
|
||||
//$fichero = fopen("querys.log","a");
|
||||
//fputs($fichero,$mensaje);
|
||||
//fclose($fichero);
|
||||
|
||||
/*$mensaje = $query." - ".$res."\r\n";
|
||||
$fichero = fopen("querys.log","a");
|
||||
fputs($fichero,$mensaje);
|
||||
fclose($fichero);*/
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Clase Candidato
|
||||
*
|
||||
@ -7,385 +8,391 @@
|
||||
* 2008-10-06 (diego): Se crea el objeto con los métodos necesarios para gestionar candidatos.
|
||||
*
|
||||
*/
|
||||
include_once("BD.php");
|
||||
include_once("Persona.php");
|
||||
class Candidato extends Persona{
|
||||
include_once("BD.php");
|
||||
include_once("Persona.php");
|
||||
include_once("Automata.php");
|
||||
|
||||
private $usuario;
|
||||
class Candidato extends Persona {
|
||||
|
||||
function Candidato($usuario, $oid){
|
||||
$consulta = "SELECT oid FROM usuarios WHERE oid = '".$oid."' AND tipo='candidato'";
|
||||
$bd = new BD();
|
||||
$num = $bd->numFilas($consulta);
|
||||
if($num > 0){
|
||||
parent::Persona($oid);
|
||||
$this->usuario = $usuario;
|
||||
}else{
|
||||
$error = "Candidato no encontrado.";
|
||||
throw new Exception($error);
|
||||
}
|
||||
}
|
||||
private $usuario;
|
||||
|
||||
function setCampo($nombre, $valor){
|
||||
//PERMISOS:
|
||||
/*
|
||||
* Admin (1) - Todos
|
||||
* RRHH (4) - Todos
|
||||
* Otro - Excepción
|
||||
*/
|
||||
$sesion = $this->usuario->getValor("oid");
|
||||
if($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)){
|
||||
return parent::setCampo($nombre, $valor);
|
||||
}else{
|
||||
//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)){
|
||||
return parent::setCampo($nombre, $valor);
|
||||
}else{
|
||||
$error = "El usuario no tiene permisos para editar al candidato.";
|
||||
throw new Exception($error);
|
||||
return false;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
function Candidato($usuario, $oid) {
|
||||
$consulta = "SELECT oid FROM usuarios WHERE oid = '" . $oid . "' AND tipo='candidato'";
|
||||
$bd = new BD();
|
||||
$num = $bd->numFilas($consulta);
|
||||
if ($num > 0) {
|
||||
parent::Persona($oid);
|
||||
$this->usuario = $usuario;
|
||||
} else {
|
||||
$error = "Candidato no encontrado.";
|
||||
throw new Exception($error);
|
||||
}
|
||||
}
|
||||
|
||||
function addCurriculum($fichero){
|
||||
//PERMISOS:
|
||||
/*
|
||||
* Admin (1) - Todos
|
||||
* RRHH (4) - Todos
|
||||
* Otro - Excepción
|
||||
*/
|
||||
$sesion = $this->usuario->getValor("oid");
|
||||
if($this->usuario->tieneRol(3) || $this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)){
|
||||
return parent::addCurriculum($fichero, $this->usuario->getValor("nombre"));
|
||||
}else{
|
||||
$error = "El usuario no tiene permisos para asociar CV al candidato.";
|
||||
throw new Exception($error);
|
||||
return false;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
function setCampo($nombre, $valor) {
|
||||
//PERMISOS:
|
||||
/*
|
||||
* Admin (1) - Todos
|
||||
* RRHH (4) - Todos
|
||||
* Otro - Excepción
|
||||
*/
|
||||
$sesion = $this->usuario->getValor("oid");
|
||||
if ($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) {
|
||||
return parent::setCampo($nombre, $valor);
|
||||
} else {
|
||||
//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)) {
|
||||
return parent::setCampo($nombre, $valor);
|
||||
} else {
|
||||
$error = "El usuario no tiene permisos para editar al candidato.";
|
||||
throw new Exception($error);
|
||||
return false;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function removeCurriculum($curriculum, $fecha){
|
||||
//PERMISOS:
|
||||
/*
|
||||
* Admin (1) - Todos
|
||||
* RRHH (4) - Todos
|
||||
* Otro - Excepción
|
||||
*/
|
||||
$sesion = $this->usuario->getValor("oid");
|
||||
if($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)){
|
||||
parent::removeCurriculum($curriculum, $fecha, $this->usuario->getValor("nombre"));
|
||||
}else{
|
||||
$error = "El usuario no tiene permisos para eliminar un CV al candidato.";
|
||||
throw new Exception($error);
|
||||
}
|
||||
}
|
||||
function addCurriculum($fichero) {
|
||||
//PERMISOS:
|
||||
/*
|
||||
* Admin (1) - Todos
|
||||
* RRHH (4) - Todos
|
||||
* Otro - Excepción
|
||||
*/
|
||||
$sesion = $this->usuario->getValor("oid");
|
||||
if ($this->usuario->tieneRol(3) || $this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) {
|
||||
return parent::addCurriculum($fichero, $this->usuario->getValor("nombre"));
|
||||
} else {
|
||||
$error = "El usuario no tiene permisos para asociar CV al candidato.";
|
||||
throw new Exception($error);
|
||||
return false;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/*SQL que da los pedidos en el que está un candidato dependiendo del estado
|
||||
function removeCurriculum($curriculum, $fecha) {
|
||||
//PERMISOS:
|
||||
/*
|
||||
* Admin (1) - Todos
|
||||
* RRHH (4) - Todos
|
||||
* Otro - Excepción
|
||||
*/
|
||||
$sesion = $this->usuario->getValor("oid");
|
||||
if ($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) {
|
||||
parent::removeCurriculum($curriculum, $fecha, $this->usuario->getValor("nombre"));
|
||||
} else {
|
||||
$error = "El usuario no tiene permisos para eliminar un CV al candidato.";
|
||||
throw new Exception($error);
|
||||
}
|
||||
}
|
||||
|
||||
En el ejemplo
|
||||
estado -> 20
|
||||
id Candidato ->12
|
||||
@param $estado - Estado del pedido.
|
||||
@return array codPedido => nombre o vacío.
|
||||
*/
|
||||
function getPedidosByEstado($estado){
|
||||
/*SELECT P.oid,P.nombre
|
||||
FROM pedidos P,candidato_pedido CP
|
||||
WHERE CP.candidato='12'
|
||||
AND CP.estado='20'
|
||||
AND P.oid=CP.pedido*/
|
||||
$idC = $this->getValor("oid");
|
||||
$consulta = "SELECT P.oid as oid,P.nombre as nombre
|
||||
/* SQL que da los pedidos en el que está un candidato dependiendo del estado
|
||||
|
||||
En el ejemplo
|
||||
estado -> 20
|
||||
id Candidato ->12
|
||||
@param $estado - Estado del pedido.
|
||||
@return array codPedido => nombre o vacío.
|
||||
*/
|
||||
|
||||
function getPedidosByEstado($estado) {
|
||||
/* SELECT P.oid,P.nombre
|
||||
FROM pedidos P,candidato_pedido CP
|
||||
WHERE CP.candidato='12'
|
||||
AND CP.estado='20'
|
||||
AND P.oid=CP.pedido */
|
||||
$idC = $this->getValor("oid");
|
||||
$consulta = "SELECT P.oid as oid,P.nombre as nombre
|
||||
FROM pedidos P,candidato_pedido CP
|
||||
WHERE CP.candidato='$idC'
|
||||
AND CP.estado='$estado'
|
||||
AND P.oid=CP.pedido";
|
||||
$bd = new BD();
|
||||
return $bd->keyValueQuery($consulta, "oid", "nombre");
|
||||
}
|
||||
$bd = new BD();
|
||||
return $bd->keyValueQuery($consulta, "oid", "nombre");
|
||||
}
|
||||
|
||||
function eliminar(){
|
||||
//PERMISOS:
|
||||
/*
|
||||
* Admin (1) - Todos
|
||||
* Otro - Excepción
|
||||
*/
|
||||
$sesion = $this->usuario->getValor("oid");
|
||||
//Nos declaramos un array de estados eliminables:
|
||||
$estados_eliminables = array(10, 20, 50, 40, 60);
|
||||
if($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)){
|
||||
$estado = $this->getValor("estado");
|
||||
if(in_array($estado, $estados_eliminables)){
|
||||
return parent::eliminar();
|
||||
}else{
|
||||
$nombre_estado = $this->getValor("nombre_estado");
|
||||
$error = "No se pueden eliminar candidatos en estado ".$nombre_estado.".";
|
||||
throw new Exception($error);
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
$error = "El usuario no tiene permisos para eliminar al candidato.";
|
||||
throw new Exception($error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function eliminar() {
|
||||
//PERMISOS:
|
||||
/*
|
||||
* Admin (1) - Todos
|
||||
* Otro - Excepción
|
||||
*/
|
||||
$sesion = $this->usuario->getValor("oid");
|
||||
//Nos declaramos un array de estados eliminables:
|
||||
$estados_eliminables = array(10, 20, 50, 40, 60);
|
||||
if ($this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) {
|
||||
$estado = $this->getValor("estado");
|
||||
if (in_array($estado, $estados_eliminables)) {
|
||||
return parent::eliminar();
|
||||
} else {
|
||||
$nombre_estado = $this->getValor("nombre_estado");
|
||||
$error = "No se pueden eliminar candidatos en estado " . $nombre_estado . ".";
|
||||
throw new Exception($error);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$error = "El usuario no tiene permisos para eliminar al candidato.";
|
||||
throw new Exception($error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function actualizarHistorial($mensaje){
|
||||
parent::actualizarHistorial($mensaje, $this->usuario->getValor("nombre"));
|
||||
}
|
||||
function actualizarHistorial($mensaje) {
|
||||
parent::actualizarHistorial($mensaje, $this->usuario->getValor("nombre"));
|
||||
}
|
||||
|
||||
function getSiguientes(){
|
||||
$estado = $this->getValor("estado");
|
||||
$idioma = $this->usuario->getValor("idioma");
|
||||
$rol = $this->usuario->getValor("rol");
|
||||
$a = new Automata("candidatos", $idioma, $rol);
|
||||
$siguientes = $a->getSiguientes($estado);
|
||||
return $siguientes;
|
||||
}
|
||||
function getSiguientes() {
|
||||
$estado = $this->getValor("estado");
|
||||
$idioma = $this->usuario->getValor("idioma");
|
||||
$rol = $this->usuario->getValor("rol");
|
||||
$a = new Automata("candidatos", $idioma, $rol);
|
||||
$siguientes = $a->getSiguientes($estado);
|
||||
return $siguientes;
|
||||
}
|
||||
|
||||
function transita($destino, $argumentos){
|
||||
$origen = $this->getValor("estado");
|
||||
$idioma = $this->usuario->getValor("idioma");
|
||||
$rol = $this->usuario->getValor("rol");
|
||||
$a = new Automata("candidatos", $idioma, $rol);
|
||||
$transita = $a->getTransicion($origen,$destino);
|
||||
function transita($destino, $argumentos) {
|
||||
$origen = $this->getValor("estado");
|
||||
$idioma = $this->usuario->getValor("idioma");
|
||||
$rol = $this->usuario->getValor("rol");
|
||||
$a = new Automata("candidatos", $idioma, $rol);
|
||||
|
||||
if(($transita == "") || !($transita >= 0)){
|
||||
return false;
|
||||
}else{
|
||||
$res = $this->ejecutaTransicion($transita, $argumentos);
|
||||
if($res){
|
||||
$total = explode("#&dias;", $argumentos);
|
||||
$msj = $total[0];
|
||||
$diasEspera = $total[1];
|
||||
$this->setCampos(array("msgEstado" => $msj, "diasEspera" => $diasEspera, "estado" => $destino));
|
||||
/*$this->setCampo("msgEstado", $msj);
|
||||
$this->setCampo("diasEspera", $diasEspera);
|
||||
$this->setCampo("estado", $destino);*/
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
$transita = $a->getTransicion($origen, $destino);
|
||||
|
||||
private function ejecutaTransicion($codigo, $argumentos){
|
||||
//Si no hace nada al transitar salimos sin más.
|
||||
if($codigo == 0) return true;
|
||||
$funcion = "ejecutar$codigo";
|
||||
$res = call_user_func(array("Candidato", $funcion), $argumentos);
|
||||
if (($transita == "") || !($transita >= 0)) {
|
||||
return false;
|
||||
} else {
|
||||
$res = $this->ejecutaTransicion($transita, $argumentos);
|
||||
if ($res) {
|
||||
$total = explode("#&dias;", $argumentos);
|
||||
$msj = $total[0];
|
||||
$diasEspera = $total[1];
|
||||
$this->setCampos(array("msgEstado" => $msj, "diasEspera" => $diasEspera, "estado" => $destino));
|
||||
/* $this->setCampo("msgEstado", $msj);
|
||||
$this->setCampo("diasEspera", $diasEspera);
|
||||
$this->setCampo("estado", $destino); */
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
private function ejecutaTransicion($codigo, $argumentos) {
|
||||
//Si no hace nada al transitar salimos sin más.
|
||||
if ($codigo == 0)
|
||||
return true;
|
||||
$funcion = "ejecutar$codigo";
|
||||
$res = call_user_func(array("Candidato", $funcion), $argumentos);
|
||||
|
||||
/**
|
||||
* Disponible a no disponible
|
||||
* Entrevistado a no disponible (entrevistado).
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Editar el estado del candidato desde la vista.
|
||||
return $res;
|
||||
}
|
||||
|
||||
PRECONDICIONES:
|
||||
- Mensaje con texto.
|
||||
/**
|
||||
* Disponible a no disponible
|
||||
* Entrevistado a no disponible (entrevistado).
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Editar el estado del candidato desde la vista.
|
||||
|
||||
POSTCONDICIONES:
|
||||
- Eliminarle de candidaturas en las que no esté rechazado
|
||||
y el pedido esté pendiente, asignado o contratado
|
||||
y comprobar transiciones a otros pedidos.
|
||||
*/
|
||||
private function ejecutar1020($mensaje){
|
||||
PRECONDICIONES:
|
||||
- Mensaje con texto.
|
||||
|
||||
if($mensaje == ""){
|
||||
echo '<script type="text/javascript">
|
||||
POSTCONDICIONES:
|
||||
- Eliminarle de candidaturas en las que no esté rechazado
|
||||
y el pedido esté pendiente, asignado o contratado
|
||||
y comprobar transiciones a otros pedidos.
|
||||
*/
|
||||
private function ejecutar1020($mensaje) {
|
||||
|
||||
if ($mensaje == "") {
|
||||
echo '<script type="text/javascript">
|
||||
<!--
|
||||
alert("Debe introducir un motivo para pasar al candidato a No disponible");
|
||||
-->
|
||||
</script>';
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disponible a Entrevistado
|
||||
* En proceso a En proceso (entrevistado)
|
||||
* No disponible a No disponible (entrevistado)
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Editar el estado del candidato desde la vista.
|
||||
/**
|
||||
* Disponible a Entrevistado
|
||||
* En proceso a En proceso (entrevistado)
|
||||
* No disponible a No disponible (entrevistado)
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Editar el estado del candidato desde la vista.
|
||||
|
||||
PRECONDICIONES:
|
||||
- Ninguna.
|
||||
PRECONDICIONES:
|
||||
- Ninguna.
|
||||
|
||||
POSTCONDICIONES:
|
||||
- Almacenar en la BD la fecha de la entrevista.
|
||||
*/
|
||||
private function ejecutar1050($mensaje){
|
||||
$fechaAntEntrevista=$this->getValor("fecha_entrevista");
|
||||
if(($fechaAntEntrevista=="2008-1-1") || ($fechaAntEntrevista=="0000-00-00")){
|
||||
$fecha = date(Y."-".m."-".d);
|
||||
$this->setCampos(array("fecha_entrevista" => $fecha));
|
||||
}
|
||||
POSTCONDICIONES:
|
||||
- Almacenar en la BD la fecha de la entrevista.
|
||||
*/
|
||||
private function ejecutar1050($mensaje) {
|
||||
$fechaAntEntrevista = $this->getValor("fecha_entrevista");
|
||||
if (($fechaAntEntrevista == "2008-1-1") || ($fechaAntEntrevista == "0000-00-00")) {
|
||||
$fecha = date(Y . "-" . m . "-" . d);
|
||||
$this->setCampos(array("fecha_entrevista" => $fecha));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* En proceso a no disponible
|
||||
* En proceso (entrevistado) a no disponible (entrevistado).
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Editar el estado del candidato desde la vista.
|
||||
/**
|
||||
* En proceso a no disponible
|
||||
* En proceso (entrevistado) a no disponible (entrevistado).
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Editar el estado del candidato desde la vista.
|
||||
|
||||
PRECONDICIONES:
|
||||
- Mensaje con texto.
|
||||
PRECONDICIONES:
|
||||
- Mensaje con texto.
|
||||
|
||||
POSTCONDICIONES:
|
||||
- Eliminarle de candidaturas en las que no esté rechazado
|
||||
y el pedido esté pendiente, asignado o contratado
|
||||
y comprobar transiciones a otros pedidos.
|
||||
*/
|
||||
private function ejecutar3020($mensaje){
|
||||
if($mensaje == ""){
|
||||
echo '<script type="text/javascript">
|
||||
POSTCONDICIONES:
|
||||
- Eliminarle de candidaturas en las que no esté rechazado
|
||||
y el pedido esté pendiente, asignado o contratado
|
||||
y comprobar transiciones a otros pedidos.
|
||||
*/
|
||||
private function ejecutar3020($mensaje) {
|
||||
if ($mensaje == "") {
|
||||
echo '<script type="text/javascript">
|
||||
<!--
|
||||
alert("Debe introducir un motivo para pasar al candidato a No disponible");
|
||||
-->
|
||||
</script>';
|
||||
return false;
|
||||
}
|
||||
$oid = $this->getValor("oid");
|
||||
$consulta = "SELECT pedido FROM candidato_pedido, pedidos WHERE candidato='$oid' AND estado <> '10' AND pedido.oid = candidato_pedido.pedido AND pedido.estado IN ('10', '20', '30')";
|
||||
$bd = new BD();
|
||||
$pedidos = $bd->arrayQuery($consulta, "pedido");
|
||||
//Elimino al usuario de todas las candidaturas en las que no esté rechazado y el pedido esté pendiente, asignado o contratado.
|
||||
$consulta = "DELETE FROM candidato_pedido, pedidos WHERE candidato='$oid' AND estado <> '10' AND pedido.oid = candidato_pedido.pedido AND pedido.estado IN ('10', '20', '30')";
|
||||
return false;
|
||||
}
|
||||
$oid = $this->getValor("oid");
|
||||
$consulta = "SELECT pedido FROM candidato_pedido, pedidos WHERE candidato='$oid' AND estado <> '10' AND pedido.oid = candidato_pedido.pedido AND pedido.estado IN ('10', '20', '30')";
|
||||
$bd = new BD();
|
||||
$pedidos = $bd->arrayQuery($consulta, "pedido");
|
||||
//Elimino al usuario de todas las candidaturas en las que no esté rechazado y el pedido esté pendiente, asignado o contratado.
|
||||
$consulta = "DELETE FROM candidato_pedido, pedidos WHERE candidato='$oid' AND estado <> '10' AND pedido.oid = candidato_pedido.pedido AND pedido.estado IN ('10', '20', '30')";
|
||||
|
||||
//Para cada candidatura en la que no esté rechazado compruebo si el sacarle
|
||||
//de ella supone un cambio en el pedido:
|
||||
foreach($pedidos as $idP){
|
||||
$pedido = new Pedido($idP);
|
||||
$estado = $pedido->getEstado("estado");
|
||||
//Si está asignado o contratado tiene que transitar a pendiente
|
||||
//(la transición se encarga ya de comprobar si cumple las precondiciones
|
||||
//de este cambio de estado)
|
||||
if(($estado == '20') || ($estado == '30')){
|
||||
$pedido->transita(10, "");
|
||||
}
|
||||
}
|
||||
//Para cada candidatura en la que no esté rechazado compruebo si el sacarle
|
||||
//de ella supone un cambio en el pedido:
|
||||
foreach ($pedidos as $idP) {
|
||||
$pedido = new Pedido($idP);
|
||||
$estado = $pedido->getEstado("estado");
|
||||
//Si está asignado o contratado tiene que transitar a pendiente
|
||||
//(la transición se encarga ya de comprobar si cumple las precondiciones
|
||||
//de este cambio de estado)
|
||||
if (($estado == '20') || ($estado == '30')) {
|
||||
$pedido->transita(10, "");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* No disponible a Disponible
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Editar el estado del candidato desde la vista.
|
||||
/**
|
||||
* No disponible a Disponible
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Editar el estado del candidato desde la vista.
|
||||
|
||||
POSTCONDICIONES:
|
||||
- Calcular la afinidad del candidato con todos los pedidos para que
|
||||
puedan aparecer en ellos como "Propuestos por el sistema".
|
||||
*/
|
||||
private function ejecutar2010(){
|
||||
$this->setCampos(array("estado" => "10"));
|
||||
$this->calculaAfinidad();
|
||||
return true;
|
||||
}
|
||||
POSTCONDICIONES:
|
||||
- Calcular la afinidad del candidato con todos los pedidos para que
|
||||
puedan aparecer en ellos como "Propuestos por el sistema".
|
||||
*/
|
||||
private function ejecutar2010() {
|
||||
$this->setCampos(array("estado" => "10"));
|
||||
$this->calculaAfinidad();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* En proceso a disponible
|
||||
* En proceso (entrevistado) a disponible
|
||||
SE LLEGA DESDE:
|
||||
- Rechazar a un candidato.
|
||||
- Poner un pedido en el que se encontraba como "No contratado".
|
||||
/**
|
||||
* En proceso a disponible
|
||||
* En proceso (entrevistado) a disponible
|
||||
SE LLEGA DESDE:
|
||||
- Rechazar a un candidato.
|
||||
- Poner un pedido en el que se encontraba como "No contratado".
|
||||
|
||||
PRECONDICIONES:
|
||||
- El usuario no se encuentra aceptado en ningún proceso de selección.
|
||||
PRECONDICIONES:
|
||||
- El usuario no se encuentra aceptado en ningún proceso de selección.
|
||||
|
||||
*/
|
||||
private function ejecutar3010(){
|
||||
$id = $this->getValor("oid");
|
||||
$bd = new BD();
|
||||
$consulta = "SELECT * FROM candidato_pedido WHERE candidato='.$id.' AND estado='20'";
|
||||
$res = $bd->numFilas(($consulta));
|
||||
//No se cambia si está en más procesos.
|
||||
if($res > 0){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
private function ejecutar3010() {
|
||||
$id = $this->getValor("oid");
|
||||
$bd = new BD();
|
||||
$consulta = "SELECT * FROM candidato_pedido WHERE candidato='.$id.' AND estado='20'";
|
||||
$res = $bd->numFilas(($consulta));
|
||||
//No se cambia si está en más procesos.
|
||||
if ($res > 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disponible a En proceso.
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Al aceptar a un candidato disponible en un proceso de selección.
|
||||
/**
|
||||
* Disponible a En proceso.
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Al aceptar a un candidato disponible en un proceso de selección.
|
||||
|
||||
EFECTOS:
|
||||
- Se envía un email a RRHH informando de que se ha aceptado en un proyecto a un
|
||||
candidato que no ha sido entrevistado.
|
||||
- Se cambia el estado del candidato de disponible a enproceso
|
||||
*/
|
||||
private function ejecutar1030(){
|
||||
//Enviar un mail a RRHH con los datos pidiendo incorporación.
|
||||
$nombre = $this->getValor("nombre")." ".$this->getValor("apellidos");
|
||||
$oid = $this->getValor("oid");
|
||||
$asunto = "Candidato aceptado por pedido no entrevistado";
|
||||
$direccion = constante("email");
|
||||
$path = "http://portal.selforsistemas.net";
|
||||
//$link = "<a href='".$path."/detalle_candidato.php?oid=".$oid."'>".$nombre."</a>";
|
||||
$email = "El candidato ".$nombre." no entrevistado ha sido aceptado para un pedido.";
|
||||
envia_correo($direccion, $asunto, $email);
|
||||
$this->setCampos(array("estado" => "30"));
|
||||
EFECTOS:
|
||||
- Se envía un email a RRHH informando de que se ha aceptado en un proyecto a un
|
||||
candidato que no ha sido entrevistado.
|
||||
- Se cambia el estado del candidato de disponible a enproceso
|
||||
*/
|
||||
private function ejecutar1030() {
|
||||
//Enviar un mail a RRHH con los datos pidiendo incorporación.
|
||||
$nombre = $this->getValor("nombre") . " " . $this->getValor("apellidos");
|
||||
$oid = $this->getValor("oid");
|
||||
$asunto = "Candidato aceptado por pedido no entrevistado";
|
||||
$direccion = constante("email");
|
||||
$path = "http://portal.selforsistemas.net";
|
||||
//$link = "<a href='".$path."/detalle_candidato.php?oid=".$oid."'>".$nombre."</a>";
|
||||
$email = "El candidato " . $nombre . " no entrevistado ha sido aceptado para un pedido.";
|
||||
envia_correo($direccion, $asunto, $email);
|
||||
$this->setCampos(array("estado" => "30"));
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Entrevistado a Incorporado
|
||||
* En proceso (entrevistado) a Incorporado *
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Editar el estado del candidato desde la vista.
|
||||
/**
|
||||
* Entrevistado a Incorporado
|
||||
* En proceso (entrevistado) a Incorporado *
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Editar el estado del candidato desde la vista.
|
||||
|
||||
PRECONDICIONES:
|
||||
- Ninguna.
|
||||
PRECONDICIONES:
|
||||
- Ninguna.
|
||||
|
||||
POSTCONDICIONES:
|
||||
- Cambia el tipo a "usuario" y desaparece de la lista de candidatos.
|
||||
- Se añade el campo "Fecha alta".
|
||||
- Se transita automáticamente a "Esperando proyecto".
|
||||
*/
|
||||
private function ejecutar5080($mensaje){
|
||||
$fecha = date(Y."-".m."-".d);
|
||||
$nombre = md5($this->getValor("nombre"));
|
||||
$this->setCampos(array("tipo" => "usuario", "estado" => "90", "password" => $nombre, "rol" => 6, "fecha_alta" => $fecha, "salario" => $mensaje));
|
||||
/*$this->setCampo("estado", "90");
|
||||
$this->setCampo("password", $nombre);
|
||||
$this->setCampo("rol", 6);
|
||||
$this->setCampo("fecha_alta", $fecha);
|
||||
$this->setCampo("salario", $mensaje);*/
|
||||
POSTCONDICIONES:
|
||||
- Cambia el tipo a "usuario" y desaparece de la lista de candidatos.
|
||||
- Se añade el campo "Fecha alta".
|
||||
- Se transita automáticamente a "Esperando proyecto".
|
||||
*/
|
||||
private function ejecutar5080($mensaje) {
|
||||
$fecha = date(Y . "-" . m . "-" . d);
|
||||
$nombre = md5($this->getValor("nombre"));
|
||||
$this->setCampos(array("tipo" => "usuario", "estado" => "90", "password" => $nombre, "rol" => 6, "fecha_alta" => $fecha, "salario" => $mensaje));
|
||||
/* $this->setCampo("estado", "90");
|
||||
$this->setCampo("password", $nombre);
|
||||
$this->setCampo("rol", 6);
|
||||
$this->setCampo("fecha_alta", $fecha);
|
||||
$this->setCampo("salario", $mensaje); */
|
||||
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Entrevistado a En proceso(entrevistado).
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Al aceptar a un candidato disponible en un proceso de selección.
|
||||
return false;
|
||||
}
|
||||
|
||||
EFECTOS:
|
||||
- Se cambia el estado del candidato de en proceso(entrevistado)
|
||||
*/
|
||||
/**
|
||||
* Entrevistado a En proceso(entrevistado).
|
||||
* Admin, RRHH
|
||||
SE LLEGA DESDE:
|
||||
- Al aceptar a un candidato disponible en un proceso de selección.
|
||||
|
||||
private function ejecutar5070(){
|
||||
$this->setCampos(array("estado" => "70"));
|
||||
$this->campos["estado_usuario"]="70";
|
||||
return true;
|
||||
}
|
||||
EFECTOS:
|
||||
- Se cambia el estado del candidato de en proceso(entrevistado)
|
||||
*/
|
||||
private function ejecutar5070() {
|
||||
$this->setCampos(array("estado" => "70"));
|
||||
$this->campos["estado_usuario"] = "70";
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@ -81,8 +81,34 @@
|
||||
echo '<a href="pedido.php?idPedido='.$_GET['idPedido'].'" class="menuOption" style="color:#000000">'.$this->locale['1077'].'</a>';
|
||||
}
|
||||
}
|
||||
if(in_array("nueva_oferta",$opcionesThis)){
|
||||
echo '<a href="addOferta.php" class="menuOption" style="color:#000000">'.'Nueva oferta'.'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function menuOfertas($usuario, $opciones){
|
||||
if(!is_array($opciones)){
|
||||
$opcionesThis = array();
|
||||
} else {
|
||||
$opcionesThis = $opciones;
|
||||
}
|
||||
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)){
|
||||
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>';
|
||||
}
|
||||
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['5103'].'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function menuCandidatos(){
|
||||
// Lista de candidatos
|
||||
echo '<a href="lista_candidatos.php" class="menuOption" style="color:#000000">'.$this->locale['801'].'</a>';
|
||||
@ -211,10 +237,15 @@
|
||||
if (!strcmp($opcion, "Gestión de candidatos")) {
|
||||
echo '<li><a title="'.$opcion.'" href="lista_candidatos.php">'.$opcion.'</a></li>';
|
||||
} elseif (!strcmp($opcion, "Mis datos")) {
|
||||
$PonerAlFinal = '<li><a title="'.$opcion.'" href="administracion_principal.php?rol='.$opcion.'">'.$opcion.'</a></li>';
|
||||
$PonerAlFinal .= '<li><a title="'.$opcion.'" href="administracion_principal.php?rol='.$opcion.'">'.$opcion.'</a></li>';
|
||||
} elseif (!strcmp($opcion, "Mantenimiento del sistema")) {
|
||||
$PonerAlFinal .= '<li><a title="'.$opcion.'" href="administracion_principal.php?rol='.$opcion.'">'.$opcion.'</a></li>';
|
||||
} elseif (!strcmp($opcion, "Solicitudes de oferta")) {
|
||||
// Ticket 640 -> Entrada automatica a la lista de solicitudes de oferta.
|
||||
echo '<li><a title="'.$opcion.'" href="lista_pedidos.php">'.$opcion.'</a></li>';
|
||||
} elseif (!strcmp($opcion, "Ofertas")) {
|
||||
// Ticket 647 -> Nueva entrada de menú para ver la lista de ofertas
|
||||
echo '<li><a title="'.$opcion.'" href="lista_ofertas.php">'.$opcion.'</a></li>';
|
||||
} else {
|
||||
echo '<li><a title="'.$opcion.'" href="administracion_principal.php?rol='.$opcion.'">'.$opcion.'</a></li>';
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Clase ListaCandidatos
|
||||
*
|
||||
@ -6,57 +7,100 @@
|
||||
*
|
||||
*/
|
||||
|
||||
include_once("ListaPersonas.php");
|
||||
include_once("ListaPersonas.php");
|
||||
|
||||
class ListaCandidatos extends ListaPersonas{
|
||||
class ListaCandidatos extends ListaPersonas {
|
||||
//Atributos:
|
||||
//Constructor:
|
||||
//Funciones:
|
||||
|
||||
//Atributos:
|
||||
/**
|
||||
* Crea una lista de candidatos.
|
||||
* @param usuario - dueño de la sesión.
|
||||
* @param orden - parámetros por los que ordenar la lista.
|
||||
* @param sql - consulta de búsqueda.
|
||||
*/
|
||||
function ListaCandidatos($usuario, $orden, $sql, $estado) {
|
||||
parent::ListaPersonas($usuario, $orden, $sql);
|
||||
$this->tipo = "candidato";
|
||||
$this->estado = $estado;
|
||||
}
|
||||
|
||||
//Constructor:
|
||||
/**
|
||||
* Devuelve la query de la consulta usada en la búsqueda para crear la lista.
|
||||
* @return una cadena de texto con la query.
|
||||
*/
|
||||
function getSQL() {
|
||||
return $this->sql;
|
||||
}
|
||||
|
||||
//Funciones:
|
||||
/**
|
||||
* Devuelve una lista de los posibles estados en los que se puede encontrar un candidato
|
||||
* como Key => value, donde key es el cod del estado y value es el nombre del estado.
|
||||
*/
|
||||
function getEstados() {
|
||||
$consulta = "SELECT cod, nombre FROM candidatos_estados WHERE tipo='candidato'";
|
||||
$bd = new BD();
|
||||
return $bd->keyValueQuery($consulta, "cod", "nombre");
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea una lista de candidatos.
|
||||
* @param usuario - dueño de la sesión.
|
||||
* @param orden - parámetros por los que ordenar la lista.
|
||||
* @param sql - consulta de búsqueda.
|
||||
*/
|
||||
function ListaCandidatos($usuario,$orden,$sql,$estado){
|
||||
parent::ListaPersonas($usuario, $orden, $sql);
|
||||
$this->tipo = "candidato";
|
||||
$this->estado=$estado;
|
||||
}
|
||||
/**
|
||||
* Inserta un nuevo candidato en la lista de candidatos.
|
||||
* @param campos - datos del candidato.
|
||||
*/
|
||||
function addCandidato($campos) {
|
||||
$campos["estado"] = 510;
|
||||
$id = parent::addPersona($campos);
|
||||
$candidato = new Candidato($this->usuario, $id);
|
||||
$mensaje = "Nuevo candidato";
|
||||
$candidato->actualizarHistorial($mensaje);
|
||||
return $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Devuelve la query de la consulta usada en la búsqueda para crear la lista.
|
||||
* @return una cadena de texto con la query.
|
||||
*/
|
||||
function getSQL(){
|
||||
return $this->sql;
|
||||
}
|
||||
/**
|
||||
* Devuelve los candidatos
|
||||
*/
|
||||
function getCandidatos() {
|
||||
$candidatos = array();
|
||||
|
||||
/**
|
||||
* Devuelve una lista de los posibles estados en los que se puede encontrar un candidato
|
||||
* como Key => value, donde key es el cod del estado y value es el nombre del estado.
|
||||
*/
|
||||
function getEstados(){
|
||||
$consulta = "SELECT cod, nombre FROM candidatos_estados WHERE tipo='candidato'";
|
||||
$bd = new BD();
|
||||
return $bd->keyValueQuery($consulta, "cod", "nombre");
|
||||
}
|
||||
if ($this->sql != "") {
|
||||
// metemos el estado si es > 0
|
||||
if ($this->estado > 0) {
|
||||
if (stripos($this->sql, "WHERE") > 0) {
|
||||
$sqlAntesWhere = substr($this->sql, 0, stripos($this->sql, "WHERE"));
|
||||
$sqlDespuesWhere = substr($this->sql, stripos($this->sql, "WHERE") + 5, strlen($this->sql));
|
||||
$sqlConEstado = "WHERE usuarios.estado='" . $this->estado . "' and ";
|
||||
$sqlNueva = $sqlAntesWhere . $sqlConEstado . $sqlDespuesWhere;
|
||||
} else {
|
||||
$sqlConEstado = "WHERE usuarios.estado='" . $this->estado . "' ";
|
||||
$sqlNueva = $this->sql . $sqlConEstado;
|
||||
}
|
||||
} else {
|
||||
$sqlNueva = $this->sql;
|
||||
}
|
||||
$consulta = $sqlNueva . " " . $this->order_by;
|
||||
} else {
|
||||
if ($this->estado > 0) {
|
||||
$consulta = "SELECT oid from usuarios WHERE tipo='" . $this->tipo . "' and estado='" . $this->estado . "'" . $this->orden;
|
||||
} else {
|
||||
$consulta = "SELECT oid from usuarios WHERE tipo='" . $this->tipo . "'" . $this->orden . "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$bd = new BD();
|
||||
$resultado = $bd->execQuery($consulta);
|
||||
|
||||
//Procesamos los candidatos.
|
||||
if (mysql_num_rows($resultado) != 0) {
|
||||
while ($rows = mysql_fetch_array($resultado)) {
|
||||
$p = new Candidato($this->usuario, $rows["oid"]);
|
||||
$candidatos[] = $p;
|
||||
}
|
||||
}
|
||||
return $candidatos;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserta un nuevo candidato en la lista de candidatos.
|
||||
* @param campos - datos del candidato.
|
||||
*/
|
||||
function addCandidato($campos){
|
||||
$campos["estado"] = 510;
|
||||
$id = parent::addPersona($campos);
|
||||
$candidato = new Candidato($this->usuario, $id);
|
||||
$mensaje = "Nuevo candidato";
|
||||
$candidato->actualizarHistorial($mensaje);
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
150
src/Objects/ListaOfertas.php
Normal file
150
src/Objects/ListaOfertas.php
Normal file
@ -0,0 +1,150 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Clase ListaOfertas
|
||||
*/
|
||||
|
||||
include_once("Objects/Oferta.php");
|
||||
|
||||
class ListaOfertas {
|
||||
|
||||
// Atributos:
|
||||
/* Una lista de pedidos. */
|
||||
private $ofertas = array();
|
||||
|
||||
/* Gestor dueño de la lista. */
|
||||
private $gestor;
|
||||
|
||||
/* Campos por los que ordenar la lista. */
|
||||
private $orden;
|
||||
|
||||
/* Condiciones para búsquedas. */
|
||||
private $condiciones;
|
||||
|
||||
// Constructor:
|
||||
/**
|
||||
* Crea una lista de ofertas.
|
||||
*
|
||||
* @param usuario $ - gestor dueño de la lista.
|
||||
* @param orden $ - parámetros por los que ordenar la lista.
|
||||
* @param sql $ - consulta de búsqueda.
|
||||
*/
|
||||
function ListaOfertas($usuario, $condiciones=array(), $orden=array()) {
|
||||
$this->gestor = $usuario;
|
||||
$this->orden = $orden;
|
||||
$this->condiciones = $condiciones;
|
||||
}
|
||||
|
||||
/**
|
||||
* Busca y devuelve todos los pedidos del usuario.
|
||||
*/
|
||||
function getOfertas() {
|
||||
// sacado de http://patrickallaert.blogspot.com/2007/09/building-dynamic-sql-queries-elegant.html
|
||||
|
||||
$consulta = "SELECT * FROM candidato_pedido";
|
||||
|
||||
if (count($this->condiciones)) {
|
||||
$consulta .= ' WHERE ' . implode(' AND ', $this->condiciones);
|
||||
}
|
||||
|
||||
if (count($this->orden)) {
|
||||
$consulta .= ' ORDER BY ' . implode(' , ', $this->orden);
|
||||
}
|
||||
|
||||
$bd = new BD();
|
||||
$resultado = $bd->execQuery($consulta);
|
||||
// Procesamos las ofertas.
|
||||
if (mysql_num_rows($resultado) == 0) {
|
||||
$this->ofertas = array();
|
||||
} else {
|
||||
while ($rows = mysql_fetch_array($resultado)) {
|
||||
$p = new Oferta($rows["oid"], $this->gestor);
|
||||
$this->ofertas[] = $p;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->ofertas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Devuelve una lista de los posibles estados en los que se puede encontrar un pedido
|
||||
* como Key => value, donde key es el cod del estado y value es el nombre del estado.
|
||||
*/
|
||||
function getEstadosOfertas() {
|
||||
$consulta = "SELECT cod, nombre FROM candidaturas_estados";
|
||||
$bd = new BD();
|
||||
return $bd->keyValueQuery($consulta, "cod", "nombre");
|
||||
}
|
||||
|
||||
/**
|
||||
* Busca una oferta en función de su identificador.
|
||||
*
|
||||
* @return el pedido, en caso de encontrarlo y null en
|
||||
* caso contrario.
|
||||
*/
|
||||
function buscarOferta($id) {
|
||||
$lista = $this->getOfertas();
|
||||
if ($lista) {
|
||||
foreach ($lista as $elem) {
|
||||
if ($elem->getValor("oid") == $id) {
|
||||
return $elem;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function addOferta($campos) {
|
||||
if (!$this->gestor->tieneRol(1) && !$this->gestor->tieneRol(3)) {
|
||||
$error = "El usuario no tiene permisos para crear ofertas.";
|
||||
throw new Exception($error);
|
||||
}
|
||||
// Calculamos el id
|
||||
$referencia = $this->calculaReferencia($campos["pedido"]);
|
||||
$inserto = "fecha, referencia";
|
||||
$fecha = "'" . date("Y-m-d") . "'";
|
||||
$valores = "$fecha, $referencia";
|
||||
// Procesamos los datos
|
||||
foreach ($campos as $key => $value) {
|
||||
$inserto .= ", $key";
|
||||
$valores .= ", '$value'";
|
||||
}
|
||||
// Insertamos en la BD
|
||||
$consulta = "INSERT INTO candidato_pedido ($inserto) VALUES ($valores)";
|
||||
|
||||
$bd = new BD();
|
||||
if (!$bd->execQuery($consulta)) {
|
||||
return "-1";
|
||||
} else {
|
||||
$id = mysql_insert_id();
|
||||
$p = new Oferta($id, $this->gestor);
|
||||
$mensaje = "Nueva oferta";
|
||||
$p->actualizarHistorial($mensaje);
|
||||
}
|
||||
return $id;
|
||||
}
|
||||
|
||||
function calculaReferencia($solicitud) {
|
||||
$bd = new BD();
|
||||
$consulta = "select referencia from candidato_pedido where pedido = '$solicitud' order by oid desc limit 1";
|
||||
|
||||
if ($resultado = $bd->execQuery($consulta)) {
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
echo "########################<br/>";
|
||||
print_r($rows);
|
||||
echo "########################<br/>";
|
||||
|
||||
$num = 1;
|
||||
if (!empty($rows[0])) {
|
||||
$num = substr($rows[0], strpos($rows[0], '/') + 1, strlen($rows[0]));
|
||||
$num += 1;
|
||||
}
|
||||
return sprintf('\'%s/%s\'', $solicitud, $num);
|
||||
} else {
|
||||
return sprintf('\'%s/%s\'', $solicitud, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -96,7 +96,7 @@ include_once("Objects/Pedido.php");
|
||||
if($estado > 0){
|
||||
$consulta = "SELECT * from pedidos WHERE estado='".$estado."'".$this->orden ;
|
||||
}else{
|
||||
$consulta = "SELECT * from pedidos WHERE estado IN (10, 20, 30) ".$this->orden."";
|
||||
$consulta = "SELECT * from pedidos ".$this->orden."";
|
||||
}
|
||||
}
|
||||
}else if($this->gestor->tieneRol(3)){
|
||||
@ -123,7 +123,7 @@ include_once("Objects/Pedido.php");
|
||||
if($estado > 0){
|
||||
$consulta = "SELECT * FROM pedidos WHERE gerente = '$id' AND estado='$estado'".$this->orden;
|
||||
}else{
|
||||
$consulta = "SELECT * FROM pedidos WHERE estado IN (10, 20, 30) AND gerente = '$id'".$this->orden;
|
||||
$consulta = "SELECT * FROM pedidos WHERE gerente = '$id'".$this->orden;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
@ -188,6 +188,7 @@ include_once("Objects/Pedido.php");
|
||||
|
||||
//Insertamos en la BD
|
||||
$consulta = "INSERT INTO pedidos ($inserto) VALUES ($valores)";
|
||||
|
||||
$bd = new BD();
|
||||
if(!$bd->execQuery($consulta)){
|
||||
return -1;
|
||||
|
||||
@ -154,7 +154,7 @@ include_once("Empleado.php");
|
||||
|
||||
//Insertamos en la BD
|
||||
$consulta = "INSERT INTO usuarios ($inserto) VALUES ($valores)";
|
||||
echo $consulta;
|
||||
|
||||
$bd = new BD();
|
||||
if(!$bd->execQuery($consulta)){
|
||||
$error = "Campos del candidato incorrectos. Por favor, avise al webmaster de este error.";
|
||||
|
||||
298
src/Objects/Oferta.php
Normal file
298
src/Objects/Oferta.php
Normal file
@ -0,0 +1,298 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Clase Oferta
|
||||
*/
|
||||
include_once("BD.php");
|
||||
include_once("Automata.php");
|
||||
include_once("ListaCandidatos.php");
|
||||
include_once("Candidato.php");
|
||||
|
||||
class Oferta {
|
||||
|
||||
// Atributos:
|
||||
/* Usuario que tiene activa la sesión. */
|
||||
private $usuario;
|
||||
protected $campos = array();
|
||||
|
||||
// Constructores:
|
||||
function Oferta($oid, $usuario) {
|
||||
$this->usuario = $usuario;
|
||||
$consulta = "SELECT oid FROM candidato_pedido WHERE oid = '$oid'";
|
||||
$bd = new BD();
|
||||
$num = $bd->numFilas($consulta);
|
||||
|
||||
if ($num > 0) {
|
||||
$this->campos['oid'] = $oid;
|
||||
} else {
|
||||
$error = "Oferta no encontrada.";
|
||||
throw new Exception($error);
|
||||
}
|
||||
}
|
||||
|
||||
function actualizarHistorial($mensaje) {
|
||||
$oid = $this->getValor("oid");
|
||||
$usuario = $this->usuario->getValor("nombre");
|
||||
$consulta = "INSERT INTO historial_oferta (oid_h, fecha_h, persona_h, texto_h) VALUES('$oid', now(), '$usuario', '$mensaje')";
|
||||
$bd = new BD();
|
||||
return $bd->execQuery($consulta);
|
||||
}
|
||||
|
||||
function getValor($nombre) {
|
||||
if (array_key_exists($nombre, $this->campos)) {
|
||||
// El campo ya lo habíamos recuperamos, lo mostramos
|
||||
return $this->campos[$nombre];
|
||||
} else {
|
||||
switch ($nombre) {
|
||||
case "nombre_estado":
|
||||
$idEstado = $this->getValor("estado");
|
||||
$idioma = $this->usuario->getValor("idioma");
|
||||
$consulta = "SELECT nombre FROM candidaturas_estados WHERE cod=\"" . $idEstado . "\" AND idioma=\"" . $idioma . "\"";
|
||||
break;
|
||||
|
||||
case "nombre_solicitud":
|
||||
$oidPedido = $this->getValor("pedido");
|
||||
$consulta = "SELECT nombre FROM pedidos WHERE oid=\"" . $oidPedido . "\"";
|
||||
break;
|
||||
|
||||
case "nombre_candidato":
|
||||
$oidCandidato = $this->getValor("candidato");
|
||||
$consulta = "SELECT concat(nombre, ' ', apellidos) FROM usuarios WHERE oid=\"" . $oidCandidato . "\"";
|
||||
break;
|
||||
|
||||
default: $consulta = "SELECT " . $nombre . " FROM candidato_pedido WHERE oid=\"" . $this->campos['oid'] . "\"";
|
||||
break;
|
||||
}
|
||||
// Lo insertamos para nosotros
|
||||
$bd = new BD();
|
||||
$valor = $bd->getCampo($consulta);
|
||||
// Lo insertamos para nosotros
|
||||
$arrayAct = array($nombre => $valor);
|
||||
$this->campos = $this->campos + $arrayAct;
|
||||
return $valor;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Acceso a los campos del pedido.
|
||||
*
|
||||
* @return los campos del pedido.
|
||||
*/
|
||||
function getCampos() {
|
||||
return $this->campos;
|
||||
}
|
||||
|
||||
function getSiguientes() {
|
||||
$estado = $this->getValor("estado");
|
||||
$idioma = $this->usuario->getValor("idioma");
|
||||
$rol = $this->usuario->getValor("rol");
|
||||
|
||||
$a = new Automata("candidaturas", $idioma, $rol);
|
||||
$siguientes = $a->getSiguientes($estado);
|
||||
return $siguientes;
|
||||
}
|
||||
|
||||
function transita($destino, $argumentos) {
|
||||
$origen = $this->getValor("estado");
|
||||
$idioma = $this->usuario->getValor("idioma");
|
||||
$rol = $this->usuario->getValor("rol");
|
||||
|
||||
$a = new Automata("candidaturas", $idioma, $rol);
|
||||
|
||||
$transita = $a->getTransicion($origen, $destino);
|
||||
|
||||
if (($transita == "") || !($transita >= 0)) {
|
||||
return false;
|
||||
} else {
|
||||
$res = $this->ejecutaTransicion($transita, $argumentos);
|
||||
if ($res) {
|
||||
$this->setAutomatico = true;
|
||||
$this->setCampo("msgEstado", $argumentos);
|
||||
$this->setCampo("estado", $destino);
|
||||
$this->setAutomatico = false;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
private function ejecutaTransicion($codigo, $argumentos) {
|
||||
// Si no hace nada al transitar salimos sin más.
|
||||
if ($codigo == 0)
|
||||
return true;
|
||||
$funcion = "ejecutar$codigo";
|
||||
$res = call_user_func(array("Oferta", $funcion), $argumentos);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* En configuración -> Configurada
|
||||
*/
|
||||
private function ejecutar110120() {
|
||||
// Comprobamos que haya un candidato asignado.
|
||||
$candidato = $this->getValor("candidato");
|
||||
if (!empty($candidato)) {
|
||||
return true;
|
||||
} else {
|
||||
$error = "No se puede cambiar de estado porque no hay ningún candidato asignado a esta oferta";
|
||||
throw new Exception($error);
|
||||
return false;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
function setCampo($nombre, $valor) {
|
||||
// PERMISOS:
|
||||
/*
|
||||
* Admin (1) - Todos
|
||||
* 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) {
|
||||
// Comprobamos multivaluado y casos especiales antes del cambio:
|
||||
$viejo = $this->getValorMulti($nombre, $viejo);
|
||||
$this->campos[$nombre] = $valor;
|
||||
$oid = $this->getValor("oid");
|
||||
$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);
|
||||
if ($viejo == "" && $valor != "") {
|
||||
$historial = "$nombre (de - a $valor)";
|
||||
} else {
|
||||
$historial = "$nombre (de $viejo a $valor)";
|
||||
}
|
||||
if ($nombre = "estado") {
|
||||
$this->actualizarHistorial($historial);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$error = "El usuario no tiene permisos para editar la solicitud de oferta.";
|
||||
throw new Exception($error);
|
||||
}
|
||||
}
|
||||
|
||||
private function getValorMulti($nombre, $antiguo) {
|
||||
switch ($nombre) {
|
||||
/* case "procedencia":
|
||||
$valor = nombre_procedencia($antiguo);
|
||||
break;
|
||||
case "estado":
|
||||
$valor = nombre_estado_pedido($antiguo);
|
||||
break;
|
||||
case "localidad":
|
||||
$valor = nombre_localidad($antiguo);
|
||||
break;
|
||||
case "perfil":
|
||||
$valor = nombre_perfil($antiguo);
|
||||
break;
|
||||
case "cliente":
|
||||
$valor = nombre_cliente($antiguo);
|
||||
break; */
|
||||
default:
|
||||
$valor = $antiguo;
|
||||
break;
|
||||
}
|
||||
return $valor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Devuelve una lista de candidatos disponibles para una oferta
|
||||
*/
|
||||
function getCandidatosDisponibles() {
|
||||
return $this->getCandidatos("540");
|
||||
}
|
||||
|
||||
/**
|
||||
* Devuelve una lista de candidatos de un estado dado
|
||||
*/
|
||||
private function getCandidatos($estado) {
|
||||
$lista = new ListaCandidatos($this->usuario, "", "", $estado);
|
||||
return $lista;
|
||||
}
|
||||
|
||||
function getHistorial() {
|
||||
$historial = "";
|
||||
$oid = $this->getValor("oid");
|
||||
|
||||
$consulta = "SELECT * FROM historial_oferta WHERE oid_h='$oid' ORDER BY fecha_h DESC";
|
||||
$bd = new BD();
|
||||
$resultado = $bd->execQuery($consulta);
|
||||
|
||||
while ($rows = mysql_fetch_array($resultado)) {
|
||||
$fecha = $rows["fecha_h"];
|
||||
$persona = $rows["persona_h"];
|
||||
$texto = $rows["texto_h"];
|
||||
$historial .= "[$fecha] $persona - $texto\n";
|
||||
}
|
||||
|
||||
return $historial;
|
||||
}
|
||||
|
||||
function quitarCandidato() {
|
||||
$idCand = $this->getValor("candidato");
|
||||
if (!empty($idCand)) {
|
||||
$candidato = new Candidato($this->usuario, $idCand);
|
||||
$estadoCand = $candidato->getValor("estado");
|
||||
|
||||
switch ($estadoCand) {
|
||||
case "560":
|
||||
$candidato->transita("540", "");
|
||||
$nombre_candidato = $candidato->getValor("nombre") . " " . $candidato->getValor("apellidos");
|
||||
$mensaje = "Eliminado el candidato ".$nombre_candidato;
|
||||
$this->actualizarHistorial($mensaje);
|
||||
|
||||
return true;
|
||||
break;
|
||||
|
||||
default:
|
||||
$error = "[quitarCandidato]. El candidato tiene un estado no permitido ('" . $estadoCand . "')";
|
||||
throw new Exception($error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function colocarCandidato($idCandidato) {
|
||||
$idCand = $this->getValor("candidato");
|
||||
if (!empty($idCand)) {
|
||||
if (!$this->quitarCandidato()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$candidato = new Candidato($this->usuario, $idCandidato);
|
||||
$estadoCand = $candidato->getValor("estado");
|
||||
|
||||
switch ($estadoCand) {
|
||||
case "540":
|
||||
if ($candidato->transita("560", "")) {
|
||||
$this->setCampo("candidato", $idCandidato);
|
||||
|
||||
$nombre_candidato = $candidato->getValor("nombre") . " " . $candidato->getValor("apellidos");
|
||||
$mensaje = "Asignado el candidato ".$nombre_candidato;
|
||||
$this->actualizarHistorial($mensaje);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
dbug("error");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$error = "El candidato tiene un estado no permitido ('" . $candidato->getValor("estado") . "')";
|
||||
throw new Exception($error);
|
||||
}
|
||||
echo dbug('print');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
133
src/addOferta.php
Normal file
133
src/addOferta.php
Normal file
@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
include("seguridad.php");
|
||||
include("functions.php");
|
||||
include_once("Objects/ListaOfertas.php");
|
||||
include_once("Objects/Oferta.php");
|
||||
include_once("Objects/HTML.php");
|
||||
|
||||
$html = new HTML($locale);
|
||||
|
||||
$errores = array();
|
||||
|
||||
// Todas las variables
|
||||
if (!empty($_POST)) {
|
||||
print_r($_POST);
|
||||
|
||||
$solicitud = "";
|
||||
if (!empty($_POST['solicitud'])) {
|
||||
$solicitud = $_POST['solicitud'][0];
|
||||
}
|
||||
|
||||
/*
|
||||
$nombre=$_POST['nombre'];
|
||||
$prioridad=$_POST['prioridad'];
|
||||
$empleados=$_POST['empleados'];
|
||||
$duracion=$_POST['duracion'];
|
||||
$clientes=$_POST['clientes'];
|
||||
$perfiles=$_POST['perfil'];
|
||||
$salario_min=$_POST['salario_min'];
|
||||
$salario_max=$_POST['salario_max'];
|
||||
$procedencia=$_POST['procedencia'];
|
||||
$tecnologias=$_POST['tecnologia'];
|
||||
$idiomas=$_POST['idiomas'];
|
||||
$provincias=$_POST['provincias']; */
|
||||
$observaciones = $_POST['observaciones'];
|
||||
/* $pesoTec=$_POST['pesoTec'];
|
||||
$pesoIdi=$_POST['pesoIdi'];
|
||||
$pesoPer=$_POST['pesoPer'];
|
||||
|
||||
|
||||
if($usuario->tieneRol("1")){
|
||||
$gerente=$_POST['gerente'];
|
||||
} else {
|
||||
$gerente=$usuario->getValor("oid");
|
||||
}
|
||||
*/
|
||||
if ($_POST['action'] == "add") {
|
||||
// Comprobamos campos obligatorios
|
||||
if (empty($solicitud)) {
|
||||
$errores[] = "1";
|
||||
}
|
||||
|
||||
// Si no hay errores insertamos el pedido
|
||||
if (count($errores) == 0) {
|
||||
$listaOfertas = new ListaOfertas($usuario, "", "", "0");
|
||||
$arrayInsert = array();
|
||||
$arrayInsert["pedido"] = $solicitud;
|
||||
$arrayInsert["obsGerente"] = $observaciones;
|
||||
$arrayInsert["estado"] = "110";
|
||||
|
||||
/* $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"]="110";
|
||||
$arrayInsert["pesoIdioma"]=$pesoIdi;
|
||||
$arrayInsert["pesoPerfil"]=$pesoPer;
|
||||
$arrayInsert["pesoTecno"]=$pesoTec; */
|
||||
|
||||
$idOferta = $listaOfertas->addOferta($arrayInsert);
|
||||
|
||||
if ($idOferta == "-1") {
|
||||
// Se he producido un fallo al insertar
|
||||
$errores[] = "0";
|
||||
$msg = "No se ha podido agregar la oferta";
|
||||
$tipo = "error";
|
||||
} else {
|
||||
$oferta = $listaOfertas->buscarOferta($idOferta);
|
||||
header("Location: oferta.php?idOferta=" . $idOferta . "&msg=1");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$referencia = "";
|
||||
$solicitud = "";
|
||||
$observaciones = "";
|
||||
}
|
||||
|
||||
include("html/cabecera.php");
|
||||
|
||||
echo $html->menuOfertas($usuario, "");
|
||||
|
||||
echo "<h2>" . $locale['5105'] . "</h2>";
|
||||
|
||||
if (isset($msg) && ($msg != "")) {
|
||||
echo "<div class=\"aviso " . $tipo . "\">" . $msg . "</div>";
|
||||
}
|
||||
|
||||
echo '<form method="POST" action="addOferta.php" name="form_registro" enctype="multipart/form-data">';
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"add\" />";
|
||||
echo "<table id=\"addOferta\">" .
|
||||
"<tr>" .
|
||||
" <td";
|
||||
if (in_array("1", $errores))
|
||||
echo " class=\"errorcampo\"";
|
||||
|
||||
echo ">" . $locale['1025'] . ":<br/>";
|
||||
|
||||
rellena_desplegable_pedidos_estado("solicitud", "130", array($solicitud));
|
||||
|
||||
echo " </td>";
|
||||
|
||||
echo "</td></tr>";
|
||||
echo "<tr>";
|
||||
|
||||
echo "</tr>";
|
||||
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>';
|
||||
// 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">';
|
||||
echo '<input type="reset" value="' . $locale['res'] . '" class="button"></td>';
|
||||
echo "</tr></table>";
|
||||
echo "</form>";
|
||||
include_once("html/pie.php");
|
||||
?>
|
||||
@ -84,7 +84,7 @@ if(!empty($_POST)) {
|
||||
$arrayInsert["salario_max"]=$salario_max;
|
||||
$arrayInsert["procedencia"]=$procedencia;
|
||||
$arrayInsert["observaciones"]=$observaciones;
|
||||
$arrayInsert["estado"]="10";
|
||||
$arrayInsert["estado"]="110";
|
||||
$arrayInsert["pesoIdioma"]=$pesoIdi;
|
||||
$arrayInsert["pesoPerfil"]=$pesoPer;
|
||||
$arrayInsert["pesoTecno"]=$pesoTec;
|
||||
@ -94,9 +94,8 @@ if(!empty($_POST)) {
|
||||
$errores[]= "0";
|
||||
$msg="No se ha podido agregar el pedido";
|
||||
$tipo="error";
|
||||
} else {
|
||||
} else {
|
||||
$pedido=$listaPedidos->buscarPedido($idPedido);
|
||||
print_r($perfiles);
|
||||
$pedido->addPerfiles($perfiles);
|
||||
$pedido->addTecnologias($tecnologias);
|
||||
$pedido->addIdiomas($idiomas);
|
||||
@ -172,7 +171,7 @@ echo "</td><td";
|
||||
if(in_array("5",$errores)) echo " class=\"errorcampo\"";
|
||||
echo ">".$locale['121']."<br/>";
|
||||
// Ticket #565 -> En una solicitud de oferta, se deben poder indicar varios perfiles técnicos
|
||||
echo $html->listaSelect("perfil","oid","id","perfil",array("",$locale['ns']),$tecnologias,true,true,"15");
|
||||
echo $html->listaSelect("perfil","oid","id","perfil",array("",$locale['ns']),$perfiles,true,true,"15");
|
||||
echo "</td><td>".$locale['132'].": ".$locale['2100'];
|
||||
|
||||
echo "</td></tr>";
|
||||
|
||||
@ -8,7 +8,7 @@ if(!$_SESSION["oid"]){
|
||||
//$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
|
||||
FROM usuarios U,pedidos P,candidato_pedido CP,candidaturas_estado CE
|
||||
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
|
||||
|
||||
@ -75,6 +75,6 @@ if ($link=conectar()){
|
||||
}
|
||||
}else {
|
||||
//si no existe le mando otra vez a la portada
|
||||
header("Location: index.php?errorusuario=si");
|
||||
// header("Location: index.php?errorusuario=si");
|
||||
}
|
||||
?>
|
||||
|
||||
@ -102,15 +102,30 @@ INSERT INTO `candidatos_estados` (`cod`, `idioma`, `nombre`, `tipo`) VALUES
|
||||
(523, 'sp', 'Rechazado 3', 'candidato'),
|
||||
(530, 'sp', 'No disponible', 'candidato'),
|
||||
(540, 'sp', 'Disponible sin asignar', 'candidato'),
|
||||
(550, 'sp', 'Disponible asignado a solicitud histórica', 'candidato'),
|
||||
(550, 'sp', 'Disponible asignado a solicitud cerrada', 'candidato'),
|
||||
(560, 'sp', 'Disponible asignado a solicitud abierta', 'candidato');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `candidaturas_transiciones` (
|
||||
`inicial` int(10) unsigned NOT NULL,
|
||||
`final` int(10) unsigned NOT NULL,
|
||||
`transicion` bigint(20) unsigned NOT NULL,
|
||||
`rol` text NOT NULL,
|
||||
PRIMARY KEY (`inicial`,`final`),
|
||||
KEY `final` (`final`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
ALTER TABLE `candidaturas_transiciones`
|
||||
ADD CONSTRAINT `candidaturas_transiciones_ibfk_1` FOREIGN KEY (`inicial`) REFERENCES `candidaturas_estado` (`cod`),
|
||||
ADD CONSTRAINT `candidaturas_transiciones_ibfk_2` FOREIGN KEY (`final`) REFERENCES `candidaturas_estado` (`cod`);
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `candidatos_transiciones`
|
||||
--
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `candidatos_transiciones` (
|
||||
`inicial` int(10) NOT NULL,
|
||||
`final` int(10) NOT NULL,
|
||||
@ -167,7 +182,8 @@ INSERT INTO `candidatos_transiciones` (`inicial`, `final`, `transicion`, `rol`)
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `candidato_pedido` (
|
||||
`oid` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`candidato` bigint(20) unsigned NOT NULL,
|
||||
`referencia` varchar(12) COLLATE latin1_spanish_ci NOT NULL,
|
||||
`candidato` bigint(20) unsigned,
|
||||
`pedido` varchar(8) COLLATE latin1_spanish_ci NOT NULL,
|
||||
`afinidad` float NOT NULL,
|
||||
`estado` int(10) unsigned NOT NULL,
|
||||
@ -190,10 +206,10 @@ CREATE TABLE IF NOT EXISTS `candidato_pedido` (
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `candidaturas_estado`
|
||||
-- Estructura de tabla para la tabla `candidaturas_estados`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `candidaturas_estado` (
|
||||
CREATE TABLE IF NOT EXISTS `candidaturas_estados` (
|
||||
`cod` int(10) unsigned NOT NULL,
|
||||
`idioma` varchar(3) COLLATE latin1_spanish_ci NOT NULL,
|
||||
`nombre` varchar(50) COLLATE latin1_spanish_ci NOT NULL,
|
||||
@ -201,10 +217,10 @@ CREATE TABLE IF NOT EXISTS `candidaturas_estado` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci;
|
||||
|
||||
--
|
||||
-- Volcar la base de datos para la tabla `candidaturas_estado`
|
||||
-- Volcar la base de datos para la tabla `candidaturas_estados`
|
||||
--
|
||||
|
||||
INSERT INTO `candidaturas_estado` (`cod`, `idioma`, `nombre`) VALUES
|
||||
INSERT INTO `candidaturas_estados` (`cod`, `idioma`, `nombre`) VALUES
|
||||
(10, 'sp', 'Descartado'),
|
||||
(20, 'sp', 'Aceptado'),
|
||||
(30, 'sp', 'En proceso'),
|
||||
@ -359,10 +375,6 @@ CREATE TABLE IF NOT EXISTS `historial_pedido` (
|
||||
KEY `oid_h` (`oid_h`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci;
|
||||
|
||||
--
|
||||
-- Volcar la base de datos para la tabla `historial_pedido`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -378,10 +390,22 @@ CREATE TABLE IF NOT EXISTS `historial_usuario` (
|
||||
KEY `oid_h` (`oid_h`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Volcar la base de datos para la tabla `historial_usuario`
|
||||
-- Estructura de tabla para la tabla `historial_oferta`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `historial_oferta` (
|
||||
`oid_h` bigint(20) unsigned NOT NULL,
|
||||
`fecha_h` varchar(20) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
|
||||
`persona_h` varchar(20) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
|
||||
`texto_h` text CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
|
||||
KEY `oid_h` (`oid_h`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -759,9 +783,9 @@ INSERT INTO `pedidos_transiciones` (`inicial`, `final`, `transicion`, `rol`) VAL
|
||||
(110, 120, 0, '1.3'),
|
||||
(110, 130, 110130, '1.3'),
|
||||
(120, 110, 0, '1.3'),
|
||||
(130, 110, 0, '1.3'),
|
||||
(130, 140, 0, ''),
|
||||
(140, 130, 0, '');
|
||||
(130, 110, 130110, '1.3'),
|
||||
(130, 140, 130140, ''),
|
||||
(140, 130, 140130, '');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -1469,7 +1493,7 @@ ALTER TABLE `candidatos_estados`
|
||||
ALTER TABLE `candidato_pedido`
|
||||
ADD CONSTRAINT `candidato_pedido_ibfk_1` FOREIGN KEY (`candidato`) REFERENCES `usuarios` (`oid`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
ADD CONSTRAINT `candidato_pedido_ibfk_2` FOREIGN KEY (`pedido`) REFERENCES `pedidos` (`oid`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
ADD CONSTRAINT `candidato_pedido_ibfk_3` FOREIGN KEY (`estado`) REFERENCES `candidaturas_estado` (`cod`) ON UPDATE CASCADE;
|
||||
ADD CONSTRAINT `candidato_pedido_ibfk_3` FOREIGN KEY (`estado`) REFERENCES `candidaturas_estados` (`cod`) ON UPDATE CASCADE;
|
||||
|
||||
--
|
||||
-- Filtros para la tabla `clientes`
|
||||
|
||||
@ -1,110 +1,131 @@
|
||||
<?php
|
||||
|
||||
/* Devuelve el nombre de un estado */
|
||||
function nombre_estado($oid){
|
||||
$consulta = "select nombre from candidatos_estados where cod='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["nombre"];
|
||||
function nombre_estado($oid)
|
||||
{
|
||||
$consulta = "select nombre from candidatos_estados where cod='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["nombre"];
|
||||
}
|
||||
|
||||
/* Devuelve el nombre de un estado de candidatura */
|
||||
function nombre_estado_candidatura($orden){
|
||||
$consulta = "select id from estado_candidatura where oid='$orden'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
function nombre_estado_candidatura($orden)
|
||||
{
|
||||
$consulta = "select id from estado_candidatura where oid='$orden'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
}
|
||||
|
||||
/* Devuelve el nombre de un estado de pedido */
|
||||
function nombre_estado_pedido($oid){
|
||||
$consulta = "select nombre from pedidos_estados where cod='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["nombre"];
|
||||
function nombre_estado_pedido($oid)
|
||||
{
|
||||
$consulta = "select nombre from pedidos_estados where cod='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["nombre"];
|
||||
}
|
||||
|
||||
function nombre_estado_oferta($oid)
|
||||
{
|
||||
$consulta = "select nombre from candidaturas_estados where cod='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["nombre"];
|
||||
}
|
||||
|
||||
/* Devuelve el nombre de una procedencia */
|
||||
function nombre_procedencia($id){
|
||||
$consulta = "select id from procedencia where num='$id'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
function nombre_procedencia($id)
|
||||
{
|
||||
$consulta = "select id from procedencia where num='$id'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
}
|
||||
|
||||
/* Devuelve el nombre de una procedencia */
|
||||
function nombre_procedencia_cv($id){
|
||||
$consulta = "select nombre from procedencia_cv where id='$id'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["nombre"];
|
||||
function nombre_procedencia_cv($id)
|
||||
{
|
||||
$consulta = "select nombre from procedencia_cv where id='$id'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["nombre"];
|
||||
}
|
||||
|
||||
/* Devuelve el nombre de una localidad */
|
||||
function nombre_localidad($oid){
|
||||
$consulta = "select id from localidades where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
function nombre_localidad($oid)
|
||||
{
|
||||
$consulta = "select id from localidades where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
}
|
||||
|
||||
/* Devuelve el nombre de una provincia */
|
||||
function nombre_provincia($oid){
|
||||
$consulta = "select id from provincias where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
function nombre_provincia($oid)
|
||||
{
|
||||
$consulta = "select id from provincias where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
}
|
||||
|
||||
/* Devuelve el nombre de un perfil */
|
||||
function nombre_perfil($oid){
|
||||
$consulta = "select id from perfil where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
function nombre_perfil($oid)
|
||||
{
|
||||
$consulta = "select id from perfil where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
}
|
||||
|
||||
/* Devuelve el nombre de un rol */
|
||||
function nombre_rol($oid){
|
||||
$consulta = "select id from rol where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
function nombre_rol($oid)
|
||||
{
|
||||
$consulta = "select id from rol where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
}
|
||||
|
||||
/* Devuelve el nombre de un cliente */
|
||||
function nombre_cliente($oid){
|
||||
$consulta = "select id from clientes where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
function nombre_cliente($oid)
|
||||
{
|
||||
$consulta = "select id from clientes where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["id"];
|
||||
}
|
||||
|
||||
/* Devuelve el perfil de un pedido */
|
||||
function perfil_pedido($oid){
|
||||
$consulta = "select perfil from pedidos where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["perfil"];
|
||||
function perfil_pedido($oid)
|
||||
{
|
||||
$consulta = "select perfil from pedidos where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["perfil"];
|
||||
}
|
||||
|
||||
/* Devuelve el nombre de un pedido */
|
||||
function nombre_pedido($oid){
|
||||
$consulta = "select nombre from pedidos where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["nombre"];
|
||||
function nombre_pedido($oid)
|
||||
{
|
||||
$consulta = "select nombre from pedidos where oid='$oid'";
|
||||
$resultado = mysql_query($consulta);
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["nombre"];
|
||||
}
|
||||
|
||||
/* Devuelve el nombre de un salario */
|
||||
function nombre_salario($id){
|
||||
$consulta = "SELECT nombre FROM salario WHERE id='$id'";
|
||||
if($resultado = mysql_query($consulta)){
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["nombre"];
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
function nombre_salario($id)
|
||||
{
|
||||
$consulta = "SELECT nombre FROM salario WHERE id='$id'";
|
||||
if ($resultado = mysql_query($consulta)) {
|
||||
$rows = mysql_fetch_array($resultado);
|
||||
return $rows["nombre"];
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -201,7 +201,7 @@ carpeta antiword en el ra
|
||||
|
||||
/* Devuelve la lista de currículums */
|
||||
function menu_curriculums($oid, $tipo){
|
||||
include LOCALE.LOCALESET."lenguaje.php";
|
||||
include_once LOCALE.LOCALESET."lenguaje.php";
|
||||
$consulta = "select * from curriculum_usuario where oid='$oid' order by fecha";
|
||||
$resultado = mysql_query($consulta);
|
||||
$num = @mysql_num_rows($resultado);
|
||||
@ -224,7 +224,7 @@ function menu_curriculums($oid, $tipo){
|
||||
|
||||
/* Muestra la lista de currículums */
|
||||
function ver_curriculums($oid, $tipo){
|
||||
include LOCALE.LOCALESET."lenguaje.php";
|
||||
include_once LOCALE.LOCALESET."lenguaje.php";
|
||||
$consulta = "select * from curriculum_usuario where oid='$oid' order by fecha";
|
||||
$resultado = mysql_query($consulta);
|
||||
$num = @mysql_num_rows($resultado);
|
||||
|
||||
@ -3,10 +3,45 @@
|
||||
ini_set("memory_limit", "32M");
|
||||
//require_once ('Excel/reader.php');
|
||||
|
||||
// Función para imprimir cosas
|
||||
// Sacado de http://php.net/manual/de/debugger.php
|
||||
// USO:
|
||||
// > dbug(<loquesea>);
|
||||
// > " "
|
||||
// > echo dbug('print');
|
||||
function dbug() {
|
||||
static $output = '', $doc_root;
|
||||
$args = func_get_args();
|
||||
if (!empty($args) && $args[0] === 'print') {
|
||||
$_output = $output;
|
||||
$output = '';
|
||||
return $_output;
|
||||
}
|
||||
// do not repeat the obvious (matter of taste)
|
||||
if (!isset($doc_root)) {
|
||||
$doc_root = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
|
||||
}
|
||||
$backtrace = debug_backtrace();
|
||||
// you may want not to htmlspecialchars here
|
||||
$line = htmlspecialchars($backtrace[0]['line']);
|
||||
$file = htmlspecialchars(str_replace(array('\\', $doc_root), array('/', ''), $backtrace[0]['file']));
|
||||
$class = !empty($backtrace[1]['class']) ? htmlspecialchars($backtrace[1]['class']) . '::' : '';
|
||||
$function = !empty($backtrace[1]['function']) ? htmlspecialchars($backtrace[1]['function']) . '() ' : '';
|
||||
$output .= "<b style='color: red;'>$class$function =>$file #$line</b><pre style='color: red;'>";
|
||||
ob_start();
|
||||
foreach ($args as $arg) {
|
||||
var_dump($arg);
|
||||
}
|
||||
$output .= htmlspecialchars(ob_get_contents(), ENT_COMPAT, 'UTF-8');
|
||||
ob_end_clean();
|
||||
$output .= '</pre>';
|
||||
}
|
||||
|
||||
|
||||
/* Conexión a la base de datos */
|
||||
function conectar()
|
||||
{
|
||||
include LOCALE.LOCALESET."lenguaje.php";
|
||||
include_once LOCALE.LOCALESET."lenguaje.php";
|
||||
if (!($puntero=mysql_connect("localhost","root","password")))
|
||||
{
|
||||
echo $locale['bd'];
|
||||
@ -24,8 +59,8 @@ function conectar()
|
||||
/* Conexión a la base de datos de tablas */
|
||||
function conectar_info()
|
||||
{
|
||||
include LOCALE.LOCALESET."lenguaje.php";
|
||||
if (!($puntero=mysql_connect("localhost","root","0selfor0")))
|
||||
include_once LOCALE.LOCALESET."lenguaje.php";
|
||||
if (!($puntero=mysql_connect("localhost","root","password")))
|
||||
{
|
||||
echo $locale['bd'];
|
||||
return false;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -294,7 +294,7 @@ $locale['283'] = "Selección solicitudes de oferta";
|
||||
$locale['284'] = "Editar";
|
||||
$locale['285'] = "Mostrar";
|
||||
$locale['286'] = "Nota: los campos marcados con * son obligatorios.";
|
||||
$locale['287'] = "Candidatos <br> asignados";
|
||||
$locale['287'] = "Número<br/>de ofertas";
|
||||
$locale['288'] = "Actualizar parte";
|
||||
$locale['289'] = "Solicitar vacaciones";
|
||||
$locale['290'] = "Se ha solicitado correctamente los días ";
|
||||
@ -1013,4 +1013,14 @@ $locale['4048'] = "Cualquier perfil técnico";
|
||||
$locale['5001'] = "Provincia no deseada:";
|
||||
$locale['5002'] = "Se ha eliminado la provincia no deseada correctamente";
|
||||
$locale['5003'] = "Estado";
|
||||
|
||||
$locale['5100'] = "Lista de ofertas";
|
||||
$locale['5101'] = "Nueva oferta";
|
||||
$locale['5102'] = "Buscar oferta";
|
||||
$locale['5103'] = "Ver oferta";
|
||||
$locale['5104'] = "Afinidad";
|
||||
$locale['5105'] = "Añadir nueva oferta";
|
||||
$locale['5106'] = "Referencia";
|
||||
$locale['5107'] = "Candidato";
|
||||
|
||||
?>
|
||||
|
||||
@ -139,6 +139,15 @@ function eliminaCapa(idCapa) {
|
||||
function mostrarCapa(idCapa){
|
||||
document.getElementById(idCapa).style.visibility="visible";
|
||||
}
|
||||
|
||||
function ocultarCapa(idCapa){
|
||||
document.getElementById(idCapa).style.visibility="hidden";
|
||||
}
|
||||
|
||||
|
||||
function cambiarCandidato(lugar) {
|
||||
var mensaje="Esta oferta ya tiene asignada un candidato. \xbfEst\xe1 seguro que desea sustituirlo?";
|
||||
if(confirm(mensaje)){
|
||||
document.location=lugar;
|
||||
}
|
||||
}
|
||||
41
src/lista_ofertas.php
Normal file
41
src/lista_ofertas.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
include("seguridad.php");
|
||||
include("functions.php");
|
||||
if (!$usuario->tieneRol("4") && !$usuario->tieneRol("1") && !$usuario->tieneRol("3")) {
|
||||
header("Location: aplicacion.php?e=permiso&rol=" . $usuario->getValor("rol"));
|
||||
exit;
|
||||
}
|
||||
include_once("html/cabecera.php");
|
||||
|
||||
/* LISTA_PROYECTOS.PHP */
|
||||
|
||||
$consulta = "";
|
||||
include_once("Objects/ListaOfertas.php");
|
||||
include_once("Objects/HTML.php");
|
||||
$html = new HTML($locale);
|
||||
|
||||
echo $html->menuOfertas($usuario, "");
|
||||
echo "<h2>" . "Lista de ofertas" . "</h2>";
|
||||
|
||||
$tipoOfertas = (!empty($_GET["byEstado"])) ? $_GET['byEstado'] : "";
|
||||
$order_by = (!empty($_GET['order'])) ? $_GET['order'] : "";
|
||||
$modo = (!empty($_GET['modo'])) ? $_GET["modo"] : "";
|
||||
|
||||
// sacado de http://patrickallaert.blogspot.com/2007/09/building-dynamic-sql-queries-elegant.html
|
||||
$cond = array();
|
||||
if ($tipoOfertas != "") {
|
||||
$cond[] = "estado = '$tipoOfertas'";
|
||||
}
|
||||
|
||||
$orden = array();
|
||||
if ($order_by != "") {
|
||||
$orden[] = $order_by.' '.$modo;
|
||||
}
|
||||
|
||||
$listaOfertas = new ListaOfertas($usuario, $cond, $orden);
|
||||
|
||||
include_once("ver_lista_ofertas.php");
|
||||
|
||||
include_once("html/pie.php");
|
||||
?>
|
||||
@ -30,7 +30,7 @@ if (isset($_GET["order"]) && ($_GET["order"]!="")) {
|
||||
|
||||
$modo = (isset($_GET["modo"])) ? stripinput($_GET["modo"]) : "";
|
||||
|
||||
$tipoPedidos = (isset($_GET["byEstado"]) && ($_GET['byEstado'] != "")) ? $_GET['byEstado'] : "10";
|
||||
$tipoPedidos = (isset($_GET["byEstado"]) && ($_GET['byEstado'] != "")) ? $_GET['byEstado'] : "0";
|
||||
|
||||
$listaPedidos=new ListaPedido($usuario,$order_by,"",$tipoPedidos);
|
||||
|
||||
|
||||
15
src/oferta.php
Normal file
15
src/oferta.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
include_once("seguridad.php");
|
||||
include("functions.php");
|
||||
|
||||
$idOferta = isset($_GET["idOferta"]) ? stripinput($_GET["idOferta"]) : "";
|
||||
$tabla = isset($_POST["tabla"]) ? stripinput($_POST["tabla"]) : "";
|
||||
$where = isset($_POST["where"]) ? stripinput($_POST["where"]) : "";
|
||||
$condicion = isset($_POST["condicion"]) ? stripinput($_POST["condicion"]) : "";
|
||||
|
||||
include_once("ver_oferta.php");
|
||||
|
||||
include_once("html/pie.php");
|
||||
|
||||
?>
|
||||
@ -4,9 +4,9 @@ include("seguridad.php");
|
||||
include("functions.php");
|
||||
|
||||
$idPedido = isset($_GET["idPedido"]) ? stripinput($_GET["idPedido"]) : "";
|
||||
if(!isset($tabla)) $tabla = stripinput($_POST["tabla"]);
|
||||
if(!isset($where)) $where = stripinput($_POST["where"]);
|
||||
if(!isset($condicion)) $condicion = stripinput($_POST["condicion"]);
|
||||
$tabla = isset($_POST["tabla"]) ? stripinput($_POST["tabla"]) : "";
|
||||
$where = isset($_POST["where"]) ? stripinput($_POST["where"]) : "";
|
||||
$condicion = isset($_POST["condicion"]) ? stripinput($_POST["condicion"]) : "";
|
||||
|
||||
include_once("ver_pedido.php");
|
||||
|
||||
|
||||
@ -6,7 +6,6 @@ ini_set("session.use_trans_sid","0");
|
||||
//iniciamos la sesión
|
||||
session_name("loginUsuario");
|
||||
include_once("Objects/Usuario.php");
|
||||
include_once("Objects/ListaPedido.php");
|
||||
include_once("Objects/Semaforo.php");
|
||||
session_start();
|
||||
//FICHERO DE IDIOMAS
|
||||
|
||||
155
src/ver_lista_ofertas.php
Normal file
155
src/ver_lista_ofertas.php
Normal file
@ -0,0 +1,155 @@
|
||||
<?php
|
||||
|
||||
include_once("seguridad.php");
|
||||
|
||||
/**
|
||||
* Muestra toda la lista de ofertas de $listaOfertas
|
||||
*/
|
||||
include("functions.php");
|
||||
|
||||
$destinoURL = substr($_SERVER['REQUEST_URI'], strripos($_SERVER['REQUEST_URI'], "/") + 1);
|
||||
if (stripos($destinoURL, "?") > 0) {
|
||||
$destinoURL = substr($destinoURL, 0, stripos($destinoURL, "?"));
|
||||
}
|
||||
// Comprobamos mensajes que pueden llegar hasta aqui
|
||||
if (isset($_GET['msg'])) {
|
||||
switch ($_GET['msg']) {
|
||||
case "1":$mensaje = "<div class=\"aviso ok\">" . $locale['1059'] . "</div>";
|
||||
break;
|
||||
case "2":$mensaje = "<div class=\"aviso error\">" . $locale['1060'] . "</div>";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isset($mensaje)) echo $mensaje;
|
||||
if (!isset($variablesExtra)) $variablesExtra = "";
|
||||
|
||||
?>
|
||||
<div style="float:left; padding-top:10px; border-top:1px solid #CCC; border-left:1px solid #CCC; border-right:1px solid #CCC;background-color:#F0F0F0">
|
||||
<ul id="tabnav">
|
||||
<li class="<?php if ($tipoOfertas == "") echo "activo";
|
||||
else echo "inactivo";
|
||||
?>"><a href="<?php echo $destinoURL . "?byEstado=0" . $variablesExtra; ?>"><?php echo $locale['1067']; ?></a></li>
|
||||
<li class="<?php if ($tipoOfertas == "110") echo "activo";
|
||||
else echo "inactivo";
|
||||
?>"><a href="<?php echo $destinoURL . "?byEstado=110" . $variablesExtra; ?>"><?php echo nombre_estado_oferta("110"); ?></a></li>
|
||||
<li class="<?php if ($tipoOfertas == "120") echo "activo";
|
||||
else echo "inactivo";
|
||||
?>"><a href="<?php echo $destinoURL . "?byEstado=120" . $variablesExtra; ?>"><?php echo nombre_estado_oferta("120"); ?></a></li>
|
||||
<li class="<?php if ($tipoOfertas == "130") echo "activo";
|
||||
else echo "inactivo";
|
||||
?>"><a href="<?php echo $destinoURL . "?byEstado=130" . $variablesExtra; ?>"><?php echo nombre_estado_oferta("130"); ?></a></li>
|
||||
<li class="<?php if ($tipoOfertas == "140") echo "activo";
|
||||
else echo "inactivo";
|
||||
?>"><a href="<?php echo $destinoURL . "?byEstado=140" . $variablesExtra; ?>"><?php echo nombre_estado_oferta("140"); ?></a></li>
|
||||
<li class="<?php if ($tipoOfertas == "150") echo "activo";
|
||||
else echo "inactivo";
|
||||
?>"><a href="<?php echo $destinoURL . "?byEstado=150" . $variablesExtra; ?>"><?php echo nombre_estado_oferta("150"); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="height: 35px; border-bottom:1px solid #CCC"></div>
|
||||
<div style="clear:both;"></div>
|
||||
<?php
|
||||
|
||||
echo '<div id="ContTabul">';
|
||||
// CABECERAS
|
||||
echo "<table width=\"100%\"> ";
|
||||
// Acciones
|
||||
echo "<tr class=\"encabezado\">";
|
||||
echo " <td align=\"center\" colspan=\"3\">" . $locale['2014'] . "</td>";
|
||||
// denominacion
|
||||
$orderView = "denominacion";
|
||||
echo " <td align=\"center\">" . $locale['1042'].":" . "<br />" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
||||
// Fecha
|
||||
$orderView = "fecha";
|
||||
echo " <td align=\"center\">" . $locale['1021'] . "<br />" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>" ;
|
||||
// estado
|
||||
$orderView = "estado";
|
||||
echo " <td align=\"center\">" . $locale['1102'] . "<br />" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
||||
// solicitud
|
||||
$orderView = "solicitud";
|
||||
echo " <td align=\"center\">" . $locale['278'].":" . "<br />" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
||||
// Cliente
|
||||
$orderView = "candidato";
|
||||
echo " <td align=\"center\">" . $locale['704'].":" . "<br />" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
||||
// Afinidad
|
||||
/*$orderView = "afinidad";
|
||||
echo " <td align=\"center\">" . $locale['5104'] . "<br />" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=asc" . $variablesExtra . "\" ><img src=\"css/asc.png\" /></a>" .
|
||||
" <a href=\"" . $destinoURL . "?byEstado=" . $tipoOfertas . "&order=" . $orderView . "&modo=desc" . $variablesExtra . "\" ><img src=\"css/desc.png\" /></a></td>";
|
||||
*/
|
||||
|
||||
echo "</tr>";
|
||||
// Vamos mostrando ofertas
|
||||
$listadeOfertas = $listaOfertas->getOfertas();
|
||||
|
||||
|
||||
$pagLista = "1";
|
||||
if (!empty($_GET['pagLista']) && ($_GET['pagLista'] > 0)) {
|
||||
$pagLista = $_GET['pagLista'];
|
||||
}
|
||||
|
||||
// Vemos si tiene ofertas
|
||||
if (count($listadeOfertas) == 0) {
|
||||
echo "<tr><td colspan=\"11\" align=\"center\">no hay ofertas</td></tr></table>";
|
||||
} else {
|
||||
$inicio = ($pagLista - 1) * constante("lista");
|
||||
if (count($listadeOfertas) > ($inicio + constante("lista"))) {
|
||||
$final = $inicio + constante("lista");
|
||||
} else {
|
||||
$final = count($listadeOfertas);
|
||||
}
|
||||
for ($i = $inicio;$i < $final;$i++) {
|
||||
// foreach($listadeOfertas as $ofertaAct){
|
||||
$ofertaAct = $listadeOfertas[$i];
|
||||
|
||||
echo "<tr>";
|
||||
if (($ofertaAct->getValor("gerente") == $usuario->getValor("oid")) || $usuario->tieneRol("1")) {
|
||||
// Es el gerente de ese pedido, puede editarlo y eliminarlo
|
||||
echo '<td align="center"><a href="gestion_pedido.php?idPedido=' . $ofertaAct->getValor("oid") . '"><img src="css/edit.png" title="' . $locale['2017'] . '"/></a></td>';
|
||||
echo "<td align=\"center\"><a href=\"#\" onclick=eliminarPedido('" . $ofertaAct->getValor("oid") . "') ><img src=\"css/eliminar.png\" title=\"" . $locale['2016'] . "\"/></a></td>";
|
||||
} else {
|
||||
// No es el gerente no puede ni editarlo ni eliminarlo
|
||||
echo '<td></td><td></td>';
|
||||
}
|
||||
echo '<td align="center"><a href="oferta.php?idOferta=' . $ofertaAct->getValor("oid") . '"><img src="css/brick_go.png" title="' . $locale['2015'] . '" /></a></td>';
|
||||
echo '<td align="center">' . $ofertaAct->getValor("referencia") . '</td>';
|
||||
echo '<td align="center">' . $ofertaAct->getValor("fecha") . '</td>';
|
||||
echo '<td align="center">' . $ofertaAct->getValor("nombre_estado") . '</td>';
|
||||
echo '<td align="center"><a href="/pedido.php?idPedido=' . $ofertaAct->getValor("pedido") . '">' . $ofertaAct->getValor("nombre_solicitud") . '</a></td>';
|
||||
echo '<td align="center"><a href="/detalle_candidato.php?oid=' . $ofertaAct->getValor("candidato") . '">' . $ofertaAct->getValor("nombre_candidato") . '</td>';
|
||||
//echo '<td align="center">' . $ofertaAct->getValor("afinidad") . '</td>';
|
||||
echo "</tr>";
|
||||
}
|
||||
// Comprobamos si tenemos que mostar una paginación
|
||||
$numPaginas = ceil(count($listadeOfertas) / constante("lista"));
|
||||
echo "<td colspan=\"11\"><div id=\"cronopaginacion\">";
|
||||
if (isset($_GET["order"]) && ($_GET["order"] != "")) {
|
||||
if ($variablesExtra != "") {
|
||||
$variablesExtra = "&" . $variablesExtra;
|
||||
}
|
||||
$variables = "byEstado=" . $tipoOfertas . "order=" . $_GET["order"] . "&modo=" . $_GET["modo"] . $variablesExtra;
|
||||
echo $html->paginacion($numPaginas, $pagLista, $destinoURL, $variables, "pagLista");
|
||||
} else {
|
||||
$variables = "byEstado=" . $tipoOfertas . $variablesExtra;
|
||||
echo $html->paginacion($numPaginas, $pagLista, $destinoURL, $variables, "pagLista");
|
||||
}
|
||||
|
||||
echo "</div></td></tr>";
|
||||
echo " </table> ";
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
||||
?>
|
||||
@ -33,9 +33,10 @@ if (!isset($variablesExtra)) $variablesExtra = "";
|
||||
<div style="float:left; padding-top:10px; border-top:1px solid #CCC; border-left:1px solid #CCC; border-right:1px solid #CCC;background-color:#F0F0F0">
|
||||
<ul id="tabnav">
|
||||
<li class="<?php if ($tipoPedidos=="0") echo "activo"; else echo "inactivo";?>"><a href="<?php echo $destinoURL."?byEstado=0".$variablesExtra; ?>"><?php echo $locale['1067']; ?></a></li>
|
||||
<li class="<?php if ($tipoPedidos=="10") echo "activo"; else echo "inactivo";?>"><a href="<?php echo $destinoURL."?byEstado=10".$variablesExtra; ?>"><?php echo nombre_estado_pedido("10"); ?></a></li>
|
||||
<li class="<?php if ($tipoPedidos=="20") echo "activo"; else echo "inactivo";?>"><a href="<?php echo $destinoURL."?byEstado=20".$variablesExtra; ?>"><?php echo nombre_estado_pedido("20"); ?></a></li>
|
||||
<li class="<?php if ($tipoPedidos=="30") echo "activo"; else echo "inactivo";?>"><a href="<?php echo $destinoURL."?byEstado=30".$variablesExtra; ?>"><?php echo nombre_estado_pedido("30"); ?></a></li>
|
||||
<li class="<?php if ($tipoPedidos=="110") echo "activo"; else echo "inactivo";?>"><a href="<?php echo $destinoURL."?byEstado=110".$variablesExtra; ?>"><?php echo nombre_estado_pedido("110"); ?></a></li>
|
||||
<li class="<?php if ($tipoPedidos=="120") echo "activo"; else echo "inactivo";?>"><a href="<?php echo $destinoURL."?byEstado=120".$variablesExtra; ?>"><?php echo nombre_estado_pedido("120"); ?></a></li>
|
||||
<li class="<?php if ($tipoPedidos=="130") echo "activo"; else echo "inactivo";?>"><a href="<?php echo $destinoURL."?byEstado=130".$variablesExtra; ?>"><?php echo nombre_estado_pedido("130"); ?></a></li>
|
||||
<li class="<?php if ($tipoPedidos=="140") echo "activo"; else echo "inactivo";?>"><a href="<?php echo $destinoURL."?byEstado=140".$variablesExtra; ?>"><?php echo nombre_estado_pedido("140"); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="float:left;padding-top:11px;">
|
||||
@ -113,24 +114,22 @@ echo " <td align=\"center\">".$locale['1524']."<br />" .
|
||||
" <a href=\"".$destinoURL."?byEstado=".$tipoPedidos."&order=".$orderView."&modo=asc".$variablesExtra."\" ><img src=\"css/asc.png\" /></a>" .
|
||||
" <a href=\"".$destinoURL."?byEstado=".$tipoPedidos."&order=".$orderView."&modo=desc".$variablesExtra."\" ><img src=\"css/desc.png\" /></a></td>";
|
||||
|
||||
// Número de personas
|
||||
// Número de ofertas
|
||||
$orderView="empleados";
|
||||
echo " <td align=\"center\">".$locale['1024']."<br />" .
|
||||
echo " <td align=\"center\">".$locale['287']."<br />" .
|
||||
" <a href=\"".$destinoURL."?byEstado=".$tipoPedidos."&order=".$orderView."&modo=asc".$variablesExtra."\" ><img src=\"css/asc.png\" /></a>" .
|
||||
" <a href=\"".$destinoURL."?byEstado=".$tipoPedidos."&order=".$orderView."&modo=desc".$variablesExtra."\" ><img src=\"css/desc.png\" /></a></td>";
|
||||
|
||||
// Candidatos asignados
|
||||
echo " <td align=\"center\">".$locale['287']."</td>";
|
||||
|
||||
echo "</tr>";
|
||||
|
||||
// Vamos mostrando petición por petición
|
||||
$listadePedidos=$listaPedidos->getPedidos();
|
||||
if($_GET['pagLista']>0){
|
||||
$pagLista=$_GET['pagLista'];
|
||||
}else{
|
||||
$pagLista="1";
|
||||
|
||||
$pagLista = "1";
|
||||
if (!empty($_GET['pagLista']) && ($_GET['pagLista'] > 0)) {
|
||||
$pagLista = $_GET['pagLista'];
|
||||
}
|
||||
|
||||
// Vemos si tiene pedidos
|
||||
if(count($listadePedidos)==0){
|
||||
echo "<tr><td colspan=\"11\" align=\"center\">no tiene solicitudes de oferta</td></tr></table>";
|
||||
@ -172,7 +171,6 @@ if(count($listadePedidos)==0){
|
||||
echo '</td>';
|
||||
|
||||
echo '<td align="center">'.$pedidoAct->getValor("empleados").'</td>';
|
||||
echo '<td align="center">'.$pedidoAct->dameNumCand("Aceptado").'</td>';
|
||||
echo "</tr>";
|
||||
}
|
||||
// Comprobamos si tenemos que mostar una paginación
|
||||
|
||||
271
src/ver_oferta.php
Normal file
271
src/ver_oferta.php
Normal file
@ -0,0 +1,271 @@
|
||||
<?php
|
||||
include_once("Objects/Oferta.php");
|
||||
include_once("seguridad.php");
|
||||
$usuario = $_SESSION['usuario'];
|
||||
|
||||
$oferta = new Oferta($idOferta, $usuario);
|
||||
|
||||
include_once("html/cabecera.php");
|
||||
include_once("Objects/Administracion.php");
|
||||
|
||||
$administracion = new Administracion($usuario, $locale);
|
||||
$constantes = $administracion->getItem("constantes");
|
||||
$mostrarTabla = $constantes['candPagina'];
|
||||
$altoScroll = 83 / 2 * $mostrarTabla;
|
||||
?>
|
||||
|
||||
<?php
|
||||
include_once("Objects/HTML.php");
|
||||
|
||||
$html = new HTML($locale);
|
||||
|
||||
// Comprogamos si hay error de semaforo activo
|
||||
if (isset($_GET["msgSem"]) && ($_GET["msgSem"] != "")) {
|
||||
$mensajeSemaforo = $semaforo->getMensaje($_GET["msgSem"]);
|
||||
echo "<div class=\"aviso semaforo\">" . $mensajeSemaforo . "</div>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$action = (isset($_GET['action']) && ($_GET['action'] != "")) ? $_GET['action'] : "";
|
||||
|
||||
if (!empty($action)) {
|
||||
$error = false;
|
||||
$mensaje = "";
|
||||
|
||||
switch ($action) {
|
||||
case "aceptar":
|
||||
if (!empty($_GET['idCand'])) {
|
||||
try {
|
||||
$idCand = $_GET['idCand'];
|
||||
$estado = $oferta->colocarCandidato($idCand);
|
||||
|
||||
if ($estado) {
|
||||
$tipo = "ok";
|
||||
$mensaje = "El candidato se ha asignado a la oferta";
|
||||
} else {
|
||||
$tipo = "error";
|
||||
$mensaje = "No se ha podido asignar el candidato a la oferta";
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$mensaje = $e->getMessage();
|
||||
$tipo = "error";
|
||||
}
|
||||
} else {
|
||||
$tipo = "error";
|
||||
$mensaje = $locale['1053'];
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case "cambEst": if (!empty($_GET['idEst'])) {
|
||||
$idEstado = $_GET['idEst'];
|
||||
try {
|
||||
$camb = $oferta->transita($idEstado, "");
|
||||
if ($camb) {
|
||||
$tipo = "ok";
|
||||
$mensaje = $locale['1072'];
|
||||
} else {
|
||||
$tipo = "error";
|
||||
$mensaje = $locale['1073'];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$mensaje = $e->getMessage();
|
||||
$tipo = "error";
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: $error = true;
|
||||
$mensaje = $locale['1057'];
|
||||
break;
|
||||
}
|
||||
if ($mensaje != "") {
|
||||
// Mostramos el mensaje
|
||||
echo "<div class=\"aviso " . $tipo . "\">" . $mensaje . "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (($oferta->getValor("estado") == 110) || ($oferta->getValor("estado") == 120)) {
|
||||
echo $html->menuOfertas($usuario, array(""));
|
||||
} else
|
||||
echo $html->menuOfertas($usuario, "gestionar");
|
||||
?>
|
||||
|
||||
<h2><?php echo $oferta->getValor("nombre"); ?></h2>
|
||||
|
||||
<?php
|
||||
// Comprobamos mensajes que pueden llegar hasta aqui
|
||||
if (isset($_GET["msg"])) {
|
||||
switch ($_GET['msg']) {
|
||||
case "1": $mensaje = "<div class=\"aviso ok\">" . $locale['1061'] . "</div>";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$mensaje = "";
|
||||
}
|
||||
echo $mensaje;
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<table width="100%">
|
||||
<tr><td>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="nombre"><?php echo $locale['5106']; ?></td>
|
||||
<td><?php echo $oferta->getValor("referencia"); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nombre"><?php echo $locale['1025']; ?></td>
|
||||
<td><?php echo $oferta->getValor("nombre_solicitud"); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nombre"><?php echo $locale['132']; ?></td>
|
||||
<td><?php echo $oferta->getValor("nombre_estado"); ?>
|
||||
<div id="obsCambioEst" class="obsCambioEst">
|
||||
<form id="formCambEst" action="oferta.php?idOferta=<?php echo $oferta->getValor("oid"); ?>&action=cambEstObs" method="post" >
|
||||
<input type="hidden" name="action" value="cambEstObs" />
|
||||
<input type="hidden" name="idEstado" id="idEstado" />
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
if ($oferta->getValor("msgEstado") != "") {
|
||||
echo " -> " . $oferta->getValor("msgEstado");
|
||||
}
|
||||
echo "<br />";
|
||||
$estadosSiguientes = $oferta->getSiguientes();
|
||||
foreach ($estadosSiguientes as $codEstado => $nombreEstado) {
|
||||
?>
|
||||
<input class="button" name="cambEstado" type="button" value="<?php echo $locale['2104'] . $nombreEstado; ?>"
|
||||
onClick="javascript:document.location='oferta.php?idOferta=<?php echo $oferta->getValor("oid"); ?>&action=cambEst&idEst=<?php echo $codEstado; ?>'"
|
||||
style="width:200px; margin-bottom:5px"><br />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nombre"><?php echo $locale['5107']; ?></td>
|
||||
<td><?php echo nl2br($oferta->getValor("nombre_candidato")); ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="nombre"><?php echo $locale['135']; ?></td>
|
||||
<td><?php echo nl2br($oferta->getValor("observaciones")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<?php
|
||||
if (($oferta->getValor("estado") == 110)) {
|
||||
?>
|
||||
<table width="100%">
|
||||
<?php
|
||||
$listaCandidatos = $oferta->getCandidatosDisponibles()->getCandidatos();
|
||||
if (!empty($listaCandidatos)) {
|
||||
?>
|
||||
<tr> <!-- Tabla de candidatos -->
|
||||
<td>
|
||||
<h3><span class="nombre">Candidatos disponibles</span></h3>
|
||||
<table width="100%" class="listaPropuestos">
|
||||
<thead>
|
||||
<tr class="nombre">
|
||||
<th><?php echo $locale['2014']; ?></th>
|
||||
<th><?php echo $locale['704']; ?></th>
|
||||
<th><?php echo $locale['202']; ?></th>
|
||||
<th><?php echo $locale['1052']; ?></th>
|
||||
<th><?php echo $locale['203']; ?></th>
|
||||
<th><?php echo $locale['206']; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
echo "<tbody>";
|
||||
$final = count($listaCandidatos);
|
||||
for ($i = 0; $i < $final; $i++) {
|
||||
$candidato = $listaCandidatos[$i];
|
||||
?>
|
||||
<tr>
|
||||
<td class="centrado">
|
||||
<?php
|
||||
$candActual = $oferta->getValor("candidato");
|
||||
if (!empty($candActual)) {
|
||||
echo "<a href=\"#\" onclick=\"cambiarCandidato('oferta.php?idOferta=".$oferta->getValor("oid")."&action=aceptar&idCand=".$candidato->getValor("oid")."')\">";
|
||||
}
|
||||
else {
|
||||
echo "<a href='oferta.php?idOferta=".$oferta->getValor("oid")."&action=aceptar&idCand=".$candidato->getValor("oid")."'>";
|
||||
}
|
||||
?>
|
||||
<img src='css/accept.png' title="<?php echo $locale['1047']; ?>" />
|
||||
</a>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="detalle_persona.php?oid=<?php echo $candidato->getValor("oid"); ?>" target=popup onclick=window.open('', 'popup', ',',',',',',',','width = 600, height = 800')><?php echo $candidato->getValor("nombre") . " " . $candidato->getValor("apellidos"); ?></a>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$perfiles = $candidato->getPerfiles();
|
||||
$keylocalidades = array_values($perfiles);
|
||||
// Mostramos la lista para borrar
|
||||
foreach ($perfiles as $nombre => $valor) {
|
||||
echo "- " . $nombre . "<br />";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $candidato->getValor("nombre_estado"); ?></td>
|
||||
<td><?php
|
||||
$tecnologias = rellena_lista_oid("tecnologia_usuario", "tecnologia", "tecnologia", $candidato->getValor("oid"));
|
||||
if (gettype($tecnologias) != "NULL") {
|
||||
foreach ($tecnologias as $tecno) {
|
||||
echo $tecno . ",";
|
||||
}
|
||||
}
|
||||
?></td>
|
||||
<td> <?php
|
||||
$idiomas = rellena_lista_oid("idioma_usuario", "idiomas", "idioma", $candidato->getValor("oid"));
|
||||
if (gettype($idiomas) != "NULL") {
|
||||
foreach ($idiomas as $tecno) {
|
||||
echo $tecno . ",";
|
||||
}
|
||||
}
|
||||
?></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
} // for
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="cronopaginacion"><?php echo $html->paginacion($numPaginas, $pagAcept, "pedido.php", "idPedido=" . $oferta->getValor("oid"), "pagAcept"); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
} // if
|
||||
?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<tr align="center"> <!-- HISTORIAL -->
|
||||
<td ><a name="historial"><?php echo $locale['127']; ?></a><br />
|
||||
<textarea name="historial" readonly rows="8" cols="90" maxlength="300" style="overflow: auto;width:100%"><?php echo $oferta->getHistorial(); ?></textarea>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<?php include_once("html/pie.php"); ?>
|
||||
1044
src/ver_pedido.php
1044
src/ver_pedido.php
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user