This commit is contained in:
Laurent Destailleur 2011-06-13 17:09:57 +00:00
parent 685d7940e6
commit 8fcf634259
3 changed files with 17 additions and 7 deletions

View File

@ -40,7 +40,8 @@ class CommonDocGenerator
/**
* Define array with couple subtitution key => subtitution value
*
* @param $mysoc
* @param $user User
* @param $outputlangs Language object for output
*/
function get_substitutionarray_user($user,$outputlangs)
{
@ -62,7 +63,8 @@ class CommonDocGenerator
/**
* Define array with couple subtitution key => subtitution value
*
* @param $mysoc
* @param $mysoc
* @param $outputlangs Language object for output
*/
function get_substitutionarray_mysoc($mysoc,$outputlangs)
{
@ -102,7 +104,8 @@ class CommonDocGenerator
/**
* Define array with couple subtitution key => subtitution value
*
* @param $object
* @param $object
* @param $outputlangs Language object for output
*/
function get_substitutionarray_thirdparty($object,$outputlangs)
{

View File

@ -386,7 +386,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
//print exit;
// Make substitutions into odt
// Make substitutions into odt of freetext
if ($newfreetext)
{
try {
@ -396,6 +396,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
{
}
}
// Make substitutions into odt of user info
$tmparray=$this->get_substitutionarray_user($user,$outputlangs);
//var_dump($tmparray); exit;
foreach($tmparray as $key=>$value)
@ -416,6 +417,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
{
}
}
// Make substitutions into odt of mysoc
$tmparray=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
//var_dump($tmparray); exit;
foreach($tmparray as $key=>$value)
@ -436,6 +438,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
{
}
}
// Make substitutions into odt of thirdparty
$tmparray=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
foreach($tmparray as $key=>$value)
{

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2010 Laurent Destailleur <ely@users.sourceforge.net>
/* Copyright (C) 2010-2011 Laurent Destailleur <ely@users.sourceforge.net>
* 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
@ -259,7 +259,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
//print $odfHandler->__toString()."\n";
// Make substitutions
// Make substitutions into odt of user info
$tmparray=$this->get_substitutionarray_user($user,$outputlangs);
//var_dump($tmparray); exit;
foreach($tmparray as $key=>$value)
@ -281,7 +281,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc
{
}
}
$tmparray=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
// Make substitutions into odt of mysoc info
$tmparray=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
//var_dump($tmparray); exit;
foreach($tmparray as $key=>$value)
{
@ -301,7 +302,10 @@ class doc_generic_odt extends ModeleThirdPartyDoc
{
}
}
// Make substitutions into odt of thirdparty + external modules
$tmparray=$this->get_substitutionarray_thirdparty($object,$outputlangs);
complete_substitutions_array($tmparray, $langs, $object);
//var_dump($object->id); exit;
foreach($tmparray as $key=>$value)
{
try {