Merge pull request #4886 from apachler/develop
Added functionality to get project customer contact as contact_xx tags
This commit is contained in:
commit
cab1c0f5cd
@ -484,6 +484,22 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
|
|
||||||
dol_mkdir($conf->projet->dir_temp);
|
dol_mkdir($conf->projet->dir_temp);
|
||||||
|
|
||||||
|
// If PROJECTLEADER contact defined on project, we use it
|
||||||
|
$usecontact=false;
|
||||||
|
$arrayidcontact=$object->getIdContact('external','PROJECTLEADER');
|
||||||
|
if (count($arrayidcontact) > 0)
|
||||||
|
{
|
||||||
|
$usecontact=true;
|
||||||
|
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Recipient name
|
||||||
|
if (! empty($usecontact))
|
||||||
|
{
|
||||||
|
// 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;
|
$socobject=$object->thirdparty;
|
||||||
|
|
||||||
// Make substitution
|
// Make substitution
|
||||||
@ -529,8 +545,12 @@ 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
|
||||||
|
$array_project_contact = array();
|
||||||
|
if ($usecontact)
|
||||||
|
$array_project_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
|
||||||
|
|
||||||
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
|
$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);
|
||||||
// Call the ODTSubstitution hook
|
// Call the ODTSubstitution hook
|
||||||
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
|
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user