From 36f1527f763fc476c39bceb6d8c773e922bbab19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Jun 2019 11:06:10 +0200 Subject: [PATCH] Fix backward compatibility for type of members --- htdocs/adherents/subscription.php | 14 +++++++++----- htdocs/adherents/subscription/card.php | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index eeeb821c223a1..fef89da8754ec 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -667,7 +667,7 @@ */ if ($action != 'addsubscription' && $action != 'create_thirdparty') { - $sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,"; + $sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe, d.type,"; $sql.= " c.rowid as crowid, c.subscription,"; $sql.= " c.datec, c.fk_type as cfk_type,"; $sql.= " c.dateadh as dateh,"; @@ -705,26 +705,30 @@ print "\n"; $accountstatic=new Account($db); + $adh = new Adherent($db); $adht = new AdherentType($db); while ($i < $num) { $objp = $db->fetch_object($result); + $adh->id = $objp->rowid; + $adh->type = $obj->type; + $subscriptionstatic->ref=$objp->crowid; $subscriptionstatic->id=$objp->crowid; - if ($objp->cfk_type > 0) + $typeid = ($objp->cfk_type > 0 ? $objp->cfk_type : $adh->typeid); + if ($typeid > 0) { - $adht->fetch($objp->cfk_type); + $adht->fetch($typeid); } print ''; print ''.$subscriptionstatic->getNomUrl(1).''; print ''.dol_print_date($db->jdate($objp->datec), 'dayhour')."\n"; print ''; - if ($objp->cfk_type > 0) - { + if ($typeid > 0) { print $adht->getNomUrl(1); } print ''; diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 1b6e58137742f..a8478f35e88b1 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -346,7 +346,7 @@ // Amount print ''.$langs->trans("Amount").''.price($object->amount).''; - // Amount + // Label print ''.$langs->trans("Label").''.$object->note.''; // Bank line