diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index dd3459b1b9c..60a05c00045 100755 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -38,7 +38,8 @@ accessforbidden(); $substitutionarrayfortest=array( '__ID__' => 'TESTIdRecord', -'__EMAIL__' => 'TESTEMail', +'__PHONEFROM__' => 'TESTPhoneFrom', +'__PHONETO__' => 'TESTPhoneTo', '__LASTNAME__' => 'TESTLastname', '__FIRSTNAME__' => 'TESTFirstname' ); diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index c3bf1ebac5a..3043cd1712f 100755 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -86,7 +86,7 @@ class FormSms /** * Show the form to input an sms */ - function show_form() + function show_form($width='180px') { global $conf, $langs, $user; @@ -133,7 +133,7 @@ function limitChars(textarea, limit, infodiv) { $help.=$key.' -> '.$langs->trans($val).'
'; } - print $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"),$help); + print $form->textwithpicto($langs->trans("SmsTestSubstitutionReplacedByGenericValues"),$help); print "\n"; } @@ -143,7 +143,7 @@ function limitChars(textarea, limit, infodiv) if ($this->withfromreadonly) { print ''; - print "".$langs->trans("SmsFrom").""; + print "".$langs->trans("SmsFrom").""; if ($this->fromtype == 'user') { $langs->load("users"); @@ -169,7 +169,7 @@ function limitChars(textarea, limit, infodiv) } else { - print "".$langs->trans("SmsFrom").""; + print "".$langs->trans("SmsFrom").""; //print ''; if ($conf->global->MAIN_SMS_SENDMODE == 'ovh') { @@ -318,47 +318,6 @@ function limitChars(textarea, limit, infodiv) print "\n"; } - - /** - * \brief Affiche la partie de formulaire pour saisie d'un sms - * \param withtopic 1 pour proposer a la saisie le sujet - * \param withbody 1 pour proposer a la saisie le corps du message - * \param withfile 1 pour proposer a la saisie l'ajout d'un fichier joint - * \todo Fonction a virer quand fichier /comm/mailing.php vire (= quand ecran dans /comm/mailing prets) - */ - function sms_topicmessagefile($withtopic=1,$withbody=1,$withfile=1,$defaultbody) - { - global $langs; - - $langs->load("other"); - - print ""; - - // Topic - if ($withtopic) - { - print ""; - print ""; - print ""; - } - - // Message - if ($withbody) - { - print ""; - print ""; - print ""; - } - - print "
".$langs->trans("MailTopic").""; - print ""; - print "
".$langs->trans("MailText").""; - print ""; - print "
"; - } - } ?> diff --git a/htdocs/lib/CSMSFile.class.php b/htdocs/lib/CSMSFile.class.php index b7f2735ebd7..ae74974a31c 100755 --- a/htdocs/lib/CSMSFile.class.php +++ b/htdocs/lib/CSMSFile.class.php @@ -134,15 +134,14 @@ class CSMSFile $ovhsms->class=$this->class; $res=$ovhsms->SmsSend(); - - if (! $res) + if ($res <= 0) { - $this->error="Failed to send SMS
Check your server logs and your firewalls setup"; - dol_syslog("CSMSFile::sendfile: mail end error=".$this->error, LOG_ERROR); + $this->error=$ovhsms->error; + dol_syslog("CSMSFile::sendfile: sms send error=".$this->error, LOG_ERROR); } else { - dol_syslog("CSMSFile::sendfile: mail end success", LOG_DEBUG); + dol_syslog("CSMSFile::sendfile: sms send success", LOG_DEBUG); } } else