diff --git a/htdocs/adherents/admin/member_emails.php b/htdocs/adherents/admin/member_emails.php index 207a913d841..45756ec2691 100644 --- a/htdocs/adherents/admin/member_emails.php +++ b/htdocs/adherents/admin/member_emails.php @@ -69,9 +69,24 @@ $constantes = array( // if ($action == 'updateall') { $db->begin(); - $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = 0; - $res1 = dolibarr_set_const($db, 'XXXX', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); - if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0) { + + $res = 0; + foreach ($constantes as $constname => $value) { + $constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alphanohtml') : GETPOST('constvalue')); + $consttype = (GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype')); + $constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'restricthtml') : GETPOST('constnote')); + + $typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype]; + $constvalue = preg_replace('/:member$/', '', $constvalue); + + $res = dolibarr_set_const($db, $constname, $constvalue, $consttype, 0, $constnote, $conf->entity); + if ($res <= 0) { + $error++; + $action = 'list'; + } + } + + if ($error > 0) { setEventMessages('ErrorFailedToSaveDate', null, 'errors'); $db->rollback(); } else { @@ -126,19 +141,19 @@ $head = member_admin_prepare_head(); print dol_get_fiche_head($head, 'emails', $langs->trans("Members"), -1, 'user'); // TODO Use global form -//print '
'; +print ''; +print ''; print dol_get_fiche_end(); diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 1192034e052..e1cf115626f 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -92,7 +92,7 @@ if ($action == 'settemplates') { if ($action == 'setvalue' && $user->admin) { $db->begin(); - $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", GETPOST("email_from", "restricthtml"), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", GETPOST("email_from", "alphawithlgt"), 'chaine', 0, '', $conf->entity); if ($result < 0) { $error++; } @@ -270,7 +270,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { } $helptext = ''; - form_constantes($constantes, 2, $helptext); + form_constantes($constantes, 3, $helptext); } else { print '| '; - print ''; - print ''; + print ''; + print ''; if ($obj->type == 'textarea' || in_array($const, array('ADHERENT_CARD_TEXT', 'ADHERENT_CARD_TEXT_RIGHT', 'ADHERENT_ETIQUETTE_TEXT'))) { - print ' | '; }