From d4fdb23618d3a6184e9b27a4e32dcd9f2a00923b Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Sat, 25 Oct 2008 23:19:30 +0000
Subject: [PATCH] Move all modules into includes/modules directory

---
 htdocs/admin/fournisseur.php                  | 23 +++++++++++--------
 htdocs/fourn/commande/dispatch.php            |  2 +-
 htdocs/fourn/commande/fiche.php               |  2 +-
 htdocs/fourn/commande/modules/index.php       | 23 -------------------
 htdocs/fourn/commande/modules/pdf/index.php   | 23 -------------------
 htdocs/fourn/facture/modules/index.php        | 23 -------------------
 htdocs/fourn/facture/modules/pdf/index.php    | 23 -------------------
 htdocs/fourn/fournisseur.commande.class.php   |  2 +-
 htdocs/html.formfile.class.php                |  2 +-
 .../mod_commande_fournisseur_muguet.php       | 12 +++++-----
 .../mod_commande_fournisseur_orchidee.php     | 12 +++++-----
 .../modules_commandefournisseur.php           | 14 +++++------
 .../pdf/pdf_muscadet.modules.php              |  6 ++---
 13 files changed, 40 insertions(+), 127 deletions(-)
 delete mode 100644 htdocs/fourn/commande/modules/index.php
 delete mode 100644 htdocs/fourn/commande/modules/pdf/index.php
 delete mode 100644 htdocs/fourn/facture/modules/index.php
 delete mode 100644 htdocs/fourn/facture/modules/pdf/index.php
 rename htdocs/{fourn/commande/modules => includes/modules/supplier_order}/mod_commande_fournisseur_muguet.php (91%)
 rename htdocs/{fourn/commande/modules => includes/modules/supplier_order}/mod_commande_fournisseur_orchidee.php (92%)
 rename htdocs/{fourn/commande/modules => includes/modules/supplier_order}/modules_commandefournisseur.php (93%)
 rename htdocs/{fourn/commande/modules => includes/modules/supplier_order}/pdf/pdf_muscadet.modules.php (99%)

diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/fournisseur.php
index 933f8fbf1c9..82ffcc01716 100644
--- a/htdocs/admin/fournisseur.php
+++ b/htdocs/admin/fournisseur.php
@@ -60,7 +60,7 @@ if ($_GET["action"] == 'specimen')
   $commande->initAsSpecimen();
   
   // Charge le modele
-  $dir = DOL_DOCUMENT_ROOT . "/fourn/commande/modules/pdf/";
+  $dir = DOL_DOCUMENT_ROOT . "/includes/modules/supplier_order/pdf/";
   $file = "pdf_".$modele.".modules.php";
   if (file_exists($dir.$file))
     {
@@ -152,17 +152,21 @@ if ($_POST["action"] == 'setNumRestart') dolibarr_set_const($db, "COMMANDE_FOURN
 /*
  * View
  */
- 
-llxHeader();
 
-$dir = "../fourn/commande/modules/pdf/";
 $html=new Form($db);
 
+llxHeader();
+
 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
 print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
 
 print "<br>";
 
+
+// Supplier order numbering module
+
+$dir = DOL_DOCUMENT_ROOT."/includes/modules/supplier_order/";
+
 print_titre($langs->trans("OrdersNumberingModules"));
 
 print '<table class="noborder" width="100%">';
@@ -176,7 +180,6 @@ print "</tr>\n";
 
 clearstatcache();
 
-$dir = "../fourn/commande/modules/";
 $handle = opendir($dir);
 if ($handle)
 {
@@ -188,7 +191,7 @@ if ($handle)
         {
             $file = substr($file, 0, strlen($file)-4);
 
-            require_once(DOL_DOCUMENT_ROOT ."/fourn/commande/modules/".$file.".php");
+            require_once(DOL_DOCUMENT_ROOT ."/includes/modules/supplier_order/".$file.".php");
 
             $module = new $file;
 
@@ -251,9 +254,13 @@ if ($handle)
 
 print '</table><br>';
 
+
 /*
- * Modeles de documents
+ * Modeles documents for supplier orders
  */
+
+$dir = DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/pdf/';
+
 print_titre($langs->trans("OrdersModelModule"));
 
 // Defini tableau def de modele
@@ -279,8 +286,6 @@ else
 	dolibarr_print_error($db);
 }
 
-$dir = "../fourn/commande/modules/pdf/";
-
 print "<table class=\"noborder\" width=\"100%\">\n";
 print "<tr class=\"liste_titre\">\n";
 print '  <td width="100">'.$langs->trans("Name")."</td>\n";
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 12ea90bddf0..2582cab2019 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -27,7 +27,7 @@
 */
 
 require('./pre.inc.php');
-require_once(DOL_DOCUMENT_ROOT.'/fourn/commande/modules/modules_commandefournisseur.php');
+require_once(DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/modules_commandefournisseur.php');
 require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php");
 if ($conf->projet->enabled)	require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
 
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index a6e0e7da84f..94c546c961d 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -28,7 +28,7 @@
 
 require('./pre.inc.php');
 require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
-require_once(DOL_DOCUMENT_ROOT.'/fourn/commande/modules/modules_commandefournisseur.php');
+require_once(DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/modules_commandefournisseur.php');
 require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.product.class.php";
 if ($conf->projet->enabled)	require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
 
diff --git a/htdocs/fourn/commande/modules/index.php b/htdocs/fourn/commande/modules/index.php
deleted file mode 100644
index e8534d391a5..00000000000
--- a/htdocs/fourn/commande/modules/index.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- *
- * 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.
- *
- * $Id$
- * $Source$
- */
-
-Header("Location: ../index.php");
-?>
diff --git a/htdocs/fourn/commande/modules/pdf/index.php b/htdocs/fourn/commande/modules/pdf/index.php
deleted file mode 100644
index e8534d391a5..00000000000
--- a/htdocs/fourn/commande/modules/pdf/index.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- *
- * 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.
- *
- * $Id$
- * $Source$
- */
-
-Header("Location: ../index.php");
-?>
diff --git a/htdocs/fourn/facture/modules/index.php b/htdocs/fourn/facture/modules/index.php
deleted file mode 100644
index e8534d391a5..00000000000
--- a/htdocs/fourn/facture/modules/index.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- *
- * 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.
- *
- * $Id$
- * $Source$
- */
-
-Header("Location: ../index.php");
-?>
diff --git a/htdocs/fourn/facture/modules/pdf/index.php b/htdocs/fourn/facture/modules/pdf/index.php
deleted file mode 100644
index e8534d391a5..00000000000
--- a/htdocs/fourn/facture/modules/pdf/index.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- *
- * 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.
- *
- * $Id$
- * $Source$
- */
-
-Header("Location: ../index.php");
-?>
diff --git a/htdocs/fourn/fournisseur.commande.class.php b/htdocs/fourn/fournisseur.commande.class.php
index eb12184b2db..a868ae9eb30 100644
--- a/htdocs/fourn/fournisseur.commande.class.php
+++ b/htdocs/fourn/fournisseur.commande.class.php
@@ -451,7 +451,7 @@ class CommandeFournisseur extends Commande
 		global $db, $langs, $conf;
 		$langs->load("orders");
 
-		$dir = DOL_DOCUMENT_ROOT .'/fourn/commande/modules';
+		$dir = DOL_DOCUMENT_ROOT .'/includes/modules/supplier_order/';
 		$modelisok=0;
 		$liste=array();
 
diff --git a/htdocs/html.formfile.class.php b/htdocs/html.formfile.class.php
index 40073fc6cc8..06222e8fa1b 100644
--- a/htdocs/html.formfile.class.php
+++ b/htdocs/html.formfile.class.php
@@ -228,7 +228,7 @@ class FormFile
 				if (is_array($genallowed)) $modellist=$genallowed;
 				else
 				{
-					include_once(DOL_DOCUMENT_ROOT.'/fourn/commande/modules/modules_commandefournisseur.php');
+					include_once(DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/modules_commandefournisseur.php');
 					$model=new ModelePDFSuppliersOrders();
 					$modellist=$model->liste_modeles($this->db);
 				}
diff --git a/htdocs/fourn/commande/modules/mod_commande_fournisseur_muguet.php b/htdocs/includes/modules/supplier_order/mod_commande_fournisseur_muguet.php
similarity index 91%
rename from htdocs/fourn/commande/modules/mod_commande_fournisseur_muguet.php
rename to htdocs/includes/modules/supplier_order/mod_commande_fournisseur_muguet.php
index 157877d6424..69924db248a 100644
--- a/htdocs/fourn/commande/modules/mod_commande_fournisseur_muguet.php
+++ b/htdocs/includes/modules/supplier_order/mod_commande_fournisseur_muguet.php
@@ -19,13 +19,13 @@
  */
 
 /**
-     	\file       htdocs/fourn/commande/modules/mod_commande_fournisseur_muguet.php
-		\ingroup    commande
-		\brief      Fichier contenant la classe du mod�le de num�rotation de r�f�rence de commande fournisseur Muguet
-		\version    $Id$
-*/
+ *    	\file       htdocs/includes/modules/supplier_order/mod_commande_fournisseur_muguet.php
+ *		\ingroup    commande
+ *		\brief      Fichier contenant la classe du mod�le de num�rotation de r�f�rence de commande fournisseur Muguet
+ *		\version    $Id$
+ */
 
-require_once(DOL_DOCUMENT_ROOT ."/fourn/commande/modules/modules_commandefournisseur.php");
+require_once(DOL_DOCUMENT_ROOT ."/includes/modules/supplier_order/modules_commandefournisseur.php");
 
 
 /**	    \class      mod_commande_fournisseur_muguet
diff --git a/htdocs/fourn/commande/modules/mod_commande_fournisseur_orchidee.php b/htdocs/includes/modules/supplier_order/mod_commande_fournisseur_orchidee.php
similarity index 92%
rename from htdocs/fourn/commande/modules/mod_commande_fournisseur_orchidee.php
rename to htdocs/includes/modules/supplier_order/mod_commande_fournisseur_orchidee.php
index 67f9cf0edf6..c6440f85825 100644
--- a/htdocs/fourn/commande/modules/mod_commande_fournisseur_orchidee.php
+++ b/htdocs/includes/modules/supplier_order/mod_commande_fournisseur_orchidee.php
@@ -20,13 +20,13 @@
  */
 
 /**
-	\file       htdocs/fourn/commande/modules/mod_commande_fournisseur_orchidee.php
-	\ingroup    commande
-	\brief      Fichier contenant la classe du mod�le de num�rotation de r�f�rence de commande fournisseur Orchidee
-	\version    $Id$
-*/
+ *	\file       htdocs/includes/modules/supplier_order/mod_commande_fournisseur_orchidee.php
+ *	\ingroup    commande
+ *	\brief      Fichier contenant la classe du mod�le de num�rotation de r�f�rence de commande fournisseur Orchidee
+ *	\version    $Id$
+ */
 
-require_once(DOL_DOCUMENT_ROOT ."/fourn/commande/modules/modules_commandefournisseur.php");
+require_once(DOL_DOCUMENT_ROOT ."/includes/modules/supplier_order/modules_commandefournisseur.php");
 
 
 /**
diff --git a/htdocs/fourn/commande/modules/modules_commandefournisseur.php b/htdocs/includes/modules/supplier_order/modules_commandefournisseur.php
similarity index 93%
rename from htdocs/fourn/commande/modules/modules_commandefournisseur.php
rename to htdocs/includes/modules/supplier_order/modules_commandefournisseur.php
index 14dc1ea0f0a..ce2d794f6fb 100644
--- a/htdocs/fourn/commande/modules/modules_commandefournisseur.php
+++ b/htdocs/includes/modules/supplier_order/modules_commandefournisseur.php
@@ -21,12 +21,12 @@
  */
 
 /**
-            \file       htdocs/includes/modules/commande/modules_commandefournisseur.php
-                \ingroup    commande
-                \brief      Fichier contenant la classe m�re de generation des commandes fournisseurs en PDF
-                            et la classe m�re de num�rotation des commandes fournisseurs
-                \version    $Id$
-*/
+ *		\file       htdocs/includes/modules/supplier_order/modules_commandefournisseur.php
+ *      \ingroup    commande
+ *      \brief      Fichier contenant la classe m�re de generation des commandes fournisseurs en PDF
+ *                  et la classe m�re de num�rotation des commandes fournisseurs
+ *      \version    $Id$
+ */
 require_once(DOL_DOCUMENT_ROOT.'/includes/fpdf/fpdfi/fpdi_protection.php');
 
 
@@ -158,7 +158,7 @@ function supplier_order_pdf_create($db, $comid, $modele='',$outputlangs='')
   global $langs;
   $langs->load("suppliers");
  
-  $dir = DOL_DOCUMENT_ROOT."/fourn/commande/modules/pdf/";
+  $dir = DOL_DOCUMENT_ROOT."//includes/modules/supplier_order/pdf/";
 
   // Positionne modele sur le nom du modele de commande fournisseur � utiliser
   if (! strlen($modele))
diff --git a/htdocs/fourn/commande/modules/pdf/pdf_muscadet.modules.php b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php
similarity index 99%
rename from htdocs/fourn/commande/modules/pdf/pdf_muscadet.modules.php
rename to htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php
index 5c6a894290b..26e2709eb1b 100644
--- a/htdocs/fourn/commande/modules/pdf/pdf_muscadet.modules.php
+++ b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php
@@ -20,14 +20,14 @@
  */
 
 /**
- *	\file       htdocs/fourn/commande/modules/pdf_muscadet.modules.php
+ *	\file       htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php
  *	\ingroup    fournisseur
  *	\brief      Fichier de la classe permettant de g�n�rer les commandes fournisseurs au mod�le Muscadet
  *	\author	    Regis Houssin
  *	\version    $Id$
  */
 
-require_once(DOL_DOCUMENT_ROOT."/fourn/commande/modules/modules_commandefournisseur.php");
+require_once(DOL_DOCUMENT_ROOT."/includes/modules/supplier_order/modules_commandefournisseur.php");
 require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.commande.class.php");
 require_once(DOL_DOCUMENT_ROOT."/product.class.php");
 require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
@@ -53,7 +53,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
 
 		$this->db = $db;
 		$this->name = "muscadet";
-		$this->description = "Mod�le de commandes fournisseur complet (logo...)";
+		$this->description = "Modele de commandes fournisseur complet (logo...)";
 
 		// Dimension page pour format A4
 		$this->type = 'pdf';
-- 
GitLab