diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index 7e9e88ac723..cef180ab96b 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -630,13 +630,13 @@ if ($action == 'edit') {
// From
print '
| '.$langs->trans("MAIN_MAIL_ERRORS_TO").' | ';
- print ' |
';
+ print '';
+ print ' | ';
// Autocopy to
print '| '.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").' | ';
- print ' |
';
+ print '';
+ print ' | ';
// Add user to select destinaries list
print '| '.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").' | ';
diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php
index 4d6f5bcd6df..0860661d31c 100644
--- a/htdocs/admin/sms.php
+++ b/htdocs/admin/sms.php
@@ -55,7 +55,7 @@ if ($action == 'update' && !$cancel) {
dolibarr_set_const($db, "MAIN_SMS_SENDMODE", GETPOST("MAIN_SMS_SENDMODE", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_MAIL_SMS_FROM", GETPOST("MAIN_MAIL_SMS_FROM", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_SMS_FROM", GETPOST("MAIN_SMS_FROM", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit;
@@ -192,16 +192,10 @@ if ($action == 'edit') {
print ' |
';
// From
- print '| '.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).' | ';
- print ' | '.$langs->trans("MAIN_SMS_FROM", $langs->transnoentities("Undefined")).' | ';
+ print ' |
';
- // Autocopy to
- /*
- print '| '.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").' | ';
- print ' |
';
- */
print '';
print '
';
@@ -232,21 +226,13 @@ if ($action == 'edit') {
print '';
// From
- print '
| '.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).' | ';
- print ''.getDolGlobalString('MAIN_MAIL_SMS_FROM');
- if (getDolGlobalString('MAIN_MAIL_SMS_FROM') && !isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) {
+ print ' |
| '.$langs->trans("MAIN_SMS_FROM", $langs->transnoentities("Undefined")).' | ';
+ print ''.getDolGlobalString('MAIN_SMS_FROM');
+ if (getDolGlobalString('MAIN_SMS_FROM') && !isValidPhone(getDolGlobalString('MAIN_SMS_FROM'))) {
print ' '.img_warning($langs->trans("ErrorBadPhone"));
}
print ' |
';
- // Autocopy to
- /*
- print '| '.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").' | ';
- print ''.$conf->global->MAIN_MAIL_AUTOCOPY_TO;
- if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO) && ! isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail"));
- print ' |
';
- */
-
print '';
@@ -273,7 +259,7 @@ if ($action == 'edit') {
$formsms = new FormSms($db);
$formsms->fromtype = 'user';
$formsms->fromid = $user->id;
- $formsms->fromsms = (GETPOSTISSET('fromsms') ? GETPOST('fromsms') : ($conf->global->MAIN_MAIL_SMS_FROM ? $conf->global->MAIN_MAIL_SMS_FROM : $user->user_mobile));
+ $formsms->fromsms = (GETPOSTISSET('fromsms') ? GETPOST('fromsms') : getDolGlobalString('MAIN_SMS_FROM', $user->user_mobile));
$formsms->withfromreadonly = 0;
$formsms->withsubstit = 0;
$formsms->withfrom = 1;
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 78158e26c2c..d216a035a50 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -316,7 +316,7 @@ MAIN_MAIL_EMAIL_DKIM_SELECTOR=Name of dkim selector
MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY=Private key for dkim signing
MAIN_DISABLE_ALL_SMS=Disable all SMS sending (for test purposes or demos)
MAIN_SMS_SENDMODE=Method to use to send SMS
-MAIN_MAIL_SMS_FROM=Default sender phone number for SMS sending
+MAIN_SMS_FROM=Default sender phone number for SMS sending
MAIN_MAIL_DEFAULT_FROMTYPE=Default sender email preselected on forms to send emails
UserEmail=User email
CompanyEmail=Company Email