diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 705d7cf426f..522f2b7afa0 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -60,6 +60,7 @@ if ($action == 'update') { $amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2); $minamount = GETPOST('MEMBER_MIN_AMOUNT'); $publiccounters = GETPOST('MEMBER_COUNTERS_ARE_PUBLIC'); + $showvoteallowed = GETPOST('MEMBER_SHOW_VOTE_ALLOWED'); $payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE'); $forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int'); $forcemorphy = GETPOST('MEMBER_NEWFORM_FORCEMORPHY', 'aZ09'); @@ -68,6 +69,7 @@ if ($action == 'update') { $res = dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT", $amount, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_MIN_AMOUNT", $minamount, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_COUNTERS_ARE_PUBLIC", $publiccounters, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "MEMBER_HIDE_VOTE_ALLOWED", !$showvoteallowed, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "hide -> show" $res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity); if ($forcetype < 0) { $res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity); @@ -246,6 +248,14 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print $form->selectyesno("MEMBER_COUNTERS_ARE_PUBLIC", (!empty($conf->global->MEMBER_COUNTERS_ARE_PUBLIC) ? $conf->global->MEMBER_COUNTERS_ARE_PUBLIC : 0), 1); print "\n"; + // Show "vote allowed" setting for membership types + $hidevoteallowed = (!empty($conf->global->MEMBER_HIDE_VOTE_ALLOWED) ? $conf->global->MEMBER_HIDE_VOTE_ALLOWED : 0); + print ''; + print $langs->trans("MembersShowVotesAllowed"); + print ''; + print $form->selectyesno("MEMBER_SHOW_VOTE_ALLOWED", !$hidevoteallowed, 1); // Reverse the logic "hide -> show" for retrocompatibility + print "\n"; + // Jump to an online payment page print ''; print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 1597f9f2719..880f66cea4e 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -27,6 +27,7 @@ MembersListNotUpToDate=List of valid members with out-of-date contribution MembersListExcluded=List of excluded members MembersListResiliated=List of terminated members MembersListQualified=List of qualified members +MembersShowVotesAllowed=Show whether votes are allowed, in the table of membership types MenuMembersToValidate=Draft members MenuMembersValidated=Validated members MenuMembersExcluded=Excluded members diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index c0d5c927564..253da6cfaaf 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -802,6 +802,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW $units[$lines->short_label] = $langs->trans(ucfirst($lines->label)); $publiccounters = getDolGlobalString("MEMBER_COUNTERS_ARE_PUBLIC"); + $hidevoteallowed = getDolGlobalString("MEMBER_HIDE_VOTE_ALLOWED"); $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,"; $sql .= " COUNT(a.rowid) AS membercount"; @@ -825,7 +826,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print ''.$langs->trans("MembershipDuration").''; print ''.$langs->trans("Amount").''; print ''.$langs->trans("MembersNature").''; - print ''.$langs->trans("VoteAllowed").''; + if (empty($hidevoteallowed)) print ''.$langs->trans("VoteAllowed").''; if ($publiccounters) print ''.$langs->trans("Members").''; print ''.$langs->trans("NewSubscription").''; print "\n"; @@ -865,7 +866,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print $langs->trans("MorAndPhy"); } print ''; - print ''.yn($objp->vote).''; + if (empty($hidevoteallowed)) print ''.yn($objp->vote).''; $membercount = $objp->membercount>0? $objp->membercount: "–"; if ($publiccounters) print ''.$membercount.''; print '';