From a3a6b6dff64c49a312c778c945b63e6866f640d3 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 26 Mar 2014 10:57:07 +0100 Subject: [PATCH] Update box_ficheinter.php External user show only is own intervention --- htdocs/core/boxes/box_ficheinter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 81cba912dff..cc7464ec3e9 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -72,8 +72,10 @@ class box_ficheinter extends ModeleBoxes $sql.= ", ".MAIN_DB_PREFIX."fichinter as f"; $sql.= " WHERE f.fk_soc = s.rowid "; $sql.= " AND f.entity = ".$conf->entity; - if (! $user->rights->societe->client->voir) + if (! $user->rights->societe->client->voir && !$user->societe_id) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; + $sql.= " ORDER BY f.tms DESC"; $sql.= $db->plimit($max, 0);