Merged in bugfix/HOR-3633-C (pull request #5890)

HOR-3633

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
jonathan Quispe
2017-08-10 18:24:56 +00:00
committed by Julio Cesar Laura Avendaño
30 changed files with 340 additions and 337 deletions

View File

@@ -1503,7 +1503,7 @@ function get_infoOnPM($workspace) {
$dbNetView = new NET(DB_HOST);
$dbNetView->loginDbServer(DB_USER, DB_PASS);
$dbConns = new dbConnections('');
$dbConns = new DbConnections('');
$availdb = '';
foreach( $dbConns->getDbServicesAvailables() as $key => $val ) {
if( $availdb != '' )

View File

@@ -31,7 +31,7 @@
* @description This class is a Dynaform handler for modify directly into file
* @package gulliver.system
*/
class dynaFormHandler
class DynaformHandler
{
private $xmlfile;

View File

@@ -488,7 +488,7 @@ class Propel {
* @date: 27-05-08 11:48 *
* @Description: this was added for the additional database connections *
***********************************************************************/
$oDbConnections = new dbConnections($_SESSION['PROCESS']);
$oDbConnections = new DbConnections($_SESSION['PROCESS']);
$oDbConnections->loadAdditionalConnections();
$dsn = isset(self::$configuration['datasources'][$name]['connection']) ? self::$configuration['datasources'][$name]['connection'] : null;
} else {

View File

@@ -110,7 +110,7 @@ try {
Bootstrap::registerClass('Entity_Base', PATH_HOME . 'engine/classes/entities/Base.php');
Bootstrap::registerClass('Entity_AppSolrQueue', PATH_HOME . 'engine/classes/entities/AppSolrQueue.php');
Bootstrap::registerClass('XMLDB', PATH_HOME . 'engine/classes/class.xmlDb.php');
Bootstrap::registerClass('dynaFormHandler', PATH_GULLIVER . 'class.dynaformhandler.php');
Bootstrap::registerClass('DynaformHandler', PATH_GULLIVER . 'class.dynaformhandler.php');
Bootstrap::registerClass('DynaFormField', PATH_HOME . 'engine/classes/class.dynaFormField.php');
Bootstrap::registerClass('SolrRequestData', PATH_HOME . 'engine/classes/entities/SolrRequestData.php');
Bootstrap::registerClass('SolrUpdateDocument', PATH_HOME . 'engine/classes/entities/SolrUpdateDocument.php');

View File

@@ -2365,7 +2365,7 @@ class AppSolr
foreach ($dynaformFileNames as $dynaformFileName) {
if (is_file(PATH_DYNAFORM . $dynaformFileName ['DYN_FILENAME'] . '.xml') &&
filesize(PATH_DYNAFORM . $dynaformFileName ['DYN_FILENAME'] . '.xml') >0 ) {
$dyn = new dynaFormHandler (PATH_DYNAFORM . $dynaformFileName ['DYN_FILENAME'] . '.xml');
$dyn = new DynaformHandler (PATH_DYNAFORM . $dynaformFileName ['DYN_FILENAME'] . '.xml');
$dynaformFields [] = $dyn->getFields ();
}
if (is_file(PATH_DYNAFORM . $dynaformFileName ['DYN_FILENAME'] . '.xml') &&

View File

@@ -21,7 +21,7 @@ require_once 'model/Content.php';
* @package workflow.engine.classes
*
*/
class dbConnections
class DbConnections
{
private $PRO_UID;
public $connections;

View File

@@ -179,7 +179,7 @@ class DynaFormField extends DBTable
public function saveField($Fields, $attributes = array(), $options = array())
{
$dynaform = new dynaFormHandler($this->getFileName());
$dynaform = new DynaformHandler($this->getFileName());
if ($Fields['TYPE'] === 'javascript') {
$Fields['XMLNODE_VALUE'] = $Fields['CODE'];
unset($Fields['CODE']);

View File

@@ -664,7 +664,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
$pathFile = $filter->xssFilterHard(PATH_DYNAFORM . "{$file}.xml", 'path');
$dynaform = new dynaFormHandler($pathFile);
$dynaform = new DynaformHandler($pathFile);
$dynaform->replace($fieldName, $fieldName, Array('type' => 'javascript', 'meta' => $meta, '#cdata' => $sCode
));
@@ -734,7 +734,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
self::_setTmpData($tmp);
}
$pathFile = $filter->xssFilterHard(PATH_DYNAFORM . "{$file}.xml", 'path');
$dynaform = new dynaFormHandler($pathFile);
$dynaform = new DynaformHandler($pathFile);
$dbc2 = new DBConnection($pathFile, '', '', '', 'myxml');
$ses2 = new DBSession($dbc2);
//if (!isset($Fields['ENABLETEMPLATE'])) $Fields['ENABLETEMPLATE'] ="0";
@@ -804,7 +804,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
// $ses2 = new DBSession( $dbc2 );
// $ses2->execute( "UPDATE . SET ENABLETEMPLATE = '$value'" );
$pathFile = $filter->xssFilterHard(PATH_DYNAFORM . "{$file}.xml", 'path');
$dynaform = new dynaFormHandler($pathFile);
$dynaform = new DynaformHandler($pathFile);
$dynaform->modifyHeaderAttribute('enabletemplate', $value);
return $value;

View File

@@ -3917,3 +3917,287 @@ function PMFSendMessageToGroup(
//Return
return 1;
}
//Start - Private functions
/**
* Convert to string
*
* @param variant $vValue
* @return string
*/
function pmToString($vValue)
{
return (string)$vValue;
}
/**
* Convert to integer
*
* @param variant $vValue
* @return integer
*/
function pmToInteger($vValue)
{
return (int)$vValue;
}
/**
* Convert to float
*
* @param variant $vValue
* @return float
*/
function pmToFloat($vValue)
{
return (float)$vValue;
}
/**
* Convert to Url
*
* @param variant $vValue
* @return url
*/
function pmToUrl($vValue)
{
return urlencode($vValue);
}
/**
* Convert to data base escaped string
*
* @param variant $vValue
* @return string
*/
function pmSqlEscape($vValue)
{
return G::sqlEscape($vValue);
}
//End - Private functions
/* * *************************************************************************
* Error handler
* author: Julio Cesar Laura Avenda<64>o <juliocesar@colosa.com>
* date: 2009-10-01
* ************************************************************************* */
/**
* @param $errno
* @param $errstr
* @param $errfile
* @param $errline
*/
function handleErrors($errno, $errstr, $errfile, $errline)
{
if ($errno != 2048 && isset($_SESSION['_DATA_TRIGGER_']['_EXECUTION_TIME_'])) {
G::logTriggerExecution($_SESSION, $errstr, '', round(microtime(true) -
$_SESSION['_DATA_TRIGGER_']['_EXECUTION_TIME_'], 5));
}
if ($errno != '' && ($errno != 8) && ($errno != 2048)) {
if (isset($_SESSION['_CODE_'])) {
$sCode = $_SESSION['_CODE_'];
unset($_SESSION['_CODE_']);
global $oPMScript;
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
$oCase = new Cases();
$oPMScript->aFields['__ERROR__'] = $errstr;
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
}
registerError(1, $errstr, $errline - 1, $sCode);
}
}
}
/*
* Handle Fatal Errors
* @param variant $buffer
* @return buffer
*/
function handleFatalErrors($buffer)
{
if (!empty($buffer)) {
G::logTriggerExecution($_SESSION, $buffer, 'FATAL_ERROR');
}
if (preg_match('/(error<\/b>:)(.+)(<br)/', $buffer, $regs)) {
$oCase = new Cases();
$err = preg_replace('/<.*?>/', '', $regs[2]);
$aAux = explode(' in ', $err);
$sCode = isset($_SESSION['_CODE_']) ? $_SESSION['_CODE_'] : null;
unset($_SESSION['_CODE_']);
registerError(2, $aAux[0], 0, $sCode);
if (strpos($_SERVER['REQUEST_URI'], '/cases/cases_Step') !== false) {
if (strpos($_SERVER['REQUEST_URI'], '&ACTION=GENERATE') !== false) {
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
}
global $oPMScript;
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
$oPMScript->aFields['__ERROR__'] = $aAux[0];
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
}
G::header('Location: ' . $aNextStep['PAGE']);
die();
}
$_SESSION['_NO_EXECUTE_TRIGGERS_'] = 1;
global $oPMScript;
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
$oPMScript->aFields['__ERROR__'] = $aAux[0];
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
}
G::header('Location: ' . $_SERVER['REQUEST_URI']);
die();
} else {
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
if (isset($_SESSION['TRIGGER_DEBUG']['ISSET']) && $_SESSION['TRIGGER_DEBUG']['ISSET']) {
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
}
if (strpos($aNextStep['PAGE'], 'TYPE=ASSIGN_TASK&UID=-1') !== false) {
G::SendMessageText('Fatal error in trigger', 'error');
}
global $oPMScript;
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
$oPMScript->aFields['__ERROR__'] = $aAux[0];
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
}
G::header('Location: ' . $aNextStep['PAGE']);
die();
}
}
return $buffer;
}
/*
* Register Error
* @param string $iType
* @param string $sError
* @param string $iLine
* @param string $sCode
* @return void
*/
function registerError($iType, $sError, $iLine, $sCode)
{
$sType = ($iType == 1 ? 'ERROR' : 'FATAL');
$_SESSION['TRIGGER_DEBUG']['ERRORS'][][$sType] = $sError . ($iLine > 0 ? ' (line ' . $iLine . ')' : '') . ':<br /><br />' . $sCode;
}
/**
* Obtain engine Data Base name
*
* @param type $connection
* @return type
*/
function getEngineDataBaseName($connection)
{
$aDNS = $connection->getDSN();
return $aDNS["phptype"];
}
/**
* Execute Queries for Oracle Database
*
* @param type $sql
* @param type $connection
*/
function executeQueryOci($sql, $connection, $aParameter = array(), $dbsEncode = "")
{
$aDNS = $connection->getDSN();
$sUsername = $aDNS["username"];
$sPassword = $aDNS["password"];
$sHostspec = $aDNS["hostspec"];
$sDatabse = $aDNS["database"];
$sPort = $aDNS["port"];
if ($sPort != "1521") {
$flagTns = ($sDatabse == "" && ($sPort . "" == "" || $sPort . "" == "0")) ? 1 : 0;
if ($flagTns == 0) {
// if not default port
$conn = oci_connect($sUsername, $sPassword, $sHostspec . ":" . $sPort . "/" . $sDatabse, $dbsEncode);
} else {
$conn = oci_connect($sUsername, $sPassword, $sHostspec, $dbsEncode);
}
} else {
$conn = oci_connect($sUsername, $sPassword, $sHostspec . "/" . $sDatabse, $dbsEncode);
}
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
return $e;
}
switch (true) {
case preg_match("/^(SELECT|SHOW|DESCRIBE|DESC|WITH)\s/i", $sql):
$stid = oci_parse($conn, $sql);
if (count($aParameter) > 0) {
foreach ($aParameter as $key => $val) {
oci_bind_by_name($stid, $key, $val);
}
}
oci_execute($stid, OCI_DEFAULT);
$result = Array();
$i = 1;
while ($row = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
$result[$i++] = $row;
}
oci_free_statement($stid);
oci_close($conn);
return $result;
break;
case preg_match("/^(INSERT|UPDATE|DELETE)\s/i", $sql):
$stid = oci_parse($conn, $sql);
$isValid = true;
if (count($aParameter) > 0) {
foreach ($aParameter as $key => $val) {
oci_bind_by_name($stid, $key, $val);
}
}
$objExecute = oci_execute($stid, OCI_DEFAULT);
$result = oci_num_rows($stid);
if ($objExecute) {
oci_commit($conn);
} else {
oci_rollback($conn);
$isValid = false;
}
oci_free_statement($stid);
oci_close($conn);
if ($isValid) {
return $result;
} else {
return oci_error();
}
break;
default:
// Stored procedures
$stid = oci_parse($conn, $sql);
$aParameterRet = array();
if (count($aParameter) > 0) {
foreach ($aParameter as $key => $val) {
$aParameterRet[$key] = $val;
// The third parameter ($aParameterRet[$key]) returned a value by reference.
oci_bind_by_name($stid, $key, $aParameterRet[$key]);
}
}
$objExecute = oci_execute($stid, OCI_DEFAULT);
oci_free_statement($stid);
oci_close($conn);
return $aParameterRet;
break;
}
}

View File

@@ -639,288 +639,4 @@ class PMScript
}
}
}
}
//Start - Private functions
/**
* Convert to string
*
* @param variant $vValue
* @return string
*/
function pmToString ($vValue)
{
return (string) $vValue;
}
/**
* Convert to integer
*
* @param variant $vValue
* @return integer
*/
function pmToInteger ($vValue)
{
return (int) $vValue;
}
/**
* Convert to float
*
* @param variant $vValue
* @return float
*/
function pmToFloat ($vValue)
{
return (float) $vValue;
}
/**
* Convert to Url
*
* @param variant $vValue
* @return url
*/
function pmToUrl ($vValue)
{
return urlencode( $vValue );
}
/**
* Convert to data base escaped string
*
* @param variant $vValue
* @return string
*/
function pmSqlEscape ($vValue)
{
return G::sqlEscape( $vValue );
}
//End - Private functions
/* * *************************************************************************
* Error handler
* author: Julio Cesar Laura Avenda<64>o <juliocesar@colosa.com>
* date: 2009-10-01
* ************************************************************************* */
/**
* @param $errno
* @param $errstr
* @param $errfile
* @param $errline
*/
function handleErrors($errno, $errstr, $errfile, $errline)
{
if ($errno != 2048 && isset($_SESSION['_DATA_TRIGGER_']['_EXECUTION_TIME_'])) {
G::logTriggerExecution($_SESSION, $errstr, '', round(microtime(true) -
$_SESSION['_DATA_TRIGGER_']['_EXECUTION_TIME_'], 5));
}
if ($errno != '' && ($errno != 8) && ($errno != 2048)) {
if (isset( $_SESSION['_CODE_'] )) {
$sCode = $_SESSION['_CODE_'];
unset( $_SESSION['_CODE_'] );
global $oPMScript;
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
$oCase = new Cases();
$oPMScript->aFields['__ERROR__'] = $errstr;
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
}
registerError( 1, $errstr, $errline - 1, $sCode );
}
}
}
/*
* Handle Fatal Errors
* @param variant $buffer
* @return buffer
*/
function handleFatalErrors ($buffer)
{
if (!empty($buffer)) {
G::logTriggerExecution($_SESSION, $buffer, 'FATAL_ERROR');
}
if (preg_match( '/(error<\/b>:)(.+)(<br)/', $buffer, $regs )) {
$oCase = new Cases();
$err = preg_replace( '/<.*?>/', '', $regs[2] );
$aAux = explode( ' in ', $err );
$sCode = isset($_SESSION['_CODE_']) ? $_SESSION['_CODE_'] : null;
unset( $_SESSION['_CODE_'] );
registerError( 2, $aAux[0], 0, $sCode );
if (strpos( $_SERVER['REQUEST_URI'], '/cases/cases_Step' ) !== false) {
if (strpos( $_SERVER['REQUEST_URI'], '&ACTION=GENERATE' ) !== false) {
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
}
global $oPMScript;
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
$oPMScript->aFields['__ERROR__'] = $aAux[0];
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
}
G::header( 'Location: ' . $aNextStep['PAGE'] );
die();
}
$_SESSION['_NO_EXECUTE_TRIGGERS_'] = 1;
global $oPMScript;
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
$oPMScript->aFields['__ERROR__'] = $aAux[0];
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
}
G::header( 'Location: ' . $_SERVER['REQUEST_URI'] );
die();
} else {
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
if (isset($_SESSION['TRIGGER_DEBUG']['ISSET']) && $_SESSION['TRIGGER_DEBUG']['ISSET']) {
$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER'));
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
}
if (strpos( $aNextStep['PAGE'], 'TYPE=ASSIGN_TASK&UID=-1' ) !== false) {
G::SendMessageText( 'Fatal error in trigger', 'error' );
}
global $oPMScript;
if (isset($oPMScript) && isset($_SESSION['APPLICATION'])) {
$oPMScript->aFields['__ERROR__'] = $aAux[0];
$oCase->updateCase($_SESSION['APPLICATION'], array('APP_DATA' => $oPMScript->aFields));
}
G::header( 'Location: ' . $aNextStep['PAGE'] );
die();
}
}
return $buffer;
}
/*
* Register Error
* @param string $iType
* @param string $sError
* @param string $iLine
* @param string $sCode
* @return void
*/
function registerError ($iType, $sError, $iLine, $sCode)
{
$sType = ($iType == 1 ? 'ERROR' : 'FATAL');
$_SESSION['TRIGGER_DEBUG']['ERRORS'][][$sType] = $sError . ($iLine > 0 ? ' (line ' . $iLine . ')' : '') . ':<br /><br />' . $sCode;
}
/**
* Obtain engine Data Base name
*
* @param type $connection
* @return type
*/
function getEngineDataBaseName ($connection)
{
$aDNS = $connection->getDSN();
return $aDNS["phptype"];
}
/**
* Execute Queries for Oracle Database
*
* @param type $sql
* @param type $connection
*/
function executeQueryOci ($sql, $connection, $aParameter = array(), $dbsEncode = "")
{
$aDNS = $connection->getDSN();
$sUsername = $aDNS["username"];
$sPassword = $aDNS["password"];
$sHostspec = $aDNS["hostspec"];
$sDatabse = $aDNS["database"];
$sPort = $aDNS["port"];
if ($sPort != "1521") {
$flagTns = ($sDatabse == "" && ($sPort . "" == "" || $sPort . "" == "0"))? 1 : 0;
if ($flagTns == 0) {
// if not default port
$conn = oci_connect($sUsername, $sPassword, $sHostspec . ":" . $sPort . "/" . $sDatabse, $dbsEncode);
} else {
$conn = oci_connect($sUsername, $sPassword, $sHostspec, $dbsEncode);
}
} else {
$conn = oci_connect( $sUsername, $sPassword, $sHostspec . "/" . $sDatabse, $dbsEncode);
}
if (! $conn) {
$e = oci_error();
trigger_error( htmlentities( $e['message'], ENT_QUOTES ), E_USER_ERROR );
return $e;
}
switch (true) {
case preg_match( "/^(SELECT|SHOW|DESCRIBE|DESC|WITH)\s/i", $sql ):
$stid = oci_parse( $conn, $sql );
if (count( $aParameter ) > 0) {
foreach ($aParameter as $key => $val) {
oci_bind_by_name( $stid, $key, $val );
}
}
oci_execute( $stid, OCI_DEFAULT );
$result = Array ();
$i = 1;
while ($row = oci_fetch_array( $stid, OCI_ASSOC + OCI_RETURN_NULLS )) {
$result[$i ++] = $row;
}
oci_free_statement( $stid );
oci_close( $conn );
return $result;
break;
case preg_match( "/^(INSERT|UPDATE|DELETE)\s/i", $sql ):
$stid = oci_parse( $conn, $sql );
$isValid = true;
if (count( $aParameter ) > 0) {
foreach ($aParameter as $key => $val) {
oci_bind_by_name( $stid, $key, $val );
}
}
$objExecute = oci_execute( $stid, OCI_DEFAULT );
$result = oci_num_rows ($stid);
if ($objExecute) {
oci_commit( $conn );
} else {
oci_rollback( $conn );
$isValid = false;
}
oci_free_statement( $stid );
oci_close( $conn );
if ($isValid) {
return $result;
} else {
return oci_error();
}
break;
default:
// Stored procedures
$stid = oci_parse( $conn, $sql );
$aParameterRet = array ();
if (count( $aParameter ) > 0) {
foreach ($aParameter as $key => $val) {
$aParameterRet[$key] = $val;
// The third parameter ($aParameterRet[$key]) returned a value by reference.
oci_bind_by_name( $stid, $key, $aParameterRet[$key] );
}
}
$objExecute = oci_execute( $stid, OCI_DEFAULT );
oci_free_statement( $stid );
oci_close( $conn );
return $aParameterRet;
break;
}
}
}

View File

@@ -349,7 +349,7 @@ class serverConf
$dbNetView = new NET(DB_HOST);
$dbNetView->loginDbServer(DB_USER, DB_PASS);
$dbConns = new dbConnections('');
$dbConns = new DbConnections('');
$availdb = '';
foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
if ($availdb != '') {

View File

@@ -531,7 +531,7 @@ function getVarsGrid ($proUid, $dynUid)
$dynaformFields = array ();
if (is_file( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'.$dynUid. '.xml' ) && filesize( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'. $dynUid .'.xml' ) > 0) {
$dyn = new dynaFormHandler( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/' .$proUid. '/' . $dynUid .'.xml' );
$dyn = new DynaformHandler( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/' .$proUid. '/' . $dynUid .'.xml' );
$dynaformFields[] = $dyn->getFields();
}

View File

@@ -137,7 +137,7 @@ class FieldCondition extends BaseFieldCondition
$oDynaform = DynaformPeer::retrieveByPk( $DYN_UID );
$PRO_UID = $oDynaform->getProUid();
$this->oDynaformHandler = new dynaFormHandler( PATH_DYNAFORM . "$PRO_UID/$DYN_UID" . '.xml' );
$this->oDynaformHandler = new DynaformHandler( PATH_DYNAFORM . "$PRO_UID/$DYN_UID" . '.xml' );
$aDynaformFields = $this->oDynaformHandler->getFieldNames();
for ($i = 0; $i < count( $aDynaformFields ); $i ++) {
$aDynaformFields[$i] = "'$aDynaformFields[$i]'";

View File

@@ -247,7 +247,7 @@ class Language extends BaseLanguage
}
$dynaform = new dynaFormHandler( PATH_XMLFORM . $xmlForm );
$dynaform = new DynaformHandler( PATH_XMLFORM . $xmlForm );
$fieldName = $match[2];
$codes = explode( '-', $reference );
@@ -460,7 +460,7 @@ class Language extends BaseLanguage
$xmlFormFile = str_replace( chr( 92 ), '/', $xmlFormPath );
$xmlFormFile = str_replace( PATH_XMLFORM, '', $xmlFormPath );
$dynaForm = new dynaFormHandler( $xmlFormPath );
$dynaForm = new DynaformHandler( $xmlFormPath );
$dynaNodes = $dynaForm->getFields();
@@ -635,7 +635,7 @@ class Language extends BaseLanguage
}
$dynaform = new dynaFormHandler( PATH_PLUGINS . $plugin . PATH_SEP . $xmlForm );
$dynaform = new DynaformHandler( PATH_PLUGINS . $plugin . PATH_SEP . $xmlForm );
$fieldName = $match[2];
$codes = explode( '-', $reference );
@@ -753,7 +753,7 @@ class Language extends BaseLanguage
foreach ($aXMLForms as $xmlFormPath) {
$xmlFormFile = str_replace( chr( 92 ), '/', $xmlFormPath );
$xmlFormFile = str_replace( PATH_PLUGINS . $plugin . PATH_SEP , '', $xmlFormPath );
$dynaForm = new dynaFormHandler( $xmlFormPath );
$dynaForm = new DynaformHandler( $xmlFormPath );
$dynaNodes = $dynaForm->getFields();
//get all fields of each xmlform
foreach ($dynaNodes as $oNode) {

View File

@@ -374,7 +374,7 @@ class Step extends BaseStep
while ($oDataset->next()) {
$aRow1 = $oDataset->getRow();
//print_r($aRow1);
$dynHandler = new dynaFormHandler(PATH_DYNAFORM . $sproUid . PATH_SEP . $aRow1["DYN_UID"] . ".xml");
$dynHandler = new DynaformHandler(PATH_DYNAFORM . $sproUid . PATH_SEP . $aRow1["DYN_UID"] . ".xml");
$dynFields = $dynHandler->getFields();
$sxmlgrid = '';
$sType = '';
@@ -477,7 +477,7 @@ class Step extends BaseStep
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
if ($aRow['DYN_TYPE'] == 'xmlform') {
$dynHandler = new dynaFormHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml" );
$dynHandler = new DynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml" );
$dynFields = $dynHandler->getFields();
$sxmlgrid = '';
$sType = '';
@@ -547,7 +547,7 @@ class Step extends BaseStep
while ($oDataset->next()) {
$aRow1 = $oDataset->getRow();
$dynHandler = new dynaFormHandler( PATH_DYNAFORM . $sproUid . "/" . $sObjUID . ".xml" );
$dynHandler = new DynaformHandler( PATH_DYNAFORM . $sproUid . "/" . $sObjUID . ".xml" );
$dynFields = $dynHandler->getFields();
$sxmlgrid = '';
$sType = '';

View File

@@ -233,7 +233,7 @@ class Admin extends Controller
$dbNetView = new NET( DB_HOST );
$dbNetView->loginDbServer( DB_USER, DB_PASS );
$dbConns = new dbConnections( '' );
$dbConns = new DbConnections( '' );
$availdb = '';
foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
if ($availdb != '') {

View File

@@ -696,7 +696,7 @@ class Main extends Controller
$dbNetView = new NET( DB_HOST );
$dbNetView->loginDbServer( DB_USER, DB_PASS );
$dbConns = new dbConnections( '' );
$dbConns = new DbConnections( '' );
$availdb = '';
foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
if ($availdb != '') {

View File

@@ -1269,7 +1269,7 @@ class pmTablesProxy extends HttpProxyController
while ($aRow = $oDataset->getRow()) {
if (file_exists( PATH_DYNAFORM . PATH_SEP . $aRow['DYN_FILENAME'] . '.xml' )) {
$dynaformHandler = new dynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
$dynaformHandler = new DynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
$nodeFieldsList = $dynaformHandler->getFields();
foreach ($nodeFieldsList as $node) {
@@ -1579,7 +1579,7 @@ class pmTablesProxy extends HttpProxyController
}
}
} else {
$dynaformHandler = new dynaformHandler(PATH_DYNAFORM . $record['DYN_FILENAME'] . '.xml');
$dynaformHandler = new DynaformHandler(PATH_DYNAFORM . $record['DYN_FILENAME'] . '.xml');
$nodeFieldsList = $dynaformHandler->getFields();
foreach ($nodeFieldsList as $node) {

View File

@@ -325,7 +325,7 @@ try {
* Added By erik 16-05-08
* Description: this was added for the additional database connections
*/
$oDbConnections = new dbConnections( $_SESSION['PROCESS'] );
$oDbConnections = new DbConnections( $_SESSION['PROCESS'] );
$oDbConnections->loadAdditionalConnections();
$_SESSION['CURRENT_DYN_UID'] = $_GET['UID'];
@@ -1146,7 +1146,7 @@ try {
* Description: this was added for the additional database connections
*/
$oDbConnections = new dbConnections( $_SESSION['PROCESS'] );
$oDbConnections = new DbConnections( $_SESSION['PROCESS'] );
$oDbConnections->loadAdditionalConnections();
$stepFilename = "$sNamespace/$sStepName";
G::evalJScript( "

View File

@@ -139,7 +139,7 @@ if (! isset( $_GET['ex'] )) {
$_GET['ex'] = $_GET['position'];
}
$oDbConnections = new dbConnections( $_SESSION['PROCESS'] );
$oDbConnections = new DbConnections( $_SESSION['PROCESS'] );
$oDbConnections->loadAdditionalConnections();
$G_PUBLISH = new Publisher();

View File

@@ -75,7 +75,7 @@ try {
}
if (file_exists( PATH_DYNAFORM . $applicationFields['PRO_UID'] . PATH_SEP . $_REQUEST['DYN_UID'] . '.xml' )) {
$_SESSION['PROCESS'] = $applicationFields['PRO_UID'];
$dbConnections = new dbConnections( $_SESSION['PROCESS'] );
$dbConnections = new DbConnections( $_SESSION['PROCESS'] );
$dbConnections->loadAdditionalConnections();
$_SESSION['CURRENT_DYN_UID'] = $_REQUEST['DYN_UID'];

View File

@@ -93,7 +93,7 @@ switch ($action) {
G::RenderPage( 'publish', 'raw' );
break;
case 'newDdConnection':
$dbs = new dbConnections( $_SESSION['PROCESS'] );
$dbs = new DbConnections( $_SESSION['PROCESS'] );
$dbServices = $dbs->getDbServicesAvailables();
$dbService = $dbs->getEncondeList();
@@ -115,7 +115,7 @@ switch ($action) {
G::RenderPage( 'publish', 'raw' );
break;
case 'editDdConnection':
$dbs = new dbConnections( $_SESSION['PROCESS'] );
$dbs = new DbConnections( $_SESSION['PROCESS'] );
$dbServices = $dbs->getDbServicesAvailables();
$rows[] = array ('uid' => 'char','name' => 'char'
@@ -343,7 +343,7 @@ switch ($action) {
$engine = $_POST['engine'];
if ($engine != "0") {
$dbs = new dbConnections();
$dbs = new DbConnections();
$var = Bootstrap::json_encode($dbs->getEncondeList($filter->xssFilterHard($engine)));
G::outRes($var);

View File

@@ -9,7 +9,7 @@
if (isset( $_SESSION['PROCESS'] )) {
$pro = include (PATH_CORE . "config/databases.php");
$oDbConnections = new dbConnections( $_SESSION['PROCESS'] );
$oDbConnections = new DbConnections( $_SESSION['PROCESS'] );
foreach ($oDbConnections->connections as $db) {
$db['DBS_PASSWORD'] = $oDbConnections->getPassWithoutEncrypt( $db );

View File

@@ -54,7 +54,7 @@ try {
$sFilter = isset( $_POST['filter'] ) ? $_POST['filter'] : '';
//$oJSON = new Services_JSON();
$oDynaformHandler = new dynaFormHandler( PATH_DYNAFORM . $_DYN_FILENAME . '.xml' );
$oDynaformHandler = new DynaformHandler( PATH_DYNAFORM . $_DYN_FILENAME . '.xml' );
$aFilter = explode( ',', $sFilter );
@@ -68,7 +68,7 @@ try {
$_DYN_FILENAME = $_SESSION['Current_Dynafom']['Parameters']['FILE'];
$sFilter = isset( $_POST['filter'] ) ? $_POST['filter'] : '';
$oDynaformHandler = new dynaFormHandler( PATH_DYNAFORM . $_DYN_FILENAME . '.xml' );
$oDynaformHandler = new DynaformHandler( PATH_DYNAFORM . $_DYN_FILENAME . '.xml' );
$aFilter = explode( ',', $sFilter );
$aAvailableFields = $oDynaformHandler->getFieldNames( $aFilter );

View File

@@ -38,7 +38,7 @@ switch ($request) {
$tmpfilename = $filter->xssFilterHard($tmpfilename);
$o = new dynaFormHandler( PATH_DYNAFORM . "{$tmpfilename}.xml" );
$o = new DynaformHandler( PATH_DYNAFORM . "{$tmpfilename}.xml" );
$list_elements = explode( ',', $items );
@@ -59,7 +59,7 @@ switch ($request) {
$tmpfilename = $_SESSION['Current_Dynafom']['Parameters']['FILE'];
$tmpfilename = $filter->xssFilterHard($tmpfilename);
$o = new dynaFormHandler( PATH_DYNAFORM . "{$tmpfilename}.xml" );
$o = new DynaformHandler( PATH_DYNAFORM . "{$tmpfilename}.xml" );
$hidden_items = Array ();
$has_hidden_items = false;

View File

@@ -901,7 +901,7 @@ try {
$proUid = isset($_REQUEST['PRO_UID']) ? $_REQUEST['PRO_UID'] : '';
$dynUid = isset($_REQUEST['DYN_UID']) ? $_REQUEST['DYN_UID'] : '';
if (is_file(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') && filesize(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') > 0) {
$dyn = new dynaFormHandler(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml');
$dyn = new DynaformHandler(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml');
$dynaformFields[] = $dyn->getFields();
}
foreach ($dynaformFields as $aDynFormFields) {

View File

@@ -1,9 +1,9 @@
<?php
namespace ProcessMaker\BusinessModel;
use \G;
use \DbSource;
use \dbConnections;
use G;
use DbSource;
use DbConnections;
class DataBaseConnection
{
@@ -61,7 +61,7 @@ class DataBaseConnection
$dbs_uid = $this->validateDbsUid($dbs_uid, $pro_uid);
}
$dbs = new dbConnections($pro_uid);
$dbs = new DbConnections($pro_uid);
$oDBConnection = new DbSource();
$aFields = $oDBConnection->load($dbs_uid, $pro_uid);
if ($aFields['DBS_PORT'] == '0') {
@@ -162,7 +162,7 @@ class DataBaseConnection
if (isset($dataDBConnection['DBS_ENCODE'])) {
$encodesExists = array();
$dbs = new dbConnections();
$dbs = new DbConnections();
$dbEncodes = $dbs->getEncondeList($dataDBConnection['DBS_TYPE']);
foreach ($dbEncodes as $value) {
$encodesExists[] = $value['0'];
@@ -423,7 +423,7 @@ class DataBaseConnection
*/
public function getDbEngines ()
{
$dbs = new dbConnections();
$dbs = new DbConnections();
$dbServices = $dbs->getDbServicesAvailables();
return $dbServices;
}

View File

@@ -1,5 +1,6 @@
<?php
namespace ProcessMaker\BusinessModel;
use DynaformHandler;
class DynaForm
{
@@ -155,7 +156,7 @@ class DynaForm
while ($oDataset->next()) {
$dataForms = $oDataset->getRow();
$dynHandler = new \dynaFormHandler(PATH_DYNAFORM . $proUid . PATH_SEP . $dataForms["DYN_UID"] . ".xml");
$dynHandler = new DynaformHandler(PATH_DYNAFORM . $proUid . PATH_SEP . $dataForms["DYN_UID"] . ".xml");
$dynFields = $dynHandler->getFields();
foreach ($dynFields as $field) {
$sType = \Step::getAttribute( $field, 'type' );

View File

@@ -3,6 +3,7 @@ namespace ProcessMaker\BusinessModel;
use G;
use Criteria;
use DynaformHandler;
class Process
{
@@ -1686,7 +1687,7 @@ class Process
while ($aRow = $oDataset->getRow()) {
if (is_file(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml")) {
$dyn = new \dynaFormHandler(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml");
$dyn = new DynaformHandler(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml");
if ($dyn->getHeaderAttribute("type") !== "xmlform" && $dyn->getHeaderAttribute("type") !== "") {
// skip it, if that is not a xmlform
@@ -1739,7 +1740,7 @@ class Process
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
if (is_file(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml")) {
$dyn = new \dynaFormHandler(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml");
$dyn = new DynaformHandler(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml");
if ($dyn->getHeaderAttribute("type") === "xmlform") {
// skip it, if that is not a xmlform
@@ -1785,7 +1786,7 @@ class Process
$aMultipleSelectionFields = array("listbox", "checkgroup", "grid");
if (is_file( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'.$dynUid. '.xml' ) && filesize( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'. $dynUid .'.xml' ) > 0) {
$dyn = new \dynaFormHandler( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/' .$proUid. '/' . $dynUid .'.xml' );
$dyn = new DynaformHandler( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/' .$proUid. '/' . $dynUid .'.xml' );
$dynaformFields[] = $dyn->getFields();
$fields = $dyn->getFields();

View File

@@ -1,9 +1,10 @@
<?php
namespace ProcessMaker\BusinessModel;
use \G;
use \AdditionalTables;
use \Fields;
use G;
use AdditionalTables;
use Fields;
use DynaformHandler;
class Table
{
@@ -798,7 +799,7 @@ class Table
while ($oDataset->next()) {
$aRow = $oDataset->getRow();
if (file_exists( PATH_DYNAFORM . PATH_SEP . $aRow['DYN_FILENAME'] . '.xml' )) {
$dynaformHandler = new \dynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
$dynaformHandler = new DynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
$nodeFieldsList = $dynaformHandler->getFields();
foreach ($nodeFieldsList as $node) {
@@ -1052,7 +1053,7 @@ class Table
while ($oDataset->next()) {
$aRow = $oDataset->getRow();
$dynaformHandler = new \dynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
$dynaformHandler = new DynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
$nodeFieldsList = $dynaformHandler->getFields();
foreach ($nodeFieldsList as $node) {
$arrayNode = $dynaformHandler->getArray( $node );