\n";
-print ' | '.$langs->trans("Name")." | \n";
-print " ".$langs->trans("Description")." | \n";
-print ''.$langs->trans("Activated")." | \n";
-print ''.$langs->trans("Default")." | \n";
-print ''.$langs->trans("ShortInfo").' | ';
-print ''.$langs->trans("Preview").' | ';
-print "
\n";
-
-clearstatcache();
-
-$var=true;
-foreach ($dirmodels as $reldir)
-{
- foreach (array('','/doc') as $valdir)
- {
- $dir = dol_buildpath($reldir."core/modules/project/task/".$valdir);
-
- if (is_dir($dir))
+ $i = 0;
+ $num_rows=$db->num_rows($resql);
+ while ($i < $num_rows)
{
- $handle=opendir($dir);
- if (is_resource($handle))
+ $array = $db->fetch_array($resql);
+ array_push($def, $array[0]);
+ $i++;
+ }
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+
+ print "\n";
+ print "\n";
+ print ' | '.$langs->trans("Name")." | \n";
+ print " ".$langs->trans("Description")." | \n";
+ print ''.$langs->trans("Activated")." | \n";
+ print ''.$langs->trans("Default")." | \n";
+ print ''.$langs->trans("ShortInfo").' | ';
+ print ''.$langs->trans("Preview").' | ';
+ print "
\n";
+
+ clearstatcache();
+
+ $var=true;
+ foreach ($dirmodels as $reldir)
+ {
+ foreach (array('','/doc') as $valdir)
+ {
+ $dir = dol_buildpath($reldir."core/modules/project/task/".$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)
{
- if (file_exists($dir.'/'.$file))
+ $filelist[]=$file;
+ }
+ closedir($handle);
+ arsort($filelist);
+
+ foreach($filelist as $file)
+ {
+ if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
{
- $name = substr($file, 4, dol_strlen($file) -16);
- $classname = substr($file, 0, dol_strlen($file) -12);
-
- require_once $dir.'/'.$file;
- $module = new $classname($db);
-
- $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;
-
- if ($modulequalified)
+ if (file_exists($dir.'/'.$file))
{
- $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 " | \n";
+ $name = substr($file, 4, dol_strlen($file) -16);
+ $classname = substr($file, 0, dol_strlen($file) -12);
- // Active
- if (in_array($name, $def))
- {
- print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">';
- 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 " | ";
- }
+ require_once $dir.'/'.$file;
+ $module = new $classname($db);
- // Defaut
- print "";
- if ($conf->global->PROJECT_TASK_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 ' | ';
+ $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;
- // Info
- $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
- $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
- if ($module->type == 'pdf')
+ if ($modulequalified)
{
- $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);
+ $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 " | \n";
- print '';
- print $form->textwithpicto('',$htmltooltip,1,0);
- print ' | ';
+ // Active
+ if (in_array($name, $def))
+ {
+ print "\n";
+ print 'scandir.'&label='.urlencode($module->name).'">';
+ 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 " | ";
+ }
- // Preview
- print '';
- if ($module->type == 'pdf')
- {
- print ''.img_object($langs->trans("Preview"),'bill').'';
+ // Defaut
+ print " | ";
+ if ($conf->global->PROJECT_TASK_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);
+
+ 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 ' | ';
+ print "
\n";
}
- else
- {
- print img_object($langs->trans("PreviewNotAvailable"),'generic');
- }
- print '';
- print "\n";
}
}
}
@@ -818,9 +889,10 @@ foreach ($dirmodels as $reldir)
}
}
}
+
+ print '