From d4f43f1fedaa6077359b1923eeafed36414eb2ac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Sep 2005 01:23:29 +0000 Subject: [PATCH] =?UTF-8?q?N'affiche=20pas=20onglet=20apercu=20propal=20si?= =?UTF-8?q?=20option=20MAIN=5FUSE=5FPREVIEW=5FTABLE=20mis=20=E0=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/propal.php | 5 +- htdocs/comm/propal/apercu.php | 14 +++-- htdocs/comm/propal/document.php | 101 +++++++++++++++++--------------- htdocs/comm/propal/info.php | 11 ++-- htdocs/comm/propal/note.php | 11 ++-- htdocs/compta/propal.php | 5 +- htdocs/install/etape5.php | 6 +- htdocs/soc.php | 2 +- 8 files changed, 86 insertions(+), 69 deletions(-) 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 ''; + print ''; print ''; print '
'; @@ -135,51 +141,50 @@ if ($propalid > 0) clearstatcache(); - $errorlevel=error_reporting(); - error_reporting(0); - $handle=opendir($upload_dir); - error_reporting($errorlevel); + if (is_dir($upload_dir)) + { + + $handle=opendir($upload_dir); + if ($handle) + { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $var=true; + while (($file = readdir($handle))!==false) + { + if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') + { + $var=!$var; + print ''; + print '\n"; + print ''; + print ''; + print '\n"; + } + } + closedir($handle); + } + else + { + print '
'.$langs->trans('ErrorCantOpenDir').' '.$upload_dir.'
'; + } - print '
'.$langs->trans('Document').''.$langs->trans('Size').''.$langs->trans('Date').' 
'; + echo ''.$file.''; + print "'.filesize($upload_dir.'/'.$file). ' bytes'.strftime('%d %b %Y %H:%M:%S',filemtime($upload_dir.'/'.$file)).''; + if ($file == $propref . '.pdf') + { + echo '-'; + } + else + { + echo ''.img_delete($langs->trans('Delete')).''; + } + print "
'; - - if ($handle) - { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - $var=true; - while (($file = readdir($handle))!==false) - { - if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') - { - $var=!$var; - print ''; - print '\n"; - print ''; - print ''; - print '\n"; - } - } - closedir($handle); - } - else - { - print '
'.$langs->trans('ErrorCantOpenDir').' '.$upload_dir.'
'; - } + } print '
'.$langs->trans('Document').''.$langs->trans('Size').''.$langs->trans('Date').' 
'; - echo ''.$file.''; - print "'.filesize($upload_dir.'/'.$file). ' bytes'.strftime('%d %b %Y %H:%M:%S',filemtime($upload_dir.'/'.$file)).''; - if ($file == $propref . '.pdf') - { - echo '-'; - } - else - { - echo ''.$langs->trans('Delete').''; - } - print "
'; print ''; diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 467e4e9b787..f651f7e00ee 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -65,10 +65,13 @@ if ($_GET['propalid']) $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++; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 2355f85934e..343af6f5e08 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -84,10 +84,13 @@ if ($_GET['propalid']) $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'); $hselected=$h; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 6483a71f5d3..23f1418c845 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -109,10 +109,13 @@ if ($_GET["propalid"]) $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"); $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/install/etape5.php b/htdocs/install/etape5.php index c31174d0394..f59bfe5da07 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -115,10 +115,8 @@ if ($_POST["action"] == "set") $db->query("DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED'"); // Si install non Français, on configure pour fonctionner en mode internationnal - if ($langs->defaultlang != "fr_FR") { - - $db->query("INSERT INTO llx_const(name,value,type,visible) values ('COMPANY_CREATE_TWO_STEPS','1','yesno',0)"); - + if ($langs->defaultlang != "fr_FR") + { $db->query("UPDATE llx_const set value='eldy.php' WHERE name='MAIN_MENU_BARRETOP';"); $db->query("UPDATE llx_const set value='eldy.php' WHERE name='MAIN_MENU_BARRELEFT';"); } diff --git a/htdocs/soc.php b/htdocs/soc.php index fd7cbc1c779..bf5e78a5d37 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -150,7 +150,7 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create') if ($user->rights->societe->creer) { /* - * Fiche societe en mode création (Creation en 1 ou 2 temps selon COMPANY_CREATE_TWO_STEPS) + * Fiche societe en mode création */ $soc->fournisseur=0; if ($_GET["type"]=='f') { $soc->fournisseur=1; }