Fix: avoid warning

This commit is contained in:
Regis Houssin 2017-09-08 12:52:56 +02:00
parent 835cd43565
commit d4c20a919d

View File

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