diff --git a/src/Objects/HTML.php b/src/Objects/HTML.php index bd3730b..becf8e9 100644 --- a/src/Objects/HTML.php +++ b/src/Objects/HTML.php @@ -94,9 +94,18 @@ $opcionesThis = $opciones; } echo ''.$this->locale['5100'].''; - if($usuario->tieneRol("3") ||$usuario->tieneRol("1")){ + + if(substr_count($_SERVER['REQUEST_URI'],"/oferta.php?idOferta")==1){ + echo ''.$this->locale['ed'].''; + } + + if(substr_count($_SERVER['REQUEST_URI'],"/gestion_oferta.php?idOferta")==1){ + echo ''.$this->locale['im'].''; + } + +// if($usuario->tieneRol("3") ||$usuario->tieneRol("1")){ // echo ''.$this->locale['5101'].''; - } +// } /*echo ''.$this->locale['5102'].'';*/ /* if(!in_array("gestionar", $opcionesThis)){ diff --git a/src/addOferta.php b/src/addOferta.php index ce8a12b..d696999 100644 --- a/src/addOferta.php +++ b/src/addOferta.php @@ -34,6 +34,7 @@ if (!empty($_POST)) { $idiomas=$_POST['idiomas']; $provincias=$_POST['provincias']; */ $observaciones = $_POST['observaciones']; + $salario_ofertado = $_POST['salario_ofertado']; $gerente=$usuario->getValor("oid"); /* $pesoTec=$_POST['pesoTec']; $pesoIdi=$_POST['pesoIdi']; @@ -61,6 +62,7 @@ if (!empty($_POST)) { $arrayInsert["obsGerente"] = $observaciones; $arrayInsert["estado"] = "100"; $arrayInsert["gerente"]=$gerente; + $arrayInsert["salario_ofertado"] = $salario_ofertado; /* $arrayInsert["prioridad"]= $prioridad; $arrayInsert["empleados"]=$empleados; @@ -122,7 +124,6 @@ if (in_array("1", $errores)) echo " class=\"errorcampo\""; echo ">" . $locale['1025'] . ":
"; -echo "holaaa"; rellena_desplegable_pedidos_estado("solicitud", "130, 140", array($solicitud)); echo " "; @@ -135,6 +136,10 @@ echo '' . '' . $locale['135'] . '
' . ''; + + echo ''.$locale['Ofertas010'].'
'; + + // Botones de guardar y restablecer echo ""; echo ''; diff --git a/src/candidaturas.php b/src/candidaturas.php index a673177..839313c 100644 --- a/src/candidaturas.php +++ b/src/candidaturas.php @@ -9,7 +9,7 @@ if(!$_SESSION["oid"]){ $consulta = "SELECT U.oid as idCandidato,CP.oid as idOferta, CP.referencia, P.oid as idPedido, U.nombre,U.apellidos,P.nombre AS pedido, CE.nombre AS estado, -CP.obsRRHH,CP.obsGerente +CP.obsRRHH,CP.obsGerente, CP.salario_ofertado FROM usuarios U,pedidos P,candidato_pedido CP,candidaturas_estados CE WHERE U.oid='".$persona->getValor("oid")."' AND CP.candidato=U.oid @@ -35,11 +35,13 @@ if ($resultado = consultar($consulta)){ $oidOferta = $row["idOferta"]; $obsRRHH = $row["obsRRHH"]; $obsGerente = $row["obsGerente"]; + $salario_ofertado = $row["salario_ofertado"]; $idCandidato = $row["idCandidato"]; echo "
  • "; echo "Oferta $referenciaOferta "; echo "($estado) "; - echo "- Solicitud \"$pedido\"
  • "; + echo "- Solicitud \"$pedido"; + echo " - Salario ofertado: ". $salario_ofertado. ""; // desactivar el comentario por ahora if (false) { //if($usuario->tieneRol("4")){ diff --git a/src/database/selfor.sql b/src/database/selfor.sql index 82a10cf..985c45b 100644 --- a/src/database/selfor.sql +++ b/src/database/selfor.sql @@ -175,6 +175,7 @@ CREATE TABLE IF NOT EXISTS `candidato_pedido` ( `fecha` datetime NOT NULL, `obsGerente` text COLLATE latin1_spanish_ci NOT NULL, `obsRRHH` text COLLATE latin1_spanish_ci NOT NULL, + `salario_ofertado` int(10) unsigned NOT NULL, PRIMARY KEY (`oid`), UNIQUE KEY `candidato pedido` (`candidato`,`pedido`), KEY `proyecto` (`pedido`), diff --git a/src/gestion_oferta.php b/src/gestion_oferta.php new file mode 100644 index 0000000..84ca49f --- /dev/null +++ b/src/gestion_oferta.php @@ -0,0 +1,100 @@ +menuOfertas($usuario, ""); + +// Comprobamos si estamos haciendo algo +$action=""; +if (isset($_POST['action']) || isset($_GET['action'])) { + if (isset($_POST['action']) && ($_POST['action']!="")) { + $action = $_POST['action']; + } else { + if (isset($_GET['action']) && ($_GET['action']!="")) { + $action = $_GET['action']; + } + } +} + +$errores = array(); +$mensaje=""; + +switch ($action) { + case "edit": + try{ + if(count($errores)==0){ + $Oferta->setCampo("pedido",$_POST['solicitud'][0]); + $Oferta->setCampo("obsGerente",$_POST['observaciones']); + $Oferta->setCampo("gerente",$usuario->getValor("oid")); + $Oferta->setCampo("salario_ofertado",$_POST['salario_ofertado']); + + $mensaje=$locale['Ofertas011']; + $Oferta=new Oferta($idOferta,$usuario); + } + } catch (Exception $e){ + $mensaje=$locale[$e->getMessage()]; + } + + break; +} + + + +echo "

    ".$Oferta->getValor("referencia") ." - ". $Oferta->getValor("nombre_candidato")."

    "; +if($mensaje!=""){ + // Mostramos el mensaje + if(in_array("9",$errores)){ + echo "
    ".$mensaje."
    "; + }else{ + echo "
    ".$mensaje."
    "; + } + +} + +echo '
    '; +echo ""; +echo "" . + "" . + " " . $locale['1025'] . ":
    "; +rellena_desplegable_pedidos_estado("solicitud", "130, 140", array($Oferta->getValor('pedido'))); + +echo " "; + +echo "
    "; +echo ""; + +echo ""; +echo '' . + ''; + + echo ''; + + +// Botones de guardar y restablecer +echo "'; +echo "
    ' . $locale['135'] . + '
    '.$locale['Ofertas010'].'
    "; +echo ''; +echo '
    "; +echo "
    "; +include_once("html/pie.php"); +?> diff --git a/src/idiomas/sp/lenguaje.php b/src/idiomas/sp/lenguaje.php index f35f99a..79ec29b 100644 --- a/src/idiomas/sp/lenguaje.php +++ b/src/idiomas/sp/lenguaje.php @@ -19,6 +19,7 @@ $locale['de'] = " de "; $locale['add'] = "Añadir"; $locale['cancel'] = "Cancelar"; $locale['cerrar'] = "Cerrar"; +$locale['im'] = "Imprimir"; //Cabecera: $locale['001'] = " .:: Gestión de solicitudes y ofertas ::."; @@ -189,6 +190,8 @@ $locale['Ofertas006'] = "Ver ficha candidato"; $locale['Ofertas007'] = "SOLICITUD"; $locale['Ofertas008'] = "CANDIDATO"; $locale['Ofertas009'] = "Todas las ofertas"; +$locale['Ofertas010'] = "Salario ofertado para la oferta"; +$locale['Ofertas011'] = "Se ha editado la oferta correctamente"; //Historial: diff --git a/src/ver_lista_ofertas.php b/src/ver_lista_ofertas.php index a0f134c..6395ce5 100644 --- a/src/ver_lista_ofertas.php +++ b/src/ver_lista_ofertas.php @@ -63,7 +63,7 @@ echo '
    '; echo " "; // Acciones echo ""; -echo " "; +echo " "; // denominacion $orderView = "denominacion"; echo " "; if (($ofertaAct->getValor("gerente") == $usuario->getValor("oid")) || $usuario->tieneRol("1")) { // Es el gerente de ese pedido, puede editarlo y eliminarlo - //echo ''; + echo ''; //echo ''; echo ""; } else { diff --git a/src/ver_oferta.php b/src/ver_oferta.php index 0789338..b9302ce 100644 --- a/src/ver_oferta.php +++ b/src/ver_oferta.php @@ -161,7 +161,8 @@ echo $mensaje;
    " . $locale['2014'] . "" . $locale['2014'] . "" . $locale['1042'].":" . "
    " . @@ -129,7 +129,7 @@ if (count($listadeOfertas) == 0) { echo "
    getValor("oid") . "') >
       getValor("nombre_gerente"); ?>
    -  getValor("observaciones")); ?> +  getValor("obsGerente")); ?>
    +  getValor("salario_ofertado"); ?>