Fix $contactobject not always defined

This commit is contained in:
Laurent Destailleur 2018-05-23 08:16:24 +02:00
parent d072c2eb5d
commit a1c799507a
8 changed files with 85 additions and 85 deletions

View File

@ -2302,7 +2302,7 @@ if (empty($reshook))
if (!$errors) if (!$errors)
{ {
setEventMessages($langs->trans('Updated')); setEventMessages($langs->trans('Updated'), '', 'mesgs');
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
} }
else else

View File

@ -364,7 +364,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$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 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');
$tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$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

@ -304,7 +304,7 @@ class doc_generic_contract_odt extends ModelePDFContract
$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 contract 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_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); $substitutionarray = array_merge($substitutionarray,$array_object_from_properties,$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

@ -372,7 +372,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$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 invoice 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');
$tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other,$array_thirdparty_contact); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$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

@ -381,7 +381,7 @@ class doc_generic_product_odt extends ModelePDFProduct
$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 product 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');
$tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_other,$array_thirdparty_contact); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$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

@ -579,7 +579,7 @@ class doc_generic_project_odt extends ModelePDFProjects
$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 project as contact_xxx tags
$array_project_contact = array(); $array_project_contact = array();
if ($usecontact) $array_project_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact'); if ($usecontact && is_object($contactobject)) $array_project_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
$tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_project_contact); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$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

@ -395,7 +395,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$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 proposal 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');
$tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$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

@ -381,7 +381,7 @@ class doc_generic_stock_odt extends ModelePDFStock
$array_other=$this->get_substitutionarray_other($outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in stock as contact_xxx tags // retrieve contact information for use in stock 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');
$tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_other,$array_thirdparty_contact); $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);