diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 52525009516..15648375677 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -86,7 +86,7 @@ llxHeader('', $langs->trans("Donations"), 'EN:Module_Donations|FR:Module_Dons|ES $donationstatic=new Don($db); // Genere requete de liste des dons -$sql = "SELECT d.rowid, d.datedon, d.fk_soc, d.firstname, d.lastname, d.societe,"; +$sql = "SELECT d.rowid, d.datedon, d.fk_soc as socid, d.firstname, d.lastname, d.societe,"; $sql.= " d.amount, d.fk_statut as statut, "; $sql.= " p.rowid as pid, p.ref, p.title, p.public"; $sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p"; @@ -154,7 +154,7 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton); @@ -172,9 +172,15 @@ if ($resql) print ''; print ''; print ''; + if (! empty($conf->global->DONATION_USE_THIRDPARTIES)) { + print ''; + print ''; + print ''; + } else { print ''; print ''; print ''; + } print ''; print ''; print ''; @@ -193,11 +199,15 @@ if ($resql) $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; - print "\n"; - - print ''; + print "\n"; + + print ''; print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "d.rowid", "", $param, "", $sortfield, $sortorder); + if (! empty($conf->global->DONATION_USE_THIRDPARTIES)) { + print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "d.fk_soc", "", $param, "", $sortfield, $sortorder); + } else { print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "d.societe", "", $param, "", $sortfield, $sortorder); + } print_liste_field_titre("Name", $_SERVER["PHP_SELF"], "d.lastname", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "d.datedon", "", $param, '', $sortfield, $sortorder, 'center '); if (! empty($conf->projet->enabled)) @@ -219,9 +229,20 @@ if ($resql) $donationstatic->ref=$objp->rowid; $donationstatic->lastname=$objp->lastname; $donationstatic->firstname=$objp->firstname; - print "".$donationstatic->getNomUrl(1)."\n"; - print "".$objp->societe."\n"; - print "".$donationstatic->getFullName($langs)."\n"; + print "".$donationstatic->getNomUrl(1).""; + if (! empty($conf->global->DONATION_USE_THIRDPARTIES)) { + + $company=new Societe($db); + $result=$company->fetch($objp->socid); + if (!empty($objp->socid) && $company->id > 0) { + print "".$company->getNomUrl(1).""; + } else { + print "".$objp->societe.""; + } + } else { + print "".$objp->societe.""; + } + print "".$donationstatic->getFullName($langs).""; print ''.dol_print_date($db->jdate($objp->datedon), 'day').''; if (! empty($conf->projet->enabled)) {