diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index ceccfdc5765..5529a25ce10 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -144,8 +144,26 @@ class doc_generic_order_odt extends ModelePDFCommandes
$texte.= '
';
// Scan directories
- if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).'';
+ $nbofiles=count($listoffiles);
+ if (! empty($conf->global->COMMANDE_ADDON_PDF_ODT_PATH))
+ {
+ $texte.=$langs->trans("NumberOfModelFilesFound").': ';
+ //$texte.=$nbofiles?'':'';
+ $texte.=count($listoffiles);
+ //$texte.=$nbofiles?'':'';
+ $texte.='';
+ }
+ if ($nbofiles)
+ {
+ $texte.='
';
+ foreach($listoffiles as $file)
+ {
+ $texte.=$file['name'].'
';
+ }
+ $texte.='
';
+ }
+
$texte.= '';
$texte.= '
';
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index 969fda5e072..9681e1a6d3e 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -145,7 +145,24 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$texte.= ' ';
// Scan directories
- if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).'';
+ $nbofiles=count($listoffiles);
+ if (! empty($conf->global->EXPEDITION_ADDON_PDF_ODT_PATH))
+ {
+ $texte.=$langs->trans("NumberOfModelFilesFound").': ';
+ //$texte.=$nbofiles?'':'';
+ $texte.=count($listoffiles);
+ //$texte.=$nbofiles?'':'';
+ $texte.='';
+ }
+ if ($nbofiles)
+ {
+ $texte.='';
+ foreach($listoffiles as $file)
+ {
+ $texte.=$file['name'].' ';
+ }
+ $texte.=' ';
+ }
$texte.= ' | ';
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 657688cb20e..34d1bcf0b2e 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -144,7 +144,24 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$texte.= '
';
// Scan directories
- if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).'';
+ $nbofiles=count($listoffiles);
+ if (! empty($conf->global->FACTURE_ADDON_PDF_ODT_PATH))
+ {
+ $texte.=$langs->trans("NumberOfModelFilesFound").': ';
+ //$texte.=$nbofiles?'':'';
+ $texte.=count($listoffiles);
+ //$texte.=$nbofiles?'':'';
+ $texte.='';
+ }
+ if ($nbofiles)
+ {
+ $texte.='';
+ foreach($listoffiles as $file)
+ {
+ $texte.=$file['name'].'
';
+ }
+ $texte.='
';
+ }
$texte.= '';
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index b80eded4bd9..c18b6a17e8d 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -357,7 +357,25 @@ class doc_generic_project_odt extends ModelePDFProjects
$texte.= '
';
// Scan directories
- if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).'';
+ $nbofiles=count($listoffiles);
+ if (! empty($conf->global->PROJECT_ADDON_PDF_ODT_PATH))
+ {
+ $texte.=$langs->trans("NumberOfModelFilesFound").': ';
+ //$texte.=$nbofiles?'':'';
+ $texte.=$nbofiles;
+ //$texte.=$nbofiles?'':'';
+ $texte.='';
+ }
+
+ if ($nbofiles)
+ {
+ $texte.='';
+ foreach($listoffiles as $file)
+ {
+ $texte.=$file['name'].'
';
+ }
+ $texte.='
';
+ }
$texte.= '';
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index 19dbe2f5ad2..e9dbc1d2adc 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -358,7 +358,25 @@ class doc_generic_task_odt extends ModelePDFTask
$texte.= '
';
// Scan directories
- if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).'';
+ $nbofiles=count($listoffiles);
+ if (! empty($conf->global->PROJECT_TASK_ADDON_PDF_ODT_PATH))
+ {
+ $texte.=$langs->trans("NumberOfModelFilesFound").': ';
+ //$texte.=$nbofiles?'':'';
+ $texte.=$nbofiles;
+ //$texte.=$nbofiles?'':'';
+ $texte.='';
+ }
+
+ if ($nbofiles)
+ {
+ $texte.='';
+ foreach($listoffiles as $file)
+ {
+ $texte.=$file['name'].'
';
+ }
+ $texte.='
';
+ }
$texte.= '';
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index e2272ba6ffb..4ca44452c8a 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -149,10 +149,25 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$texte.= '
';
// Scan directories
- if (count($listofdir))
+ $nbofiles=count($listoffiles);
+ if (! empty($conf->global->PROPALE_ADDON_PDF_ODT_PATH))
{
- $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).'';
+ $texte.=$langs->trans("NumberOfModelFilesFound").': ';
+ //$texte.=$nbofiles?'':'';
+ $texte.=count($listoffiles);
+ //$texte.=$nbofiles?'':'';
+ $texte.='';
+ }
+ if ($nbofiles)
+ {
+ $texte.='';
+ foreach($listoffiles as $file)
+ {
+ $texte.=$file['name'].'
';
+ }
+ $texte.='
';
+
if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0)
{
// Model for creation
diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
index 548e72b5675..63dbc12cf5b 100644
--- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
+++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
@@ -131,8 +131,26 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$texte.= '';
// Scan directories
- if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").':
'.count($listoffiles).'';
+ $nbofiles=count($listoffiles);
+ if (! empty($conf->global->COMPANY_ADDON_PDF_ODT_PATH))
+ {
+ $texte.=$langs->trans("NumberOfModelFilesFound").':
';
+ //$texte.=$nbofiles?'':'';
+ $texte.=$nbofiles;
+ //$texte.=$nbofiles?'':'';
+ $texte.='';
+ }
+ if ($nbofiles)
+ {
+ $texte.='
';
+ foreach($listoffiles as $file)
+ {
+ $texte.=$file['name'].'
';
+ }
+ $texte.='
';
+ }
+
$texte.= '';
$texte.= '
';
diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
index 0a468681edc..a820265571c 100644
--- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
@@ -149,9 +149,24 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
$texte.= ' ';
// Scan directories
- if (count($listofdir))
+ $nbofiles=count($listoffiles);
+ if (! empty($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH))
{
- $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).'';
+ $texte.=$langs->trans("NumberOfModelFilesFound").': ';
+ //$texte.=$nbofiles?'':'';
+ $texte.=count($listoffiles);
+ //$texte.=$nbofiles?'':'';
+ $texte.='';
+ }
+
+ if ($nbofiles)
+ {
+ $texte.='';
+ foreach($listoffiles as $file)
+ {
+ $texte.=$file['name'].' ';
+ }
+ $texte.=' ';
if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0)
{
|