Cambios para usuario ISBAN, los usuarios de cliente, solo verán las solicitudes de ofertas suyas, el campo que establece en el usuario a que cliente pertenece es cliente_actual
git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_Intranet/trunk@147 e2b1556b-49f8-d141-9351-52d6861a72d9
This commit is contained in:
parent
98f4822082
commit
7a8dbc2420
@ -66,7 +66,8 @@
|
||||
if($usuario->tieneRol("3") ||$usuario->tieneRol("1")){
|
||||
echo '<a href="addPedido.php" class="menuOption" style="color:#000000">'.$this->locale['1008'].'</a>';
|
||||
}
|
||||
echo '<a href="buscar_pedido.php" class="menuOption" style="color:#000000">'.$this->locale['1009'].'</a>';
|
||||
|
||||
//echo '<a href="buscar_pedido.php" class="menuOption" style="color:#000000">'.$this->locale['1009'].'</a>';
|
||||
// Buscar candidatos
|
||||
/*if(substr_count($_SERVER['REQUEST_URI'],"/pedido.php?idPedido")==1){
|
||||
echo '<a href="buscar.php" class="menuOption" target="_blank" style="color:#000000">'.$this->locale['820'].'</a>';
|
||||
|
||||
@ -72,7 +72,7 @@ include_once("Objects/Pedido.php");
|
||||
$estado = $this->tipo;
|
||||
if($this->pedidos == null){
|
||||
//Modificamos la consulta en función del rol.
|
||||
if($this->gestor->tieneRol(4) || $this->gestor->tieneRol(1)){
|
||||
if($this->gestor->tieneRol(4) || $this->gestor->tieneRol(1) || $this->gestor->tieneRol(7)){
|
||||
if($this->sql != ""){
|
||||
// metemos el tipo si es >0
|
||||
if($estado > 0){
|
||||
@ -94,9 +94,23 @@ include_once("Objects/Pedido.php");
|
||||
$consulta = $sqlNueva." ".$this->order_by;
|
||||
}else{
|
||||
if($estado > 0){
|
||||
$consulta = "SELECT * from pedidos WHERE estado='".$estado."'".$this->orden ;
|
||||
$consulta = "SELECT * from pedidos WHERE estado='".$estado."'";
|
||||
|
||||
//En el caso de ser un usuario de cliente para ver sus pedidos filtramos por cliente
|
||||
if (($this->gestor->tieneRol(7)) && ($this->gestor->getValor("cliente_actual")>0)){
|
||||
$consulta .= " and cliente = ". $this->gestor->getValor("cliente_actual") . " ";
|
||||
}
|
||||
|
||||
$consulta .= $this->orden;
|
||||
}else{
|
||||
$consulta = "SELECT * from pedidos ".$this->orden."";
|
||||
$consulta = "SELECT * from pedidos ";
|
||||
|
||||
//En el caso de ser un usuario de cliente para ver sus pedidos filtramos por cliente
|
||||
if (($this->gestor->tieneRol(7)) && ($this->gestor->getValor("cliente_actual")>0)){
|
||||
$consulta .= " where cliente = ". $this->gestor->getValor("cliente_actual") . " ";
|
||||
}
|
||||
|
||||
$consulta .= $this->orden;
|
||||
}
|
||||
}
|
||||
}else if($this->gestor->tieneRol(3)){
|
||||
@ -132,6 +146,7 @@ include_once("Objects/Pedido.php");
|
||||
}
|
||||
|
||||
$bd=new BD();
|
||||
|
||||
$resultado = $bd->execQuery($consulta);
|
||||
//Procesamos los pedidos.
|
||||
if(mysql_num_rows($resultado) == 0){
|
||||
|
||||
@ -13,7 +13,7 @@ if(!$usuario->tieneRol("7")) {
|
||||
include("tablero.php");
|
||||
}
|
||||
else {
|
||||
header("Location: lista_ofertas.php");
|
||||
header("Location: lista_pedidos.php");
|
||||
}
|
||||
|
||||
if($_SESSION["oid"]){
|
||||
|
||||
@ -4,7 +4,8 @@ include("seguridad.php");
|
||||
include("functions.php");
|
||||
if(!$usuario->tieneRol("4")
|
||||
&& !$usuario->tieneRol("1")
|
||||
&& !$usuario->tieneRol("3")){
|
||||
&& !$usuario->tieneRol("3")
|
||||
&& !$usuario->tieneRol("7")){
|
||||
header("Location: aplicacion.php?e=permiso&rol=".$usuario->getValor("rol"));
|
||||
exit;
|
||||
}
|
||||
@ -34,7 +35,6 @@ $tipoPedidos = (isset($_GET["byEstado"]) && ($_GET['byEstado'] != "")) ? $_GET['
|
||||
|
||||
$listaPedidos=new ListaPedido($usuario,$order_by,"",$tipoPedidos);
|
||||
|
||||
|
||||
include_once("ver_lista_pedidos.php");
|
||||
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ 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=="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=="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>
|
||||
@ -73,7 +73,11 @@ echo "<table width=\"100%\"> ";
|
||||
|
||||
// Acciones
|
||||
echo "<tr class=\"encabezado\">";
|
||||
echo " <td align=\"center\" colspan=\"3\">".$locale['2014']."</td>";
|
||||
|
||||
//Si es usuario cliente para consulta quitamos las acciones para ganr espacio
|
||||
if (!$usuario->tieneRol("7")) {
|
||||
echo " <td align=\"center\" colspan=\"3\">".$locale['2014']."</td>";
|
||||
}
|
||||
|
||||
// Código
|
||||
//$orderView="oid";
|
||||
@ -151,15 +155,21 @@ if(count($listadePedidos)==0){
|
||||
$pedidoAct=$listadePedidos[$i];
|
||||
$color = color_procedencia($pedidoAct->getValor("procedencia"));
|
||||
echo "<tr style='background-color: $color;'>";
|
||||
if(($pedidoAct->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='.$pedidoAct->getValor("oid").'"><img src="css/edit.png" title="'.$locale['2017'].'"/></a></td>';
|
||||
echo "<td align=\"center\"><a href=\"#\" onclick=eliminarPedido('".$pedidoAct->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>';
|
||||
//INICIO ACCIONES
|
||||
//Si es usuario cliente para consulta quitamos las acciones para ganr espacio
|
||||
if (!$usuario->tieneRol("7")) {
|
||||
|
||||
if(($pedidoAct->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='.$pedidoAct->getValor("oid").'"><img src="css/edit.png" title="'.$locale['2017'].'"/></a></td>';
|
||||
echo "<td align=\"center\"><a href=\"#\" onclick=eliminarPedido('".$pedidoAct->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="pedido.php?idPedido='.$pedidoAct->getValor("oid").'"><img src="css/brick_go.png" title="'.$locale['2015'].'" /></a></td>';
|
||||
}
|
||||
echo '<td align="center"><a href="pedido.php?idPedido='.$pedidoAct->getValor("oid").'"><img src="css/brick_go.png" title="'.$locale['2015'].'" /></a></td>';
|
||||
//FIN ACCIONES
|
||||
// echo '<td align="center">'.$pedidoAct->getValor("oid").'</td>';
|
||||
echo '<td align="center">'.$pedidoAct->getValor("fecha").'</td>';
|
||||
/*echo '<td align="center">'.discretiza_prioridad($pedidoAct->getValor("prioridad")).'</td>';*/
|
||||
@ -180,10 +190,15 @@ for ($j = 0; $j < count($listaOfertas); $j++) {
|
||||
$ofertaAct = $listaOfertas[$j];
|
||||
echo '<a href="oferta.php?idOferta=' . $ofertaAct->getValor("oid") . '">'.$ofertaAct->getValor("referencia").'</a> : '.$ofertaAct->getValor("nombre_estado").' ';
|
||||
if ($ofertaAct->getValor("nombre_candidato")=="") {
|
||||
echo "No asignado";
|
||||
echo " - No asignado";
|
||||
}
|
||||
else {
|
||||
echo '<a href="/detalle_candidato.php?oid=' . $ofertaAct->getValor("candidato") . '">' . $ofertaAct->getValor("nombre_candidato"). '</a>';
|
||||
//Si es usuario cliente para consulta quitamos las acciones para ganr espacio
|
||||
if (!$usuario->tieneRol("7")) {
|
||||
echo '<a href="/detalle_candidato.php?oid=' . $ofertaAct->getValor("candidato") . '">' . $ofertaAct->getValor("nombre_candidato"). '</a>';
|
||||
} else {
|
||||
echo ' - '. $ofertaAct->getValor("nombre_candidato");
|
||||
}
|
||||
}
|
||||
echo ' "'. $ofertaAct->getValor("nombre_gerente").'"<br/>';
|
||||
}
|
||||
|
||||
@ -98,11 +98,14 @@ if (!empty($action)) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (($oferta->getValor("estado") == 120)) {
|
||||
echo $html->menuOfertas($usuario, array(""));
|
||||
} else
|
||||
echo $html->menuOfertas($usuario, "gestionar");
|
||||
//Si es usuario cliente para consulta quitamos las acciones para ganr espacio
|
||||
if (!$usuario->tieneRol("7")) {
|
||||
if (($oferta->getValor("estado") == 120)) {
|
||||
echo $html->menuOfertas($usuario, array(""));
|
||||
} else
|
||||
echo $html->menuOfertas($usuario, "gestionar");
|
||||
}
|
||||
else echo $html->menuPedidos($usuario, array(""));
|
||||
?>
|
||||
|
||||
<h2><?php echo $oferta->getValor("referencia") ." - ". $oferta->getValor("nombre_solicitud")?></h2>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user