Allow custom fields in IF placeholders

This commit is contained in:
Nathan Gray 2015-10-06 19:59:43 +00:00
parent a269120683
commit f57ccb9a41

View File

@ -1364,19 +1364,19 @@ abstract class bo_merge
if (strpos($content,'$$IF') !== false)
{ //Example use to use: $$IF n_prefix~Herr~Sehr geehrter~Sehr geehrte$$
$this->replacements =& $replacements;
$content = preg_replace_callback('/\$\$IF ([0-9a-z_\/-]+)~(.*)~(.*)~(.*)\$\$/imU',Array($this,'replace_callback'),$content);
$content = preg_replace_callback('/\$\$IF ([#0-9a-z_\/-]+)~(.*)~(.*)~(.*)\$\$/imU',Array($this,'replace_callback'),$content);
unset($this->replacements);
}
if (strpos($content,'$$NELF') !== false)
{ //Example: $$NEPBR org_unit$$ sets a LF and value of org_unit, only if there is a value
$this->replacements =& $replacements;
$content = preg_replace_callback('/\$\$NELF ([0-9a-z_\/-]+)\$\$/imU',Array($this,'replace_callback'),$content);
$content = preg_replace_callback('/\$\$NELF ([#0-9a-z_\/-]+)\$\$/imU',Array($this,'replace_callback'),$content);
unset($this->replacements);
}
if (strpos($content,'$$NENVLF') !== false)
{ //Example: $$NEPBRNV org_unit$$ sets only a LF if there is a value for org_units, but did not add any value
$this->replacements =& $replacements;
$content = preg_replace_callback('/\$\$NENVLF ([0-9a-z_\/-]+)\$\$/imU',Array($this,'replace_callback'),$content);
$content = preg_replace_callback('/\$\$NENVLF ([#0-9a-z_\/-]+)\$\$/imU',Array($this,'replace_callback'),$content);
unset($this->replacements);
}
if (strpos($content,'$$LETTERPREFIX$$') !== false)
@ -1387,7 +1387,7 @@ abstract class bo_merge
if (strpos($content,'$$LETTERPREFIXCUSTOM') !== false)
{ //Example use to use for a custom Letter Prefix: $$LETTERPREFIX n_prefix title n_family$$
$this->replacements =& $replacements;
$content = preg_replace_callback('/\$\$LETTERPREFIXCUSTOM ([0-9a-z_-]+)(.*)\$\$/imU',Array($this,'replace_callback'),$content);
$content = preg_replace_callback('/\$\$LETTERPREFIXCUSTOM ([#0-9a-z_-]+)(.*)\$\$/imU',Array($this,'replace_callback'),$content);
unset($this->replacements);
}
return $content;