Skip to content
Snippets Groups Projects
Commit 7ef66e8e authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Modif pour ne pas afficher les onglets d'une catégorie de module si il n'y a...

Modif pour ne pas afficher les onglets d'une catégorie de module si il n'y a aucun module (évite es categ vide si tous les modules de la categ ont été supprimés).
parent 4dd51f1f
No related branches found
No related tags found
No related merge requests found
......@@ -149,56 +149,15 @@ llxHeader("","");
print_fiche_titre($langs->trans("ModulesSetup"),'','setup');
if ($mode==0) print $langs->trans("ModulesDesc")."<br>\n";
if ($mode==1) print $langs->trans("ModulesInterfaceDesc")."<br>\n";
if ($mode==2) print $langs->trans("ModulesSpecialDesc")."<br>\n";
if ($mode==3) print $langs->trans("ModulesJobDesc")."<br>\n";
print "<br>\n";
$h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=0";
$head[$h][1] = $langs->trans("ModulesCommon");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=1";
$head[$h][1] = $langs->trans("ModulesInterfaces");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=2";
$head[$h][1] = $langs->trans("ModulesSpecial");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=3";
$head[$h][1] = $langs->trans("ModulesJob");
dolibarr_fiche_head($head, $mode, $langs->trans("Modules"));
if ($mesg) print '<div class="error">'.$mesg.'</div>';
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print " <td>".$langs->trans("Family")."</td>\n";
print " <td colspan=\"2\">".$langs->trans("Module")."</td>\n";
print " <td>".$langs->trans("Description")."</td>\n";
print " <td align=\"center\">".$langs->trans("Version")."</td>\n";
//print " <td align=\"center\">".$langs->trans("DbVersion")."</td>\n";
print " <td align=\"center\">".$langs->trans("Activated")."</td>\n";
print " <td align=\"center\">".$langs->trans("Action")."</td>\n";
print " <td>".$langs->trans("SetupShort")."</td>\n";
print "</tr>\n";
// Recherche les modules
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/";
// Charge tableaux modules, nom, numero, orders depuis rpertoire dir
$handle=opendir($dir);
$nom = array();
$filename = array();
$modules = array();
$orders = array();
$categ = array();
$i = 0;
$j = 0;
while (($file = readdir($handle))!==false)
......@@ -222,8 +181,9 @@ while (($file = readdir($handle))!==false)
}
$modules[$i] = $objMod;
$nom[$i] = $modName;
$filename[$i]= $modName;
$orders[$i] = "$objMod->family"."_".$j; // Tri par famille puis numero module
$categ[$objMod->special]++; // Array of all different modules categories
$j++;
$i++;
}
......@@ -231,6 +191,75 @@ while (($file = readdir($handle))!==false)
}
asort($orders);
// Affichage debut page
if ($mode==0) print $langs->trans("ModulesDesc")."<br>\n";
if ($mode==1) print $langs->trans("ModulesInterfaceDesc")."<br>\n";
if ($mode==2) print $langs->trans("ModulesSpecialDesc")."<br>\n";
if ($mode==3) print $langs->trans("ModulesJobDesc")."<br>\n";
print "<br>\n";
$h = 0;
$categidx=0;
if ($categ[$categidx])
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesCommon");
$head[$h][2] = 'common';
$h++;
}
$categidx=1;
if ($categ[$categidx])
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesInterfaces");
$head[$h][2] = 'interfaces';
$h++;
}
$categidx=2;
if ($categ[$categidx])
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesOther");
$head[$h][2] = 'other';
$h++;
}
$categidx=3;
if ($categ[$categidx])
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=3";
$head[$h][1] = $langs->trans("ModulesJob");
$head[$h][2] = 'functional';
$h++;
}
dolibarr_fiche_head($head, $mode, $langs->trans("Modules"));
if ($mesg) print '<div class="error">'.$mesg.'</div>';
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print " <td>".$langs->trans("Family")."</td>\n";
print " <td colspan=\"2\">".$langs->trans("Module")."</td>\n";
print " <td>".$langs->trans("Description")."</td>\n";
print " <td align=\"center\">".$langs->trans("Version")."</td>\n";
//print " <td align=\"center\">".$langs->trans("DbVersion")."</td>\n";
print " <td align=\"center\">".$langs->trans("Activated")."</td>\n";
print " <td align=\"center\">".$langs->trans("Action")."</td>\n";
print " <td>".$langs->trans("SetupShort")."</td>\n";
print "</tr>\n";
// Affichage liste modules
$var=True;
$familylib=array(
......@@ -248,8 +277,8 @@ foreach ($orders as $key => $value)
$tab=split('_',$value);
$family=$tab[0]; $numero=$tab[1];
$modName = $nom[$key];
$objMod = $modules[$key];
$modName = $filename[$key];
$objMod = $modules[$key];
// On affiche pas les modules en version 'development' si
// constante MAIN_SHOW_DEVELOPMENT_MODULES non dfinie
......
......@@ -69,7 +69,9 @@ else
// Check PHP support for $_POST
if (! isset($_GET["testget"]) && ! isset($_POST["testpost"]))
{
print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("PHPSupportPOSTGETKo")."<br>\n";
print '<img src="../theme/eldy/img/warning.png" alt="Warning"> '.$langs->trans("PHPSupportPOSTGETKo");
print ' (<a href="'.$_SERVER["PHP_SELF"].'?testget=ok">'.$langs->trans("Recheck").'</a>)';
print "<br>\n";
$checksok=0;
}
else
......
......@@ -38,7 +38,8 @@ OtherSetup=Other setup
Modules=Modules
ModulesCommon=Common modules
ModulesInterfaces=Interfaces modules
ModulesSpecial=Special modules
ModulesOther=Other modules
ModulesJob=Setup modules
ParameterInDolibarr=Parameter %s
LanguageParameter=Language parameter %s
LanguageBrowserParameter=Parameter %s
......
......@@ -38,7 +38,7 @@ OtherSetup=Divers
Modules=Modules
ModulesCommon=Modules standards
ModulesInterfaces=Modules interfaces
ModulesSpecial=Modules spéciaux
ModulesOther=Modules autres
ModulesJob=Modules métiers
ParameterInDolibarr=Variable %s
LanguageParameter=Variable langue %s
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment