From 77031ca5a48b3ffd4a2aae29679fa5a8765baa4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 May 2011 22:38:19 +0000 Subject: [PATCH] New: odt templates usage for invoices are now visible --- htdocs/admin/facture.php | 9 ++++++++- .../facture/doc/doc_generic_invoice_odt.modules.php | 9 +++++---- .../includes/modules/facture/doc/pdf_crabe.modules.php | 5 ++++- .../includes/modules/facture/doc/pdf_oursin.modules.php | 6 +++++- .../modules/societe/doc/doc_generic_odt.modules.php | 4 ++-- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 7e1dc7093eb..c0edab9028d 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -437,6 +437,14 @@ foreach ($conf->file->dol_document_root as $dirroot) if (is_resource($handle)) { while (($file = readdir($handle))!==false) + { + $filelist[]=$file; + } + closedir($handle); + //sort($filelist); + //var_dump($filelist); + + foreach($filelist as $file) { if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) { @@ -532,7 +540,6 @@ foreach ($conf->file->dol_document_root as $dirroot) } } } - closedir($handle); } } } diff --git a/htdocs/includes/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/includes/modules/facture/doc/doc_generic_invoice_odt.modules.php index 29785fa8fa0..c2f6ceee788 100644 --- a/htdocs/includes/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/includes/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2011 Laurent Destailleur * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,7 +41,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures var $emetteur; // Objet societe qui emet var $phpmin = array(5,2,0); // Minimum version of PHP required by module - var $version = 'development'; + var $version = 'dolibarr'; + /** * \brief Constructor @@ -179,7 +180,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $texthelp=$langs->trans("ListOfDirectoriesForModelGenODT"); // Add list of substitution keys $texthelp.='
'.$langs->trans("FollowingSubstitutionKeysCanBeUsed").'
'; - $dummy=new User($db); + /*$dummy=new User($db); $tmparray=$this->get_substitutionarray_user($dummy,$langs); $nb=0; foreach($tmparray as $key => $val) @@ -204,7 +205,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $texthelp.='{'.$key.'}
'; $nb++; if ($nb >= 5) { $texthelp.='...
'; break; } - } + }*/ $texthelp.=$langs->trans("FullListOnOnlineDocumentation"); $texte.= $form->textwithpicto($texttitle,$texthelp,1,'help'); diff --git a/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php b/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php index 1085d89baa0..e0804fe8ed2 100755 --- a/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php @@ -44,6 +44,9 @@ class pdf_crabe extends ModelePDFFactures { var $emetteur; // Objet societe qui emet + var $phpmin = array(4,3,0); // Minimum version of PHP required by module + var $version = 'dolibarr'; + /** * Constructor @@ -1093,7 +1096,7 @@ class pdf_crabe extends ModelePDFFactures // Add list of linked orders and proposals // TODO mutualiser $object->fetchObjectLinked(); - + foreach($object->linkedObjects as $objecttype => $objects) { if ($objecttype == 'propal') diff --git a/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php b/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php index 5caec8e66e1..a7a34e96f74 100755 --- a/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php +++ b/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php @@ -44,6 +44,10 @@ class pdf_oursin extends ModelePDFFactures var $emetteur; // Objet societe qui emet var $marges=array("g"=>10,"h"=>5,"d"=>10,"b"=>15); + var $phpmin = array(4,3,0); // Minimum version of PHP required by module + var $version = 'dolibarr'; + + /** * \brief Constructeur * \param db Database handler @@ -964,7 +968,7 @@ class pdf_oursin extends ModelePDFFactures // Add list of linked orders and proposals // TODO mutualiser $object->fectObjectLinked(); - + foreach($object->linkedObjects as $objecttype => $objects) { if ($objecttype == 'propal') diff --git a/htdocs/includes/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/includes/modules/societe/doc/doc_generic_odt.modules.php index 20f8b996a53..beb7cb91cd1 100644 --- a/htdocs/includes/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/includes/modules/societe/doc/doc_generic_odt.modules.php @@ -115,7 +115,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $texthelp=$langs->trans("ListOfDirectoriesForModelGenODT"); // Add list of substitution keys $texthelp.='
'.$langs->trans("FollowingSubstitutionKeysCanBeUsed").'
'; - $dummy=new User($db); + /*$dummy=new User($db); $tmparray=$this->get_substitutionarray_user($dummy,$langs); $nb=0; foreach($tmparray as $key => $val) @@ -140,7 +140,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $texthelp.='{'.$key.'}
'; $nb++; if ($nb >= 5) { $texthelp.='...
'; break; } - } + }*/ $texthelp.=$langs->trans("FullListOnOnlineDocumentation"); $texte.= $form->textwithpicto($texttitle,$texthelp,1,'help');