forked from Wavyzz/dolibarr
Fix: Show error message
This commit is contained in:
@@ -230,25 +230,29 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
if (substr($file, 0, 13) == 'mod_commande_' && substr($file, dol_strlen($file)-3, 3) == 'php')
|
||||
{
|
||||
$file = substr($file, 0, dol_strlen($file)-4);
|
||||
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/commande/".$file.".php");
|
||||
|
||||
|
||||
$module = new $file;
|
||||
|
||||
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||
|
||||
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Examples
|
||||
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
|
||||
|
||||
|
||||
// Show example of numbering module
|
||||
print '<td nowrap="nowrap">';
|
||||
$tmp=$module->getExample();
|
||||
if (preg_match('/^Error/',$tmp)) print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td align="center">';
|
||||
if ($conf->global->COMMANDE_ADDON == "$file")
|
||||
{
|
||||
@@ -261,10 +265,10 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
$commande=new Commande($db);
|
||||
$commande->initAsSpecimen();
|
||||
|
||||
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
@@ -282,11 +286,11 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
$htmltooltip.=$langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '<td align="center">';
|
||||
print $html->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
@@ -357,7 +361,7 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
{
|
||||
$name = substr($file, 4, dol_strlen($file) -16);
|
||||
$classname = substr($file, 0, dol_strlen($file) -12);
|
||||
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">\n <td>";
|
||||
print "$name";
|
||||
@@ -366,7 +370,7 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
$module = new $classname($db);
|
||||
print $module->description;
|
||||
print "</td>\n";
|
||||
|
||||
|
||||
// Activated
|
||||
print "<td align=\"center\">\n";
|
||||
if (in_array($name, $def))
|
||||
@@ -389,7 +393,7 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
print '</a>';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->COMMANDE_ADDON_PDF == "$name")
|
||||
@@ -403,7 +407,7 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
@@ -416,14 +420,14 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
||||
//$htmltooltip.='<br>'.$langs->trans("Escompte").': '.yn($module->option_escompte,1,1);
|
||||
//$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
|
||||
|
||||
|
||||
print '<td align="center">';
|
||||
print $html->textwithpicto('',$htmltooltip,1,0);
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user