From 798945767883a1c218683a152e45d968523b39fa Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Mon, 16 Jun 2014 11:47:23 -0400 Subject: [PATCH 1/5] BUG-14984 validations - A validation was added --- .../creole/drivers/mysql/MySQLConnection.php | 6 +++++- workflow/engine/classes/class.applications.php | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php b/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php index 0202cacb0..f55cd3b68 100755 --- a/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php +++ b/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php @@ -199,7 +199,11 @@ class MySQLConnection extends ConnectionCommon implements Connection { }//echo $sql . '

'; $result = @mysql_query($sql, $this->dblink); if (!$result) { - throw new SQLException('Could not execute query', mysql_error($this->dblink), $sql); + if (isset($_SESSION['PROCESSMAKER_ENV']['debug_sql']) && $_SESSION['PROCESSMAKER_ENV']['debug_sql'] == 1) { + throw new SQLException('Could not execute query', mysql_error($this->dblink), $sql); + } else { + throw new SQLException('It is not possible to execute the query. Please contact your system administrator'); + } } return new MySQLResultSet($this, $result, $fetchmode); } diff --git a/workflow/engine/classes/class.applications.php b/workflow/engine/classes/class.applications.php index 97410fe81..154416a77 100755 --- a/workflow/engine/classes/class.applications.php +++ b/workflow/engine/classes/class.applications.php @@ -21,6 +21,14 @@ class Applications ) { $callback = isset($callback)? $callback : "stcCallback1001"; $dir = isset($dir)? $dir : "DESC"; + + if (isset($sort)) { + G::LoadClass('phpSqlParser'); + $parser = new PHPSQLParser($sort); + $sort = $parser->parsed; + $sort = $sort[''][0]; + } + $sort = isset($sort)? $sort : ""; $start = isset($start)? $start : "0"; $limit = isset($limit)? $limit : "25"; @@ -493,10 +501,10 @@ class Applications //execute the query $oDataset = AppCacheViewPeer::doSelectRS( $Criteria ); - + $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); -//g::pr($oDataset); + //g::pr($oDataset); $result = array (); $result['totalCount'] = $totalCount; $rows = array (); From 31309ee648ad24147380a8754f3a1c5ae2f8d8a7 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Tue, 17 Jun 2014 10:28:54 -0400 Subject: [PATCH 2/5] BUG-14984 Improvement value DEBUG_SQL --- .../thirdparty/creole/drivers/mysql/MySQLConnection.php | 6 +++++- workflow/public_html/sysGeneric.php | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php b/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php index f55cd3b68..d3c8a05ee 100755 --- a/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php +++ b/gulliver/thirdparty/creole/drivers/mysql/MySQLConnection.php @@ -198,8 +198,12 @@ class MySQLConnection extends ConnectionCommon implements Connection { } }//echo $sql . '

'; $result = @mysql_query($sql, $this->dblink); + if (!$result) { - if (isset($_SESSION['PROCESSMAKER_ENV']['debug_sql']) && $_SESSION['PROCESSMAKER_ENV']['debug_sql'] == 1) { + if (!defined('DEBUG_SQL')) { + define('DEBUG_SQL', 0); + } + if (DEBUG_SQL == 1) { throw new SQLException('Could not execute query', mysql_error($this->dblink), $sql); } else { throw new SQLException('It is not possible to execute the query. Please contact your system administrator'); diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 96dd851e8..4225e2da2 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -309,6 +309,7 @@ ini_set( 'soap.wsdl_cache_enabled', $config['wsdl_cache'] ); ini_set( 'date.timezone', $config['time_zone'] ); define( 'DEBUG_SQL_LOG', $config['debug_sql'] ); +define( 'DEBUG_SQL', $config['debug'] ); define( 'DEBUG_TIME_LOG', $config['debug_time'] ); define( 'DEBUG_CALENDAR_LOG', $config['debug_calendar'] ); define( 'MEMCACHED_ENABLED', $config['memcached'] ); From af70198315539367e441f9474536e7f1005ed6f1 Mon Sep 17 00:00:00 2001 From: jennylee Date: Wed, 18 Jun 2014 11:31:22 -0400 Subject: [PATCH 3/5] BUG-15193 Error in PM Table Data Search option The search option in PMTables has a validation where the APP_UID field is ignored in the search because this was causing some search troubles when you wanna search a number that was include into the APP_UID (eg. 'APP_UID':405044408538cb9472ade260172, 'text to search':4408 ) Now, we add a checkbox field near the search text field to customize this behavior. With this checkbox 'Search also in the APP_UID field' you can decide if the search will include or not the APP_UID field. --- .../engine/classes/model/AdditionalTables.php | 24 +++++++++---------- workflow/engine/controllers/pmTablesProxy.php | 5 ++-- workflow/engine/templates/pmTables/data.js | 10 +++++++- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/workflow/engine/classes/model/AdditionalTables.php b/workflow/engine/classes/model/AdditionalTables.php index 0c45819ef..24a4c063a 100755 --- a/workflow/engine/classes/model/AdditionalTables.php +++ b/workflow/engine/classes/model/AdditionalTables.php @@ -347,7 +347,7 @@ class AdditionalTables extends BaseAdditionalTables } } - public function getAllData($sUID, $start = null, $limit = null, $keyOrderUppercase = true, $filter = '') + public function getAllData($sUID, $start = null, $limit = null, $keyOrderUppercase = true, $filter = '', $appUid = false) { $addTab = new AdditionalTables(); $aData = $addTab->load($sUID, true); @@ -400,17 +400,17 @@ class AdditionalTables extends BaseAdditionalTables $closure = ''; $types = array('INTEGER', 'BIGINT', 'SMALLINT', 'TINYINT', 'DECIMAL', 'DOUBLE', 'FLOAT', 'REAL'); foreach ($aData['FIELDS'] as $aField) { - if ($aField['FLD_NAME'] != 'APP_UID') { - if (in_array($aField['FLD_TYPE'], $types)) { - if (is_numeric($filter)) { - $stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "' . $filter . '", Criteria::EQUAL)' . $closure . ';'; - $closure = '->addOr($a)'; - } - } else { - $stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "%' . $filter . '%", Criteria::LIKE)' . $closure . ';'; - $closure = '->addOr($a)'; - } - } + if (($appUid == "false" && $aField['FLD_NAME'] != 'APP_UID') || ($appUid == "true")) { + if (in_array($aField['FLD_TYPE'], $types)) { + if (is_numeric($filter)) { + $stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "' . $filter . '", Criteria::EQUAL)' . $closure . ';'; + $closure = '->addOr($a)'; + } + } else { + $stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "%' . $filter . '%", Criteria::LIKE)' . $closure . ';'; + $closure = '->addOr($a)'; + } + } } $stringOr = $stringOr . '$oCriteria->add($a);'; eval($stringOr); diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index be79ac2d3..3eb414519 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -408,6 +408,7 @@ class pmTablesProxy extends HttpProxyController * @param string $httpData->id * @param string $httpData->start * @param string $httpData->limit + * @param string $httpData->appUid */ public function dataView ($httpData) { @@ -419,13 +420,13 @@ class pmTablesProxy extends HttpProxyController $limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20; $start = isset( $httpData->start ) ? $httpData->start : 0; $limit = isset( $httpData->limit ) ? $httpData->limit : $limit_size; + $appUid = isset( $httpData->appUid ) ? $httpData->appUid : false; $filter = isset( $httpData->textFilter ) ? $httpData->textFilter : ''; - $additionalTables = new AdditionalTables(); $table = $additionalTables->load( $httpData->id, true ); if ($filter != '') { - $result = $additionalTables->getAllData( $httpData->id, $start, $limit, true, $filter); + $result = $additionalTables->getAllData( $httpData->id, $start, $limit, true, $filter, $appUid); } else { $result = $additionalTables->getAllData( $httpData->id, $start, $limit ); } diff --git a/workflow/engine/templates/pmTables/data.js b/workflow/engine/templates/pmTables/data.js index 6751d0d39..d9cfc1b19 100755 --- a/workflow/engine/templates/pmTables/data.js +++ b/workflow/engine/templates/pmTables/data.js @@ -76,6 +76,11 @@ Ext.onReady(function(){ handler: DoSearch }); + appUidSearch = new Ext.form.Checkbox ({ + id: 'appUidSearch', + boxLabel : 'Search also in the APP_UID field' + }); + contextMenu = new Ext.menu.Menu({ items : [ editButton, deleteButton ] }); @@ -386,6 +391,7 @@ Ext.onReady(function(){ importButton, exportButton, '->', + appUidSearch, searchText, clearTextButton, searchButton @@ -394,6 +400,7 @@ Ext.onReady(function(){ else tbar = [genDataReportButton, '->', + appUidSearch, searchText, clearTextButton, searchButton]; @@ -466,12 +473,13 @@ onMessageContextMenu = function (grid, rowIndex, e) { //Do Search Function DoSearch = function(){ infoGrid.store.setBaseParam('textFilter', searchText.getValue()); - infoGrid.store.load({params: {start : 0 , limit : pageSize }}); + infoGrid.store.load({params: {start : 0 , limit : pageSize , appUid : appUidSearch.getValue() }}); }; //Load Grid By Default GridByDefault = function(){ searchText.reset(); + appUidSearch.reset(); infoGrid.store.setBaseParam('textFilter', searchText.getValue()); infoGrid.store.load(); }; From fdc1a997e3a174aff8496bdcea54dd23b7a1a669 Mon Sep 17 00:00:00 2001 From: jennylee Date: Wed, 18 Jun 2014 16:28:44 -0400 Subject: [PATCH 4/5] BUG-15193 Error in PM Table Data Search option The search option in PMTables has a validation where the APP_UID field is ignored in the search because this was causing some search troubles when you wanna search a number that was include into the APP_UID (eg. 'APP_UID':405044408538cb9472ade260172, 'text to search':4408 ) Now, we add a checkbox field near the search text field to customize this behavior. With this checkbox 'Search also in the APP_UID field' you can decide if the search will include or not the APP_UID field. --- workflow/engine/classes/model/AdditionalTables.php | 2 +- workflow/engine/controllers/pmTablesProxy.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/workflow/engine/classes/model/AdditionalTables.php b/workflow/engine/classes/model/AdditionalTables.php index 24a4c063a..14c79148f 100755 --- a/workflow/engine/classes/model/AdditionalTables.php +++ b/workflow/engine/classes/model/AdditionalTables.php @@ -400,7 +400,7 @@ class AdditionalTables extends BaseAdditionalTables $closure = ''; $types = array('INTEGER', 'BIGINT', 'SMALLINT', 'TINYINT', 'DECIMAL', 'DOUBLE', 'FLOAT', 'REAL'); foreach ($aData['FIELDS'] as $aField) { - if (($appUid == "false" && $aField['FLD_NAME'] != 'APP_UID') || ($appUid == "true")) { + if (($appUid == false && $aField['FLD_NAME'] != 'APP_UID') || ($appUid == true)) { if (in_array($aField['FLD_TYPE'], $types)) { if (is_numeric($filter)) { $stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "' . $filter . '", Criteria::EQUAL)' . $closure . ';'; diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index 3eb414519..0364b4d0c 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -421,6 +421,7 @@ class pmTablesProxy extends HttpProxyController $start = isset( $httpData->start ) ? $httpData->start : 0; $limit = isset( $httpData->limit ) ? $httpData->limit : $limit_size; $appUid = isset( $httpData->appUid ) ? $httpData->appUid : false; + $appUid = ($appUid == "true") ? true : false; $filter = isset( $httpData->textFilter ) ? $httpData->textFilter : ''; $additionalTables = new AdditionalTables(); $table = $additionalTables->load( $httpData->id, true ); From 8cb260dcf6354685be025cb0f2bdbad12bb8835a Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Fri, 20 Jun 2014 10:55:52 -0400 Subject: [PATCH 5/5] BUG-15167 Error al momento de envio de triggers SOLVED - No validation if exists the file env.ini - A validation was added in file class.system.php --- workflow/engine/classes/class.system.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.system.php b/workflow/engine/classes/class.system.php index 7d2f9655a..4ee4518e5 100755 --- a/workflow/engine/classes/class.system.php +++ b/workflow/engine/classes/class.system.php @@ -1092,8 +1092,10 @@ class System } // Workspace environment configuration - if ($readWsIniFile && ($wsConf = @parse_ini_file( $wsIniFile )) !== false) { - $config = array_merge( $config, $wsConf ); + if (file_exists($wsIniFile) ) { + if (($wsConf = @parse_ini_file($wsIniFile)) !== false) { + $config = array_merge($config, $wsConf); + } } // validation debug config, only binary value is valid; debug = 1, to enable