Categories > OpenTBS with ODT >

On field merged out of four

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Christoforos Korifidis
Date: 2013-11-10
Time: 18:33

On field merged out of four

Hello,
I have a libre office writer template with four fields defined in it.
The fields are  "blkname", "blktel", "blkdate", "blkcode".
I try to merge them using the below code.
        $blkname = array('test');
        $blktel = array('2221302602');
        $blkdate = array('12/03/2013');
        $blkcode = array('12032013.405');
       
        $TBS = new clsTinyButStrong;
       $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN); // load the OpenTBS plugin

       $TBS->LoadTemplate(JPATH_SITE .'/media/com_elgergon/proposalstemplates/10.10.odt');
        //$TBS->MergeBlock('elgblk', $data);
        $TBS->MergeBlock('elgname',$blkname);
        $TBS->MergeBlock('blktel',$blktel);
        $TBS->MergeBlock('blkdate',$blkdate);
        $TBS->MergeBlock('blkcode',$blkcode);
      
        $testPath = JPATH_SITE . '/images/elgergon/files/test.odt';
       
        //$TBS->PlugIn(OPENTBS_DEBUG_XML_SHOW);
        $TBS->Show(OPENTBS_FILE+TBS_EXIT, $testPath);
        $TBS->Show();

the template i use in the document is

Προς : [blkname.val;block=_]
Τηλέφωνο Επικοινωνίας:[blktel.val;block=_]
Χαλκίδα,  [blkdate.val;block=_]
Κωδικός Πρωτοκόλλου: 10.10.[blkcode.val;block=_]

If I have understand correct, the templates should be filled with their corresponding values.
Unfortunately only the the field "code" is merged and all the previous stay untouched.

Any help would be appreciated

thank you,
Christoforos
By: Skrol29
Date: 2013-11-10
Time: 22:56

Re: On field merged out of four

Hi Christoforos,

What is your version of LibreOffice ?
By: Christoforos
Date: 2013-11-14
Time: 15:28

Re: On field merged out of four

It's 4.0.5.2
By: Skrol29
Date: 2013-11-17
Time: 02:15

Re: On field merged out of four

Hi Christoforos,

I've observed that since LibreOffice Writer version 4, there is the same behavior as in Ms Office Word :
LibreOffice inserts invisible serial IDs in the XML in order to follow the user modifications.
Those Ids may deconstruct the modified TBS fields, but you cannot see that. The result is that the content looks like a TBS field, but TBS just ignore it.

So far, I've seen 2 ways to workaround this issue:
- Cut and paste as "Unformatted text" (Menu "Edit", "Paste special...")
  This will paste a fresh new string without XML split inside.  
or

- In the Options dialog box, in item "Load/Save", sub-item "General", at "ODF file format and ODF settings" choose "1.2".
  This solution will prevent from inserting the invisible serial Ids.
By: Skrol29
Date: 2013-11-20
Time: 03:05

Re: On field merged out of four

Hi Christoforos,

There is a beta version available that should fix this issue.
Do you want to try ?