diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index e8b2b7bdc10..77f4d14dc77 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -178,6 +178,7 @@ if ($action == 'edit') jQuery("#MAIN_MAIL_EMAIL_DKIM_DOMAIN").prop("disabled", true); jQuery("#MAIN_MAIL_EMAIL_DKIM_SELECTOR").prop("disabled", true); jQuery("#MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").prop("disabled", true); + jQuery(".smtp_method").hide(); jQuery(".dkim").hide(); '; if ($linuxlike) @@ -191,7 +192,7 @@ if ($action == 'edit') print ' jQuery("#MAIN_MAIL_SMTP_SERVER").prop("disabled", true); jQuery("#MAIN_MAIL_SMTP_PORT").prop("disabled", true); - jQuery("#smtp_server_mess").hide(); + jQuery("#smtp_server_mess").hide(); jQuery("#smtp_port_mess").hide();'; } print ' @@ -220,7 +221,8 @@ if ($action == 'edit') jQuery("#MAIN_MAIL_SMTP_PORT").show(); jQuery("#smtp_server_mess").hide(); jQuery("#smtp_port_mess").hide(); - jQuery(".dkim").hide(); + jQuery(".smtp_method").show(); + jQuery(".dkim").hide(); } if (jQuery("#MAIN_MAIL_SENDMODE").val()==\'swiftmailer\') { @@ -246,6 +248,7 @@ if ($action == 'edit') jQuery("#MAIN_MAIL_SMTP_PORT").show(); jQuery("#smtp_server_mess").hide(); jQuery("#smtp_port_mess").hide(); + jQuery(".smtp_method").show(); jQuery(".dkim").show(); } } @@ -318,13 +321,15 @@ if ($action == 'edit') print ''; // Host server - print ''; - if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') - { + print ''; + if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { + print ''; print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; + print ''; } else { + print ''; $mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : ''); $smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -333,17 +338,19 @@ if ($action == 'edit') // SuperAdministrator access only if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { - print ''; + print ''; print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; + print ' '.$langs->trans("SeeLinkToOnlineDocumentation").''; } else { $text = !empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } + print ''; } - print ''; + print ''; // Port print ''; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 94b7d0f1a2d..a94fe759125 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -717,17 +717,18 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $langs->loadLangs(array("admin", "help")); $warnpicto = ''; - if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) + if (!empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) { $langs->load("errors"); - $warnpicto = ' '.img_warning($langs->trans("WarningMandatorySetupNotComplete")); + $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); } $newmenu->add("/admin/company.php?mainmenu=home", $langs->trans("MenuCompanySetup").$warnpicto, 1); + $warnpicto = ''; - if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled + if (1 || count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled { $langs->load("errors"); - $warnpicto = ' '.img_warning($langs->trans("WarningMandatorySetupNotComplete")); + $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); } $newmenu->add("/admin/modules.php?mainmenu=home", $langs->trans("Modules").$warnpicto, 1); $newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"), 1); @@ -740,7 +741,18 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/admin/security_other.php?mainmenu=home", $langs->trans("Security"), 1); $newmenu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"), 1); $newmenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1); - $newmenu->add("/admin/mails.php?mainmenu=home", $langs->trans("Emails"), 1); + + $warnpicto = ''; + if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { + $langs->load("errors"); + $warnpicto = img_warning($langs->trans("WarningPHPMailD")); + } + if (in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmail')) && empty($conf->global->MAIN_MAIL_SMTP_SERVER)) { + $langs->load("errors"); + $warnpicto = img_warning($langs->trans("ErrorSetupOfEmailsNotComplete")); + } + + $newmenu->add("/admin/mails.php?mainmenu=home", $langs->trans("Emails").$warnpicto, 1); $newmenu->add("/admin/sms.php?mainmenu=home", $langs->trans("SMS"), 1); $newmenu->add("/admin/dict.php?mainmenu=home", $langs->trans("Dictionary"), 1); $newmenu->add("/admin/const.php?mainmenu=home", $langs->trans("OtherSetup"), 1); @@ -1985,17 +1997,14 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) $showmenu = false; // Begin of new left menu block - if (empty($menu_array[$i]['level']) && $showmenu) - { + if (empty($menu_array[$i]['level']) && $showmenu) { $altok++; $blockvmenuopened = true; $lastopened = true; - for ($j = ($i + 1); $j < $num; $j++) - { + for ($j = ($i + 1); $j < $num; $j++) { if (empty($menu_array[$j]['level'])) $lastopened = false; } - if ($altok % 2 == 0) - { + if ($altok % 2 == 0) { print '
'."\n"; } else { print '
'."\n"; @@ -2005,10 +2014,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Add tabulation $tabstring = ''; $tabul = ($menu_array[$i]['level'] - 1); - if ($tabul > 0) - { - for ($j = 0; $j < $tabul; $j++) - { + if ($tabul > 0) { + for ($j = 0; $j < $tabul; $j++) { $tabstring .= '   '; } } @@ -2048,7 +2055,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if ($menu_array[$i]['enabled']) // Enabled so visible { print '