\n";
+ print '| '.$langs->trans("Name").' | ';
+ print ''.$langs->trans("Description").' | ';
+ print ''.$langs->trans("Status")." | \n";
+ print ''.$langs->trans("Default")." | \n";
+ print ''.$langs->trans("ShortInfo").' | ';
+ print ''.$langs->trans("Preview").' | ';
+ print "
\n";
+
+ clearstatcache();
+
+ foreach ($dirmodels as $reldir)
+ {
+ foreach (array('','/doc') as $valdir)
{
- $handle=opendir($dir);
- if (is_resource($handle))
+ $dir = dol_buildpath($reldir."core/modules/bom".$valdir);
+
+ if (is_dir($dir))
{
- while (($file = readdir($handle))!==false)
+ $handle=opendir($dir);
+ if (is_resource($handle))
{
- $filelist[]=$file;
- }
- closedir($handle);
- arsort($filelist);
-
- foreach($filelist as $file)
- {
- if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file))
+ while (($file = readdir($handle))!==false)
{
+ $filelist[]=$file;
+ }
+ closedir($handle);
+ arsort($filelist);
- if (file_exists($dir.'/'.$file))
- {
- $name = substr($file, 4, dol_strlen($file) -16);
- $classname = substr($file, 0, dol_strlen($file) -12);
+ foreach($filelist as $file)
+ {
+ if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file))
+ {
- require_once $dir.'/'.$file;
- $module = new $classname($db);
+ if (file_exists($dir.'/'.$file))
+ {
+ $name = substr($file, 4, dol_strlen($file) -16);
+ $classname = substr($file, 0, dol_strlen($file) -12);
- $modulequalified=1;
- if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
- if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
+ require_once $dir.'/'.$file;
+ $module = new $classname($db);
- if ($modulequalified)
- {
- $var = !$var;
- print '| ';
- print (empty($module->name)?$name:$module->name);
- print " | \n";
- if (method_exists($module, 'info')) print $module->info($langs);
- else print $module->description;
- print ' | ';
+ $modulequalified=1;
+ if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
+ if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
- // Active
- if (in_array($name, $def))
- {
- print ''."\n";
- print '';
- print img_picto($langs->trans("Enabled"), 'switch_on');
- print '';
- print ' | ';
- }
- else
- {
- print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'';
- print " | ";
- }
+ if ($modulequalified)
+ {
+ $var = !$var;
+ print '
| ';
+ print (empty($module->name)?$name:$module->name);
+ print " | \n";
+ if (method_exists($module, 'info')) print $module->info($langs);
+ else print $module->description;
+ print ' | ';
- // Default
- print '';
- if ($conf->global->BOM_ADDON_PDF == $name)
- {
- print img_picto($langs->trans("Default"), 'on');
- }
- else
- {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
- }
- print ' | ';
+ // Active
+ if (in_array($name, $def))
+ {
+ print ''."\n";
+ print '';
+ print img_picto($langs->trans("Enabled"), 'switch_on');
+ print '';
+ print ' | ';
+ }
+ else
+ {
+ print ''."\n";
+ print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'';
+ print " | ";
+ }
- // Info
- $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
- $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
- if ($module->type == 'pdf')
- {
- $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
- }
- $htmltooltip.='
'.$langs->trans("FeaturesSupported").':';
- $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
- $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
- $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
- $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
- //$htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
- //$htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
- $htmltooltip.='
'.$langs->trans("WatermarkOnDraftBOMs").': '.yn($module->option_draft_watermark, 1, 1);
+ // Default
+ print '';
+ if ($conf->global->BOM_ADDON_PDF == $name)
+ {
+ print img_picto($langs->trans("Default"), 'on');
+ }
+ else
+ {
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
+ }
+ print ' | ';
+
+ // Info
+ $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
+ $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
+ if ($module->type == 'pdf')
+ {
+ $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
+ }
+ $htmltooltip.='
'.$langs->trans("FeaturesSupported").':';
+ $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
+ $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
+ $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
+ $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
+ //$htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
+ //$htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
+ $htmltooltip.='
'.$langs->trans("WatermarkOnDraftBOMs").': '.yn($module->option_draft_watermark, 1, 1);
- print '';
- print $form->textwithpicto('', $htmltooltip, 1, 0);
- print ' | ';
+ print '';
+ print $form->textwithpicto('', $htmltooltip, 1, 0);
+ print ' | ';
- // Preview
- print '';
- if ($module->type == 'pdf')
- {
- print ''.img_object($langs->trans("Preview"), 'bill').'';
- }
- else
- {
- print img_object($langs->trans("PreviewNotAvailable"), 'generic');
- }
- print ' | ';
+ // Preview
+ print '';
+ if ($module->type == 'pdf')
+ {
+ print ''.img_object($langs->trans("Preview"), 'bill').'';
+ }
+ else
+ {
+ print img_object($langs->trans("PreviewNotAvailable"), 'generic');
+ }
+ print ' | ';
- print "
\n";
- }
- }
+ print "\n";
+ }
+ }
+ }
}
}
}
}
}
-}
-print '