FIX Error generating ODT when option to use contact on doc on

This commit is contained in:
Laurent Destailleur 2018-10-31 15:31:22 +01:00
parent b0ef8680ff
commit ca726e6c94
8 changed files with 53 additions and 60 deletions

View File

@ -360,10 +360,9 @@ class doc_generic_order_odt extends ModelePDFCommandes
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in order as contact_xxx tags // retrieve contact information for use in object as contact_xxx tags
$array_thirdparty_contact = array(); $array_thirdparty_contact = array();
if ($usecontact) if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -309,9 +309,9 @@ class doc_generic_contract_odt extends ModelePDFContract
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in contract as contact_xxx tags // retrieve contact information for use in order as contact_xxx tags
$array_thirdparty_contact = array(); $array_thirdparty_contact = array();
if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$substitutionarray = array_merge($substitutionarray,$array_contract,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); $substitutionarray = array_merge($substitutionarray,$array_contract,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
complete_substitutions_array($substitutionarray, $outputlangs, $object); complete_substitutions_array($substitutionarray, $outputlangs, $object);

View File

@ -368,10 +368,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array(); $array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array();
$array_other=$this->get_substitutionarray_other($outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in invoice as contact_xxx tags // retrieve contact information for use in object as contact_xxx tags
$array_thirdparty_contact = array(); $array_thirdparty_contact = array();
if ($usecontact) if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other,$array_thirdparty_contact); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -377,10 +377,9 @@ class doc_generic_product_odt extends ModelePDFProduct
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
//$array_objet=$this->get_substitutionarray_object($object,$outputlangs); //$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in product as contact_xxx tags // retrieve contact information for use in order as contact_xxx tags
$array_thirdparty_contact = array(); $array_thirdparty_contact = array();
if ($usecontact) if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($array_global,$array_user,$array_soc,$array_thirdparty,$array_other,$array_thirdparty_contact); $tmparray = array_merge($array_global,$array_user,$array_soc,$array_thirdparty,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -588,10 +588,9 @@ class doc_generic_project_odt extends ModelePDFProjects
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in project as contact_xxx tags // retrieve contact information for use in order as contact_xxx tags
$array_project_contact = array(); $array_thirdparty_contact = array();
if ($usecontact) if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$array_project_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_project_contact); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_project_contact);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -390,10 +390,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in proposal as contact_xxx tags // retrieve contact information for use in object as contact_xxx tags
$array_thirdparty_contact = array(); $array_thirdparty_contact = array();
if ($usecontact) if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -338,10 +338,9 @@ class doc_generic_user_odt extends ModelePDFUser
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in user as contact_xxx tags // retrieve contact information for use in object as contact_xxx tags
$array_thirdparty_contact = array(); $array_thirdparty_contact = array();
if ($usecontact) if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_other,$array_thirdparty_contact); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -376,10 +376,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_each_var_object($object,$outputlangs); $array_objet=$this->get_substitutionarray_each_var_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in user as contact_xxx tags // retrieve contact information for use in object as contact_xxx tags
$array_thirdparty_contact = array(); $array_thirdparty_contact = array();
if ($usecontact) if ($usecontact && is_object($contactobject)) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($array_global,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); $tmparray = array_merge($array_global,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);