Problem with sentences in scriptcase

0

I have a problem. I have a grid with a list of requests, those requests can be in 3 states (Accepted, Rejected, Waiting). I also have 3 user groups (Administrator, Employee, Supervisor). Well, my problem is that I want the "technical" user that is in the "Supervisor" group to only see the requests that are "On Hold". In the login application I put the following statement to save it in a global variable called [usr_group]:

$sql2 = "SELECT group_id FROM sec_users_groups";
sc_lookup(gu, $sql2);
$usr_group = {gu[0][0]};
sc_set_global($usr_group);

In the request grid I have put the following SQL statement:

SELECT
PK_SOLICITUD,
FK_EMPLEADO,
FECHA_SOLICITUD,
FECHA_INICIO,
FECHA_FIN,
FK_MOTIVO,
FK_ESTADO,
JUSTIFICANTE,
DOCUMENTO,
N_DIASSOLICITADOS,
FK_TIPO
FROM
solicitud
WHERE
FK_EMPLEADO='[usr_login]'
OR
'[usr_login]'='admin'
OR
'[usr_group]'= 3
AND
FK_ESTADO = 3

The problem is that the user who is in the "Supervisor" group, sees the ones that are "On Hold" but the others too. What could be the problem?

Thank you!

    
asked by Alvaro Roman 23.02.2018 в 08:52
source

0 answers