diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 686da7fc68c..e3aab979a41 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -99,7 +99,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if (! isValidEmail($email)) { $langs->load("errors"); - setEventMessage($langs->trans("ErrorBadEMail",$email),'errors'); + setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors'); } else { @@ -118,11 +118,11 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if ($result < 0) { $error++; - setEventMessage($mailmanspip->error,'errors'); + setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors'); } else { - setEventMessage($langs->trans("MailmanCreationSuccess")); + setEventMessages($langs->trans("MailmanCreationSuccess"), null); } } if ($action == 'testunsubscribe') @@ -131,11 +131,11 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if ($result < 0) { $error++; - setEventMessage($mailmanspip->error,'errors'); + setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors'); } else { - setEventMessage($langs->trans("MailmanDeletionSuccess")); + setEventMessages($langs->trans("MailmanDeletionSuccess"), null); } } } @@ -156,12 +156,15 @@ print load_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'title_setup' $head = mailmanspip_admin_prepare_head(); -dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); $var=true; if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { + print '
'; + + dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); + //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; //$link.=$langs->trans("Disable"); @@ -200,21 +203,30 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN)) }); '; - form_constantes($constantes,1); - + form_constantes($constantes,2); + print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL%
'; + + dol_fiche_end(); + + print '
'; + + print ''; } else { + dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); + $link='
'; //$link.=img_$langs->trans("Activate") $link.=img_picto($langs->trans("Disabled"),'switch_off'); $link.=''; print load_fiche_titre($langs->trans('MailmanTitle'), $link,''); + + dol_fiche_end(); } -dol_fiche_end(); if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index e46d9b8f5b7..13d959eb38c 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -54,28 +54,30 @@ if ($action == 'update' || $action == 'add') $constname=GETPOST("constname"); $constvalue=GETPOST("constvalue"); - if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE') && $constvalue == -1) $constvalue=''; - if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice - { - if ($constvalue) $constvalue=0; - else $constvalue=1; - } + // Action mise a jour ou ajout d'une constante + if ($action == 'update' || $action == 'add') + { + foreach($_POST['constname'] as $key => $val) + { + $constname=$_POST["constname"][$key]; + $constvalue=$_POST["constvalue"][$key]; + $consttype=$_POST["consttype"][$key]; + $constnote=$_POST["constnote"][$key]; - if (in_array($constname,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $constvalue=$_POST["constvalue".$constname]; - $consttype=$_POST["consttype"]; - $constnote=GETPOST("constnote"); - $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); - - if (! $res > 0) $error++; - - if (! $error) - { - setEventMessage($langs->trans("SetupSaved")); - } - else - { - setEventMessage($langs->trans("Error"),'errors'); - } + $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); + + if (! $res > 0) $error++; + } + + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } + } } // Action activation d'un sous module du module adherent @@ -115,7 +117,6 @@ print load_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'title_setup' $head = mailmanspip_admin_prepare_head(); -dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); $var=true; @@ -124,6 +125,10 @@ $var=true; */ if (! empty($conf->global->ADHERENT_USE_SPIP)) { + print '
'; + + dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); + //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; //$link.=$langs->trans("Disable"); @@ -139,21 +144,28 @@ if (! empty($conf->global->ADHERENT_USE_SPIP)) print load_fiche_titre($langs->trans('SPIPTitle'), $link, ''); print '
'; - form_constantes($constantes); - print '
'; + + form_constantes($constantes,2); + + dol_fiche_end(); + + print '
'; + + print ''; } else { + dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); + $link='
'; //$link.=$langs->trans("Activate"); $link.=img_picto($langs->trans("Disabled"),'switch_off'); $link.=''; print load_fiche_titre($langs->trans('SPIPTitle'), $link, ''); + + dol_fiche_end(); } - -dol_fiche_end(); - llxFooter(); $db->close(); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 3d887f1bd18..7b22a2e8dbe 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1053,7 +1053,7 @@ function complete_elementList_with_modules(&$elementList) * Show array with constants to edit * * @param array $tableau Array of constants - * @param int $strictw3c Respect W3C (no form into table) + * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all * @return void */ function form_constantes($tableau,$strictw3c=0) @@ -1062,7 +1062,7 @@ function form_constantes($tableau,$strictw3c=0) $form = new Form($db); - if (! empty($strictw3c)) print "\n".'
'; + if (! empty($strictw3c) && $strictw3c == 1) print "\n".''; print ''; print ''; @@ -1199,7 +1199,7 @@ function form_constantes($tableau,$strictw3c=0) } print '
'; - if (! empty($strictw3c)) + if (! empty($strictw3c) && $strictw3c == 1) { print '
'; print "
\n";