From 43d626ad556ff2c83e8e1c64c533563938b9ddfe Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Thu, 1 Sep 2016 15:30:31 -0400 Subject: [PATCH 1/4] HOR-1757 "WEB_ENTRY > se presenta un error al derivar un caso desde el link generado." SOLVED Issue: WEB_ENTRY > se presenta un error al derivar un caso desde el link generado. Cause: El servidor web esta configurado con SSL (https), lo que ocasiona que la clase "SoapClient" requiera de un "SSL Certificate" Solution: - Se instancia un objeto de la clase "SoapClient" deshabilitando el "SSL Certificate" - Para que el WebEntry funcione de manera correcta se debera volver a generar el mismo (Editar el WebEntry y presionar en el boton "Generate Link") --- workflow/engine/templates/processes/wsClient.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workflow/engine/templates/processes/wsClient.php b/workflow/engine/templates/processes/wsClient.php index a693f7a25..607fe73dc 100644 --- a/workflow/engine/templates/processes/wsClient.php +++ b/workflow/engine/templates/processes/wsClient.php @@ -101,7 +101,11 @@ function ws_open() { global $client; $endpoint = WS_WSDL_URL; $sessionId = ''; - @$client = new SoapClient($endpoint); + + $client = new SoapClient( + $endpoint, + ['stream_context' => stream_context_create(['ssl' => ['verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true]])] + ); $user = WS_USER_ID; $pass = WS_USER_PASS; From f59382b1768ace9566837b1a1c45e31f819b5f3c Mon Sep 17 00:00:00 2001 From: Dheeyi William Date: Thu, 1 Sep 2016 14:51:00 -0400 Subject: [PATCH 2/4] =?UTF-8?q?R-1749=20Al=20derivar=20de=20un=20script=20?= =?UTF-8?q?task=20y=20end=20email=20no=20env=C3=ADa=20el=20correo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R-1763 Process Name - limit size R-1763 Process Name - limit size --- workflow/engine/classes/class.derivation.php | 2 +- .../BusinessModel/Migrator/PMXPublisher.php | 19 +++++++++--- .../src/ProcessMaker/Exporter/XmlExporter.php | 31 ++++++++++++------- workflow/engine/templates/processes/main.js | 2 ++ 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php index 567588251..6938842c8 100644 --- a/workflow/engine/classes/class.derivation.php +++ b/workflow/engine/classes/class.derivation.php @@ -940,7 +940,7 @@ class Derivation break; case TASK_FINISH_TASK: $iAppThreadIndex = $appFields['DEL_THREAD']; - $this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex ); + $this->case->closeAppThread($currentDelegation['APP_UID'], $iAppThreadIndex); break; default: //Get all siblingThreads diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/PMXPublisher.php b/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/PMXPublisher.php index 13371f7dc..31c665a8e 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/PMXPublisher.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/PMXPublisher.php @@ -27,6 +27,11 @@ class PMXPublisher return $filename; } + /** + * @param $outputFile + * @param bool $dirName + * @return mixed|string + */ public function truncateName($outputFile, $dirName = true) { $limit = 200; @@ -34,23 +39,27 @@ class PMXPublisher $limit = 150; } if ($dirName) { - if (strlen(basename($outputFile)) >= $limit) { - $lastPos = strrpos(basename($outputFile), '.'); - $fileName = substr(basename($outputFile), 0, $lastPos); + $currentLocale = setlocale(LC_CTYPE, 0); + setlocale(LC_CTYPE, 'en_US.UTF-8'); + $filename = basename($outputFile); + if (strlen($filename) >= $limit) { + $lastPos = strrpos($filename, '.'); + $fileName = substr($filename, 0, $lastPos); $newFileName = \G::inflect($fileName); $excess = strlen($newFileName) - $limit; - $newFileName = substr($newFileName, 0, strlen($newFileName) - $excess); + $newFileName = substr($newFileName, 0, strlen($newFileName) - $excess - 1); $newOutputFile = str_replace($fileName, $newFileName, $outputFile); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $newOutputFile = str_replace("/", DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, $newOutputFile); } $outputFile = $newOutputFile; } + setlocale(LC_CTYPE, $currentLocale); } else { $outputFile = \G::inflect($outputFile); if (strlen($outputFile) >= $limit) { $excess = strlen($outputFile) - $limit; - $newFileName = substr($outputFile, 0, strlen($outputFile) - $excess); + $newFileName = substr($outputFile, 0, strlen($outputFile) - $excess - 1); $outputFile = $newFileName; } } diff --git a/workflow/engine/src/ProcessMaker/Exporter/XmlExporter.php b/workflow/engine/src/ProcessMaker/Exporter/XmlExporter.php index fa817dc02..d85d76d5e 100644 --- a/workflow/engine/src/ProcessMaker/Exporter/XmlExporter.php +++ b/workflow/engine/src/ProcessMaker/Exporter/XmlExporter.php @@ -161,31 +161,40 @@ class XmlExporter extends Exporter return $this->dom->createCDATASection($value); } } - - public function truncateName($outputFile,$dirName = true) + + /** + * @param $outputFile + * @param bool $dirName + * @return mixed|string + */ + public function truncateName($outputFile, $dirName = true) { $limit = 200; if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $limit = 150; } - if($dirName) { - if (strlen(basename($outputFile)) >= $limit) { - $lastPos = strrpos(basename($outputFile),'.'); - $fileName = substr(basename($outputFile),0,$lastPos); + if ($dirName) { + $currentLocale = setlocale(LC_CTYPE, 0); + setlocale(LC_CTYPE, 'en_US.UTF-8'); + $filename = basename($outputFile); + if (strlen($filename) >= $limit) { + $lastPos = strrpos($filename, '.'); + $fileName = substr($filename, 0, $lastPos); $newFileName = \G::inflect($fileName); $excess = strlen($newFileName) - $limit; - $newFileName = substr($newFileName,0,strlen($newFileName)-$excess); - $newOutputFile = str_replace($fileName,$newFileName,$outputFile); + $newFileName = substr($newFileName, 0, strlen($newFileName) - $excess - 1); + $newOutputFile = str_replace($fileName, $newFileName, $outputFile); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $newOutputFile = str_replace("/", DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, $newOutputFile); + $newOutputFile = str_replace("/", DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, $newOutputFile); } $outputFile = $newOutputFile; - } + } + setlocale(LC_CTYPE, $currentLocale); } else { $outputFile = \G::inflect($outputFile); if (strlen($outputFile) >= $limit) { $excess = strlen($outputFile) - $limit; - $newFileName = substr($outputFile,0,strlen($outputFile)-$excess); + $newFileName = substr($outputFile, 0, strlen($outputFile) - $excess - 1); $outputFile = $newFileName; } } diff --git a/workflow/engine/templates/processes/main.js b/workflow/engine/templates/processes/main.js index e33f5902e..43adb6cb0 100644 --- a/workflow/engine/templates/processes/main.js +++ b/workflow/engine/templates/processes/main.js @@ -813,9 +813,11 @@ function newProcess(params) fieldLabel: _('ID_TITLE'), xtype:'textfield', width: 260, + maxLength: 100, maskRe: /^(?!^(PRN|AUX|CLOCK\$|NUL|CON|COM\d|LPT\d|\...*)(\..+)?$)[^\x00-\x1f\\?*\";|/]+$/i, allowBlank: false, vtype: "textWithoutTags", + autoCreate: {tag: 'input', type: 'text', size: '100', autocomplete: 'off', maxlength: '100'}, listeners: { 'focus' : function(value){ document.getElementById("PRO_TITLE").onpaste = function() { From 1ab97241ab9df2f12859e14151bf27a0aece4a86 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Fri, 2 Sep 2016 13:14:03 -0400 Subject: [PATCH 3/4] HOR-1768 "Upgrade: No se muestran los casos de la bandeja Unnasigned..." SOLVED Issue: Upgrade: No se muestran los casos de la bandeja Unnasigned pero es posible recuperarlos con Jump to Cause: Validaciones faltantes en el metodo "workspaceTools::migrateList()" Solution: Se mejoran las validaciones en el metodo "workspaceTools::migrateList()" --- workflow/engine/classes/class.wsTools.php | 56 +++++++++++++---------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index b3c485630..bc6b17bdb 100644 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -2008,50 +2008,60 @@ class workspaceTools * @param string $workSpace Workspace * @param bool $flagReinsert Flag that specifies the re-insertion * - * return all LIST TABLES with data + * @return void */ public function migrateList($workSpace, $flagReinsert = false, $lang='en') { $this->initPropel(true); - G::LoadClass("case"); + $flagListAll = $this->listFirstExecution('check'); + $flagListUnassigned = $this->listFirstExecution('check', 'unassigned'); - if (!$flagReinsert && $this->listFirstExecution("check")) { - return 1; + if (!$flagReinsert && $flagListAll && $flagListUnassigned) { + return; } + $arrayTable1 = ['ListInbox', 'ListMyInbox', 'ListCanceled', 'ListParticipatedLast', 'ListParticipatedHistory', 'ListPaused', 'ListCompleted']; + $arrayTable2 = ['ListUnassigned', 'ListUnassignedGroup']; + $arrayTable = array_merge($arrayTable1, $arrayTable2); + if ($flagReinsert) { //Delete all records - $arrayTable = array("ListInbox", "ListMyInbox", "ListCanceled", "ListParticipatedLast", "ListParticipatedHistory", "ListPaused", "ListCompleted", "ListUnassigned", "ListUnassignedGroup"); - foreach ($arrayTable as $value) { - $tableName = $value . "Peer"; + $tableName = $value . 'Peer'; $list = new $tableName(); $list->doDeleteAll(); } + } + if (!$flagReinsert && !$flagListAll) { + foreach ($arrayTable1 as $value) { + $tableName = $value . 'Peer'; + $list = new $tableName(); + + if ((int)($list->doCount(new Criteria())) > 0) { + $flagListAll = true; + break; + } + } + } + + if ($flagReinsert || !$flagListAll) { $this->regenerateListCompleted($lang); $this->regenerateListCanceled($lang); - $this->regenerateListMyInbox(); // this list require no translation - $this->regenerateListInbox(); // this list require no translation - $this->regenerateListParticipatedHistory(); // this list require no translation - $this->regenerateListParticipatedLast(); // this list require no translation - $this->regenerateListPaused(); // this list require no translation - $this->regenerateListUnassigned(); // this list require no translation - } - if (!$flagReinsert) { - $this->listFirstExecution("insert"); - $this->listFirstExecution('insert', 'unassigned'); + $this->regenerateListMyInbox(); //This list require no translation + $this->regenerateListInbox(); //This list require no translation + $this->regenerateListParticipatedHistory(); //This list require no translation + $this->regenerateListParticipatedLast(); //This list require no translation + $this->regenerateListPaused(); //This list require no translation } - //Check for the List Unassigned - if(!$this->listFirstExecution('check','unassigned')){ - $this->regenerateListUnassigned(); // this list require no translation - $this->listFirstExecution('insert', 'unassigned'); + if ($flagReinsert || !$flagListUnassigned) { + $this->regenerateListUnassigned(); //This list require no translation } - //Return - return true; + $this->listFirstExecution('insert'); + $this->listFirstExecution('insert', 'unassigned'); } public function regenerateListCanceled($lang = 'en') From c278810e58cb81fa0d22f7850727694bb966d1f6 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Fri, 2 Sep 2016 16:16:07 -0400 Subject: [PATCH 4/4] HOR-1751 --- workflow/engine/classes/class.processes.php | 5 +++-- .../src/ProcessMaker/Project/Workflow.php | 21 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/workflow/engine/classes/class.processes.php b/workflow/engine/classes/class.processes.php index 3cf3c8c43..db5ad1ad9 100644 --- a/workflow/engine/classes/class.processes.php +++ b/workflow/engine/classes/class.processes.php @@ -2004,13 +2004,14 @@ class Processes { $map = array(); foreach ($oData->inputs as $key => $val) { - $oldUid = $val['INP_DOC_UID']; $newGuid = $this->getUnusedInputGUID(); $map[$val['INP_DOC_UID']] = $newGuid; $oData->inputFiles[$oData->inputs[$key]['INP_DOC_UID']] = $newGuid; $oData->inputs[$key]['INP_DOC_UID'] = $newGuid; - $oData->inputs[$key]['INP_DOC_UID_OLD'] = $oldUid; } + + $oData->uid["INPUT_DOCUMENT"] = $map; + if (!isset($oData->inputFiles)) { $oData->inputFiles = array(); } diff --git a/workflow/engine/src/ProcessMaker/Project/Workflow.php b/workflow/engine/src/ProcessMaker/Project/Workflow.php index 49be55766..33483917e 100644 --- a/workflow/engine/src/ProcessMaker/Project/Workflow.php +++ b/workflow/engine/src/ProcessMaker/Project/Workflow.php @@ -1285,6 +1285,7 @@ class Workflow extends Handler $arrayWorkflowData = (array)($workflowData); + //Synchronize dynaforms json. foreach ($arrayWorkflowData["dynaforms"] as $key => $value) { if ($arrayWorkflowData["dynaforms"][$key]["DYN_CONTENT"] != "") { $dynaFormContent = $arrayWorkflowData["dynaforms"][$key]["DYN_CONTENT"]; @@ -1304,15 +1305,21 @@ class Workflow extends Handler } } - foreach ($arrayWorkflowData["inputs"] as $keyin => $value) { - $newUid = $value["INP_DOC_UID"]; - if(isset($value["INP_DOC_UID_OLD"])){ - foreach ($arrayWorkflowData["processVariables"] as $keypv => $vars) { - if($vars['INP_DOC_UID'] === $value["INP_DOC_UID_OLD"]){ - $arrayWorkflowData["processVariables"][$keypv]["INP_DOC_UID"] = $newUid; + //Synchronize caseTrackerObject with dynaforms, input documents, output documents. + foreach ($arrayWorkflowData["caseTrackerObject"] as $key => $value) { + if (isset($arrayWorkflowData["uid"]) && + isset($arrayWorkflowData["uid"][$value["CTO_TYPE_OBJ"]]) && + isset($arrayWorkflowData["uid"][$value["CTO_TYPE_OBJ"]][$value["CTO_UID_OBJ"]])) { + $arrayWorkflowData["caseTrackerObject"][$key]["CTO_UID_OBJ"] = $arrayWorkflowData["uid"][$value["CTO_TYPE_OBJ"]][$value["CTO_UID_OBJ"]]; } } - unset($arrayWorkflowData["inputs"][$keyin]["INP_DOC_UID_OLD"]); + + //Synchronize variables with process variables. + foreach ($arrayWorkflowData["processVariables"] as $key => $value) { + if (isset($arrayWorkflowData["uid"]) && + isset($arrayWorkflowData["uid"]["INPUT_DOCUMENT"]) && + isset($arrayWorkflowData["uid"]["INPUT_DOCUMENT"][$value["INP_DOC_UID"]])) { + $arrayWorkflowData["processVariables"][$key]["INP_DOC_UID"] = $arrayWorkflowData["uid"]["INPUT_DOCUMENT"][$value["INP_DOC_UID"]]; } }