Fix: Evite erreur si module numrotation facture install avec rep sans fichier

This commit is contained in:
Laurent Destailleur 2006-04-29 10:34:55 +00:00
parent dedb6206de
commit cfb4537850

View File

@ -181,48 +181,49 @@ while (($file = readdir($handle))!==false)
{ {
if (is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') if (is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
{ {
$var = !$var;
print '<tr '.$bc[$var].'><td width="100">';
echo "$file";
print "</td><td>\n";
$filebis = $file."/".$file.".modules.php"; $filebis = $file."/".$file.".modules.php";
if (is_readable($dir.$filebis))
// Chargement de la classe de numérotation {
$classname = "mod_facture_".$file; $var = !$var;
require_once($dir.$filebis); print '<tr '.$bc[$var].'><td width="100">';
echo "$file";
$module = new $classname($db); print "</td><td>\n";
print $module->info();
// Chargement de la classe de numérotation
print '</td>'; require_once($dir.$filebis);
$classname = "mod_facture_".$file;
// Affiche example $module = new $classname($db);
print '<td nowrap="nowrap">'.$module->getExample().'</td>'; print $module->info();
print '<td align="center">'; print '</td>';
if ($conf->global->FACTURE_ADDON == "$file")
{ // Affiche example
print img_tick($langs->trans("Activated")); print '<td nowrap="nowrap">'.$module->getExample().'</td>';
}
else print '<td align="center">';
{ if ($conf->global->FACTURE_ADDON == "$file")
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>'; {
} print img_tick($langs->trans("Activated"));
print '</td>'; }
else
// Info {
$htmltooltip=''; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
$nextval=$module->getNextValue(); }
if ($nextval != $langs->trans("NotAvailable")) print '</td>';
{
$htmltooltip='<b>'.$langs->trans("NextValue").'</b>: '.$nextval; // Info
} $htmltooltip='';
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>'; $nextval=$module->getNextValue();
print ($htmltooltip?img_help(0):''); if ($nextval != $langs->trans("NotAvailable"))
print '</td>'; {
$htmltooltip='<b>'.$langs->trans("NextValue").'</b>: '.$nextval;
print "</tr>\n"; }
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>';
print ($htmltooltip?img_help(0):'');
print '</td>';
print "</tr>\n";
}
} }
} }
closedir($handle); closedir($handle);