diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 59fe5f778a1..bef6fb9a00e 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -23,7 +23,7 @@ /** * \file htdocs/adherents/admin/adherent.php * \ingroup adherent - * \brief Page d'administration/configuration du module Adherent + * \brief Page to setup the module Foundation * \version $Id$ */ @@ -45,7 +45,14 @@ if ($_POST["action"] == 'update' || $_POST["action"] == 'add') { if (($_POST["constname"]=='ADHERENT_CARD_TYPE' || $_POST["constname"]=='ADHERENT_ETIQUETTE_TYPE') && $_POST["constvalue"] == -1) $_POST["constvalue"]=''; - $result=dolibarr_set_const($db, $_POST["constname"],$_POST["constvalue"],$typeconst[$_POST["consttype"]],0,isset($_POST["constnote"])?$_POST["constnote"]:'',$conf->entity); + + $const=$_POST["constname"]; + $value=$_POST["constvalue"]; + if (in_array($const,array('ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $value=$_POST["constvalue".$const]; + $type=$_POST["consttype"]; + $constnote=isset($_POST["constnote"])?$_POST["constnote"]:''; + + $result=dolibarr_set_const($db,$const,$value,$typeconst[$type],0,$constnote,$conf->entity); if ($result < 0) { print $db->error(); @@ -126,9 +133,6 @@ print '\n"; print ''; - - - // Insertion cotisations dans compte financier $var=!$var; print '
'; print ''; print '