From 96db11b011db83c917c4e5ad0e066321aa313a41 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Sep 2005 11:51:40 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20N'affiche=20le=20titre=20du=20tableau=20?= =?UTF-8?q?"Document"=20si=20le=20tableau=20n'est=20pas=20affich=E9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/html.form.class.php | 84 +++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 164cbb15755..4b9fb7da912 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1553,40 +1553,6 @@ class Form $filename = sanitize_string($filename); $relativepath = "${filename}/${filename}.pdf"; $fullpathfile = $filedir . "/" . $filename . ".pdf"; - - if ($genallowed) - { - print '
'; - print ''; - } - print_titre($langs->trans("Documents")); - print ''; - - if ($genallowed) - { - $liste=array(); - if ($modulepart == 'propal') - { - include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php'); - $model=new ModelePDFPropales(); - $liste=$model->liste_modeles($this->db); - } - elseif ($modulepart == 'facture') - { - include_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php'); - $model=new ModelePDFFactures(); - $liste=$model->liste_modeles($this->db); - } - else - { - dolibarr_print_error($this->db,'Bad value for modulepart'); - } - print ''; - } $i=0; if (is_dir($filedir)) @@ -1597,6 +1563,46 @@ class Form // Si fichier non lisible ou non .pdf, on passe au suivant if (! is_readable($filedir."/".$file) || ! eregi('\.pdf$',$file)) continue; + + if ($i==0) + { + // Affiche en-tete tableau + if ($genallowed) + { + print ''; + print ''; + } + + print_titre($langs->trans("Documents")); + print '
'.$langs->trans('Model').''; - $this->select_array('modelpdf',$liste,$modelselected); - $texte=$langs->trans('Generate'); - print ''; - print '
'; + + if ($genallowed) + { + $liste=array(); + if ($modulepart == 'propal') + { + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php'); + $model=new ModelePDFPropales(); + $liste=$model->liste_modeles($this->db); + } + elseif ($modulepart == 'facture') + { + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php'); + $model=new ModelePDFFactures(); + $liste=$model->liste_modeles($this->db); + } + else + { + dolibarr_print_error($this->db,'Bad value for modulepart'); + } + print ''; + } + } + print ""; if (eregi('\-detail\.pdf',$file)) print ''; else print ''; @@ -1612,10 +1618,14 @@ class Form } } - print "
'.$langs->trans('Model').''; + $this->select_array('modelpdf',$liste,$modelselected); + $texte=$langs->trans('Generate'); + print ''; + print '
PDF DétailléPDF
\n"; - if ($genallowed) + if ($i > 0) { - print '
'; + // Affiche pied du tableau + print "\n"; + if ($genallowed) + { + print ''; + } } }