This commit is contained in:
Paula Quispe
2018-11-21 16:32:48 -04:00
parent 29cd1acc59
commit 7fff95b0f6
5 changed files with 210 additions and 111 deletions

View File

@@ -117,6 +117,11 @@ class PMScript
*/
protected $executedOn = self::UNDEFINED_ORIGIN;
/**
* Variables changed in the trigger execution
*/
private $varsChanged = [];
/**
* Constructor of the class PMScript
*
@@ -127,6 +132,28 @@ class PMScript
$this->aFields['__ERROR__'] = 'none';
}
/**
* Set the fields changed in the trigger execution
*
* @param array $v
*
* @return void
*/
public function setVarsChanged(array $v)
{
$this->varsChanged = $v;
}
/**
* Get the fields changed in the trigger execution
*
* @return array
*/
public function getVarsChanged()
{
return $this->varsChanged;
}
/**
* Set the fields to use
*
@@ -437,7 +464,7 @@ class PMScript
$sScript = "try {\n" . $sScript . "\n} catch (Exception \$oException) {\n " . " \$this->aFields['__ERROR__'] = utf8_encode(\$oException->getMessage());\n}";
$this->executeAndCatchErrors($sScript, $this->sScript);
$this->setVarsChanged($this->affected_fields);
$this->aFields["__VAR_CHANGED__"] = implode(",", $this->affected_fields);
for ($i = 0; $i < count($this->affected_fields); $i ++) {
$_SESSION['TRIGGER_DEBUG']['DATA'][] = Array('key' => $this->affected_fields[$i], 'value' => isset($this->aFields[$this->affected_fields[$i]]) ? $this->aFields[$this->affected_fields[$i]] : ''