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")){
|
if($usuario->tieneRol("3") ||$usuario->tieneRol("1")){
|
||||||
echo '<a href="addPedido.php" class="menuOption" style="color:#000000">'.$this->locale['1008'].'</a>';
|
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
|
// Buscar candidatos
|
||||||
/*if(substr_count($_SERVER['REQUEST_URI'],"/pedido.php?idPedido")==1){
|
/*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>';
|
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;
|
$estado = $this->tipo;
|
||||||
if($this->pedidos == null){
|
if($this->pedidos == null){
|
||||||
//Modificamos la consulta en función del rol.
|
//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 != ""){
|
if($this->sql != ""){
|
||||||
// metemos el tipo si es >0
|
// metemos el tipo si es >0
|
||||||
if($estado > 0){
|
if($estado > 0){
|
||||||
@ -94,9 +94,23 @@ include_once("Objects/Pedido.php");
|
|||||||
$consulta = $sqlNueva." ".$this->order_by;
|
$consulta = $sqlNueva." ".$this->order_by;
|
||||||
}else{
|
}else{
|
||||||
if($estado > 0){
|
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{
|
}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)){
|
}else if($this->gestor->tieneRol(3)){
|
||||||
@ -132,6 +146,7 @@ include_once("Objects/Pedido.php");
|
|||||||
}
|
}
|
||||||
|
|
||||||
$bd=new BD();
|
$bd=new BD();
|
||||||
|
|
||||||
$resultado = $bd->execQuery($consulta);
|
$resultado = $bd->execQuery($consulta);
|
||||||
//Procesamos los pedidos.
|
//Procesamos los pedidos.
|
||||||
if(mysql_num_rows($resultado) == 0){
|
if(mysql_num_rows($resultado) == 0){
|
||||||
|
|||||||
@ -13,7 +13,7 @@ if(!$usuario->tieneRol("7")) {
|
|||||||
include("tablero.php");
|
include("tablero.php");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
header("Location: lista_ofertas.php");
|
header("Location: lista_pedidos.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_SESSION["oid"]){
|
if($_SESSION["oid"]){
|
||||||
|
|||||||
@ -4,7 +4,8 @@ include("seguridad.php");
|
|||||||
include("functions.php");
|
include("functions.php");
|
||||||
if(!$usuario->tieneRol("4")
|
if(!$usuario->tieneRol("4")
|
||||||
&& !$usuario->tieneRol("1")
|
&& !$usuario->tieneRol("1")
|
||||||
&& !$usuario->tieneRol("3")){
|
&& !$usuario->tieneRol("3")
|
||||||
|
&& !$usuario->tieneRol("7")){
|
||||||
header("Location: aplicacion.php?e=permiso&rol=".$usuario->getValor("rol"));
|
header("Location: aplicacion.php?e=permiso&rol=".$usuario->getValor("rol"));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -34,7 +35,6 @@ $tipoPedidos = (isset($_GET["byEstado"]) && ($_GET['byEstado'] != "")) ? $_GET['
|
|||||||
|
|
||||||
$listaPedidos=new ListaPedido($usuario,$order_by,"",$tipoPedidos);
|
$listaPedidos=new ListaPedido($usuario,$order_by,"",$tipoPedidos);
|
||||||
|
|
||||||
|
|
||||||
include_once("ver_lista_pedidos.php");
|
include_once("ver_lista_pedidos.php");
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -73,7 +73,11 @@ echo "<table width=\"100%\"> ";
|
|||||||
|
|
||||||
// Acciones
|
// Acciones
|
||||||
echo "<tr class=\"encabezado\">";
|
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
|
// Código
|
||||||
//$orderView="oid";
|
//$orderView="oid";
|
||||||
@ -151,15 +155,21 @@ if(count($listadePedidos)==0){
|
|||||||
$pedidoAct=$listadePedidos[$i];
|
$pedidoAct=$listadePedidos[$i];
|
||||||
$color = color_procedencia($pedidoAct->getValor("procedencia"));
|
$color = color_procedencia($pedidoAct->getValor("procedencia"));
|
||||||
echo "<tr style='background-color: $color;'>";
|
echo "<tr style='background-color: $color;'>";
|
||||||
if(($pedidoAct->getValor("gerente")==$usuario->getValor("oid")) || $usuario->tieneRol("1")){
|
//INICIO ACCIONES
|
||||||
// Es el gerente de ese pedido, puede editarlo y eliminarlo
|
//Si es usuario cliente para consulta quitamos las acciones para ganr espacio
|
||||||
echo '<td align="center"><a href="gestion_pedido.php?idPedido='.$pedidoAct->getValor("oid").'"><img src="css/edit.png" title="'.$locale['2017'].'"/></a></td>';
|
if (!$usuario->tieneRol("7")) {
|
||||||
echo "<td align=\"center\"><a href=\"#\" onclick=eliminarPedido('".$pedidoAct->getValor("oid")."') ><img src=\"css/eliminar.png\" title=\"".$locale['2016']."\"/></a></td>";
|
|
||||||
} else {
|
if(($pedidoAct->getValor("gerente")==$usuario->getValor("oid")) || $usuario->tieneRol("1")){
|
||||||
// No es el gerente no puede ni editarlo ni eliminarlo
|
// Es el gerente de ese pedido, puede editarlo y eliminarlo
|
||||||
echo '<td></td><td></td>';
|
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("oid").'</td>';
|
||||||
echo '<td align="center">'.$pedidoAct->getValor("fecha").'</td>';
|
echo '<td align="center">'.$pedidoAct->getValor("fecha").'</td>';
|
||||||
/*echo '<td align="center">'.discretiza_prioridad($pedidoAct->getValor("prioridad")).'</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];
|
$ofertaAct = $listaOfertas[$j];
|
||||||
echo '<a href="oferta.php?idOferta=' . $ofertaAct->getValor("oid") . '">'.$ofertaAct->getValor("referencia").'</a> : '.$ofertaAct->getValor("nombre_estado").' ';
|
echo '<a href="oferta.php?idOferta=' . $ofertaAct->getValor("oid") . '">'.$ofertaAct->getValor("referencia").'</a> : '.$ofertaAct->getValor("nombre_estado").' ';
|
||||||
if ($ofertaAct->getValor("nombre_candidato")=="") {
|
if ($ofertaAct->getValor("nombre_candidato")=="") {
|
||||||
echo "No asignado";
|
echo " - No asignado";
|
||||||
}
|
}
|
||||||
else {
|
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/>';
|
echo ' "'. $ofertaAct->getValor("nombre_gerente").'"<br/>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,11 +98,14 @@ if (!empty($action)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Si es usuario cliente para consulta quitamos las acciones para ganr espacio
|
||||||
if (($oferta->getValor("estado") == 120)) {
|
if (!$usuario->tieneRol("7")) {
|
||||||
echo $html->menuOfertas($usuario, array(""));
|
if (($oferta->getValor("estado") == 120)) {
|
||||||
} else
|
echo $html->menuOfertas($usuario, array(""));
|
||||||
echo $html->menuOfertas($usuario, "gestionar");
|
} else
|
||||||
|
echo $html->menuOfertas($usuario, "gestionar");
|
||||||
|
}
|
||||||
|
else echo $html->menuPedidos($usuario, array(""));
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h2><?php echo $oferta->getValor("referencia") ." - ". $oferta->getValor("nombre_solicitud")?></h2>
|
<h2><?php echo $oferta->getValor("referencia") ." - ". $oferta->getValor("nombre_solicitud")?></h2>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user