diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php
index e267b1a8692..1410a6d7b84 100644
--- a/htdocs/expedition/fiche.php
+++ b/htdocs/expedition/fiche.php
@@ -18,7 +18,7 @@
* along with this program. If not, see .
*/
-// Code identique a /expedition/commande.php
+// Code identique a /expedition/shipment.php
/**
* \file htdocs/expedition/fiche.php
@@ -27,7 +27,8 @@
* \version $Id$
*/
-require("./pre.inc.php");
+require("../main.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/expedition/expedition.class.php");
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/html.formproduct.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
@@ -37,6 +38,7 @@ if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php"
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
if ($conf->stock->enabled) require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php");
+$langs->load("sendings");
$langs->load("companies");
$langs->load("bills");
$langs->load('deliveries');
diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php
index 3fb81d5e44b..21b59082f51 100644
--- a/htdocs/expedition/index.php
+++ b/htdocs/expedition/index.php
@@ -25,11 +25,11 @@
* \version $Id$
*/
-require("./pre.inc.php");
+require("../main.inc.php");
+$langs->load("orders");
$langs->load("sendings");
-
/*
* View
*/
diff --git a/htdocs/expedition/liste.php b/htdocs/expedition/liste.php
index 59873cac539..4ada5d6503f 100644
--- a/htdocs/expedition/liste.php
+++ b/htdocs/expedition/liste.php
@@ -25,8 +25,10 @@
* \version $Id$
*/
-require("./pre.inc.php");
+require("../main.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/expedition/expedition.class.php");
+$langs->load("sendings");
$langs->load('companies');
// Security check
diff --git a/htdocs/expedition/pre.inc.php b/htdocs/expedition/pre.inc.php
deleted file mode 100644
index 4a15f239b30..00000000000
--- a/htdocs/expedition/pre.inc.php
+++ /dev/null
@@ -1,51 +0,0 @@
-
- * Copyright (C) 2004 Laurent Destailleur
- *
- * 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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/**
- \file htdocs/expedition/pre.inc.php
- \ingroup expedition
- \brief Fichier de gestion du menu gauche du module expedition
- \version $Id$
-*/
-
-require("../main.inc.php");
-
-require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
-require_once(DOL_DOCUMENT_ROOT."/expedition/expedition.class.php");
-
-$langs->load("orders");
-$langs->load("sendings");
-
-function llxHeader($head = "", $title="", $help_url='')
-{
- global $langs;
-
- top_menu($head, $title);
-
- $menu = new Menu();
-
- $menu->add(DOL_URL_ROOT."/commande/", $langs->trans("Orders"));
-
- $menu->add(DOL_URL_ROOT."/expedition/", $langs->trans("Sendings"));
- $menu->add_submenu(DOL_URL_ROOT."/expedition/liste.php", $langs->trans("List"));
- $menu->add_submenu(DOL_URL_ROOT."/expedition/stats/", $langs->trans("Statistics"));
-
- left_menu($menu->liste, $help_url);
-}
-?>
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index bd3126ea568..88e0fdb43e1 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -26,14 +26,16 @@
* \version $Id$
*/
-require("./pre.inc.php");
+require("../main.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/expedition/expedition.class.php");
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
-require_once(DOL_DOCUMENT_ROOT."/product.class.php");
-require_once(DOL_DOCUMENT_ROOT."/projet/project.class.php");
-require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
-require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php");
+if ($conf->produit->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product.class.php");
+if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/projet/project.class.php");
+if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
+if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
+if ($conf->stock->enabled) require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php");
$langs->load('orders');
$langs->load("companies");
diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php
index c47129f3fbe..7f3624258d3 100644
--- a/htdocs/expedition/stats/index.php
+++ b/htdocs/expedition/stats/index.php
@@ -19,14 +19,14 @@
*/
/**
- \file htdocs/expedition/stats/index.php
- \ingroup expedition
- \brief Page des stats expeditions
- \version $Id$
-*/
+ * \file htdocs/expedition/stats/index.php
+ * \ingroup expedition
+ * \brief Page des stats expeditions
+ * \version $Id$
+ */
-require("./pre.inc.php");
-require("../expedition.class.php");
+require("../../main.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/expedition/expedition.class.php");
$langs->load("sendings");
diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php
index 6b1c8b28227..c81d4967c65 100644
--- a/htdocs/expedition/stats/month.php
+++ b/htdocs/expedition/stats/month.php
@@ -18,13 +18,13 @@
*/
/**
- \file htdocs/expedition/stats/month.php
- \ingroup commande
- \brief Page des stats expeditions par mois
- \version $Id$
-*/
+ * \file htdocs/expedition/stats/month.php
+ * \ingroup commande
+ * \brief Page des stats expeditions par mois
+ * \version $Id$
+ */
-require("./pre.inc.php");
+require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/expedition/expedition.class.php");
require_once(DOL_DOCUMENT_ROOT."/expedition/stats/expeditionstats.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/dolgraph.class.php");
diff --git a/htdocs/expedition/stats/pre.inc.php b/htdocs/expedition/stats/pre.inc.php
deleted file mode 100644
index 4c9fc9e3f36..00000000000
--- a/htdocs/expedition/stats/pre.inc.php
+++ /dev/null
@@ -1,47 +0,0 @@
-
- * Copyright (C) 2006 Laurent Destailleur
- *
- * 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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/**
- \file htdocs/product/stats/pre.inc.php
- \ingroup expedition
- \brief Fichier gestionnaire du menu gauche des statistiques expedition
- \version $Id$
-*/
-
-require("../../main.inc.php");
-
-$langs->load("orders");
-
-function llxHeader($head = "", $title="", $urlp = "")
-{
- global $langs;
-
- top_menu($head, $title);
-
- $menu = new Menu();
-
- $menu->add(DOL_URL_ROOT."/commande/", $langs->trans("Orders"));
-
- $menu->add(DOL_URL_ROOT."/expedition/", $langs->trans("Sendings"));
- $menu->add_submenu(DOL_URL_ROOT."/expedition/liste.php", $langs->trans("List"));
- $menu->add_submenu(DOL_URL_ROOT."/expedition/stats/", $langs->trans("Statistics"));
-
- left_menu($menu->liste);
-}
-?>
diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php
index a9ff49449e2..e72cd50fffe 100644
--- a/htdocs/livraison/fiche.php
+++ b/htdocs/livraison/fiche.php
@@ -3,7 +3,7 @@
* Copyright (C) 2005-2009 Laurent Destailleur
* Copyright (C) 2005 Simon TOSSER
* Copyright (C) 2007 Franky Van Liedekerke
- * Copyright (C) 2005-2009 Regis Houssin
+ * Copyright (C) 2005-2010 Regis Houssin
*
* 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
@@ -582,32 +582,29 @@ else
if ($user->societe_id == 0)
{
print '