placeholders within footer in odt templates

Hello,
Trying these days 3.1. Looks grrrr8!!
I’ve found a problem with placeholders within footer in odt templates.
They work fine in the body of the document, but they just stop working if you put them in the footer.
See attached template.

Any ideas?

Attached? I couldn’t find it. Can you provide a link please? I have trouble setting up my odt template too, maybe I can try yours to see what I’m doing wrong.

Thanks !

As I told you, it works fine with the body, but not in the footer of the document. You can try attached doc

factura_particular2.odt (15.2 KB)

I see. I just put your odt in my doctemplates/invoices, and I select it from the list and hit generate, but it doesn’t work at all with me!!!

How did you set up the odt generation? I put doc_generic_odt.modules in includes/modules/facture/doc but it doesnt work :unhappy:

Could you upload your doc_generic_odt.modules.php? I want to try because I have no php knowledge at all!

Thank you, and please tell me if you know why my odt generation may not be working. Oh, and I’m really sorry if I changed the subject a little…

Exactly, this was not the subject. I suggest you to open a new thread.
Regarding your problem, I can tell you that a standard installation works fine, so maybe you mixed up files a little bit. Maybe you can check it comparing your structure with an original structure. If you want, I can provide you pro support to fix your problem. You can first contact me in pnueda at gmail (oops, is that allowed here?)

odf.zip (4.14 KB) I’ve found a way to fix the problem, and learn a few things in the process :happy:
Footers in odt files seem to be in styles.xml, as long as document body is in content.xml.
All the document parsing is in includes/odtphp/odf.php
All we had to do is adding parsing for styles.xml part of the document.
The new feature is available just replacing original Dolibarr 3.1 includes/odtphp/odf.php with the attached one.

I am pleased to add a little documentation about the changes:
a) __construct, added a new protected object variable “stylesXml”
b) __construct, error checking (styles.xml exists?)
c) in setVars, add a new “AND” condition to include styles.xml while searching for the vars
d) in parse, add replacing instruction for stylesXml variables that were set in the array within setVars function
e) in _save, just add an instruction to save modified styles.xml

I tried it and it seems to work fine now. Enjoy you all.

Hope this will be fixed in version 3.2!