From 07651e5e352d3e1c85b93002b0d4fa06ffe0888c Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Wed, 8 Feb 2006 16:51:38 +0000
Subject: [PATCH] =?UTF-8?q?Ajout=20onglet=20aper=E7u=20sur=20la=20fiche=20?=
 =?UTF-8?q?commande=20client?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 htdocs/commande/apercu.php       |  3 ++-
 htdocs/commande/info.php         | 12 ++++++++++--
 htdocs/compta/commande/fiche.php |  8 ++++++++
 htdocs/expedition/commande.php   | 12 ++++++++++--
 4 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php
index db8205f9c79..fa14828b467 100644
--- a/htdocs/commande/apercu.php
+++ b/htdocs/commande/apercu.php
@@ -40,6 +40,7 @@ if (!$user->rights->commande->lire)
 $langs->load('propal');
 $langs->load("bills");
 $langs->load('compta');
+$langs->load('sendings');
 
 
 require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
@@ -122,7 +123,7 @@ if ($_GET["id"] > 0) {
 		$sql = 'SELECT s.nom, s.idp, p.price, p.fk_projet, p.remise, p.tva, p.total, p.ref, p.fk_statut, '.$db->pdate('p.datep').' as dp, p.note,';
 		$sql.= ' x.firstname, x.name, x.fax, x.phone, x.email, p.fk_user_author, p.fk_user_valid, p.fk_user_cloture, p.datec, p.date_valid, p.date_cloture';
 		$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p, '.MAIN_DB_PREFIX.'socpeople as x';
-		$sql.= ' WHERE p.fk_soc = s.idp AND p.fk_soc_contact = x.idp AND p.rowid = '.$propal->id;
+		$sql.= ' WHERE p.fk_soc = s.idp AND p.fk_soc_contact = x.idp AND p.rowid = '.$commande->id;
 		if ($socidp) $sql .= ' AND s.idp = '.$socidp;
 
 		$result = $db->query($sql);
diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php
index bc0f492f5ee..f79646cda67 100644
--- a/htdocs/commande/info.php
+++ b/htdocs/commande/info.php
@@ -1,5 +1,6 @@
 <?php
-/* Copyright (C) 2005 Laurent Destailleur  <eldy@users.sourceforge.net>
+/* Copyright (C) 2005      Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2005-2006 Regis Houssin        <regis.houssin@cap-networks.com>
  *
  * 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
@@ -68,7 +69,14 @@ $h = 0;
     	  $head[$h][0] = DOL_URL_ROOT.'/compta/commande/fiche.php?id='.$commande->id;
     	  $head[$h][1] = $langs->trans("ComptaCard");
     	  $h++;
-        }
+      }
+        
+    if ($conf->use_preview_tabs)
+		  {
+    		$head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$commande->id;
+    		$head[$h][1] = $langs->trans("Preview");
+    		$h++;
+      }
  
       $head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id;
       $head[$h][1] = $langs->trans("Info");
diff --git a/htdocs/compta/commande/fiche.php b/htdocs/compta/commande/fiche.php
index 54efa592fcf..5d5a677243f 100644
--- a/htdocs/compta/commande/fiche.php
+++ b/htdocs/compta/commande/fiche.php
@@ -1,6 +1,7 @@
 <?php
 /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2005-2006 Regis Houssin        <regis.houssin@cap-networks.com>
  *
  * 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
@@ -109,6 +110,13 @@ if ($_GET["id"] > 0)
             $hselected = $h;
             $h++;
         }
+        
+        if ($conf->use_preview_tabs)
+		    {
+    		$head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$commande->id;
+    		$head[$h][1] = $langs->trans("Preview");
+    		$h++;
+        }
 
         $head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id;
         $head[$h][1] = $langs->trans("Info");
diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/commande.php
index f048044733a..d200d73331e 100644
--- a/htdocs/expedition/commande.php
+++ b/htdocs/expedition/commande.php
@@ -1,6 +1,7 @@
 <?php
-/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2005 Laurent Destailleur  <eldy@users.sourceforge.net>
+/* Copyright (C) 2003      Rodolphe Quiedeville <rodolphe@quiedeville.org>
+ * Copyright (C) 2005      Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2005-2006 Regis Houssin        <regis.houssin@cap-networks.com>
  *
  * 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
@@ -108,6 +109,13 @@ if ($_GET["id"] > 0)
             $head[$h][1] = $langs->trans("ComptaCard");
             $h++;
         }
+        
+        if ($conf->use_preview_tabs)
+		    {
+    		$head[$h][0] = DOL_URL_ROOT.'/commande/apercu.php?id='.$commande->id;
+    		$head[$h][1] = $langs->trans("Preview");
+    		$h++;
+        }
 
         $head[$h][0] = DOL_URL_ROOT.'/commande/info.php?id='.$commande->id;
         $head[$h][1] = $langs->trans("Info");
-- 
GitLab