\n";
// SHow counter of validated members publicly
diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang
index 71f01b36739..f8981df17d9 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -206,7 +206,8 @@ SubscriptionsStatistics=Contributions statistics
NbOfSubscriptions=Number of contributions
AmountOfSubscriptions=Amount collected from contributions
TurnoverOrBudget=Turnover (for a company) or Budget (for a foundation)
-DefaultAmount=Default amount of contribution
+DefaultAmount=Default amount of contribution (used only if no amount is defined at member type level)
+MinimumAmount=Minimum amount (used only when contribution amount is free)
CanEditAmount=Subscription amount is free
CanEditAmountDetail=Visitor can choose/edit amount of its contribution regardless of the member type
AmountIsLowerToMinimumNotice=sur un dû total de %s
diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php
index cb4ba38e628..f245b6c10f7 100644
--- a/htdocs/public/eventorganization/attendee_new.php
+++ b/htdocs/public/eventorganization/attendee_new.php
@@ -686,7 +686,7 @@ print load_fiche_titre($langs->trans("NewRegistration"), '', '', 0, 0, 'center')
print '
';
print '
';
-print '
';
+print '
';
// Welcome message
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 33bbe59f118..a121f2cc5a1 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -30,7 +30,6 @@
*
* Note that you can add following constant to change behaviour of page
* MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form
- * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited
* MEMBER_MIN_AMOUNT Minimum amount
* MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe
* MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation)
@@ -431,7 +430,7 @@ if (empty($reshook) && $action == 'add') {
}
if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) && $conf->global->MEMBER_NEWFORM_PAYONLINE != '-1') {
- if (empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { // If edition of amount not allowed
+ if (empty($adht->caneditamount)) { // If edition of amount not allowed
// TODO Check amount is same than the amount required for the type of member or if not defined as the defeault amount into $conf->global->MEMBER_NEWFORM_AMOUNT
// It is not so important because a test is done on return of payment validation.
}
@@ -505,7 +504,7 @@ print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center')
print '
';
print '
';
-print '
';
+print '
';
if (!empty($conf->global->MEMBER_NEWFORM_TEXT)) {
print $langs->trans($conf->global->MEMBER_NEWFORM_TEXT)." \n";
} else {
@@ -765,7 +764,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
$amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
}
- if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) || $caneditamount) {
+ if ($caneditamount) {
print '';
print ' '.$langs->trans("Currency".$conf->currency).' – ';
print $amount > 0 ? $langs->trans("AnyAmountWithAdvisedAmount", price($amount, 0, $langs, 1, -1, -1, $conf->currency)): $langs->trans("AnyAmountWithoutAdvisedAmount");
@@ -833,7 +832,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
$i = 0;
while ($i < $num) {
- $objp = $db->fetch_object($result);
+ $objp = $db->fetch_object($result); // Load the member type and information on it
print '
'.$langs->trans("Amount");
if (empty($amount)) {
- if (empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
+ if (empty($conf->global->DONATION_NEWFORM_AMOUNT)) {
print ' ('.$langs->trans("ToComplete");
}
- if (!empty($conf->global->MEMBER_EXT_URL_SUBSCRIPTION_INFO)) {
- print ' - '.$langs->trans("SeeHere").'';
+ if (!empty($conf->global->DONATION_EXT_URL_SUBSCRIPTION_INFO)) {
+ print ' - '.$langs->trans("SeeHere").'';
}
- if (empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
+ if (empty($conf->global->DONATION_NEWFORM_AMOUNT)) {
print ')';
}
}
@@ -1767,21 +1767,21 @@ if ($source == 'donation') {
$valtoshow = price2num(GETPOST("newamount", 'alpha'), 'MT');
// force default subscription amount to value defined into constant...
if (empty($valtoshow)) {
- if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
- if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
- $valtoshow = $conf->global->MEMBER_NEWFORM_AMOUNT;
+ if (!empty($conf->global->DONATION_NEWFORM_EDITAMOUNT)) {
+ if (!empty($conf->global->DONATION_NEWFORM_AMOUNT)) {
+ $valtoshow = $conf->global->DONATION_NEWFORM_AMOUNT;
}
} else {
- if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
- $amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
+ if (!empty($conf->global->DONATION_NEWFORM_AMOUNT)) {
+ $amount = $conf->global->DONATION_NEWFORM_AMOUNT;
}
}
}
}
if (empty($amount) || !is_numeric($amount)) {
//$valtoshow=price2num(GETPOST("newamount",'alpha'),'MT');
- if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
- $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
+ if (!empty($conf->global->DONATION_MIN_AMOUNT) && $valtoshow) {
+ $valtoshow = max($conf->global->DONATION_MIN_AMOUNT, $valtoshow);
}
print '';
print '';
@@ -1789,8 +1789,8 @@ if ($source == 'donation') {
print ' '.$langs->trans("Currency".$currency).'';
} else {
$valtoshow = $amount;
- if (!empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) {
- $valtoshow = max($conf->global->MEMBER_MIN_AMOUNT, $valtoshow);
+ if (!empty($conf->global->DONATION_MIN_AMOUNT) && $valtoshow) {
+ $valtoshow = max($conf->global->DONATION_MIN_AMOUNT, $valtoshow);
$amount = $valtoshow;
}
print ''.price($valtoshow, 1, $langs, 1, -1, -1, $currency).''; // Price with currency
diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php
index a82364bcce3..e596fd3d261 100644
--- a/htdocs/public/payment/paymentok.php
+++ b/htdocs/public/payment/paymentok.php
@@ -441,7 +441,7 @@ if ($ispaymentok) {
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) {
// Security protection:
- if (empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { // If we didn't allow members to choose their membership amount (if free amount is allowed, no need to check)
+ if (empty($adht->caneditamount)) { // If we didn't allow members to choose their membership amount (if the amount is allowed in edit mode, no need to check)
if ($object->status == $object::STATUS_DRAFT) { // If the member is not yet validated, we check that the amount is the same as expected.
$typeid = $object->typeid;
diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php
index 108f8d13771..c07062e3284 100644
--- a/htdocs/public/project/new.php
+++ b/htdocs/public/project/new.php
@@ -450,7 +450,7 @@ print load_fiche_titre($langs->trans("NewContact"), '', '', 0, 0, 'center');
print '