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 b6d4df5657f..84dec7b817e 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 a2ddb144e6d..c2fcf108c10 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 6065de505c6..2cd392a0bd6 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 3ea28a1bd81..b1ce4554459 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 caebf1d78d4..a00658a9837 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 f651c56e028..8f8a2edce9b 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 3c66bd5f11d..08f6372c11b 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 ab906617b07..d1386d646a5 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)
{
|