NEW getCommonSubstitutionArray to have more substitute keys
This commit is contained in:
parent
fc44801581
commit
f510357f85
@ -881,8 +881,24 @@ class EmailCollector extends CommonObject
|
|||||||
*/
|
*/
|
||||||
private function overwritePropertiesOfObject(&$object, $actionparam, $messagetext, $subject, $header, &$operationslog)
|
private function overwritePropertiesOfObject(&$object, $actionparam, $messagetext, $subject, $header, &$operationslog)
|
||||||
{
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
$errorforthisaction = 0;
|
$errorforthisaction = 0;
|
||||||
|
|
||||||
|
// set output lang
|
||||||
|
$outputlangs = $langs;
|
||||||
|
$newlang = '';
|
||||||
|
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
|
||||||
|
$newlang = GETPOST('lang_id', 'aZ09');
|
||||||
|
}
|
||||||
|
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
|
||||||
|
$newlang = $object->thirdparty->default_lang;
|
||||||
|
}
|
||||||
|
if (!empty($newlang)) {
|
||||||
|
$outputlangs = new Translate('', $conf);
|
||||||
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
}
|
||||||
|
|
||||||
// Overwrite values with values extracted from source email
|
// Overwrite values with values extracted from source email
|
||||||
// $this->actionparam = 'opportunity_status=123;abc=EXTRACT:BODY:....'
|
// $this->actionparam = 'opportunity_status=123;abc=EXTRACT:BODY:....'
|
||||||
$arrayvaluetouse = dolExplodeIntoArray($actionparam, ';', '=');
|
$arrayvaluetouse = dolExplodeIntoArray($actionparam, ';', '=');
|
||||||
@ -978,7 +994,8 @@ class EmailCollector extends CommonObject
|
|||||||
|
|
||||||
if ($regforregex[1] == 'SET' || empty($valuecurrent)) {
|
if ($regforregex[1] == 'SET' || empty($valuecurrent)) {
|
||||||
$valuetouse = $regforregex[2];
|
$valuetouse = $regforregex[2];
|
||||||
$substitutionarray = array();
|
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||||
|
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||||
$matcharray = array();
|
$matcharray = array();
|
||||||
preg_match_all('/__([a-z0-9]+(?:_[a-z0-9]+)?)__/i', $valuetouse, $matcharray);
|
preg_match_all('/__([a-z0-9]+(?:_[a-z0-9]+)?)__/i', $valuetouse, $matcharray);
|
||||||
//var_dump($tmpproperty.' - '.$object->$tmpproperty.' - '.$valuetouse); var_dump($matcharray);
|
//var_dump($tmpproperty.' - '.$object->$tmpproperty.' - '.$valuetouse); var_dump($matcharray);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user