This commit is contained in:
Laurent Destailleur 2017-09-18 15:49:21 +02:00
parent 0c01c7ceba
commit aba907d1a8

View File

@ -143,7 +143,7 @@ class Segment implements IteratorAggregate, Countable
} }
$reg = "/\[!--\sBEGIN\s$this->name\s--\](.*)\[!--\sEND\s$this->name\s--\]/sm"; $reg = "/\[!--\sBEGIN\s$this->name\s--\](.*)\[!--\sEND\s$this->name\s--\]/sm";
$this->xmlParsed = preg_replace($reg, '$1', $this->xmlParsed); $this->xmlParsed = preg_replace($reg, '$1', $this->xmlParsed);
// Miguel Erill 09704/2017 - Add macro replacement to invoice lines // Miguel Erill 09704/2017 - Add macro replacement to invoice lines
$this->xmlParsed = $this->macroReplace($this->xmlParsed); $this->xmlParsed = $this->macroReplace($this->xmlParsed);
$this->file->open($this->odf->getTmpfile()); $this->file->open($this->odf->getTmpfile());
foreach ($this->images as $imageKey => $imageValue) { foreach ($this->images as $imageKey => $imageValue) {
@ -175,8 +175,8 @@ class Segment implements IteratorAggregate, Countable
{ {
global $langs; global $langs;
$patterns=array( '__CURRENTDAY__','__CURRENTDAYTEXT__','__CURRENTMONTHSHORT__','__CURRENTMONTH__','__CURRENTYEAR__' ); $patterns=array('/__CURRENTDAY__/','/__CURRENTDAYTEXT__/','/__CURRENTMONTHSHORT__/','/__CURRENTMONTH__/','/__CURRENTYEAR__/');
$values=array( date('j'), $langs->trans(date('l')), $langs->trans(date('M')), $langs->trans(date('F')), date('Y') ); $values=array(date('j'), $langs->trans(date('l')), $langs->trans(date('M')), $langs->trans(date('F')), date('Y'));
$text=preg_replace($patterns, $values, $text); $text=preg_replace($patterns, $values, $text);