diff --git a/htdocs/fourn/product/liste.php b/htdocs/fourn/product/liste.php
index 28c355b5655..a1a4189b422 100644
--- a/htdocs/fourn/product/liste.php
+++ b/htdocs/fourn/product/liste.php
@@ -58,11 +58,10 @@ if ($_POST["button_removefilter"] == $langs->trans("RemoveFilter")) {
$snom="";
}
-if (strlen($_REQUEST['catid']) == 0)
+if (isset($_REQUEST['catid']))
{
- $_REQUEST['catid'] = 1;
+ $catid = $_REQUEST['catid'];
}
-$catid = $_REQUEST['catid'];
/*
* Mode Liste
@@ -152,38 +151,18 @@ if ($result)
*
*
*/
-
- $c = new Categorie ($db, $catid);
-
- $ways = $c->print_all_ways(' > ','fourn/product/liste.php');
print "
";
+ print '
Top';
- print $ways[0]."
\n";
+ if (isset($catid))
+ {
+ $c = new Categorie ($db, $catid);
+ $ways = $c->print_all_ways(' > ','fourn/product/liste.php');
- print "
";
-
- $cats = $c->get_filles();
-
- print '
';
- print '';
- if ($cats < 0)
- {
- print "-";
+ print " > ".$ways[0]." \n";
}
- elseif (sizeof ($cats) > 0)
- {
- print "\n";
- foreach ($cats as $cat)
- {
- $i++;
- print "\n";
- print "| ".$cat->label." | \n";
- print " \n";
- }
- print " \n";
- }
-
- print ' | ';
+ print " ";
+
print '';
// Lignes des titres
@@ -232,7 +211,7 @@ if ($result)
$db->free();
print " ";
- print ' |
';
+
}
else
diff --git a/htdocs/fourn/product/pre.inc.php b/htdocs/fourn/product/pre.inc.php
index dccfa519c9e..db5fa251bb3 100644
--- a/htdocs/fourn/product/pre.inc.php
+++ b/htdocs/fourn/product/pre.inc.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2001-2005 Rodolphe Quiedeville
* Copyright (C) 2004 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
@@ -39,7 +39,7 @@ $user->getrights("produit");
function llxHeader($head = "", $title="", $help_url='',$addons='')
{
- global $user, $conf, $langs;
+ global $db, $user, $conf, $langs;
top_menu($head, $title);
@@ -52,22 +52,6 @@ function llxHeader($head = "", $title="", $help_url='',$addons='')
$menu->add($addons[0][0], $addons[0][1]);
}
- if ($conf->fournisseur->enabled)
- {
- $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers"));
- }
-
- if ($conf->societe->enabled)
- {
- $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts"));
- }
-
- $langs->load("bills");
- $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills"));
-
- $langs->load("orders");
- $menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders"));
-
if ($conf->produit->enabled)
{
$menu->add(DOL_URL_ROOT."/fourn/product/", $langs->trans("Products"));
@@ -84,6 +68,40 @@ function llxHeader($head = "", $title="", $help_url='',$addons='')
$menu->add(DOL_URL_ROOT."/categories/", $langs->trans("Categories"));
}
+ $menu->add('liste.php','Top');
+
+ if (isset($_REQUEST['catid']))
+ {
+ $catid = $_REQUEST['catid'];
+
+ $c = new Categorie ($db, $catid);
+
+ $menu->add('liste.php?catid='.$c->id, $c->label);
+
+ $cats = $c->get_filles();
+
+ if (sizeof ($cats) > 0)
+ {
+ foreach ($cats as $cat)
+ {
+ $menu->add_submenu('liste.php?catid='.$cat->id, $cat->label);
+ }
+ }
+ }
+ else
+ {
+ $c = new Categorie ($db);
+ $cats = $c->get_main_categories();
+
+ if (sizeof ($cats) > 0)
+ {
+ foreach ($cats as $cat)
+ {
+ $menu->add_submenu('liste.php?catid='.$cat->id, $cat->label);
+ }
+ }
+ }
+
left_menu($menu->liste, $help_url);
}
?>