Clean code

This commit is contained in:
ldestailleur 2025-03-25 12:42:51 +01:00
parent c6d50cf46b
commit 705eb17310
6 changed files with 17 additions and 29 deletions

View file

@ -22,6 +22,7 @@ The following changes may create regressions for some external modules, but were
* The deprecated variable $trigger_name (duplicate of variable $triggersendname) has been removed. You must use $triggersendname everywhere now.
* The behavior of constant STOCK_ALLOW_NEGATIVE_TRANSFER has been reversed. It has been renamed to STOCK_DISALLOW_NEGATIVE_TRANSFER.
* Method Categoie->getObjectsInCateg() is deprecated. Try by using instead getListForItem() or containing().
* Global variable $bctag and $conffiletoshowshort has been removed.
***** ChangeLog for 21.0.0 compared to 20.0 *****

View file

@ -210,25 +210,18 @@ print '<td class="hideonsmartphone"></td>';
print '</tr>';
// Limit number for each mailing batch, displayed only if this value is not defined in the conf.php file
print '<tr class="oddeven">';
$help = img_help(1, $langs->trans("MailingNumberOfEmailsPerBatchHelp"));
print '<td>' . $langs->trans("MailingNumberOfEmailsPerBatch") . ' ' . $help . '</td>';
print '<td>';
if (empty($conf->file->mailing_limit_sendbyweb)) {
print '<tr class="oddeven">';
$help = img_help(1, $langs->trans("MailingNumberOfEmailsPerBatchHelp"));
print '<td>' . $langs->trans("MailingNumberOfEmailsPerBatch") . ' ' . $help . '</td>';
print '<td>';
print '<input class="minwidth100 maxwdith250 widthcentpercentminusx" type="text" name="MAILING_LIMIT_SENDBYWEB" id="MAILING_LIMIT_SENDBYWEB" value="' . getDolGlobalString('MAILING_LIMIT_SENDBYWEB') . '">';
print '</td>';
print '<td class="hideonsmartphone"></td>';
print '</tr>';
}
if (!empty($conf->use_javascript_ajax) && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
print '<tr class="oddeven"><td>';
print $langs->trans("MailAdvTargetRecipients") . '</td><td>';
print ajax_constantonoff('EMAILING_USE_ADVANCED_SELECTOR');
print '</td>';
print '<td class="hideonsmartphone"></td>';
print '</tr>';
print '<input class="width75 right" type="number" name="MAILING_LIMIT_SENDBYWEB" id="MAILING_LIMIT_SENDBYWEB" value="' . getDolGlobalString('MAILING_LIMIT_SENDBYWEB') . '">';
} else {
print $conf->file->mailing_limit_sendbyweb;
}
print '</td>';
print '<td class="hideonsmartphone"></td>';
print '</tr>';
print '</table>';

View file

@ -37,16 +37,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
'
@phan-var-force array{0:string,1:string} $bctag From main.inc
';
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
* @var array{0:string,1:string} $bctag From main.inc
*/
// Load translation files required by the page
@ -591,15 +587,13 @@ if ($object->fetch($id) >= 0) {
// If module is qualified
if ($qualified) {
$var = !$var;
if ($allowaddtarget) {
print '<form '.$bctag[$var].' name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
print '<form class="oddeven trforbreakperms trforbreaknobg impair tagtr" name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="page_y" value="'.newToken().'">';
} else {
print '<div '.$bctag[$var].'>';
print '<div class="oddeven trforbreakperms trforbreaknobg impair tagtr">';
}
print '<div class="tagtd paddingleftimp marginleftonly paddingrightimp marginrightonly valignmiddle center">';

View file

@ -1294,6 +1294,10 @@ class Conf extends stdClass
$this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2; // Use the domain in $dolibarr_main_url_root (mydomain.com)
}
if (!empty($this->use_javascript_ajax) && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
$this->global->EMAILING_USE_ADVANCED_SELECTOR = 1;
}
// Security
if (!defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
if (defined('MAIN_ANTIVIRUS_COMMAND')) {

View file

@ -1247,7 +1247,6 @@ if (!defined('NOREQUIRETRAN')) {
$bc = array(0 => 'class="impair"', 1 => 'class="pair"');
$bcdd = array(0 => 'class="drag drop oddeven"', 1 => 'class="drag drop oddeven"');
$bcnd = array(0 => 'class="nodrag nodrop nohover"', 1 => 'class="nodrag nodrop nohoverpair"'); // Used for tr to add new lines
$bctag = array(0 => 'class="impair tagtr"', 1 => 'class="pair tagtr"');
// Define messages variables
$mesg = '';

View file

@ -4814,9 +4814,6 @@ tr.pair td, tr.impair td, form.impair div.tagtd, form.pair div.tagtd, div.impair
padding: 7px 8px 7px 8px;
border-bottom: 1px solid #ddd;
}
form.pair, form.impair {
font-weight: normal;
}
form.tagtr:last-of-type div.tagtd, tr.pair:last-of-type td, tr.impair:last-of-type td {
border-bottom: 0px !important;
}