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.
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.
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
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.