Merge pull request #14729 from bafbes/abb120143

allow access to adherent_extrafields table fields in printFieldListWhere hook
This commit is contained in:
Laurent Destailleur 2020-09-16 01:14:01 +02:00 committed by GitHub
commit 4224e5da41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,11 +147,13 @@ $sql .= " c.rowid as crowid, c.fk_type, c.subscription,";
$sql .= " c.dateadh, c.datef, c.datec as date_creation, c.tms as date_update,";
$sql .= " c.fk_bank as bank, c.note,";
$sql .= " b.fk_account";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
$sql .= " JOIN ".MAIN_DB_PREFIX."subscription as c on d.rowid = c.fk_adherent";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields as ef on (d.rowid = ef.fk_object)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank=b.rowid";
$sql .= " WHERE d.rowid = c.fk_adherent";
$sql .= " AND d.entity IN (".getEntity('adherent').")";
if (isset($date_select) && $date_select != '') {
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
if (isset($date_select) && $date_select != '')
{
$sql .= " AND c.dateadh >= '".$date_select."-01-01 00:00:00'";
$sql .= " AND c.dateadh < '".($date_select + 1)."-01-01 00:00:00'";
}