CODE STYLE class.pmScript.php
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
/**
|
||||
* class.pmScript.php
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
@@ -32,8 +33,10 @@
|
||||
// License: LGPL, see LICENSE
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/**
|
||||
* PMScript - PMScript class
|
||||
*
|
||||
* @author Julio Cesar Laura Avenda<64>o <juliocesar@colosa.com>
|
||||
* last modify 2008.08.13 by Erik Amaru Ortiz <erik@colosa.com>
|
||||
* last modify comment was added and adapted the catch errors
|
||||
@@ -84,6 +87,7 @@ if (file_exists($dir)) {
|
||||
|
||||
/**
|
||||
* PMScript - PMScript class
|
||||
*
|
||||
* @copyright 2007 COLOSA
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/
|
||||
@@ -117,6 +121,7 @@ class PMScript
|
||||
|
||||
/**
|
||||
* Constructor of the class PMScript
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function PMScript ()
|
||||
@@ -126,6 +131,7 @@ class PMScript
|
||||
|
||||
/**
|
||||
* Set the fields to use
|
||||
*
|
||||
* @param array $aFields
|
||||
* @return void
|
||||
*/
|
||||
@@ -139,6 +145,7 @@ class PMScript
|
||||
|
||||
/**
|
||||
* Set the current script
|
||||
*
|
||||
* @param string $sScript
|
||||
* @return void
|
||||
*/
|
||||
@@ -149,6 +156,7 @@ class PMScript
|
||||
|
||||
/**
|
||||
* Verify the syntax
|
||||
*
|
||||
* @param string $sScript
|
||||
* @return boolean
|
||||
*/
|
||||
@@ -169,6 +177,7 @@ class PMScript
|
||||
|
||||
/**
|
||||
* Execute the current script
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute ()
|
||||
@@ -176,9 +185,7 @@ class PMScript
|
||||
$sScript = "";
|
||||
$iAux = 0;
|
||||
$bEqual = false;
|
||||
$iOcurrences = preg_match_all( '/\@(?:([\@\%\#\?\$\=])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]'
|
||||
. '*(?:[\\\\][\w\W])?)*)\))((?:\s*\[[\'"]?\w+[\'"]?\])+)?/',
|
||||
$this->sScript, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||
$iOcurrences = preg_match_all( '/\@(?:([\@\%\#\?\$\=])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]' . '*(?:[\\\\][\w\W])?)*)\))((?:\s*\[[\'"]?\w+[\'"]?\])+)?/', $this->sScript, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE );
|
||||
if ($iOcurrences) {
|
||||
for ($i = 0; $i < $iOcurrences; $i ++) {
|
||||
$sAux = substr( $this->sScript, $iAux, $aMatch[0][$i][1] - $iAux );
|
||||
@@ -198,15 +205,9 @@ class PMScript
|
||||
}
|
||||
if ($bEqual) {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
eval("if (!isset(\$this->aFields['" . $aMatch[2][$i][0] . "'])) { \$this->aFields['"
|
||||
. $aMatch[2][$i][0] . "'] = null; }");
|
||||
eval( "if (!isset(\$this->aFields['" . $aMatch[2][$i][0] . "'])) { \$this->aFields['" . $aMatch[2][$i][0] . "'] = null; }" );
|
||||
} else {
|
||||
eval( "if (!isset(\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0] . ")) { \$this->aFields"
|
||||
. (isset($aMatch[2][$i][0]) ? "['" . $aMatch[2][$i][0]
|
||||
. "']" : '') . $aMatch[5][$i][0] . " = null; }");
|
||||
eval( "if (!isset(\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . ")) { \$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . " = null; }" );
|
||||
}
|
||||
}
|
||||
$sScript .= $sAux;
|
||||
@@ -217,19 +218,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "pmToString(\$this->aFields['" . $aMatch[2][$i][0] . "'])";
|
||||
} else {
|
||||
$sScript .= "pmToString(\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0] . ")";
|
||||
$sScript .= "pmToString(\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . ")";
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -238,19 +233,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "pmToInteger(\$this->aFields['" . $aMatch[2][$i][0] . "'])";
|
||||
} else {
|
||||
$sScript .= "pmToInteger(\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0] . ")";
|
||||
$sScript .= "pmToInteger(\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . ")";
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -259,19 +248,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "pmToFloat(\$this->aFields['" . $aMatch[2][$i][0] . "'])";
|
||||
} else {
|
||||
$sScript .= "pmToFloat(\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0] . ")";
|
||||
$sScript .= "pmToFloat(\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . ")";
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -280,19 +263,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "pmToUrl(\$this->aFields['" . $aMatch[2][$i][0] . "'])";
|
||||
} else {
|
||||
$sScript .= "pmToUrl(\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0] . ")";
|
||||
$sScript .= "pmToUrl(\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . ")";
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -301,19 +278,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "pmSqlEscape(\$this->aFields['" . $aMatch[2][$i][0] . "'])";
|
||||
} else {
|
||||
$sScript .= "pmSqlEscape(\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0] . ")";
|
||||
$sScript .= "pmSqlEscape(\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . ")";
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -322,19 +293,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -343,16 +308,11 @@ class PMScript
|
||||
}
|
||||
}
|
||||
$sScript .= substr( $this->sScript, $iAux );
|
||||
$sScript = "try {\n" . $sScript . "\n} catch (Exception \$oException) {\n "
|
||||
. " \$this->aFields['__ERROR__'] = utf8_encode(\$oException->getMessage());\n}";
|
||||
$sScript = "try {\n" . $sScript . "\n} catch (Exception \$oException) {\n " . " \$this->aFields['__ERROR__'] = utf8_encode(\$oException->getMessage());\n}";
|
||||
//echo '<pre>-->'; print_r($this->aFields); echo '<---</pre>';
|
||||
$this->executeAndCatchErrors( $sScript, $this->sScript );
|
||||
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]]
|
||||
: ''
|
||||
$_SESSION['TRIGGER_DEBUG']['DATA'][] = Array ('key' => $this->affected_fields[$i],'value' => isset( $this->aFields[$this->affected_fields[$i]] ) ? $this->aFields[$this->affected_fields[$i]] : ''
|
||||
);
|
||||
}
|
||||
//echo '<pre>-->'; print_r($_SESSION['TRIGGER_DEBUG']['DATA']); echo '<---</pre>';
|
||||
@@ -360,6 +320,7 @@ class PMScript
|
||||
|
||||
/**
|
||||
* Evaluate the current script
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function evaluate ()
|
||||
@@ -369,9 +330,7 @@ class PMScript
|
||||
$iAux = 0;
|
||||
$bEqual = false;
|
||||
$variableIsDefined = true;
|
||||
$iOcurrences = preg_match_all('/\@(?:([\@\%\#\?\$\=])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]'
|
||||
. '*(?:[\\\\][\w\W])?)*)\))((?:\s*\[[\'"]?\w+[\'"]?\])+)?/',
|
||||
$this->sScript, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||
$iOcurrences = preg_match_all( '/\@(?:([\@\%\#\?\$\=])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]' . '*(?:[\\\\][\w\W])?)*)\))((?:\s*\[[\'"]?\w+[\'"]?\])+)?/', $this->sScript, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE );
|
||||
if ($iOcurrences) {
|
||||
for ($i = 0; $i < $iOcurrences; $i ++) {
|
||||
// if the variables for that condition has not been previously defined then $variableIsDefined
|
||||
@@ -399,19 +358,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "pmToString(\$this->aFields['" . $aMatch[2][$i][0] . "'])";
|
||||
} else {
|
||||
$sScript .= "pmToString(\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0] . ")";
|
||||
$sScript .= "pmToString(\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . ")";
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -420,19 +373,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "pmToInteger(\$this->aFields['" . $aMatch[2][$i][0] . "'])";
|
||||
} else {
|
||||
$sScript .= "pmToInteger(\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0] . ")";
|
||||
$sScript .= "pmToInteger(\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . ")";
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -441,19 +388,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "pmToFloat(\$this->aFields['" . $aMatch[2][$i][0] . "'])";
|
||||
} else {
|
||||
$sScript .= "pmToFloat(\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0] . ")";
|
||||
$sScript .= "pmToFloat(\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . ")";
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -462,19 +403,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "pmToUrl(\$this->aFields['" . $aMatch[2][$i][0] . "'])";
|
||||
} else {
|
||||
$sScript .= "pmToUrl(\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0] . ")";
|
||||
$sScript .= "pmToUrl(\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . ")";
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -483,19 +418,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "pmSqlEscape(\$this->aFields['" . $aMatch[2][$i][0] . "'])";
|
||||
} else {
|
||||
$sScript .= "pmSqlEscape(\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0] . ")";
|
||||
$sScript .= "pmSqlEscape(\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0] . ")";
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -504,19 +433,13 @@ class PMScript
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
} else {
|
||||
if (! isset( $aMatch[5][$i][0] )) {
|
||||
$sScript .= "\$this->aFields['" . $aMatch[2][$i][0] . "']";
|
||||
} else {
|
||||
$sScript .= "\$this->aFields"
|
||||
. (isset($aMatch[2][$i][0])
|
||||
? "['" . $aMatch[2][$i][0] . "']"
|
||||
: '') . $aMatch[5][$i][0];
|
||||
$sScript .= "\$this->aFields" . (isset( $aMatch[2][$i][0] ) ? "['" . $aMatch[2][$i][0] . "']" : '') . $aMatch[5][$i][0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -540,8 +463,10 @@ class PMScript
|
||||
|
||||
//Start - Private functions
|
||||
|
||||
|
||||
/**
|
||||
* Convert to string
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return string
|
||||
*/
|
||||
@@ -552,6 +477,7 @@ function pmToString($vValue)
|
||||
|
||||
/**
|
||||
* Convert to integer
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return integer
|
||||
*/
|
||||
@@ -562,6 +488,7 @@ function pmToInteger($vValue)
|
||||
|
||||
/**
|
||||
* Convert to float
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return float
|
||||
*/
|
||||
@@ -572,6 +499,7 @@ function pmToFloat($vValue)
|
||||
|
||||
/**
|
||||
* Convert to Url
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return url
|
||||
*/
|
||||
@@ -582,6 +510,7 @@ function pmToUrl($vValue)
|
||||
|
||||
/**
|
||||
* Convert to data base escaped string
|
||||
*
|
||||
* @param variant $vValue
|
||||
* @return string
|
||||
*/
|
||||
@@ -593,7 +522,6 @@ function pmSqlEscape($vValue)
|
||||
//End - Private functions
|
||||
|
||||
|
||||
|
||||
/* * *************************************************************************
|
||||
* Error handler
|
||||
* author: Julio Cesar Laura Avenda<64>o <juliocesar@colosa.com>
|
||||
@@ -636,28 +564,22 @@ function handleFatalErrors($buffer)
|
||||
if (strpos( $_SERVER['REQUEST_URI'], '&ACTION=GENERATE' ) !== false) {
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'],
|
||||
$_SESSION['APPLICATION'],
|
||||
$_SESSION['INDEX'],
|
||||
$_SESSION['STEP_POSITION']);
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
|
||||
}
|
||||
G::header( 'Location: ' . $aNextStep['PAGE'] );
|
||||
die;
|
||||
die();
|
||||
}
|
||||
$_SESSION['_NO_EXECUTE_TRIGGERS_'] = 1;
|
||||
G::header( 'Location: ' . $_SERVER['REQUEST_URI'] );
|
||||
die;
|
||||
die();
|
||||
} else {
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'],
|
||||
$_SESSION['APPLICATION'],
|
||||
$_SESSION['INDEX'],
|
||||
$_SESSION['STEP_POSITION']);
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
@@ -667,7 +589,7 @@ function handleFatalErrors($buffer)
|
||||
G::SendMessageText( 'Fatal error in trigger', 'error' );
|
||||
}
|
||||
G::header( 'Location: ' . $aNextStep['PAGE'] );
|
||||
die;
|
||||
die();
|
||||
}
|
||||
}
|
||||
return $buffer;
|
||||
@@ -685,8 +607,7 @@ function handleFatalErrors($buffer)
|
||||
function registerError ($iType, $sError, $iLine, $sCode)
|
||||
{
|
||||
$sType = ($iType == 1 ? 'ERROR' : 'FATAL');
|
||||
$_SESSION['TRIGGER_DEBUG']['ERRORS'][][$sType] = $sError . ($iLine > 0 ? ' (line ' . $iLine . ')' : '')
|
||||
. ':<br /><br />' . $sCode;
|
||||
$_SESSION['TRIGGER_DEBUG']['ERRORS'][][$sType] = $sError . ($iLine > 0 ? ' (line ' . $iLine . ')' : '') . ':<br /><br />' . $sCode;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user