|
@@ -48,6 +48,37 @@ $action = GETPOST('action','alpha');
|
|
|
* Actions
|
|
|
*/
|
|
|
|
|
|
+//
|
|
|
+if ($action == 'updateall')
|
|
|
+{
|
|
|
+ $db->begin();
|
|
|
+ $res1=$res2=$res3=$res4=$res5=$res6=0;
|
|
|
+ $res1=dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), '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);
|
|
|
+ $res4=dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
|
+ // Use vat for invoice creation
|
|
|
+ if ($conf->facture->enabled)
|
|
|
+ {
|
|
|
+ $res4=dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
|
+ $res5=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
|
+ if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
|
|
+ {
|
|
|
+ $res6=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0)
|
|
|
+ {
|
|
|
+ setEventMessages('ErrorFailedToSaveDate', null, 'errors');
|
|
|
+ $db->rollback();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
|
|
|
+ $db->commit();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// Action mise a jour ou ajout d'une constante
|
|
|
if ($action == 'update' || $action == 'add')
|
|
|
{
|
|
@@ -116,113 +147,81 @@ print load_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
|
|
|
|
|
|
$head = member_admin_prepare_head();
|
|
|
|
|
|
-dol_fiche_head($head, 'general', $langs->trans("Members"), 0, 'user');
|
|
|
+dol_fiche_head($head, 'general', $langs->trans("Members"), -1, 'user');
|
|
|
+
|
|
|
+print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
|
|
+print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
+print '<input type="hidden" name="action" value="updateall">';
|
|
|
|
|
|
print load_fiche_titre($langs->trans("MemberMainOptions"),'','');
|
|
|
print '<table class="noborder" width="100%">';
|
|
|
print '<tr class="liste_titre">';
|
|
|
print '<td>'.$langs->trans("Description").'</td>';
|
|
|
print '<td>'.$langs->trans("Value").'</td>';
|
|
|
-print '<td align="center">'.$langs->trans("Action").'</td>';
|
|
|
print "</tr>\n";
|
|
|
|
|
|
// Login/Pass required for members
|
|
|
-print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
|
|
-print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
-print '<input type="hidden" name="action" value="update">';
|
|
|
-print '<input type="hidden" name="constname" value="ADHERENT_LOGIN_NOT_REQUIRED">';
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
|
|
|
-print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1);
|
|
|
-print '</td><td align="center" width="80">';
|
|
|
-print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
|
|
+print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1);
|
|
|
print "</td></tr>\n";
|
|
|
-print '</form>';
|
|
|
|
|
|
// Mail required for members
|
|
|
-print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
|
|
-print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
-print '<input type="hidden" name="action" value="update">';
|
|
|
-print '<input type="hidden" name="constname" value="ADHERENT_MAIL_REQUIRED">';
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
|
|
|
-print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1);
|
|
|
-print '</td><td align="center" width="80">';
|
|
|
-print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
|
|
+print $form->selectyesno('ADHERENT_MAIL_REQUIRED',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1);
|
|
|
print "</td></tr>\n";
|
|
|
-print '</form>';
|
|
|
|
|
|
// Send mail information is on by default
|
|
|
-print '<form action="adherent.php" method="POST">';
|
|
|
-print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
-print '<input type="hidden" name="action" value="update">';
|
|
|
-print '<input type="hidden" name="constname" value="ADHERENT_DEFAULT_SENDINFOBYMAIL">';
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
|
|
|
-print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1);
|
|
|
-print '</td><td align="center" width="80">';
|
|
|
-print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
|
|
+print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1);
|
|
|
print "</td></tr>\n";
|
|
|
-print '</form>';
|
|
|
|
|
|
// Insert subscription into bank account
|
|
|
-print '<form action="adherent.php" method="POST">';
|
|
|
-print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
-print '<input type="hidden" name="action" value="update">';
|
|
|
-print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
|
|
|
$arraychoices=array('0'=>$langs->trans("None"));
|
|
|
if (! empty($conf->banque->enabled)) $arraychoices['bankdirect']=$langs->trans("MoreActionBankDirect");
|
|
|
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['invoiceonly']=$langs->trans("MoreActionInvoiceOnly");
|
|
|
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['bankviainvoice']=$langs->trans("MoreActionBankViaInvoice");
|
|
|
print '<td>';
|
|
|
-print $form->selectarray('constvalue',$arraychoices,$conf->global->ADHERENT_BANK_USE,0);
|
|
|
-print '</td><td align="center" width="80">';
|
|
|
-print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
|
|
+print $form->selectarray('ADHERENT_BANK_USE',$arraychoices,$conf->global->ADHERENT_BANK_USE,0);
|
|
|
print '</td>';
|
|
|
print "</tr>\n";
|
|
|
-print '</form>';
|
|
|
|
|
|
// Use vat for invoice creation
|
|
|
if ($conf->facture->enabled)
|
|
|
{
|
|
|
- print '<form action="adherent.php" method="POST">';
|
|
|
- print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
- print '<input type="hidden" name="action" value="update">';
|
|
|
- print '<input type="hidden" name="constname" value="ADHERENT_VAT_FOR_SUBSCRIPTIONS">';
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
|
|
|
if (! empty($conf->banque->enabled))
|
|
|
{
|
|
|
print '<td>';
|
|
|
- print $form->selectarray('constvalue', array('0'=>$langs->trans("NoVatOnSubscription"),'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS)?'0':$conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
|
|
|
- print '</td><td align="center" width="80">';
|
|
|
- print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
|
|
+ print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"),'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS)?'0':$conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
|
|
|
print '</td>';
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- print '<td align="right" colspan="2">';
|
|
|
+ print '<td align="right">';
|
|
|
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name"));
|
|
|
print '</td>';
|
|
|
}
|
|
|
print "</tr>\n";
|
|
|
- print '</form>';
|
|
|
-
|
|
|
+
|
|
|
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
|
|
{
|
|
|
- print '<form action="adherent.php" method="POST">';
|
|
|
- print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|
|
- print '<input type="hidden" name="action" value="update">';
|
|
|
- print '<input type="hidden" name="constname" value="ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS">';
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
|
|
|
print '<td>';
|
|
|
- $form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'constvalue_ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS');
|
|
|
- print '</td><td align="center" width="80">';
|
|
|
- print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
|
|
+ $form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS');
|
|
|
print '</td>';
|
|
|
}
|
|
|
print "</tr>\n";
|
|
|
- print '</form>';
|
|
|
}
|
|
|
|
|
|
print '</table>';
|
|
|
+
|
|
|
+print '<center>';
|
|
|
+print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
|
|
+print '</center>';
|
|
|
+
|
|
|
+print '</form>';
|
|
|
+
|
|
|
print '<br>';
|
|
|
|
|
|
|
|
@@ -240,13 +239,12 @@ $constantes=array(
|
|
|
|
|
|
print load_fiche_titre($langs->trans("MembersCards"),'','');
|
|
|
|
|
|
-form_constantes($constantes);
|
|
|
+$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
|
|
+$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
|
|
+$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
|
|
+$helptext.='%YEAR%, %MONTH%, %DAY%';
|
|
|
|
|
|
-print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
|
|
-print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
|
|
-print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
|
|
-print '%YEAR%, %MONTH%, %DAY%';
|
|
|
-print '<br>';
|
|
|
+form_constantes($constantes, 0, $helptext);
|
|
|
|
|
|
print '<br>';
|
|
|
|
|
@@ -258,13 +256,12 @@ $constantes=array('ADHERENT_ETIQUETTE_TYPE','ADHERENT_ETIQUETTE_TEXT');
|
|
|
|
|
|
print load_fiche_titre($langs->trans("MembersTickets"),'','');
|
|
|
|
|
|
-form_constantes($constantes);
|
|
|
+$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
|
|
+$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
|
|
+$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
|
|
+$helptext.='%YEAR%, %MONTH%, %DAY%';
|
|
|
|
|
|
-print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
|
|
-print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
|
|
-print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
|
|
-print '%YEAR%, %MONTH%, %DAY%';
|
|
|
-print '<br>';
|
|
|
+form_constantes($constantes, 0, $helptext);
|
|
|
|
|
|
print '<br>';
|
|
|
|
|
@@ -288,13 +285,17 @@ $constantes=array(
|
|
|
|
|
|
print load_fiche_titre($langs->trans("Other"),'','');
|
|
|
|
|
|
-form_constantes($constantes);
|
|
|
+$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
|
|
+$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
|
|
+$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
|
|
+$helptext.='%YEAR%, %MONTH%, %DAY%';
|
|
|
|
|
|
-print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
|
|
-print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
|
|
-print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
|
|
-//print '%YEAR%, %MONTH%, %DAY%'; // Not supported
|
|
|
-print '<br>';
|
|
|
+$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
|
|
+$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
|
|
+$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
|
|
+//$helptext.='%YEAR%, %MONTH%, %DAY%'; // Not supported
|
|
|
+
|
|
|
+form_constantes($constantes, 0, $helptext);
|
|
|
|
|
|
dol_fiche_end();
|
|
|
|