From 5534aa3fba1fa4e7e19e4a12854d1e8fbb12846c Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Sat, 10 Sep 2005 16:15:19 +0000
Subject: [PATCH] =?UTF-8?q?Ajout=20option=20pour=20d=E9sactiver=20les=20fo?=
 =?UTF-8?q?nctions=20aper=E7u=20(pour=20ceux=20qui=20n'ont=20pas=20imagema?=
 =?UTF-8?q?gick)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 htdocs/compta/facture.php             | 10 +++++++---
 htdocs/compta/facture/apercu.php      | 12 ++++++++----
 htdocs/compta/facture/info.php        |  9 ++++++---
 htdocs/compta/facture/note.php        | 10 +++++++---
 htdocs/compta/facture/prelevement.php | 11 +++++++----
 htdocs/master.inc.php                 |  2 +-
 6 files changed, 36 insertions(+), 18 deletions(-)

diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index bae2281cbe0..229964c8a74 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1087,10 +1087,14 @@ else
             $head[$h][1] = $langs->trans("CardBill");
             $hselected = $h;
             $h++;
-            $head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
-            $head[$h][1] = $langs->trans("Preview");
-            $h++;
 
+            if ($conf->use_preview_tabs)
+            {
+                $head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
+                $head[$h][1] = $langs->trans("Preview");
+                $h++;
+            }
+            
             if ($fac->mode_reglement_code == 'PRE')
             {
                 $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$fac->id;
diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php
index 8c8c111ff59..4bf9d8be4c2 100644
--- a/htdocs/compta/facture/apercu.php
+++ b/htdocs/compta/facture/apercu.php
@@ -81,11 +81,15 @@ if ($_GET["facid"] > 0)
         $head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$fac->id;
         $head[$h][1] = $langs->trans("CardBill");
         $h++;
-        $head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
-        $head[$h][1] = $langs->trans("Preview");
-        $hselected = $h;
-        $h++;
 
+        if ($conf->use_preview_tabs)
+        {
+            $head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
+            $head[$h][1] = $langs->trans("Preview");
+            $hselected = $h;
+            $h++;
+        }
+        
         if ($fac->mode_reglement_code == 'PRE')
         {
             $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$fac->id;
diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php
index e57b57ba115..45506a5b5d3 100644
--- a/htdocs/compta/facture/info.php
+++ b/htdocs/compta/facture/info.php
@@ -51,9 +51,12 @@ $head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$fac->id;
 $head[$h][1] = $langs->trans("CardBill");
 $h++;
 
-$head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
-$head[$h][1] = $langs->trans("Preview");
-$h++;
+if ($conf->use_preview_tabs)
+{
+    $head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
+    $head[$h][1] = $langs->trans("Preview");
+    $h++;
+}
 
 if ($fac->mode_reglement_code == 'PRE')
 {
diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php
index 721c9598a47..fd18da3619d 100644
--- a/htdocs/compta/facture/note.php
+++ b/htdocs/compta/facture/note.php
@@ -80,10 +80,14 @@ if ($_GET["facid"])
     $head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$fac->id;
     $head[$h][1] = $langs->trans("CardBill");
     $h++;
-    $head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
-    $head[$h][1] = $langs->trans("Preview");
-    $h++;
 
+    if ($conf->use_preview_tabs)
+    {
+        $head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
+        $head[$h][1] = $langs->trans("Preview");
+        $h++;
+    }
+    
     if ($fac->mode_reglement_code == 'PRE')
     {
         $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$fac->id;
diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index 771ef7741c4..ea6a101f094 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -113,10 +113,13 @@ if ($_GET["facid"] > 0)
         $head[$h][1] = $langs->trans("CardBill");
         $h++;
 
-        $head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
-        $head[$h][1] = $langs->trans("Preview");
-        $h++;
-
+        if ($conf->use_preview_tabs)
+        {
+            $head[$h][0] = DOL_URL_ROOT.'/compta/facture/apercu.php?facid='.$fac->id;
+            $head[$h][1] = $langs->trans("Preview");
+            $h++;
+        }
+        
         if ($fac->mode_reglement_code == 'PRE')
         {
             $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$fac->id;
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index aa4e587329a..f81ad9b61e9 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -298,7 +298,7 @@ $conf->actionscomm->dir_output=DOL_DATA_ROOT."/action";
 
 // conf->use_preview_tabs
 $conf->use_preview_tabs=1;
-if (isset($conf->global->USE_PREVIEW_TABS)) $conf->use_preview_tabs=$conf->global->USE_PREVIEW_TABS;
+if (isset($conf->global->MAIN_USE_PREVIEW_TABS)) $conf->use_preview_tabs=$conf->global->MAIN_USE_PREVIEW_TABS;
 
 // conf->monnaie
 if (! $conf->global->MAIN_MONNAIE) $conf->global->MAIN_MONNAIE='EUR';	
-- 
GitLab