From 88e5616622557375c5d42238e4c29296eaf8bc65 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Mar 2016 17:35:58 +0100 Subject: [PATCH] Prepare code to be able to download ODT templates --- .../doc/doc_generic_order_odt.modules.php | 20 ++++++++++++++++++- .../doc/doc_generic_shipment_odt.modules.php | 19 +++++++++++++++++- .../doc/doc_generic_invoice_odt.modules.php | 19 +++++++++++++++++- .../doc/doc_generic_project_odt.modules.php | 20 ++++++++++++++++++- .../task/doc/doc_generic_task_odt.modules.php | 20 ++++++++++++++++++- .../doc/doc_generic_proposal_odt.modules.php | 19 ++++++++++++++++-- .../societe/doc/doc_generic_odt.modules.php | 20 ++++++++++++++++++- ..._generic_supplier_proposal_odt.modules.php | 19 ++++++++++++++++-- 8 files changed, 146 insertions(+), 10 deletions(-) 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.=''; // 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.=''; // 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.=''; // 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.=''; // 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.=''; // 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.='