2
0
forked from Wavyzz/dolibarr

NEW Remove hardcoded code for OVH sms. Generic method is ok now.

This commit is contained in:
Laurent Destailleur
2023-08-26 12:02:19 +02:00
parent 3199bd7137
commit 8cc3d2358b
8 changed files with 56 additions and 92 deletions

View File

@@ -185,7 +185,7 @@ if ($action == 'edit') {
// Method
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
if (count($listofmethods)) {
print $form->selectarray('MAIN_SMS_SENDMODE', $listofmethods, $conf->global->MAIN_SMS_SENDMODE, 1);
print $form->selectarray('MAIN_SMS_SENDMODE', $listofmethods, getDolGlobalString('MAIN_SMS_SENDMODE'), 1);
} else {
print '<span class="error">'.$langs->trans("None").'</span>';
}
@@ -224,7 +224,7 @@ if ($action == 'edit') {
// Method
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
$text = empty(getDolGlobalString('MAIN_SMS_SENDMODE')) ? '' : $listofmethods[getDolGlobalString('MAIN_SMS_SENDMODE')];
$text = getDolGlobalString('MAIN_SMS_SENDMODE') ? $listofmethods[getDolGlobalString('MAIN_SMS_SENDMODE')] : '';
if (empty($text)) {
$text = $langs->trans("Undefined").' '.img_warning();
}
@@ -256,19 +256,7 @@ if ($action == 'edit') {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
/*if ($conf->global->MAIN_SMS_SENDMODE != 'mail' || ! $linuxlike)
{
if (function_exists('fsockopen') && $port && $server)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect">'.$langs->trans("DoTestServerAvailability").'</a>';
}
}
else
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
}*/
if (count($listofmethods) && !empty($conf->global->MAIN_SMS_SENDMODE)) {
if (count($listofmethods) && getDolGlobalString('MAIN_SMS_SENDMODE')) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&amp;mode=init">'.$langs->trans("DoTestSend").'</a>';
} else {
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("DoTestSend").'</a>';