|
@@ -9,6 +9,7 @@
|
|
|
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
|
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
|
|
* Copyright (C) 2020-2021 Frédéric France <frederic.france@netlogic.fr>
|
|
|
+ * Copyright (C) 2023 Waël Almoman <info@almoman.com>
|
|
|
*
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
@@ -103,13 +104,15 @@ if ($action == 'set_default') {
|
|
|
}
|
|
|
} elseif ($action == 'updatemainoptions') {
|
|
|
$db->begin();
|
|
|
- $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = $res7 = 0;
|
|
|
+ $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = $res7 = $res8 = $res9 = 0;
|
|
|
$res1 = dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha') ? 0 : 1, 'chaine', 0, '', $conf->entity);
|
|
|
$res2 = dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
|
$res3 = dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
|
$res3 = dolibarr_set_const($db, 'ADHERENT_CREATE_EXTERNAL_USER_LOGIN', GETPOST('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
|
$res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
|
$res7 = dolibarr_set_const($db, 'MEMBER_PUBLIC_ENABLED', GETPOST('MEMBER_PUBLIC_ENABLED', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
|
+ $res8 = dolibarr_set_const($db, 'MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF', GETPOST('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
|
+ $res9 = dolibarr_set_const($db, 'MEMBER_SUBSCRIPTION_START_AFTER', GETPOST('MEMBER_SUBSCRIPTION_START_AFTER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
|
// Use vat for invoice creation
|
|
|
if (isModEnabled('facture')) {
|
|
|
$res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
@@ -335,6 +338,24 @@ print '<td>'.$langs->trans("Description").'</td>';
|
|
|
print '<td>'.$langs->trans("Value").'</td>';
|
|
|
print "</tr>\n";
|
|
|
|
|
|
+// Start date of new membership
|
|
|
+$startpoint[0] = $langs->trans("SubscriptionPayment");
|
|
|
+$startpoint["m"] = $langs->trans("Month");
|
|
|
+$startpoint["Y"] = $langs->trans("Year");
|
|
|
+print '<tr class="oddeven drag" id="startfirstdayof"><td>';
|
|
|
+print $langs->trans("MemberSubscriptionStartFirstDayOf");
|
|
|
+print '</td><td>';
|
|
|
+$startfirstdayof = !getDolGlobalString('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF') ? 0 : getDolGlobalString('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF');
|
|
|
+print $form->selectarray("MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF", $startpoint, $startfirstdayof, 0);
|
|
|
+print "</td></tr>\n";
|
|
|
+
|
|
|
+// Delay to start the new membership ([+/-][0-99][Y/m/d], for instance, with "+4m", the subscription will start in 4 month.)
|
|
|
+print '<tr class="oddeven drag" id="startfirstdayof"><td>';
|
|
|
+print $langs->trans("MemberSubscriptionStartAfter");
|
|
|
+print '</td><td>';
|
|
|
+print '<input type="text" class="right width50" id="MEMBER_SUBSCRIPTION_START_AFTER" name="MEMBER_SUBSCRIPTION_START_AFTER" value="'.(getDolGlobalString('MEMBER_SUBSCRIPTION_START_AFTER') ? getDolGlobalString('MEMBER_SUBSCRIPTION_START_AFTER') : '').'">';
|
|
|
+print "</td></tr>\n";
|
|
|
+
|
|
|
// Mail required for members
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
|
|
|
print $form->selectyesno('ADHERENT_MAIL_REQUIRED', (getDolGlobalString('ADHERENT_MAIL_REQUIRED') ? $conf->global->ADHERENT_MAIL_REQUIRED : 0), 1);
|