Fix warning on scandir for #30563

This commit is contained in:
Laurent Destailleur 2024-08-17 17:28:18 +02:00
parent 3b147a2776
commit 3f73447489
4 changed files with 11 additions and 11 deletions

View file

@ -241,7 +241,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->RECEPTION_ADDON_NUMBER == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodel&token='.newToken().'&value='.urlencode($file).(!empty($module->scandir) ? '&scan_dir='.$module->scandir : '').(!empty($module->name) ? '&label='.urlencode($module->name) : '').'">';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodel&token='.newToken().'&value='.urlencode($file).(!empty($module->name) ? '&label='.urlencode($module->name) : '').'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
}

View file

@ -145,6 +145,7 @@ if ($action == 'updateMask') {
}
}
/*
* View
*/
@ -157,7 +158,7 @@ $form = new Form($db);
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("SupplierPaymentSetup"), $linkback, 'title_setup');
print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
print "<br>";
@ -221,6 +222,7 @@ foreach ($dirmodels as $reldir) {
$classname = "mod_supplier_payment_".$file;
}
// Check if there is a filter on country
$reg = array();
preg_match('/\-(.*)_(.*)$/', $classname, $reg);
if (!empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) {
continue;
@ -264,11 +266,10 @@ foreach ($dirmodels as $reldir) {
print '</td>'."\n";
print '<td class="center">';
//print "> ".$conf->global->SUPPLIER_PAYMENT_ADDON." - ".$file;
if ($conf->global->SUPPLIER_PAYMENT_ADDON == $file || getDolGlobalString('SUPPLIER_PAYMENT_ADDON') . '.php' == $file) {
if (getDolGlobalString('SUPPLIER_PAYMENT_ADDON') == $file || getDolGlobalString('SUPPLIER_PAYMENT_ADDON') . '.php' == $file) {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.preg_replace('/\.php$/', '', $file).(!empty($module->scandir) ? '&scandir='.$module->scandir : '').'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.preg_replace('/\.php$/', '', $file).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
}
print '</td>';
@ -318,6 +319,7 @@ print '</table>';
/*
* Document templates generators
*/
print '<br>';
print load_fiche_titre($langs->trans("PaymentsPDFModules"), '', '');
@ -348,15 +350,13 @@ foreach ($dirmodels as $reldir) {
$classname = substr($file, 0, dol_strlen($file) - 12);
require_once $dir.'/'.$file;
$module = new $classname($db, new PaiementFourn($db));
$module = new $classname($db);
print "<tr class=\"oddeven\">\n";
print '<tr class="oddeven">'."\n";
print "<td>";
print(empty($module->name) ? $name : $module->name);
print "</td>\n";
print "<td>\n";
require_once $dir.'/'.$file;
$module = new $classname($db, new Societe($db));
if (method_exists($module, 'info')) {
print $module->info($langs);
} else {

View file

@ -51,7 +51,7 @@ class doc_generic_member_odt extends ModelePDFMember
*/
public function __construct($db)
{
global $conf, $langs, $mysoc;
global $langs, $mysoc;
// Load translation files required by the page
$langs->loadLangs(array("main", "companies"));

View file

@ -48,7 +48,7 @@ class pdf_standard_member extends CommonStickerGenerator
*/
public function __construct($db)
{
global $conf, $langs, $mysoc;
global $langs;
// Translations
$langs->loadLangs(array("main", "admin"));