From 7eded39e2803f4070ff50e355f56f54b420049f0 Mon Sep 17 00:00:00 2001 From: Andreas Pachler Date: Wed, 30 Mar 2016 08:34:32 +0200 Subject: [PATCH] Reworked functionality to get project contact as contact_xx tags --- .../doc/doc_generic_project_odt.modules.php | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index b8dfa111446..8b06239c996 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -494,19 +494,12 @@ class doc_generic_project_odt extends ModelePDFProjects // Recipient name if (! empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else { - $socobject = $object->thirdparty; - // if we have a PROJECTLEADER contact and we dont use it as recipient we store the contact object for later use - $contactobject = $object->contact; - } - } - else - { - $socobject=$object->thirdparty; + // if we have a PROJECTLEADER contact and we dont use it as recipient we store the contact object for later use + $contactobject = $object->contact; } + $socobject=$object->thirdparty; + // Make substitution $substitutionarray=array( '__FROM_NAME__' => $this->emetteur->name, @@ -551,11 +544,11 @@ class doc_generic_project_odt extends ModelePDFProjects $array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs); // retrieve contact information for use in project as contact_xxx tags - $array_thirdparty_contact = array(); + $array_project_contact = array(); if ($usecontact) - $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_thirdparty_contact); + $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_project_contact); complete_substitutions_array($tmparray, $outputlangs, $object); // Call the ODTSubstitution hook $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);