Fix: compatibility with custom path
This commit is contained in:
parent
48d0356d7e
commit
488938cde1
@ -448,96 +448,99 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
|||||||
{
|
{
|
||||||
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
|
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
|
||||||
{
|
{
|
||||||
$name = substr($file, 4, dol_strlen($file) -16);
|
if (file_exists($dir.'/'.$file))
|
||||||
$classname = substr($file, 0, dol_strlen($file) -12);
|
{
|
||||||
|
$name = substr($file, 4, dol_strlen($file) -16);
|
||||||
require_once($dir.'/'.$file);
|
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||||
$module = new $classname($db);
|
|
||||||
|
require_once($dir.'/'.$file);
|
||||||
$modulequalified=1;
|
$module = new $classname($db);
|
||||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
|
|
||||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
|
$modulequalified=1;
|
||||||
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
|
||||||
if ($modulequalified)
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
|
||||||
{
|
|
||||||
$var = !$var;
|
if ($modulequalified)
|
||||||
print '<tr '.$bc[$var].'><td width="100">';
|
{
|
||||||
print (empty($module->name)?$name:$module->name);
|
$var = !$var;
|
||||||
print "</td><td>\n";
|
print '<tr '.$bc[$var].'><td width="100">';
|
||||||
if (method_exists($module,'info')) print $module->info($langs);
|
print (empty($module->name)?$name:$module->name);
|
||||||
else print $module->description;
|
print "</td><td>\n";
|
||||||
print '</td>';
|
if (method_exists($module,'info')) print $module->info($langs);
|
||||||
|
else print $module->description;
|
||||||
// Active
|
print '</td>';
|
||||||
if (in_array($name, $def))
|
|
||||||
{
|
// Active
|
||||||
print "<td align=\"center\">\n";
|
if (in_array($name, $def))
|
||||||
if ($conf->global->FACTURE_ADDON_PDF != "$name")
|
{
|
||||||
{
|
print "<td align=\"center\">\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
if ($conf->global->FACTURE_ADDON_PDF != "$name")
|
||||||
print img_picto($langs->trans("Enabled"),'on');
|
{
|
||||||
print '</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||||
}
|
print img_picto($langs->trans("Enabled"),'on');
|
||||||
else
|
print '</a>';
|
||||||
{
|
}
|
||||||
print img_picto($langs->trans("Enabled"),'on');
|
else
|
||||||
}
|
{
|
||||||
print "</td>";
|
print img_picto($langs->trans("Enabled"),'on');
|
||||||
}
|
}
|
||||||
else
|
print "</td>";
|
||||||
{
|
}
|
||||||
print "<td align=\"center\">\n";
|
else
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
{
|
||||||
print "</td>";
|
print "<td align=\"center\">\n";
|
||||||
}
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
|
print "</td>";
|
||||||
// Defaut
|
}
|
||||||
print "<td align=\"center\">";
|
|
||||||
if ($conf->global->FACTURE_ADDON_PDF == "$name")
|
// Defaut
|
||||||
{
|
print "<td align=\"center\">";
|
||||||
print img_picto($langs->trans("Default"),'on');
|
if ($conf->global->FACTURE_ADDON_PDF == "$name")
|
||||||
}
|
{
|
||||||
else
|
print img_picto($langs->trans("Default"),'on');
|
||||||
{
|
}
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
else
|
||||||
}
|
{
|
||||||
print '</td>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
|
}
|
||||||
// Info
|
print '</td>';
|
||||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
|
||||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
// Info
|
||||||
if ($module->type == 'pdf')
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
{
|
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||||
$htmltooltip.='<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
|
if ($module->type == 'pdf')
|
||||||
}
|
{
|
||||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip.='<br>'.$langs->trans("Height").'/'.$langs->trans("Width").': '.$module->page_hauteur.'/'.$module->page_largeur;
|
||||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
}
|
||||||
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
|
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
|
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||||
$htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1);
|
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
|
||||||
$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
|
||||||
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
$htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1);
|
||||||
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftInvoices").': '.yn($module->option_draft_watermark,1,1);
|
$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
||||||
|
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftInvoices").': '.yn($module->option_draft_watermark,1,1);
|
||||||
print '<td align="center">';
|
|
||||||
print $html->textwithpicto('',$htmltooltip,1,0);
|
|
||||||
print '</td>';
|
print '<td align="center">';
|
||||||
|
print $html->textwithpicto('',$htmltooltip,1,0);
|
||||||
// Preview
|
print '</td>';
|
||||||
print '<td align="center">';
|
|
||||||
if ($module->type == 'pdf')
|
// Preview
|
||||||
{
|
print '<td align="center">';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
|
if ($module->type == 'pdf')
|
||||||
}
|
{
|
||||||
else
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
|
||||||
{
|
}
|
||||||
print img_object($langs->trans("PreviewNotAvailable"),'generic');
|
else
|
||||||
}
|
{
|
||||||
print '</td>';
|
print img_object($langs->trans("PreviewNotAvailable"),'generic');
|
||||||
|
}
|
||||||
print "</tr>\n";
|
print '</td>';
|
||||||
}
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user