From 48ea47541344240d77d7d27c865ac569a488dd8e Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Wed, 20 May 2015 18:35:38 -0400 Subject: [PATCH 01/12] PM-874 No se puede importar Report Tables en los procesos Se aumentaron validaciones varias, segun se especifica en el comentario en jira --- .../engine/classes/model/AdditionalTables.php | 8 +- workflow/engine/controllers/pmTablesProxy.php | 81 +++++++++-- workflow/engine/templates/pmTables/list.js | 130 +++++++++++++++++- 3 files changed, 205 insertions(+), 14 deletions(-) diff --git a/workflow/engine/classes/model/AdditionalTables.php b/workflow/engine/classes/model/AdditionalTables.php index e13391417..115c2c76d 100755 --- a/workflow/engine/classes/model/AdditionalTables.php +++ b/workflow/engine/classes/model/AdditionalTables.php @@ -751,9 +751,11 @@ class AdditionalTables extends BaseAdditionalTables } else { // grids foreach ($caseData[$dKey] as $dIndex => $dRow) { - foreach ($dRow as $k => $v) { - if (trim($v) === '') { - $caseData[$dKey][$dIndex][$k] = null; + if (!is_array($dRow)) { + foreach ($dRow as $k => $v) { + if (trim($v) === '') { + $caseData[$dKey][$dIndex][$k] = null; + } } } } diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index 0fd99f919..30892b520 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -915,17 +915,32 @@ class pmTablesProxy extends HttpProxyController */ public function import ($httpData) { + if (isset( $_POST["form"]["TYPE_TABLE"] ) && ! empty( $_POST["form"]["TYPE_TABLE"] )) { + if($_POST["form"]["TYPE_TABLE"] == 'admin') { + $fromAdmin = true; + } else { + $fromAdmin = false; + } + } + require_once 'classes/model/AdditionalTables.php'; try { $result = new stdClass(); $errors = ''; + $fromConfirm = false; $overWrite = isset( $_POST['form']['OVERWRITE'] ) ? true : false; + + if (isset( $_POST["form"]["FROM_CONFIRM"] ) && ! empty( $_POST["form"]["FROM_CONFIRM"] )) { + $fromConfirm = $_POST["form"]["FROM_CONFIRM"]; + $_FILES['form'] = $_SESSION['FILES_FORM']; + } //save the file if ($_FILES['form']['error']['FILENAME'] !== 0) { throw new Exception( G::loadTranslation( 'ID_PMTABLE_UPLOADING_FILE_PROBLEM' ) ); } + $_SESSION['FILES_FORM'] = $_FILES['form']; $oAdditionalTables = new AdditionalTables(); $tableNameMap = array (); @@ -935,7 +950,10 @@ class pmTablesProxy extends HttpProxyController $PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP; $filename = $_FILES['form']['name']['FILENAME']; $tempName = $_FILES['form']['tmp_name']['FILENAME']; - G::uploadFile( $tempName, $PUBLIC_ROOT_PATH, $filename ); + + if(!$fromConfirm) { + G::uploadFile( $tempName, $PUBLIC_ROOT_PATH, $filename ); + } $fileContent = file_get_contents( $PUBLIC_ROOT_PATH . $filename ); @@ -947,6 +965,17 @@ class pmTablesProxy extends HttpProxyController $fsData = intval( fread( $fp, 9 ) ); //reading the metadata $sType = fread( $fp, $fsData ); + $pmTables = $this->getList(''); + $proUids = Array(); + if($pmTables['count']) { + $pmTables = $pmTables['rows']; + foreach($pmTables as $val) { + if($val['PRO_UID'] != '') { + $proUids[] = $val['PRO_UID']; + } + } + } + // first create the tables structures while (! feof( $fp )) { @@ -964,7 +993,44 @@ class pmTablesProxy extends HttpProxyController $additionalTable = new additionalTables(); $tableExists = $additionalTable->loadByName( $contentSchema['ADD_TAB_NAME'] ); $tableNameMap[$contentSchema['ADD_TAB_NAME']] = $contentSchema['ADD_TAB_NAME']; - + + $tableData = new stdClass(); + if (isset( $_POST["form"]["PRO_UID"] ) && ! empty( $_POST["form"]["PRO_UID"] )) { + $tableData->PRO_UID = $_POST["form"]["PRO_UID"]; + } else { + $tableData->PRO_UID = isset( $contentSchema["PRO_UID"] ) ? $contentSchema["PRO_UID"] : ""; + } + + if($fromAdmin) { /*from admin tab*/ + if ($tableExists !== false && !$fromConfirm) { + $validationType = 1; + throw new Exception( G::loadTranslation( 'ID_OVERWRITE_PMTABLE' ) ); + } + if(!in_array($tableData->PRO_UID, $proUids)) { + $validationType = 2; + throw new Exception( G::loadTranslation( 'ID_NO_RELATED_PROCESS' ) ); + } + } else { /*from designer tab*/ + if ($tableExists !== false && !$fromConfirm) { + $validationType = 1; + throw new Exception( G::loadTranslation( 'ID_OVERWRITE_PMTABLE' ) ); + } + if (isset( $_SESSION['PROCESS'] ) && !empty( $_SESSION['PROCESS'] )) { + if($_SESSION['PROCESS'] != $tableData->PRO_UID) { + if(!in_array($tableData->PRO_UID, $proUids)) { + $validationType = 2; + if($fromConfirm == $validationType) { + throw new Exception( G::loadTranslation( 'ID_OVERWRITE_RELATED_PROCESS' ) ); + } else { + $tableData->PRO_UID = $_SESSION['PROCESS']; + } + } else { + $validationType = 3; + throw new Exception( G::loadTranslation( 'ID_ALREADY_RELATED_TABLE ' ) ); + } + } + } + } if ($overWrite) { if ($tableExists !== false) { $additionalTable->deleteAll( $tableExists['ADD_TAB_UID'] ); @@ -995,18 +1061,11 @@ class pmTablesProxy extends HttpProxyController $columns[] = $column; } - $tableData = new stdClass(); $tableData->REP_TAB_UID = $contentSchema['ADD_TAB_UID']; $tableData->REP_TAB_NAME = $contentSchema['ADD_TAB_NAME']; $tableData->REP_TAB_DSC = $contentSchema['ADD_TAB_DESCRIPTION']; $tableData->REP_TAB_CONNECTION = $contentSchema['DBS_UID']; - - if (isset( $_POST["form"]["PRO_UID"] ) && ! empty( $_POST["form"]["PRO_UID"] )) { - $tableData->PRO_UID = $_POST["form"]["PRO_UID"]; - } else { - $tableData->PRO_UID = isset( $contentSchema["PRO_UID"] ) ? $contentSchema["PRO_UID"] : ""; - } - + $tableData->REP_TAB_TYPE = isset( $contentSchema['ADD_TAB_TYPE'] ) ? $contentSchema['ADD_TAB_TYPE'] : ''; $tableData->REP_TAB_GRID = isset( $contentSchema['ADD_TAB_GRID'] ) ? $contentSchema['ADD_TAB_GRID'] : ''; $tableData->columns = G::json_encode( $columns ); @@ -1147,6 +1206,8 @@ class pmTablesProxy extends HttpProxyController $result->message = $msg; } catch (Exception $e) { $result = new stdClass(); + $result->fromAdmin = $fromAdmin; + $result->validationType = $validationType; $result->errorType = 'error'; $result->buildResult = ob_get_contents(); ob_end_clean(); diff --git a/workflow/engine/templates/pmTables/list.js b/workflow/engine/templates/pmTables/list.js index c3d8c44c7..3d1762686 100755 --- a/workflow/engine/templates/pmTables/list.js +++ b/workflow/engine/templates/pmTables/list.js @@ -561,6 +561,10 @@ ImportPMTable = function(){ fieldLabel: '', boxLabel: _('ID_OVERWRITE_EXIST'), // 'Overwrite if exists?', name: 'form[OVERWRITE]' + }, { + xtype: 'hidden', + name: 'form[TYPE_TABLE]', + value: (PRO_UID? 'designer' : 'admin') }], buttons: [{ id: 'importPMTableButtonUpload', @@ -613,7 +617,131 @@ ImportPMTable = function(){ PMExt.warning(_('ID_WARNING'), result.message.replace(/\n/g,'
')); } else { - PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + if(result.fromAdmin) { /*from admin tab*/ + if(result.validationType == 1) { + Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,'
'), function(btn, text){ + if (btn == 'yes'){ + Ext.Ajax.request({ + url: 'pmTablesProxy/import', + params: { + 'form[FROM_CONFIRM]':'overWrite', + 'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin'), + 'form[OVERWRITE]':true + }, + success: function(resp){ + var result = Ext.util.JSON.decode(resp.responseText); + if (result.success) { + PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + } else { + if(result.validationType == 2) { + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + } + }, + failure: function(obj, resp){ + var result = Ext.util.JSON.decode(resp.responseText); + if(result.validationType == 2) { + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + } + }); + Ext.getCmp('infoGrid').getStore().reload(); + } + }); + return false; + } else { + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + } else { /*from designer tab*/ + if(result.validationType == 1) { + Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,'
'), function(btn, text){ + if (btn == 'yes'){ + Ext.Ajax.request({ + url: 'pmTablesProxy/import', + params: { + 'form[FROM_CONFIRM]':'2', + 'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin'), + 'form[OVERWRITE]':true + }, + success: function(resp){ + var result = Ext.util.JSON.decode(resp.responseText); + if (result.success) { + PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + } else { + if(result.validationType == 2) { + Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,'
'), function(btn, text){ + if (btn == 'yes'){ + Ext.Ajax.request({ + url: 'pmTablesProxy/import', + params: { + 'form[FROM_CONFIRM]':'overWrite', + 'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin'), + 'form[OVERWRITE]':true + }, + success: function(resp){ + var result = Ext.util.JSON.decode(resp.responseText); + if (result.success) { + PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + } else { + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + }, + failure: function(obj, resp){ + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + }); + Ext.getCmp('infoGrid').getStore().reload(); + } + }); + return false; + } + else { + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + } + }, + failure: function(obj, resp){ + var result = Ext.util.JSON.decode(resp.responseText); + if(result.validationType == 2) { + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + } + }); + Ext.getCmp('infoGrid').getStore().reload(); + } + }); + return false; + } + if(result.validationType == 2) { + Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,'
'), function(btn, text){ + if (btn == 'yes'){ + Ext.Ajax.request({ + url: 'pmTablesProxy/import', + params: { + 'form[FROM_CONFIRM]':'overWrite', + 'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin'), + 'form[OVERWRITE]':true + }, + success: function(resp){ + var result = Ext.util.JSON.decode(resp.responseText); + if (result.success) { + PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + } else { + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + }, + failure: function(obj, resp){ + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + }); + Ext.getCmp('infoGrid').getStore().reload(); + } + }); + return false; + } else { + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + } } } }); From b4420c2614a74d0fb58e634a1d36b092c5ff2a60 Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Mon, 25 May 2015 14:34:51 -0400 Subject: [PATCH 02/12] PM-874 No se puede importar Report Tables en los procesos Se aumentaron validaciones varias, segun se especifica en el comentario en jira --- workflow/engine/controllers/pmTablesProxy.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index 30892b520..5cf282954 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -915,12 +915,11 @@ class pmTablesProxy extends HttpProxyController */ public function import ($httpData) { + $fromAdmin = false; if (isset( $_POST["form"]["TYPE_TABLE"] ) && ! empty( $_POST["form"]["TYPE_TABLE"] )) { if($_POST["form"]["TYPE_TABLE"] == 'admin') { $fromAdmin = true; - } else { - $fromAdmin = false; - } + } } require_once 'classes/model/AdditionalTables.php'; From 4ef02142adeef0c4ee83a14c54b365ea024d1a2c Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Wed, 27 May 2015 11:37:32 -0400 Subject: [PATCH 03/12] PM-874 No se puede importar Report Tables en los procesos Se aumentaron validaciones varias, segun se especifica en el comentario en jira --- workflow/engine/controllers/pmTablesProxy.php | 43 ++++++---- workflow/engine/templates/pmTables/list.js | 81 ++++++++++++++++++- 2 files changed, 105 insertions(+), 19 deletions(-) diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index 5cf282954..f3af71cf6 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -953,6 +953,10 @@ class pmTablesProxy extends HttpProxyController if(!$fromConfirm) { G::uploadFile( $tempName, $PUBLIC_ROOT_PATH, $filename ); } + + if ($fromConfirm == 'clear') { + $fromConfirm = true; + } $fileContent = file_get_contents( $PUBLIC_ROOT_PATH . $filename ); @@ -1000,36 +1004,45 @@ class pmTablesProxy extends HttpProxyController $tableData->PRO_UID = isset( $contentSchema["PRO_UID"] ) ? $contentSchema["PRO_UID"] : ""; } - if($fromAdmin) { /*from admin tab*/ + $isPmTable = false; /*is a report table*/ + if($contentSchema["PRO_UID"] == "" ) { + $isPmTable = true; + } + if (isset( $_POST["form"]["PRO_UID_HELP"] ) && !empty($_POST["form"]["PRO_UID_HELP"])) { + $currentPRO_UID = $_POST["form"]["PRO_UID_HELP"]; + } else { + $currentPRO_UID = (isset( $_SESSION['PROCESS'] ) && !empty( $_SESSION['PROCESS'] )) ? $_SESSION['PROCESS'] : ''; + } + + if($fromAdmin) { /* from admin tab */ if ($tableExists !== false && !$fromConfirm) { $validationType = 1; throw new Exception( G::loadTranslation( 'ID_OVERWRITE_PMTABLE' ) ); } - if(!in_array($tableData->PRO_UID, $proUids)) { + if(!in_array($tableData->PRO_UID, $proUids) && !$isPmTable) { $validationType = 2; throw new Exception( G::loadTranslation( 'ID_NO_RELATED_PROCESS' ) ); } - } else { /*from designer tab*/ + } else { /* from designer tab */ if ($tableExists !== false && !$fromConfirm) { $validationType = 1; throw new Exception( G::loadTranslation( 'ID_OVERWRITE_PMTABLE' ) ); - } - if (isset( $_SESSION['PROCESS'] ) && !empty( $_SESSION['PROCESS'] )) { - if($_SESSION['PROCESS'] != $tableData->PRO_UID) { - if(!in_array($tableData->PRO_UID, $proUids)) { - $validationType = 2; - if($fromConfirm == $validationType) { - throw new Exception( G::loadTranslation( 'ID_OVERWRITE_RELATED_PROCESS' ) ); - } else { - $tableData->PRO_UID = $_SESSION['PROCESS']; - } + } + if($currentPRO_UID != $tableData->PRO_UID) { + if(!in_array($tableData->PRO_UID, $proUids)) { + $validationType = 2; + if(($fromConfirm == $validationType || !$fromConfirm) && !$isPmTable) { + throw new Exception( G::loadTranslation( 'ID_OVERWRITE_RELATED_PROCESS' ) ); } else { - $validationType = 3; - throw new Exception( G::loadTranslation( 'ID_ALREADY_RELATED_TABLE ' ) ); + $tableData->PRO_UID = $currentPRO_UID; } + } else { + $validationType = 3; + throw new Exception( G::loadTranslation( 'ID_ALREADY_RELATED_TABLE ' ) ); } } } + if ($overWrite) { if ($tableExists !== false) { $additionalTable->deleteAll( $tableExists['ADD_TAB_UID'] ); diff --git a/workflow/engine/templates/pmTables/list.js b/workflow/engine/templates/pmTables/list.js index 3d1762686..a6497ceb2 100755 --- a/workflow/engine/templates/pmTables/list.js +++ b/workflow/engine/templates/pmTables/list.js @@ -617,7 +617,7 @@ ImportPMTable = function(){ PMExt.warning(_('ID_WARNING'), result.message.replace(/\n/g,'
')); } else { - if(result.fromAdmin) { /*from admin tab*/ + if(result.fromAdmin) { /* from admin tab */ if(result.validationType == 1) { Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,'
'), function(btn, text){ if (btn == 'yes'){ @@ -632,6 +632,7 @@ ImportPMTable = function(){ var result = Ext.util.JSON.decode(resp.responseText); if (result.success) { PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + Ext.getCmp('infoGrid').getStore().reload(); } else { if(result.validationType == 2) { PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); @@ -645,14 +646,27 @@ ImportPMTable = function(){ } } }); - Ext.getCmp('infoGrid').getStore().reload(); + } else { + Ext.Ajax.request({ + url: 'pmTablesProxy/import', + params: { + 'form[FROM_CONFIRM]':'clear', + 'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin') + }, + success: function(resp) { + var result = Ext.util.JSON.decode(resp.responseText); + PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + Ext.getCmp('infoGrid').getStore().reload(); + } + }); } + Ext.getCmp('infoGrid').getStore().reload(); }); return false; } else { PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); } - } else { /*from designer tab*/ + } else { /* from designer tab */ if(result.validationType == 1) { Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,'
'), function(btn, text){ if (btn == 'yes'){ @@ -667,6 +681,7 @@ ImportPMTable = function(){ var result = Ext.util.JSON.decode(resp.responseText); if (result.success) { PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + Ext.getCmp('infoGrid').getStore().reload(); } else { if(result.validationType == 2) { Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,'
'), function(btn, text){ @@ -682,6 +697,7 @@ ImportPMTable = function(){ var result = Ext.util.JSON.decode(resp.responseText); if (result.success) { PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + Ext.getCmp('infoGrid').getStore().reload(); } else { PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); } @@ -708,7 +724,62 @@ ImportPMTable = function(){ } }); Ext.getCmp('infoGrid').getStore().reload(); + } else { + Ext.Ajax.request({ + url: 'pmTablesProxy/import', + params: { + 'form[FROM_CONFIRM]':'2', + 'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin'), + 'form[PRO_UID_HELP]':PRO_UID + }, + success: function(resp) { + var result = Ext.util.JSON.decode(resp.responseText); + if(result.validationType == 2) { + /*add code if related process*/ + Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,'
'), function(btn, text){ + if (btn == 'yes'){ + Ext.Ajax.request({ + url: 'pmTablesProxy/import', + params: { + 'form[FROM_CONFIRM]':'overWrite', + 'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin'), + 'form[PRO_UID_HELP]':PRO_UID + }, + success: function(resp){ + var result = Ext.util.JSON.decode(resp.responseText); + if (result.success) { + PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + Ext.getCmp('infoGrid').getStore().reload(); + } else { + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + }, + failure: function(obj, resp){ + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + }); + Ext.getCmp('infoGrid').getStore().reload(); + } + }); + return false; + } else { + var result = Ext.util.JSON.decode(resp.responseText); + if (result.success) { + PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + Ext.getCmp('infoGrid').getStore().reload(); + } else { + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + } + //PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + }, + failure: function(obj, resp){ + var result = Ext.util.JSON.decode(resp.responseText); + PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); + } + }); } + Ext.getCmp('infoGrid').getStore().reload(); }); return false; } @@ -720,12 +791,14 @@ ImportPMTable = function(){ params: { 'form[FROM_CONFIRM]':'overWrite', 'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin'), - 'form[OVERWRITE]':true + 'form[OVERWRITE]':true, + 'form[PRO_UID_HELP]':PRO_UID }, success: function(resp){ var result = Ext.util.JSON.decode(resp.responseText); if (result.success) { PMExt.notify(_('ID_IMPORT_RESULT'), result.message); + Ext.getCmp('infoGrid').getStore().reload(); } else { PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,'
')); } From b3ffa94b028f5c8bad9256bc8a6a62f8a0a6a60e Mon Sep 17 00:00:00 2001 From: dheeyi Date: Wed, 27 May 2015 16:19:02 -0400 Subject: [PATCH 04/12] PM-2790 0017387: Derivacion en paralelo, una de los hilos llega a la bandeja como leido --- workflow/engine/classes/class.derivation.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php index 5ad3d3308..873b8b65b 100755 --- a/workflow/engine/classes/class.derivation.php +++ b/workflow/engine/classes/class.derivation.php @@ -805,7 +805,6 @@ class Derivation unset( $aSP ); } //end foreach - /* Start Block : UPDATES APPLICATION */ //Set THE APP_STATUS @@ -836,6 +835,15 @@ class Derivation //Start Block : UPDATES APPLICATION $this->case->updateCase( $currentDelegation["APP_UID"], $appFields ); //End Block : UPDATES APPLICATION + + if($currentDelegation['ROU_TYPE'] == 'PARALLEL-BY-EVALUATION'){ + $con = Propel::getConnection('workflow'); + $c1 = new Criteria('workflow'); + $c1->add(ListInboxPeer::APP_UID, $currentDelegation["APP_UID"]); + $c2 = new Criteria('workflow'); + $c2->add(ListInboxPeer::DEL_INIT_DATE, null); + BasePeer::doUpdate($c1, $c2, $con); + } } } From a136e1adebc485e1b4a17047301522e067e43422 Mon Sep 17 00:00:00 2001 From: dheeyi Date: Thu, 28 May 2015 17:44:37 -0400 Subject: [PATCH 05/12] =?UTF-8?q?PM-2713=20Outlook=20Connector:=20No=20mue?= =?UTF-8?q?stra=20la=20informaci=C3=B3e=20Process=20Map=20en=20el=20client?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- workflow/engine/templates/cases/open.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/templates/cases/open.js b/workflow/engine/templates/cases/open.js index a9ff7a662..6292f2ee1 100755 --- a/workflow/engine/templates/cases/open.js +++ b/workflow/engine/templates/cases/open.js @@ -1539,7 +1539,7 @@ Ext.onReady(function(){ TabPanel.setActiveTab(tabId); } else { - if(name == "processMap" && isBrowserIE()){ + if(name == "processMap" && isBrowserIE() && _PROJECT_TYPE === 'bpmn'){ var windContainer = window.open(uri,"winContainer"); } else { TabPanel.add({ From cf1ccbb15d77d679c00d0f8eb1301866f8ab0bab Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Fri, 29 May 2015 11:33:05 -0400 Subject: [PATCH 06/12] PM-874 --- workflow/engine/controllers/pmTablesProxy.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index f3af71cf6..cf7851e50 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -1024,6 +1024,9 @@ class pmTablesProxy extends HttpProxyController throw new Exception( G::loadTranslation( 'ID_NO_RELATED_PROCESS' ) ); } } else { /* from designer tab */ + if($isPmTable){ + throw new Exception( G::loadTranslation( 'ID_NO_REPORT_TABLE' ) ); + } if ($tableExists !== false && !$fromConfirm) { $validationType = 1; throw new Exception( G::loadTranslation( 'ID_OVERWRITE_PMTABLE' ) ); From 69ede48baf366e263f0a5d3f973d10418b4c5c61 Mon Sep 17 00:00:00 2001 From: dheeyi Date: Fri, 29 May 2015 12:03:35 -0400 Subject: [PATCH 07/12] PM-2672 La cuadro "Get Started" es modal, pero en Chrome esta propiedad no ocupa toda la ventana del Navegador --- workflow/engine/skinEngine/neoclassic/css/form.css | 1 + 1 file changed, 1 insertion(+) diff --git a/workflow/engine/skinEngine/neoclassic/css/form.css b/workflow/engine/skinEngine/neoclassic/css/form.css index 58a553086..5fc8dbfb6 100644 --- a/workflow/engine/skinEngine/neoclassic/css/form.css +++ b/workflow/engine/skinEngine/neoclassic/css/form.css @@ -293,6 +293,7 @@ INPUT { background-color: black; left: 0px; top: 0px; + height:100% !important; } .panel_iframe___processmaker { width: 100%; From 1aee191a1bee412bb70ea1a6b55cc7ba145b15b7 Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Fri, 29 May 2015 14:42:29 -0400 Subject: [PATCH 08/12] PM-2791: I added the regular expresion in other place --- workflow/engine/classes/class.wsTools.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 098598a99..944ab1734 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -1357,6 +1357,10 @@ class workspaceTools } if ( !$flag && !is_null($flagFunction) ) { + //Replace TYPE by ENGINE + $script = file_get_contents($filename); + $script = preg_replace('/\)TYPE\=|\)\sTYPE\=/', ')ENGINE=', $script); + file_put_contents($filename,$script); $aHost = explode(':',$parameters['dbHost']); $dbHost = $aHost[0]; if(isset($aHost[1])){ From 5018092db2c81e8f49fc146009b3625b0eab458c Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Fri, 29 May 2015 15:23:51 -0400 Subject: [PATCH 09/12] PM-2828 "In the BPMN Designer, can not connect..." SOLVED --- workflow/engine/classes/class.dbConnections.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.dbConnections.php b/workflow/engine/classes/class.dbConnections.php index 3e3d709a7..ec4ac1aa7 100755 --- a/workflow/engine/classes/class.dbConnections.php +++ b/workflow/engine/classes/class.dbConnections.php @@ -154,7 +154,7 @@ class dbConnections $result = DbSourcePeer::doSelectRS( $c ); $result->next(); $row = $result->getRow(); - + while ($row = $result->getRow()) { if ((trim( $pProUid ) == trim( $row[1] )) && ($row[2] == 'mysql')) { $connections[] = Array ('DBS_UID' => $row[0],'DBS_NAME' => '[' . $row[3] . '] ' . $row[2] . ': ' . $row[4] @@ -335,7 +335,12 @@ class dbConnections ); break; case 'oracle': - $encodes = Array (); + $encodes = array ( + array ("UTF8", "UTF8 - Unicode 3.0 UTF-8 Universal character set CESU-8 compliant"), + array ("UTFE", "UTFE - EBCDIC form of Unicode 3.0 UTF-8 Universal character set"), + array ("AL16UTF16", "AL16UTF16 - Unicode 3.1 UTF-16 Universal character set"), + array ("AL32UTF8", "AL32UTF8 - Unicode 3.1 UTF-8 Universal character set") + ); break; } From cfcebd3da5e073b4e86c58a1eea6f055a5c74853 Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Fri, 29 May 2015 16:07:30 -0400 Subject: [PATCH 10/12] pm-874 --- workflow/engine/controllers/pmTablesProxy.php | 1 + 1 file changed, 1 insertion(+) diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index cf7851e50..988d4b04a 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -1025,6 +1025,7 @@ class pmTablesProxy extends HttpProxyController } } else { /* from designer tab */ if($isPmTable){ + $validationType = ''; throw new Exception( G::loadTranslation( 'ID_NO_REPORT_TABLE' ) ); } if ($tableExists !== false && !$fromConfirm) { From 35247643f1fb4710d3c9a9fda76004d7e713a110 Mon Sep 17 00:00:00 2001 From: dheeyi Date: Fri, 29 May 2015 17:31:16 -0400 Subject: [PATCH 11/12] PM-2790 0017387: Derivacion en paralelo, una de los hilos llega a la bandeja como leido --- workflow/engine/classes/class.case.php | 1 + workflow/engine/classes/class.derivation.php | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 99e9e4479..1e3a1dcf9 100755 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -1078,6 +1078,7 @@ class Cases $Fields['DEL_INDEX'] = 1; } $inbox = new ListInbox(); + unset($Fields['DEL_INIT_DATE']); $inbox->update(array_merge($Fields, $arrayNewCaseTitleAndDescription)); /*----------------------------------********---------------------------------*/ diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php index 873b8b65b..3fc95bac3 100755 --- a/workflow/engine/classes/class.derivation.php +++ b/workflow/engine/classes/class.derivation.php @@ -835,15 +835,6 @@ class Derivation //Start Block : UPDATES APPLICATION $this->case->updateCase( $currentDelegation["APP_UID"], $appFields ); //End Block : UPDATES APPLICATION - - if($currentDelegation['ROU_TYPE'] == 'PARALLEL-BY-EVALUATION'){ - $con = Propel::getConnection('workflow'); - $c1 = new Criteria('workflow'); - $c1->add(ListInboxPeer::APP_UID, $currentDelegation["APP_UID"]); - $c2 = new Criteria('workflow'); - $c2->add(ListInboxPeer::DEL_INIT_DATE, null); - BasePeer::doUpdate($c1, $c2, $con); - } } } From 914537d4459a899e493e2f2c3757f8198b4ad766 Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Mon, 1 Jun 2015 13:58:50 -0400 Subject: [PATCH 12/12] PM-2828 "In the BPMN Designer, can not connect..." SOLVED --- workflow/engine/classes/class.net.php | 21 +++++++++---------- workflow/engine/classes/class.pmFunctions.php | 9 +++++++- workflow/engine/classes/class.pmScript.php | 11 +++++----- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/workflow/engine/classes/class.net.php b/workflow/engine/classes/class.net.php index 4091f5ffe..d7901502a 100755 --- a/workflow/engine/classes/class.net.php +++ b/workflow/engine/classes/class.net.php @@ -206,7 +206,7 @@ class NET * * @return void */ - public function tryConnectServer($pDbDriver, array $arrayServerData = array()) + public function tryConnectServer($pDbDriver, array $arrayServerData = array(), $dbsEncode = "") { G::LoadSystem('inputfilter'); $filter = new InputFilter(); @@ -224,8 +224,8 @@ class NET if ($arrayServerData["connectionType"] == "TNS" || $arrayServerData["DBS_TYPEORACLE"] == "TNS") { $flagTns=1; }else{ - $flagTns=0; - } + $flagTns=0; + } }else{ $flagTns=0; } @@ -291,9 +291,9 @@ class NET if ($flagTns == 0) { $this->db_port = ($this->db_port == "" || $this->db_port == 0)? "1521" : $this->db_port; - $cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))"); + $cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))", $dbsEncode); } else { - $cnn = @oci_connect($this->db_user, $this->db_passwd, $arrayServerData["tns"]); + $cnn = @oci_connect($this->db_user, $this->db_passwd, $arrayServerData["tns"], $dbsEncode); } if ($cnn) { @@ -329,7 +329,7 @@ class NET * * @return void */ - public function tryOpenDataBase($pDbDriver, array $arrayServerData = array()) + public function tryOpenDataBase($pDbDriver, array $arrayServerData = array(), $dbsEncode = "") { G::LoadSystem('inputfilter'); $filter = new InputFilter(); @@ -349,8 +349,8 @@ class NET if ($arrayServerData["connectionType"] == "TNS" || $arrayServerData["DBS_TYPEORACLE"] == "TNS") { $flagTns=1; }else{ - $flagTns=0; - } + $flagTns=0; + } }else{ $flagTns=0; } @@ -434,9 +434,9 @@ class NET if ($flagTns == 0) { $this->db_port = ($this->db_port == "" || $this->db_port == 0)? "1521" : $this->db_port; - $cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))"); + $cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))", $dbsEncode); } else { - $cnn = @oci_connect($this->db_user, $this->db_passwd, $arrayServerData["tns"]); + $cnn = @oci_connect($this->db_user, $this->db_passwd, $arrayServerData["tns"], $dbsEncode); } if ($cnn) { @@ -592,4 +592,3 @@ class Stat $this->status = false; } } - diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index 555e04870..ac2a8b223 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -242,6 +242,7 @@ function executeQuery ($SqlStatement, $DBConnectionUID = 'workflow', $aParameter { $con = Propel::getConnection( $DBConnectionUID ); $con->begin(); + try { $statement = trim( $SqlStatement ); $statement = str_replace( '(', '', $statement ); @@ -278,7 +279,13 @@ function executeQuery ($SqlStatement, $DBConnectionUID = 'workflow', $aParameter break; } } else { - $result = executeQueryOci( $SqlStatement, $con, $aParameter ); + $dataEncode = $con->getDSN(); + + if (isset($dataEncode["encoding"]) && $dataEncode["encoding"] != "") { + $result = executeQueryOci($SqlStatement, $con, $aParameter, $dataEncode["encoding"]); + } else { + $result = executeQueryOci($SqlStatement, $con, $aParameter); + } } return $result; diff --git a/workflow/engine/classes/class.pmScript.php b/workflow/engine/classes/class.pmScript.php index 326f7d8d5..24da4f0aa 100644 --- a/workflow/engine/classes/class.pmScript.php +++ b/workflow/engine/classes/class.pmScript.php @@ -493,7 +493,7 @@ class PMScript $sScript .= substr( $this->sScript, $iAux ); if(preg_match('/\b(or|and|xor)\b/i' , $sScript)) { $sScript = "( ".$sScript." )"; - } + } $sScript = '$bResult = ' . $sScript . ';'; // checks if the syntax is valid or if the variables in that condition has been previously defined if ($this->validSyntax( $sScript ) && $variableIsDefined) { @@ -695,7 +695,7 @@ function getEngineDataBaseName ($connection) * @param type $sql * @param type $connection */ -function executeQueryOci ($sql, $connection, $aParameter = array()) +function executeQueryOci ($sql, $connection, $aParameter = array(), $dbsEncode = "") { $aDNS = $connection->getDSN(); @@ -710,12 +710,12 @@ function executeQueryOci ($sql, $connection, $aParameter = array()) if ($flagTns == 0) { // if not default port - $conn = oci_connect($sUsername, $sPassword, $sHostspec . ":" . $sPort . "/" . $sDatabse); + $conn = oci_connect($sUsername, $sPassword, $sHostspec . ":" . $sPort . "/" . $sDatabse, $dbsEncode); } else { - $conn = oci_connect($sUsername, $sPassword, $sHostspec); + $conn = oci_connect($sUsername, $sPassword, $sHostspec, $dbsEncode); } } else { - $conn = oci_connect( $sUsername, $sPassword, $sHostspec . "/" . $sDatabse ); + $conn = oci_connect( $sUsername, $sPassword, $sHostspec . "/" . $sDatabse, $dbsEncode); } if (! $conn) { @@ -786,4 +786,3 @@ function executeQueryOci ($sql, $connection, $aParameter = array()) break; } } -