Merge pull request #7346 from hregis/6.0_bug3

Fix: avoid warning
This commit is contained in:
Laurent Destailleur 2017-09-11 14:07:38 +02:00 committed by GitHub
commit 19e780c53f

View File

@ -313,7 +313,7 @@ class doc_generic_user_odt extends ModelePDFUser
{
$socobject=$object->client;
}
// Open and load template
require_once ODTPHP_PATH.'odf.php';
try {
@ -332,7 +332,7 @@ class doc_generic_user_odt extends ModelePDFUser
$this->error=$e->getMessage();
return -1;
}
// Make substitutions into odt
$array_user=$this->get_substitutionarray_user($object,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
@ -366,7 +366,7 @@ class doc_generic_user_odt extends ModelePDFUser
{
}
}
// Replace labels translated
$tmparray=$outputlangs->get_translations_for_substitutions();
foreach($tmparray as $key=>$value)
@ -420,12 +420,13 @@ class doc_generic_user_odt extends ModelePDFUser
return -1;
}
function get_substitutionarray_object($object,$outputlangs) {
function get_substitutionarray_object($object,$outputlangs,$array_key='object') {
$array_other=array();
foreach($object as $key => $value) {
if(!is_array($value) && !is_object($value)) {
$array_other['object_'.$key] = $value;
if (!is_array($value) && !is_object($value)) {
$array_other[$array_key.'_'.$key] = $value;
}
}
}
return $array_other;
}