diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index ce0c0e07223..396cf3dab35 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -1,9 +1,9 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * * This program is free software; you can redistribute it and/or modify @@ -182,7 +182,6 @@ if ($_POST["action"] == 'setNumRestart') dolibarr_set_const($db, "FICHEINTER_NUM llxHeader(); -$dir=DOL_DOCUMENT_ROOT."/includes/modules/fichinter/"; $html=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; @@ -204,67 +203,75 @@ print "\n"; clearstatcache(); -$handle = opendir($dir); -if (is_resource($handle)) +foreach ($conf->file->dol_document_root as $dirroot) { - $var=true; - - while (($file = readdir($handle))!==false) + $dir = $dirroot . "/includes/modules/fichinter/"; + + if (is_dir($dir)) { - if (preg_match('/^(mod_.*)\.php$/i',$file,$reg)) + $handle = opendir($dir); + if (is_resource($handle)) { - $file = $reg[1]; - $classname = substr($file,4); - - require_once($dir.$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=true; + + while (($file = readdir($handle))!==false) { - $var=!$var; - print ''.$module->nom."\n"; - print $module->info(); - print ''; - - // Examples - print ''.$module->getExample()."\n"; - - print ''; - if ($conf->global->FICHEINTER_ADDON == $classname) + if (preg_match('/^(mod_.*)\.php$/i',$file,$reg)) { - print img_picto($langs->trans("Activated"),'on'); + $file = $reg[1]; + $classname = substr($file,4); + + require_once($dir.$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 ''.$module->nom."\n"; + print $module->info(); + print ''; + + // Examples + print ''.$module->getExample()."\n"; + + print ''; + if ($conf->global->FICHEINTER_ADDON == $classname) + { + print img_picto($langs->trans("Activated"),'on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; + + $ficheinter=new Fichinter($db); + $ficheinter->initAsSpecimen(); + + // Info + $htmltooltip=''; + $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; + $nextval=$module->getNextValue($mysoc,$ficheinter); + if ($nextval != $langs->trans("NotAvailable")) + { + $htmltooltip.=''.$langs->trans("NextValue").': '.$nextval; + } + print ''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ''; + + print ''; + } } - else - { - print ''.img_picto($langs->trans("Disabled"),'off').''; - } - print ''; - - $ficheinter=new Fichinter($db); - $ficheinter->initAsSpecimen(); - - // Info - $htmltooltip=''; - $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$ficheinter); - if ($nextval != $langs->trans("NotAvailable")) - { - $htmltooltip.=''.$langs->trans("NextValue").': '.$nextval; - } - print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - - print ''; } + closedir($handle); } } - closedir($handle); } print '
'; @@ -310,83 +317,90 @@ print "\n"; clearstatcache(); $var=true; - -$handle=opendir($dir); -if (is_resource($handle)) +foreach ($conf->file->dol_document_root as $dirroot) { - while (($file = readdir($handle))!==false) - { - if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') - { - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); + $dir = $dirroot . "/includes/modules/fichinter/"; - $var=!$var; - - print ''; - echo "$name"; - print "\n"; - require_once($dir.$file); - $module = new $classname(); - print $module->description; - print ''; - - // Active - if (in_array($name, $def)) - { - print "\n"; - if ($conf->global->FICHEINTER_ADDON_PDF != "$name") - { - print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'on'); - print ''; - } - else - { - print img_picto($langs->trans("Enabled"),'on'); - } - print ""; - } - else - { - print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'off').''; - print ""; - } - - // Defaut - print ""; - if ($conf->global->FICHEINTER_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")); - $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("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); - print ''; - print $html->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''; - print ''.img_object($langs->trans("Preview"),'intervention').''; - print ''; - - print ''; - } - } - closedir($handle); + if (is_dir($dir)) + { + $handle=opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); + + $var=!$var; + + print ''; + echo "$name"; + print "\n"; + require_once($dir.$file); + $module = new $classname(); + print $module->description; + print ''; + + // Active + if (in_array($name, $def)) + { + print "\n"; + if ($conf->global->FICHEINTER_ADDON_PDF != "$name") + { + print 'scandir.'&label='.urlencode($module->name).'">'; + print img_picto($langs->trans("Enabled"),'on'); + print ''; + } + else + { + print img_picto($langs->trans("Enabled"),'on'); + } + print ""; + } + else + { + print "\n"; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'off').''; + print ""; + } + + // Defaut + print ""; + if ($conf->global->FICHEINTER_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")); + $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("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + print ''; + print $html->textwithpicto('',$htmltooltip,1,0); + print ''; + print ''; + print ''.img_object($langs->trans("Preview"),'intervention').''; + print ''; + + print ''; + } + } + closedir($handle); + } + } } print '';