Al subir el fichero de CV de un candidato, indicar si es un CV comercial o interno
git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk@136 e2b1556b-49f8-d141-9351-52d6861a72d9
This commit is contained in:
parent
1b46718a76
commit
9626ad3d8d
@ -147,7 +147,7 @@ return $resultado;
|
||||
return $bd->getCampo($consulta);
|
||||
}
|
||||
|
||||
function addCurriculum($fichero) {
|
||||
function addCurriculum($fichero, $tipo) {
|
||||
//PERMISOS:
|
||||
/*
|
||||
* Admin (1) - Todos
|
||||
@ -156,7 +156,7 @@ return $resultado;
|
||||
*/
|
||||
$sesion = $this->usuario->getValor("oid");
|
||||
if ($this->usuario->tieneRol(3) || $this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)) {
|
||||
return parent::addCurriculum($fichero, $this->usuario->getValor("nombre"));
|
||||
return parent::addCurriculum($fichero, $tipo, $this->usuario->getValor("nombre"));
|
||||
} else {
|
||||
$error = "El usuario no tiene permisos para asociar CV al candidato.";
|
||||
throw new Exception($error);
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
function addCurriculum($fichero){
|
||||
function addCurriculum($fichero, $tipo){
|
||||
//PERMISOS:
|
||||
/*
|
||||
* Admin (1) - Todos
|
||||
@ -82,7 +82,7 @@
|
||||
*/
|
||||
$sesion = $this->usuario->getValor("oid");
|
||||
if($this->usuario->tieneRol(3) || $this->usuario->tieneRol(1) || $this->usuario->tieneRol(4)){
|
||||
return parent::addCurriculum($fichero, $this->usuario->getValor("nombre"));
|
||||
return parent::addCurriculum($fichero, $tipo, $this->usuario->getValor("nombre"));
|
||||
}else{
|
||||
$error = "El usuario no tiene permisos para asociar CV al empleado.";
|
||||
throw new Exception($error);
|
||||
|
||||
@ -692,11 +692,12 @@
|
||||
/**
|
||||
* A<EFBFBD>ade un nuevo curr<EFBFBD>culum a la persona.
|
||||
*/
|
||||
protected function addCurriculum($archivo, $usuario){
|
||||
protected function addCurriculum($archivo, $tipo, $usuario){
|
||||
$cv = $this->getValor("cv") + 1;
|
||||
$oid = $this->getValor("oid");
|
||||
|
||||
$nombre_archivo = $oid."-".$cv;
|
||||
$tipo_curriculum = $tipo;
|
||||
|
||||
$directorio = constante("srcDocs").SLASH."cv".SLASH;
|
||||
if (!@file_exists($directorio)){
|
||||
@ -717,7 +718,7 @@
|
||||
|
||||
if($fichero_subido){
|
||||
$bd = new BD();
|
||||
$consulta = "INSERT INTO curriculum_usuario (oid, curriculum, fecha) values ('".$oid."', '".$nombre_ruta_tabla."', now())";
|
||||
$consulta = "INSERT INTO curriculum_usuario (oid, curriculum, fecha, tipo_curriculum) values ('".$oid."', '".$nombre_ruta_tabla."', now(), ".$tipo_curriculum.")";
|
||||
$bd->execQuery($consulta);
|
||||
//$this->actualizarHistorial("Nuevo CV", $usuario);
|
||||
$consulta = "update usuarios set cv=cv+1 where oid='$oid'";
|
||||
|
||||
@ -99,7 +99,7 @@ if(stripinput($_POST['action'])=="add"){
|
||||
|
||||
|
||||
$candidatoNew->addPerfiles($_POST['perfil']);
|
||||
$candidatoNew->addCurriculum($_FILES['userfile']);
|
||||
$candidatoNew->addCurriculum($_FILES['userfile'], $_POST['tipo_curriculum']);
|
||||
//Subimos la foto
|
||||
uploadImagenCandidato($idCandidatoNew, 250, 250, 150, 150);
|
||||
|
||||
@ -386,12 +386,12 @@ echo '<div class="encabezado">'.$locale['1549'].'</div>';
|
||||
echo '<table align="center" width="100%">';
|
||||
echo '<tr><td colspan="6">';
|
||||
menu_curriculums($_GET['oid'], "candidato");
|
||||
echo '</td></tr><tr>';
|
||||
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000"><td colspan="6" textalign="right">'.$locale['125'].'<br>';
|
||||
echo '<input name="userfile" type="file">';
|
||||
echo '<input value="Subir" type="submit">';
|
||||
echo '</td></tr><td colspan="6" textalign="right">';
|
||||
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000">'.$locale['125'].' ';
|
||||
echo '<input name="userfile" type="file"> '.$locale['00208']. ' ';
|
||||
rellena_desplegable_select_oidCol("tipo_curriculum","oid","tipo","tipo_curriculum","","0");
|
||||
echo ' <input value="Subir" type="submit">';
|
||||
echo '</td></tr></table>';
|
||||
echo '<input type="submit" value="'.$locale['802'].'" class="button">';
|
||||
|
||||
echo "</form>";
|
||||
include_once("html/pie.php");
|
||||
|
||||
@ -79,7 +79,7 @@ if(stripinput($_POST['action'])=="add"){
|
||||
}
|
||||
$empleadoNew->addProvinciasDeseadas($_POST['provincia_deseada']);
|
||||
$empleadoNew->addPerfiles($_POST['perfil']);
|
||||
$empleadoNew->addCurriculum($_FILES['userfile']);
|
||||
$empleadoNew->addCurriculum($_FILES['userfile'], $_POST['tipo_curriculum']);
|
||||
header("Location: detalle_empleado.php?oid=".$idEmpleadoNew);
|
||||
} else {
|
||||
$tipomsg="error";
|
||||
@ -251,10 +251,11 @@ echo $html->listaSelect("titulaciones","oid","id","titulaciones",array("",$local
|
||||
</tr>';
|
||||
echo '<tr><td colspan="6">';
|
||||
menu_curriculums($_GET['oid'], "candidato");
|
||||
echo '</td></tr><tr>';
|
||||
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000">
|
||||
<td colspan="6" textalign="right">'.$locale['125'].'<br>';
|
||||
echo '<input name="userfile" type="file">';
|
||||
echo '</td></tr><td colspan="6" textalign="right">';
|
||||
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000">'.$locale['125'].' ';
|
||||
echo '<input name="userfile" type="file"> '.$locale['00208']. ' ';
|
||||
rellena_desplegable_select_oidCol("tipo_curriculum","oid","tipo","tipo_curriculum","","0");
|
||||
echo ' <input value="Subir" type="submit">';
|
||||
echo '</td></tr></table>';
|
||||
|
||||
echo '</table>';
|
||||
|
||||
@ -63,6 +63,21 @@ CREATE TABLE IF NOT EXISTS `alarmas` (
|
||||
-- Volcar la base de datos para la tabla `alarmas`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Estructura de tabla para la tabla `tipo_curriculum`
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS `tipo_curriculum` (
|
||||
`oid` int(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`tipo` varchar(20) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
|
||||
PRIMARY KEY (`oid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3;
|
||||
--
|
||||
|
||||
INSERT INTO `tipo_curriculum` (`oid`, `tipo`) VALUES
|
||||
('0','interno'),
|
||||
('1', 'comercial');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -391,6 +406,7 @@ CREATE TABLE IF NOT EXISTS `curriculum_usuario` (
|
||||
`oid` bigint(20) unsigned NOT NULL,
|
||||
`curriculum` varchar(100) NOT NULL,
|
||||
`fecha` date NOT NULL,
|
||||
`tipo_curriculum` int(11),
|
||||
PRIMARY KEY (`cod`,`oid`,`curriculum`),
|
||||
KEY `oid` (`oid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=379 ;
|
||||
|
||||
@ -310,7 +310,7 @@ if (in_array("curriculum", $mostrarDetalle)) { ?>
|
||||
<tr align="center">
|
||||
<td colspan="3" width="100%">
|
||||
<?php if (in_array("addCurriculum", $mostrarDetalle)) {
|
||||
$persona->addCurriculum($_FILES['userfile']);
|
||||
$persona->addCurriculum($_FILES['userfile'], $_POST['tipo_curriculum']);
|
||||
} ?>
|
||||
<?php echo ver_curriculums($persona->getValor("oid"), $tipo); ?>
|
||||
</td>
|
||||
@ -320,9 +320,10 @@ if (in_array("curriculum", $mostrarDetalle)) { ?>
|
||||
<tr>
|
||||
<form action="<?php echo $destinoURL; ?>?oid=<?php echo $persona->getValor("oid") ?>" method="POST" enctype="multipart/form-data">
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="10000000">
|
||||
<td colspan="6" textalign="right"><?php echo $locale['125']; ?><br>
|
||||
<input name="userfile" type="file">
|
||||
<input value="Subir" type="submit">
|
||||
<td colspan="6" textalign="right"><?php echo $locale['125']; ?> <br>
|
||||
<input name="userfile" type="file"> <?php echo $locale['00208']. ' '?>
|
||||
<?php rellena_desplegable_select_oidCol("tipo_curriculum","oid","tipo","tipo_curriculum","","0"); ?>
|
||||
<input value="Subir" type="submit">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -202,17 +202,22 @@ carpeta antiword en el ra
|
||||
/* Devuelve la lista de currículums */
|
||||
function menu_curriculums($oid, $tipo){
|
||||
include LOCALE.LOCALESET."lenguaje.php";
|
||||
$consulta = "select * from curriculum_usuario where oid='$oid' order by fecha";
|
||||
$consulta = "SELECT curriculum_usuario.cod, curriculum_usuario.oid, curriculum_usuario.curriculum, curriculum_usuario.fecha, curriculum_usuario.tipo_curriculum, tipo_curriculum.tipo as descripcion_tipo
|
||||
FROM curriculum_usuario
|
||||
left join tipo_curriculum on (tipo_curriculum.oid = curriculum_usuario.tipo_curriculum)
|
||||
where curriculum_usuario.oid='$oid' order by curriculum_usuario.fecha";
|
||||
|
||||
$resultado = mysql_query($consulta);
|
||||
$num = @mysql_num_rows($resultado);
|
||||
|
||||
if($num > 0){
|
||||
echo "<table width='100%'>";
|
||||
echo "<tr class='encabezado'><td>FECHA</td><td>CURRÍCULUM</td><td>ELIMINAR</td></tr>";
|
||||
echo "<tr class='encabezado'><td>FECHA</td><td>CURRÍCULUM</td><td>TIPO</td><td>ELIMINAR</td></tr>";
|
||||
while($rows = @mysql_fetch_array($resultado)){
|
||||
$ruta = $rows["curriculum"];
|
||||
$fecha = $rows["fecha"];
|
||||
echo "<tr><td>$fecha</td><td><a href='descargas.php?tipo=cv&cod=".$rows['cod']."' target=popup onclick=window.open('', 'popup', 'width = 200, height = 100')>".$rows['curriculum']."</a></td><td>
|
||||
$descripcion_tipo = $rows["descripcion_tipo"];
|
||||
echo "<tr><td>$fecha</td><td><a href='descargas.php?tipo=cv&cod=".$rows['cod']."' target=popup onclick=window.open('', 'popup', 'width = 200, height = 100')>".$rows['curriculum']."</a></td><td>".$descripcion_tipo."</td><td>
|
||||
<a href='borrar_curriculum.php?oid=$oid&tipo=$tipo&fecha=$fecha&curriculum=$ruta'>
|
||||
<img src='css/eliminar.png'/></a></td></tr>";
|
||||
}
|
||||
@ -225,17 +230,21 @@ function menu_curriculums($oid, $tipo){
|
||||
/* Muestra la lista de currículums */
|
||||
function ver_curriculums($oid, $tipo){
|
||||
include LOCALE.LOCALESET."lenguaje.php";
|
||||
$consulta = "select * from curriculum_usuario where oid='$oid' order by fecha";
|
||||
$consulta = "SELECT curriculum_usuario.cod, curriculum_usuario.oid, curriculum_usuario.curriculum, curriculum_usuario.fecha, curriculum_usuario.tipo_curriculum, tipo_curriculum.tipo as descripcion_tipo
|
||||
FROM curriculum_usuario
|
||||
left join tipo_curriculum on (tipo_curriculum.oid = curriculum_usuario.tipo_curriculum)
|
||||
where curriculum_usuario.oid='$oid' order by curriculum_usuario.fecha";
|
||||
$resultado = mysql_query($consulta);
|
||||
$num = @mysql_num_rows($resultado);
|
||||
|
||||
if($num > 0){
|
||||
echo "<table width='100%'>";
|
||||
echo "<tr class='encabezado'><td>FECHA</td><td>CURRÍCULUM</td></tr>";
|
||||
echo "<tr class='encabezado'><td>FECHA</td><td>CURRÍCULUM</td><td>TIPO</td></tr>";
|
||||
while($rows = @mysql_fetch_array($resultado)){
|
||||
$ruta = $rows["curriculum"];
|
||||
$fecha = $rows["fecha"];
|
||||
echo "<tr><td>$fecha</td><td><a href='descargas.php?tipo=cv&cod=".$rows['cod']."' target=popup onclick=window.open('', 'popup', 'width = 200, height = 100')>".$rows["curriculum"]."</a></td></tr>";
|
||||
$descripcion_tipo = $rows["descripcion_tipo"];
|
||||
echo "<tr><td>$fecha</td><td><a href='descargas.php?tipo=cv&cod=".$rows['cod']."' target=popup onclick=window.open('', 'popup', 'width = 200, height = 100')>".$rows["curriculum"]."</a></td><td>".$descripcion_tipo."</td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}else{
|
||||
|
||||
@ -134,7 +134,7 @@ switch ($action) {
|
||||
$candidato->addProvinciasNoDeseadas($_POST['provincias_no_deseadas']);
|
||||
|
||||
$candidato->addPerfiles($_POST['perfil']);
|
||||
$candidato->addCurriculum($_FILES['userfile']);
|
||||
$candidato->addCurriculum($_FILES['userfile'], $_POST['tipo_curriculum']);
|
||||
//Subimos la foto
|
||||
uploadImagenCandidato($_GET ['oid'], 250, 250, 150, 150);
|
||||
|
||||
@ -474,10 +474,11 @@ echo '<div class="encabezado">'.$locale['1549'].'</div>';
|
||||
echo '<table align="center" width="100%">';
|
||||
echo '<tr><td colspan="6">';
|
||||
menu_curriculums($_GET['oid'], "candidato");
|
||||
echo '</td></tr><tr>';
|
||||
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000"><td colspan="6" textalign="right">'.$locale['125'].'<br>';
|
||||
echo '<input name="userfile" type="file">';
|
||||
echo '<input value="Subir" type="submit">';
|
||||
echo '</td></tr><td colspan="6" textalign="right">';
|
||||
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000">'.$locale['125'].' ';
|
||||
echo '<input name="userfile" type="file"> '.$locale['00208']. ' ';
|
||||
rellena_desplegable_select_oidCol("tipo_curriculum","oid","tipo","tipo_curriculum","","0");
|
||||
echo ' <input value="Subir" type="submit">';
|
||||
echo '</td></tr></table>';
|
||||
|
||||
echo '<input type="submit" value="'.$locale['1580'].'" class="button">';
|
||||
|
||||
@ -106,7 +106,7 @@ switch ($action) {
|
||||
}
|
||||
$candidato->addProvinciasDeseadas($_POST['provincia_deseada']);
|
||||
$candidato->addPerfiles($_POST['perfil']);
|
||||
$candidato->addCurriculum($_FILES['userfile']);
|
||||
$candidato->addCurriculum($_FILES['userfile'], $_POST['tipo_curriculum']);
|
||||
$mensaje=$locale['1591'];
|
||||
$tipomsg="ok";
|
||||
|
||||
@ -336,10 +336,11 @@ foreach ($titulaciones as $nombre =>$valor) {
|
||||
</tr>';
|
||||
echo '<tr><td colspan="6">';
|
||||
menu_curriculums($_GET['oid'], "candidato");
|
||||
echo '</td></tr><tr>';
|
||||
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000">
|
||||
<td colspan="6" textalign="right">'.$locale['125'].'<br>';
|
||||
echo '<input name="userfile" type="file">';
|
||||
echo '</td></tr><td colspan="6" textalign="right">';
|
||||
echo '<input type="hidden" name="MAX_FILE_SIZE" value="10000000">'.$locale['125'].' ';
|
||||
echo '<input name="userfile" type="file"> '.$locale['00208']. ' ';
|
||||
rellena_desplegable_select_oidCol("tipo_curriculum","oid","tipo","tipo_curriculum","","0");
|
||||
echo ' <input value="Subir" type="submit">';
|
||||
echo '</td></tr></table>';
|
||||
|
||||
echo '</table>';
|
||||
|
||||
@ -258,6 +258,7 @@ $locale['205'] = "Situaciones";
|
||||
$locale['206'] = "Idiomas";
|
||||
$locale['207'] = "Titulaciones";
|
||||
$locale['208'] = "Tipos de vías";
|
||||
$locale['00208'] = "Tipo curriculum";
|
||||
$locale['209'] = "Lugar de trabajo";
|
||||
$locale['210'] = "Localidades";
|
||||
$locale['211'] = "Clientes";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user