';
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang
index e4ca610c44f..aebe3affdae 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -15,6 +15,7 @@ ErrorMemberIsAlreadyLinkedToThisThirdParty=Another member (name: %s, logi
ErrorUserPermissionAllowsToLinksToItselfOnly=For security reasons, you must be granted permissions to edit all users to be able to link a member to a user that is not yours.
SetLinkToUser=Link to a Dolibarr user
SetLinkToThirdParty=Link to a Dolibarr third party
+MemberCountersArePublic=Counters of valid members are public
MembersCards=Generation of cards for members
MembersList=List of members
MembersListToValid=List of draft members (to be validated)
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index c409703862c..531bfcfd152 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -753,10 +753,14 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
foreach ($measuringUnits->records as $lines)
$units[$lines->short_label] = $langs->trans(ucfirst($lines->label));
- $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.note, d.duration, d.statut as status, d.morphy";
+ $publiccounters = $conf->global->MEMBER_COUNTERS_ARE_PUBLIC;
+
+ $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.note, d.duration, d.statut as status, d.morphy, COUNT(a.rowid) AS membercount";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as a";
+ $sql .= " ON d.rowid = a.fk_adherent_type AND a.statut>0";
$sql .= " WHERE d.entity IN (".getEntity('member_type').")";
- $sql .= " AND d.statut=1";
+ $sql .= " AND d.statut=1 GROUP BY d.rowid";
$result = $db->query($sql);
if ($result) {
@@ -772,6 +776,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
print '