2
0
forked from Wavyzz/dolibarr

clean code (#35677)

* clean code

* clean code

* clean code

* clean code

* clean code

* clean code
This commit is contained in:
Frédéric FRANCE
2025-10-07 23:30:13 +02:00
committed by GitHub
parent d67db1e685
commit 152cc48585
6 changed files with 29 additions and 38 deletions

View File

@@ -1222,6 +1222,7 @@ function activateModule($value, $withdeps = 1, $noconfverification = 0)
$objMod = new $modName($db);
'@phan-var-force DolibarrModules $objMod';
/** @var DolibarrModules $objMod */
// Test if PHP version ok
$verphp = versionphparray();
@@ -1364,6 +1365,7 @@ function unActivateModule($value, $requiredby = 1)
if ($found) {
$objMod = new $modName($db);
'@phan-var-force DolibarrModules $objMod';
/** @var DolibarrModules $objMod */
$result = $objMod->remove();
if ($result <= 0) {
$ret = $objMod->error;
@@ -1437,6 +1439,7 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab
include_once $dir.$file;
$objMod = new $modName($db);
'@phan-var-force DolibarrModules $objMod';
/** @var DolibarrModules $objMod */
if ($objMod->numero > 0) {
$j = $objMod->numero;
@@ -1604,6 +1607,7 @@ function activateModulesRequiredByCountry($country_code)
include_once $dir.$file;
$objMod = new $modName($db);
'@phan-var-force DolibarrModules $objMod';
/** @var DolibarrModules $objMod */
$modulequalified = 1;
@@ -1680,6 +1684,7 @@ function complete_elementList_with_modules(&$elementList)
if ($modName) {
include_once $dir.$file;
$objMod = new $modName($db);
/** @var DolibarrModules $objMod */
if ($objMod->numero > 0) {
$j = $objMod->numero;
@@ -1930,7 +1935,7 @@ function form_constantes($tableau, $strictw3c = 2, $helptext = '', $text = 'Valu
//var_dump($arrayofmessagename);
print $form->selectarray('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $arrayofmessagename, $obj->value.':'.$tmp[1], 'None', 0, 0, '', 0, 0, 0, '', '', 1);
print '<a href="'.DOL_URL_ROOT.'/admin/mails_templates.php?action=create&type_template='.urlencode($tmp[1]).'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_picto('', 'add').'</a>';
print '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/mails_templates.php', ['action' => 'create', 'type_template' => $tmp[1], 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"])]).'">'.img_picto('', 'add').'</a>';
} elseif (preg_match('/MAIL_FROM$/i', $const)) {
print img_picto('', 'email', 'class="pictofixedwidth"').'<input type="text" class="flat minwidth300" name="constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')).'" value="'.dol_escape_htmltag($obj->value).'">';
} else { // type = 'string' ou 'chaine'