Fix: Does not filter correctly by project contacts

This commit is contained in:
Ferran Marcet
2024-10-10 09:16:32 +02:00
committed by Juanjo Menent
parent f1cd746f7b
commit 786905a6c8

View File

@@ -10,7 +10,7 @@
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -1026,7 +1026,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc on ec.fk_c_type_contact = tc.rowid";
$sql .= " WHERE sc.fk_soc = ".((int) $object->id);
$sql .= " AND p.entity IN (".getEntity('project').")";
$sql .= " AND tc.element = 'project'";
$sql .= " AND tc.element = 'project' AND tc.source = 'external'";
$sql .= " ORDER BY p.dateo DESC";
$result = $db->query($sql);