add new rule

This commit is contained in:
Frédéric FRANCE
2020-05-21 01:41:27 +02:00
parent 416e6dd90d
commit ee6fadd0d5
565 changed files with 5190 additions and 8632 deletions

View File

@@ -180,8 +180,7 @@ function limitChars(textarea, limit, infodiv)
{
print $this->fromsms;
}
else
{
else {
if ($this->fromtype)
{
$langs->load("errors");
@@ -191,22 +190,19 @@ function limitChars(textarea, limit, infodiv)
print "</td></tr>\n";
print "</td></tr>\n";
}
else
{
else {
print '<tr><td class="'.$morecss.'">'.$langs->trans("SmsFrom")."</td><td>";
//print '<input type="text" name="fromname" size="30" value="'.$this->fromsms.'">';
if ($conf->global->MAIN_SMS_SENDMODE == 'ovh') // For backward compatibility @deprecated
{
dol_include_once('/ovh/class/ovhsms.class.php');
try
{
try {
$sms = new OvhSms($this->db);
if (empty($conf->global->OVHSMS_ACCOUNT))
{
$resultsender = 'ErrorOVHSMS_ACCOUNT not defined';
}
else
{
else {
$resultsender = $sms->SmsSenderList();
}
}
@@ -220,16 +216,14 @@ function limitChars(textarea, limit, infodiv)
$tmp = explode('@', $conf->global->MAIN_SMS_SENDMODE);
$classfile = $tmp[0]; $module = (empty($tmp[1]) ? $tmp[0] : $tmp[1]);
dol_include_once('/'.$module.'/class/'.$classfile.'.class.php');
try
{
try {
$classname = ucfirst($classfile);
if (class_exists($classname))
{
$sms = new $classname($this->db);
$resultsender = $sms->SmsSenderList();
}
else
{
else {
$sms = new stdClass();
$sms->error = 'The SMS manager "'.$classfile.'" defined into SMS setup MAIN_SMS_SENDMODE is not found';
}
@@ -240,8 +234,7 @@ function limitChars(textarea, limit, infodiv)
exit;
}
}
else
{
else {
dol_syslog("Warning: The SMS sending method has not been defined into MAIN_SMS_SENDMODE", LOG_WARNING);
$resultsender = array();
$resultsender[0]->number = $this->fromsms;
@@ -256,8 +249,7 @@ function limitChars(textarea, limit, infodiv)
}
print '</select>';
}
else
{
else {
print '<span class="error">'.$langs->trans("SmsNoPossibleSenderFound");
if (is_object($sms) && !empty($sms->error)) print ' '.$sms->error;
print '</span>';
@@ -279,8 +271,7 @@ function limitChars(textarea, limit, infodiv)
{
print (!is_array($this->withto) && !is_numeric($this->withto)) ? $this->withto : "";
}
else
{
else {
print "<input size=\"16\" id=\"sendto\" name=\"sendto\" value=\"".dol_escape_htmltag(!is_array($this->withto) && $this->withto != '1' ? (isset($_REQUEST["sendto"]) ?GETPOST("sendto") : $this->withto) : "+")."\">";
if (!empty($this->withtosocid) && $this->withtosocid > 0)
{
@@ -318,8 +309,7 @@ function limitChars(textarea, limit, infodiv)
print nl2br($defaultmessage);
print '<input type="hidden" name="message" value="'.dol_escape_htmltag($defaultmessage).'">';
}
else
{
else {
print '<textarea class="quatrevingtpercent" name="message" id="message" rows="'.ROWS_4.'" onkeyup="limitChars(this, 160, \'charlimitinfospan\')">'.$defaultmessage.'</textarea>';
print '<div id="charlimitinfo">'.$langs->trans("SmsInfoCharRemain").': <span id="charlimitinfospan">'.(160 - dol_strlen($defaultmessage)).'</span></div></td>';
}