Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6
This commit is contained in:
commit
13c208dd8f
@ -293,29 +293,29 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
// setVars failed, probably because key not found
|
// setVars failed, probably because key not found
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Replace tags of lines for contacts
|
// Replace tags of lines for contacts
|
||||||
$contact_arrray=array();
|
$contact_arrray=array();
|
||||||
|
|
||||||
$sql = "SELECT p.rowid";
|
$sql = "SELECT p.rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
||||||
$sql .= " WHERE p.fk_soc = ".$object->id;
|
$sql .= " WHERE p.fk_soc = ".$object->id;
|
||||||
|
|
||||||
dol_syslog('doc_generic_odt :: sql='.$sql,LOG_DEBUG);
|
dol_syslog('doc_generic_odt :: sql='.$sql,LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
$num = $this->db->num_rows($result);
|
$num = $this->db->num_rows($result);
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i=0;
|
$i=0;
|
||||||
$contactstatic = new Contact($this->db);
|
$contactstatic = new Contact($this->db);
|
||||||
|
|
||||||
while($i < $num)
|
while($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
$contact_arrray[$i] = $obj->rowid;
|
$contact_arrray[$i] = $obj->rowid;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -325,7 +325,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
$listlines = $odfHandler->setSegment('companycontacts');
|
$listlines = $odfHandler->setSegment('companycontacts');
|
||||||
|
|
||||||
foreach($contact_arrray as $array_key => $contact_id)
|
foreach($contact_arrray as $array_key => $contact_id)
|
||||||
{
|
{
|
||||||
$res_contact = $contactstatic->fetch($contact_id);
|
$res_contact = $contactstatic->fetch($contact_id);
|
||||||
@ -354,11 +354,16 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
//return -1;
|
//return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make substitutions into odt of thirdparty + external modules
|
||||||
|
$tmparray=$this->get_substitutionarray_thirdparty($object,$outputlangs);
|
||||||
|
complete_substitutions_array($tmparray, $outputlangs, $object);
|
||||||
|
|
||||||
// Call the ODTSubstitution hook
|
// Call the ODTSubstitution hook
|
||||||
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
|
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
|
||||||
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
//var_dump($object->id); exit;
|
|
||||||
|
// Replace variables into document
|
||||||
foreach($tmparray as $key=>$value)
|
foreach($tmparray as $key=>$value)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -389,11 +394,6 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Make substitutions into odt of thirdparty + external modules
|
|
||||||
$tmparray=$this->get_substitutionarray_thirdparty($object,$outputlangs);
|
|
||||||
complete_substitutions_array($tmparray, $outputlangs, $object);
|
|
||||||
|
|
||||||
// Call the beforeODTSave hook
|
// Call the beforeODTSave hook
|
||||||
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user