From 07d07d522af3e09660866f29f847a39c5124c915 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 6 Jun 2016 16:31:42 +0200 Subject: [PATCH] FIX : if user is only allowed to see his companies, he must be allowed to see deplacement which are not linked to a company --- htdocs/compta/deplacement/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 497de98fa72..eacc77ad136 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -91,7 +91,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_ $sql.= " WHERE d.fk_user = u.rowid"; $sql.= " AND d.entity = ".$conf->entity; if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',',$childids).')'; -if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id; +if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND (sc.fk_user = " .$user->id." OR d.fk_soc IS NULL) "; if ($socid) $sql.= " AND s.rowid = ".$socid; if ($search_ref) $sql.=" AND d.rowid=".$search_ref;