diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index ff830ae549f..f51c9e1a03a 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -382,10 +382,13 @@ if ($_GET['propalid'] > 0)
$head[$h][1] = $langs->trans('AccountancyCard');
$h++;
+ if ($conf->use_preview_tabs)
+ {
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans("Preview");
$h++;
-
+ }
+
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans('Note');
$h++;
diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php
index 1e6a30ccc5a..8a2362d8c21 100644
--- a/htdocs/comm/propal/apercu.php
+++ b/htdocs/comm/propal/apercu.php
@@ -20,7 +20,6 @@
*
* $Id$
* $Source$
- *
*/
/**
@@ -85,11 +84,14 @@ if ($_GET["propalid"] > 0) {
$head[$h][1] = $langs->trans('AccountancyCard');
$h++;
- $head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
- $head[$h][1] = $langs->trans("Preview");
- $hselected=$h;
- $h++;
-
+ if ($conf->use_preview_tabs)
+ {
+ $head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
+ $head[$h][1] = $langs->trans("Preview");
+ $hselected=$h;
+ $h++;
+ }
+
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans('Note');
$h++;
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 768c146a6ab..66f9f2e934f 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -76,6 +76,7 @@ if ($propalid > 0)
{
$propref = sanitize_string($propal->ref);
$upload_dir = $conf->propal->dir_output.'/'.$propref;
+
if ( $error_msg )
{
echo ''.$error_msg.'
';
@@ -105,10 +106,13 @@ if ($propalid > 0)
$head[$h][1] = $langs->trans('AccountancyCard');
$h++;
- $head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
- $head[$h][1] = $langs->trans("Preview");
- $h++;
-
+ if ($conf->use_preview_tabs)
+ {
+ $head[$h][0] = DOL_URL_ROOT.'/comm/propal/apercu.php?propalid='.$propal->id;
+ $head[$h][1] = $langs->trans("Preview");
+ $h++;
+ }
+
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id;
$head[$h][1] = $langs->trans('Note');
$h++;
@@ -126,6 +130,8 @@ if ($propalid > 0)
print_titre($langs->trans('AssociatedDocuments').' '.$propal->ref_url);
+ print '