diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index a5331bca70c..d99698473a4 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -29,6 +29,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
@@ -197,20 +198,9 @@ print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
print "
";
-$h = 0;
+$head = supplierorder_admin_prepare_head(null);
-$head[$h][0] = DOL_URL_ROOT."/admin/supplier_order.php";
-$head[$h][1] = $langs->trans("SupplierOrder");
-$head[$h][2] = 'Order';
-$h++;
-
-$head[$h][0] = DOL_URL_ROOT."/admin/supplier_invoice.php";
-$head[$h][1] = $langs->trans("SuppliersInvoice");
-$head[$h][2] = 'Invoice';
-$hselected=$h;
-$h++;
-
-dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
+dol_fiche_head($head, 'invoice', $langs->trans("ModuleSetup"));
// Supplier invoice numbering module
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index ab8569b15b0..f80e6c3b28b 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -29,6 +29,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
@@ -197,21 +198,9 @@ print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
print "
";
-$h = 0;
+$head = supplierorder_admin_prepare_head(null);
-$head[$h][0] = DOL_URL_ROOT."/admin/supplier_order.php";
-$head[$h][1] = $langs->trans("SupplierOrder");
-$head[$h][2] = 'Order';
-$hselected=$h;
-$h++;
-
-$head[$h][0] = DOL_URL_ROOT."/admin/supplier_invoice.php";
-$head[$h][1] = $langs->trans("SuppliersInvoice");
-$head[$h][2] = 'Invoice';
-
-$h++;
-
-dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
+dol_fiche_head($head, 'order', $langs->trans("ModuleSetup"));
// Supplier order numbering module
diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php
index f834bdd5570..06f5dc1ddb5 100644
--- a/htdocs/core/lib/fourn.lib.php
+++ b/htdocs/core/lib/fourn.lib.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2009 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2006 Marc Barilley
+ * Copyright (C) 2011-2013 Philippe Grand
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -148,5 +149,35 @@ function ordersupplier_prepare_head($object)
return $head;
}
+/**
+ * Return array head with list of tabs to view object informations.
+ *
+ * @param Object $object order
+ * @return array head array with tabs
+ */
+function supplierorder_admin_prepare_head($object)
+{
+ global $langs, $conf, $user;
+
+ $h = 0;
+ $head = array();
+
+ $head[$h][0] = DOL_URL_ROOT."/admin/supplier_order.php";
+ $head[$h][1] = $langs->trans("SupplierOrder");
+ $head[$h][2] = 'order';
+ $h++;
+
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'supplierorder_admin');
+
+ $head[$h][0] = DOL_URL_ROOT."/admin/supplier_invoice.php";
+ $head[$h][1] = $langs->trans("SuppliersInvoice");
+ $head[$h][2] = 'invoice';
+ $h++;
+
+ complete_head_from_modules($conf,$langs,$object,$head,$h,'supplierorder_admin','remove');
+
+ return $head;
+}
+
?>
\ No newline at end of file