Merge pull request #15422 from frederic34/patch-10
add optional tag which list all other tags in odt substitutions
This commit is contained in:
commit
95460e6372
@ -6660,6 +6660,14 @@ function complete_substitutions_array(&$substitutionarray, $outputlangs, $object
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!empty($conf->global->ODT_ENABLE_ALL_TAGS_IN_SUBSTITUTIONS)) {
|
||||||
|
// to list all tags in odt template
|
||||||
|
$tags = '';
|
||||||
|
foreach ($substitutionarray as $key => $value) {
|
||||||
|
$tags .= '{' . $key . '} => ' . $value ."\n";
|
||||||
|
}
|
||||||
|
$substitutionarray = array_merge($substitutionarray, array('__ALL_TAGS__' => $tags));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -322,11 +322,6 @@ class doc_generic_member_odt extends ModelePDFMember
|
|||||||
|
|
||||||
$tmparray = array_merge($array_member, $array_soc, $array_thirdparty, $array_other, $array_thirdparty_contact);
|
$tmparray = array_merge($array_member, $array_soc, $array_thirdparty, $array_other, $array_thirdparty_contact);
|
||||||
complete_substitutions_array($tmparray, $outputlangs, $object);
|
complete_substitutions_array($tmparray, $outputlangs, $object);
|
||||||
$tags = '';
|
|
||||||
foreach ($tmparray as $key => $value) {
|
|
||||||
$tags .= '{' . $key . '} => ' . $value ."\n";
|
|
||||||
}
|
|
||||||
$tmparray = array_merge($tmparray, array('__ALL_TAGS__' => $tags));
|
|
||||||
// Call the ODTSubstitution hook
|
// Call the ODTSubstitution hook
|
||||||
$parameters = array(
|
$parameters = array(
|
||||||
'file'=>$file,
|
'file'=>$file,
|
||||||
@ -352,12 +347,10 @@ class doc_generic_member_odt extends ModelePDFMember
|
|||||||
|
|
||||||
// Replace labels translated
|
// Replace labels translated
|
||||||
$tmparray = $outputlangs->get_translations_for_substitutions();
|
$tmparray = $outputlangs->get_translations_for_substitutions();
|
||||||
foreach ($tmparray as $key=>$value)
|
foreach ($tmparray as $key=>$value) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
$odfHandler->setVars($key, $value, true, 'UTF-8');
|
||||||
} catch (OdfException $e)
|
} catch (OdfException $e) {
|
||||||
{
|
|
||||||
dol_syslog($e->getMessage(), LOG_WARNING);
|
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user