From e5f5df38204df0213263dd2ab0a581cd1291ba83 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 15 Jul 2025 14:55:09 +0200 Subject: [PATCH] FIX wrong multicompany filter (#34714) Co-authored-by: Laurent Destailleur --- htdocs/projet/list.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 825ab376dfe..b6f8e9df9b3 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -105,8 +105,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; $search_all = GETPOST('search_all', 'alphanohtml'); -$search_entity = ($user->entity > 0 ? $user->entity : GETPOSTINT('search_entity')); - +$search_entity = GETPOSTINT('search_entity'); $search_ref = GETPOST("search_ref", 'alpha'); $search_label = GETPOST("search_label", 'alpha'); $search_societe = GETPOST("search_societe", 'alpha'); @@ -590,11 +589,10 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON p.fk_user_creat = u.rowid'; $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; - if ($search_entity > 0) { $sql .= " WHERE p.entity = ".((int) $search_entity); } else { - $sql .= " WHERE p.entity IN (".getEntity('project', (GETPOSTINT('search_current_entity') ? 0 : 1)).')'; + $sql .= " WHERE p.entity IN (".getEntity('project').')'; } if (!$user->hasRight('projet', 'all', 'lire')) { $sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users