From e96cae74916fa408e3267d7a8e187c71e2337000 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Mon, 6 Nov 2017 10:37:16 -0400 Subject: [PATCH 1/7] HOR-4033 --- .../BusinessModel/Cases/ChangeLog.php | 76 +++++++++++++++++-- 1 file changed, 70 insertions(+), 6 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases/ChangeLog.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/ChangeLog.php index 1f09e8a2c..68444e554 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases/ChangeLog.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/ChangeLog.php @@ -2,13 +2,13 @@ namespace ProcessMaker\BusinessModel\Cases; -use Propel; -use StdClass; -use G; -use Cases as ClassesCase; use AppDocument; +use Cases as ClassesCases; use Dynaform; use Exception; +use G; +use Propel; +use StdClass; use Task as ClassesTask; /** @@ -61,6 +61,13 @@ class ChangeLog return ['data' => $this->tree, 'totalCount' => $totalCount]; } + /** + * This function get the appHistory related to the case + * + * @param string $appUid + * + * @return array; + */ private function getResultSet($appUid) { $conn = Propel::getConnection('workflow'); @@ -75,6 +82,15 @@ class ChangeLog return $stmt->getResultSet(); } + /** + * This function read the records, related to the specific result and update the data + * + * @param object $result + * @param integer $start + * @param integer $limit + * + * @return integer; + */ private function readRecords($result, $start = 0, $limit = 15) { $index = 0; @@ -97,6 +113,13 @@ class ChangeLog return $index; } + /** + * This function check if is empty + * + * @param array $data + * + * @return boolean; + */ private function isEmpty($data) { foreach ($data as $key => $value) { @@ -108,6 +131,16 @@ class ChangeLog return true; } + /** + * This function update the data + * + * @param array $data + * @param array $row + * @param boolean $hasPermission + * @param boolean $addToTree + * + * @return integer; + */ private function updateData($data, $row, $hasPermission, $addToTree = false) { $i = 0; @@ -143,6 +176,13 @@ class ChangeLog return $i; } + /** + * This function get the title related to the row + * + * @param array $row + * + * @return string; + */ private function getHistoryTitle($row) { return $this->getObjectTitle($row['TAS_UID'], 'TASK') @@ -151,6 +191,14 @@ class ChangeLog .' / '.G::LoadTranslation('ID_USER').': '.$row['USR_USERNAME']; } + /** + * This function get the object title + * + * @param string $uid + * @param string $objType + * + * @return string; + */ private function getObjectTitle($uid, $objType) { switch ($objType) { @@ -176,14 +224,30 @@ class ChangeLog return $title; } - private function loadPermissions($APP_UID, $PRO_UID, $TAS_UID) + /** + * This function get the permissions + * + * @param string $appUid + * @param string $proUid + * @param string $tasUid + * + * @return void; + */ + private function loadPermissions($appUid, $proUid, $tasUid) { $oCase = new ClassesCases(); $this->permissions = $oCase->getAllObjects( - $PRO_UID, $APP_UID, $TAS_UID, $_SESSION['USER_LOGGED'] + $proUid, $appUid, $tasUid, $_SESSION['USER_LOGGED'] ); } + /** + * This function verify if has permission + * + * @param string $uid + * + * @return boolean; + */ private function hasPermission($uid) { if(array_search($uid, $this->reservedSteps)!==false) { From a6457b221106bea3d840b757c168f0e2e80bda69 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Wed, 12 Jul 2017 15:55:02 -0400 Subject: [PATCH 2/7] HOR-3510 --- workflow/engine/methods/cases/cases_Open.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/workflow/engine/methods/cases/cases_Open.php b/workflow/engine/methods/cases/cases_Open.php index 4405c598c..4ad552a6d 100644 --- a/workflow/engine/methods/cases/cases_Open.php +++ b/workflow/engine/methods/cases/cases_Open.php @@ -82,6 +82,13 @@ try { $_SESSION['CURRENT_TASK'] = $aFields['TAS_UID']; } + unset($_SESSION['ACTION']); + $flagJump = ''; + if ($_action == 'jump') { + $_SESSION['ACTION'] = 'jump'; + $flagJump = 1; + } + switch ($aFields['APP_STATUS']) { case 'DRAFT': case 'TO_DO': @@ -201,13 +208,7 @@ try { $_SESSION['INDEX'] = $row['DEL_INDEX']; } - if ($_action == 'jump') { - $Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'], 1); - $_SESSION['ACTION'] = 'jump'; - } else { - $Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX']); - unset($_SESSION['ACTION']); - } + $Fields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $flagJump); $_SESSION['CURRENT_TASK'] = $Fields['TAS_UID']; require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php'); @@ -220,7 +221,7 @@ try { $_SESSION['PROCESS'] = $aFields['PRO_UID']; $_SESSION['TASK'] = - 1; $_SESSION['STEP_POSITION'] = 0; - $Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX']); + $Fields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $flagJump); $_SESSION['CURRENT_TASK'] = $Fields['TAS_UID']; require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php'); From af1443ce10634a5504ca2fa2e4b43737ebf59060 Mon Sep 17 00:00:00 2001 From: davidcallizaya Date: Fri, 10 Nov 2017 11:24:27 -0400 Subject: [PATCH 3/7] HOR-4074 Add getallheaders compatibility. --- composer.json | 3 +- composer.lock | 233 +++++++++++++++++++++++++++++--------------------- 2 files changed, 139 insertions(+), 97 deletions(-) diff --git a/composer.json b/composer.json index 291f144b6..ac2129184 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,8 @@ "phpmailer/phpmailer": "5.2.*", "pear/archive_tar": "1.4.*", "pear/console_getopt": "1.4.*", - "TYPO3/class-alias-loader": "^1.0" + "TYPO3/class-alias-loader": "^1.0", + "ralouphie/getallheaders": "^2.0" }, "require-dev": { "guzzle/guzzle": "~3.1.1", diff --git a/composer.lock b/composer.lock index e3279b80a..207c7dc7d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "fe59fa461e9821731c50135b7703f06e", + "hash": "ca4e31d385248c976ef1b88d6f6c725f", + "content-hash": "674fafac9f49f8b6da9f7a0189549eb1", "packages": [ { "name": "bshaffer/oauth2-server-php", @@ -47,7 +48,7 @@ "oauth", "oauth2" ], - "time": "2013-08-12T16:35:58+00:00" + "time": "2013-08-12 16:35:58" }, { "name": "colosa/MichelangeloFE", @@ -66,7 +67,7 @@ "keywords": [ "js app ProcessMaker" ], - "time": "2017-09-05T17:01:30+00:00" + "time": "2017-09-05 17:01:30" }, { "name": "colosa/pmDynaform", @@ -82,7 +83,7 @@ "keywords": [ "js lib ProcessMaker Dynaforms" ], - "time": "2017-09-05T17:02:30+00:00" + "time": "2017-09-05 17:02:30" }, { "name": "colosa/pmUI", @@ -98,7 +99,7 @@ "keywords": [ "js lib ProcessMaker UI" ], - "time": "2017-08-10T14:57:39+00:00" + "time": "2017-08-10 14:57:39" }, { "name": "dapphp/securimage", @@ -145,7 +146,7 @@ "captcha", "security" ], - "time": "2016-12-04T17:45:57+00:00" + "time": "2016-12-04 17:45:57" }, { "name": "doctrine/inflector", @@ -212,7 +213,7 @@ "singularize", "string" ], - "time": "2015-11-06T14:35:42+00:00" + "time": "2015-11-06 14:35:42" }, { "name": "erusev/parsedown", @@ -254,7 +255,7 @@ "markdown", "parser" ], - "time": "2017-05-14T14:47:48+00:00" + "time": "2017-05-14 14:47:48" }, { "name": "geshi/geshi", @@ -294,7 +295,7 @@ ], "description": "Generic Syntax Highlighter", "homepage": "http://qbnz.com/highlighter/", - "time": "2017-07-30T00:08:49+00:00" + "time": "2017-07-30 00:08:49" }, { "name": "google/apiclient", @@ -337,7 +338,7 @@ "keywords": [ "google" ], - "time": "2015-10-16T22:11:08+00:00" + "time": "2015-10-16 22:11:08" }, { "name": "laravel/framework", @@ -466,7 +467,7 @@ "framework", "laravel" ], - "time": "2017-08-30T09:26:16+00:00" + "time": "2017-08-30 09:26:16" }, { "name": "league/flysystem", @@ -549,7 +550,7 @@ "sftp", "storage" ], - "time": "2017-08-06T17:41:04+00:00" + "time": "2017-08-06 17:41:04" }, { "name": "libchart/libchart", @@ -595,7 +596,7 @@ "line charts", "pie charts" ], - "time": "2013-10-19T22:21:30+00:00" + "time": "2013-10-19 22:21:30" }, { "name": "luracast/restler", @@ -674,7 +675,7 @@ "rest", "server" ], - "time": "2017-01-11T03:42:36+00:00" + "time": "2017-01-11 03:42:36" }, { "name": "monolog/monolog", @@ -752,7 +753,7 @@ "logging", "psr-3" ], - "time": "2016-04-12T18:29:35+00:00" + "time": "2016-04-12 18:29:35" }, { "name": "mtdowling/cron-expression", @@ -796,7 +797,7 @@ "cron", "schedule" ], - "time": "2017-01-23T04:29:33+00:00" + "time": "2017-01-23 04:29:33" }, { "name": "nesbot/carbon", @@ -849,7 +850,7 @@ "datetime", "time" ], - "time": "2017-01-16T07:55:07+00:00" + "time": "2017-01-16 07:55:07" }, { "name": "paragonie/random_compat", @@ -897,7 +898,7 @@ "pseudorandom", "random" ], - "time": "2017-03-13T16:27:32+00:00" + "time": "2017-03-13 16:27:32" }, { "name": "pear/archive_tar", @@ -963,7 +964,7 @@ "archive", "tar" ], - "time": "2017-06-11T17:28:11+00:00" + "time": "2017-06-11 17:28:11" }, { "name": "pear/console_getopt", @@ -1010,7 +1011,7 @@ } ], "description": "More info available on: http://pear.php.net/package/Console_Getopt", - "time": "2015-07-20T20:28:12+00:00" + "time": "2015-07-20 20:28:12" }, { "name": "pear/pear-core-minimal", @@ -1054,7 +1055,7 @@ } ], "description": "Minimal set of PEAR core files to be used as composer dependency", - "time": "2017-02-28T16:46:11+00:00" + "time": "2017-02-28 16:46:11" }, { "name": "pear/pear_exception", @@ -1109,7 +1110,7 @@ "keywords": [ "exception" ], - "time": "2015-02-10T20:07:52+00:00" + "time": "2015-02-10 20:07:52" }, { "name": "phpmailer/phpmailer", @@ -1186,7 +1187,7 @@ } ], "description": "PHPMailer is a full-featured email creation and transfer class for PHP", - "time": "2017-08-28T11:12:07+00:00" + "time": "2017-08-28 11:12:07" }, { "name": "psr/log", @@ -1224,7 +1225,47 @@ "psr", "psr-3" ], - "time": "2012-12-21T11:40:51+00:00" + "time": "2012-12-21 11:40:51" + }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11 07:05:27" }, { "name": "ramsey/uuid", @@ -1306,7 +1347,7 @@ "identifier", "uuid" ], - "time": "2017-08-04T13:39:04+00:00" + "time": "2017-08-04 13:39:04" }, { "name": "swiftmailer/swiftmailer", @@ -1360,7 +1401,7 @@ "mail", "mailer" ], - "time": "2017-05-01T15:54:03+00:00" + "time": "2017-05-01 15:54:03" }, { "name": "symfony/console", @@ -1428,7 +1469,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-08-27T14:52:21+00:00" + "time": "2017-08-27 14:52:21" }, { "name": "symfony/css-selector", @@ -1481,7 +1522,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/debug", @@ -1537,7 +1578,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-08-27T14:52:21+00:00" + "time": "2017-08-27 14:52:21" }, { "name": "symfony/event-dispatcher", @@ -1600,7 +1641,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/finder", @@ -1649,7 +1690,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/http-foundation", @@ -1702,7 +1743,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-08-10T07:07:06+00:00" + "time": "2017-08-10 07:07:06" }, { "name": "symfony/http-kernel", @@ -1788,7 +1829,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2017-08-28T22:35:03+00:00" + "time": "2017-08-28 22:35:03" }, { "name": "symfony/polyfill-mbstring", @@ -1847,7 +1888,7 @@ "portable", "shim" ], - "time": "2017-06-14T15:44:48+00:00" + "time": "2017-06-14 15:44:48" }, { "name": "symfony/process", @@ -1896,7 +1937,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/routing", @@ -1974,7 +2015,7 @@ "uri", "url" ], - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/translation", @@ -2039,7 +2080,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/var-dumper", @@ -2107,7 +2148,7 @@ "debug", "dump" ], - "time": "2017-08-27T14:52:21+00:00" + "time": "2017-08-27 14:52:21" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -2154,7 +2195,7 @@ ], "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", - "time": "2016-09-20T12:50:39+00:00" + "time": "2016-09-20 12:50:39" }, { "name": "typo3/class-alias-loader", @@ -2212,7 +2253,7 @@ "classloader", "composer" ], - "time": "2015-10-06T10:25:44+00:00" + "time": "2015-10-06 10:25:44" }, { "name": "vlucas/phpdotenv", @@ -2262,7 +2303,7 @@ "env", "environment" ], - "time": "2016-09-01T10:05:43+00:00" + "time": "2016-09-01 10:05:43" } ], "packages-dev": [ @@ -2319,7 +2360,7 @@ "assertion", "validation" ], - "time": "2017-05-04T02:00:24+00:00" + "time": "2017-05-04 02:00:24" }, { "name": "behat/behat", @@ -2401,7 +2442,7 @@ "symfony", "testing" ], - "time": "2017-05-15T16:49:16+00:00" + "time": "2017-05-15 16:49:16" }, { "name": "behat/gherkin", @@ -2460,7 +2501,7 @@ "gherkin", "parser" ], - "time": "2017-08-30T11:04:43+00:00" + "time": "2017-08-30 11:04:43" }, { "name": "behat/mink", @@ -2518,7 +2559,7 @@ "testing", "web" ], - "time": "2016-03-05T08:26:18+00:00" + "time": "2016-03-05 08:26:18" }, { "name": "behat/mink-selenium2-driver", @@ -2579,7 +2620,7 @@ "testing", "webdriver" ], - "time": "2016-03-05T09:10:18+00:00" + "time": "2016-03-05 09:10:18" }, { "name": "behat/transliterator", @@ -2623,7 +2664,7 @@ "slug", "transliterator" ], - "time": "2017-04-04T11:38:05+00:00" + "time": "2017-04-04 11:38:05" }, { "name": "clue/graph", @@ -2668,7 +2709,7 @@ "network", "vertex" ], - "time": "2015-03-07T18:11:31+00:00" + "time": "2015-03-07 18:11:31" }, { "name": "container-interop/container-interop", @@ -2699,7 +2740,7 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", - "time": "2017-02-14T19:40:03+00:00" + "time": "2017-02-14 19:40:03" }, { "name": "doctrine/instantiator", @@ -2753,7 +2794,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2015-06-14 21:17:01" }, { "name": "facebook/webdriver", @@ -2805,7 +2846,7 @@ "selenium", "webdriver" ], - "time": "2017-04-28T14:54:49+00:00" + "time": "2017-04-28 14:54:49" }, { "name": "florianwolters/component-core-stringutils", @@ -2850,7 +2891,7 @@ "string", "wrapper" ], - "time": "2013-07-01T10:24:07+00:00" + "time": "2013-07-01 10:24:07" }, { "name": "florianwolters/component-util-reflection", @@ -2894,7 +2935,7 @@ "reflection", "utility" ], - "time": "2013-03-19T16:42:41+00:00" + "time": "2013-03-19 16:42:41" }, { "name": "florianwolters/component-util-singleton", @@ -2945,7 +2986,7 @@ "singleton", "utility" ], - "time": "2013-06-29T12:35:22+00:00" + "time": "2013-06-29 12:35:22" }, { "name": "graphp/algorithms", @@ -2995,7 +3036,7 @@ "prim", "shortest path" ], - "time": "2015-03-08T10:12:01+00:00" + "time": "2015-03-08 10:12:01" }, { "name": "guzzle/guzzle", @@ -3088,7 +3129,7 @@ "web service" ], "abandoned": "guzzlehttp/guzzle", - "time": "2013-01-28T00:07:40+00:00" + "time": "2013-01-28 00:07:40" }, { "name": "instaclick/php-webdriver", @@ -3147,7 +3188,7 @@ "webdriver", "webtest" ], - "time": "2017-06-30T04:02:48+00:00" + "time": "2017-06-30 04:02:48" }, { "name": "lmc/steward", @@ -3222,7 +3263,7 @@ "testing", "webdriver" ], - "time": "2017-06-05T23:56:28+00:00" + "time": "2017-06-05 23:56:28" }, { "name": "myclabs/deep-copy", @@ -3264,7 +3305,7 @@ "object", "object graph" ], - "time": "2017-04-12T18:52:22+00:00" + "time": "2017-04-12 18:52:22" }, { "name": "nette/caching", @@ -3333,7 +3374,7 @@ "nette", "sqlite" ], - "time": "2017-08-18T15:20:18+00:00" + "time": "2017-08-18 15:20:18" }, { "name": "nette/finder", @@ -3389,7 +3430,7 @@ ], "description": "Nette Finder: Files Searching", "homepage": "https://nette.org", - "time": "2017-07-10T23:47:08+00:00" + "time": "2017-07-10 23:47:08" }, { "name": "nette/reflection", @@ -3453,7 +3494,7 @@ "nette", "reflection" ], - "time": "2017-07-11T19:28:57+00:00" + "time": "2017-07-11 19:28:57" }, { "name": "nette/utils", @@ -3532,7 +3573,7 @@ "utility", "validation" ], - "time": "2017-08-20T17:32:29+00:00" + "time": "2017-08-20 17:32:29" }, { "name": "ondram/ci-detector", @@ -3585,7 +3626,7 @@ "teamcity", "travis" ], - "time": "2017-05-26T16:39:57+00:00" + "time": "2017-05-26 16:39:57" }, { "name": "phpdocumentor/reflection-common", @@ -3639,7 +3680,7 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2015-12-27 11:43:31" }, { "name": "phpdocumentor/reflection-docblock", @@ -3684,7 +3725,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-08T06:39:58+00:00" + "time": "2017-08-08 06:39:58" }, { "name": "phpdocumentor/type-resolver", @@ -3731,7 +3772,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-06-03T08:32:36+00:00" + "time": "2017-06-03 08:32:36" }, { "name": "phpspec/prophecy", @@ -3794,7 +3835,7 @@ "spy", "stub" ], - "time": "2017-09-04T11:05:03+00:00" + "time": "2017-09-04 11:05:03" }, { "name": "phpunit/php-code-coverage", @@ -3857,7 +3898,7 @@ "testing", "xunit" ], - "time": "2017-04-02T07:44:40+00:00" + "time": "2017-04-02 07:44:40" }, { "name": "phpunit/php-file-iterator", @@ -3904,7 +3945,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", @@ -3945,7 +3986,7 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", @@ -3994,7 +4035,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", @@ -4043,7 +4084,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-02-27 10:12:30" }, { "name": "phpunit/phpunit", @@ -4125,7 +4166,7 @@ "testing", "xunit" ], - "time": "2017-06-21T08:11:54+00:00" + "time": "2017-06-21 08:11:54" }, { "name": "phpunit/phpunit-mock-objects", @@ -4184,7 +4225,7 @@ "mock", "xunit" ], - "time": "2017-06-30T09:13:00+00:00" + "time": "2017-06-30 09:13:00" }, { "name": "psr/container", @@ -4233,7 +4274,7 @@ "container-interop", "psr" ], - "time": "2017-02-14T16:28:37+00:00" + "time": "2017-02-14 16:28:37" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -4278,7 +4319,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "time": "2017-03-04 06:30:41" }, { "name": "sebastian/comparator", @@ -4342,7 +4383,7 @@ "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2017-01-29 09:50:25" }, { "name": "sebastian/diff", @@ -4394,7 +4435,7 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-05-22 07:24:03" }, { "name": "sebastian/environment", @@ -4444,7 +4485,7 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "time": "2016-11-26 07:53:53" }, { "name": "sebastian/exporter", @@ -4511,7 +4552,7 @@ "export", "exporter" ], - "time": "2016-11-19T08:54:04+00:00" + "time": "2016-11-19 08:54:04" }, { "name": "sebastian/global-state", @@ -4562,7 +4603,7 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/object-enumerator", @@ -4608,7 +4649,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" + "time": "2017-02-18 15:18:39" }, { "name": "sebastian/recursion-context", @@ -4661,7 +4702,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" + "time": "2016-11-19 07:33:16" }, { "name": "sebastian/resource-operations", @@ -4703,7 +4744,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2015-07-28 20:34:47" }, { "name": "sebastian/version", @@ -4746,7 +4787,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "time": "2016-10-03 07:35:21" }, { "name": "squizlabs/php_codesniffer", @@ -4797,7 +4838,7 @@ "phpcs", "standards" ], - "time": "2017-07-18T01:12:32+00:00" + "time": "2017-07-18 01:12:32" }, { "name": "symfony/class-loader", @@ -4853,7 +4894,7 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/config", @@ -4915,7 +4956,7 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-08-03T08:59:45+00:00" + "time": "2017-08-03 08:59:45" }, { "name": "symfony/dependency-injection", @@ -4985,7 +5026,7 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-08-28T22:20:37+00:00" + "time": "2017-08-28 22:20:37" }, { "name": "symfony/filesystem", @@ -5034,7 +5075,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/options-resolver", @@ -5088,7 +5129,7 @@ "configuration", "options" ], - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/stopwatch", @@ -5137,7 +5178,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-07-29 21:54:42" }, { "name": "symfony/yaml", @@ -5192,7 +5233,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-07-29T21:54:42+00:00" + "time": "2017-07-29 21:54:42" }, { "name": "webmozart/assert", @@ -5242,7 +5283,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2016-11-23 20:04:58" }, { "name": "wimg/php-compatibility", @@ -5294,7 +5335,7 @@ "phpcs", "standards" ], - "time": "2017-08-07T19:39:05+00:00" + "time": "2017-08-07 19:39:05" } ], "aliases": [], From 54a316f77511c770ff3268fde641f90851e6f47e Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Mena Date: Wed, 15 Nov 2017 10:13:22 -0400 Subject: [PATCH 4/7] HOR-4072 The steps are lost when importing with the option "Do you wish to create a new UID for this process?" - Add section after import in regenerateUids --- .../ProcessMaker/BusinessModel/Migrator/GranularImporter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php b/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php index 80b6aba72..4c0df6ed8 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php @@ -330,6 +330,10 @@ class GranularImporter $newData['tables']['workflow'] = $arrayWorkflowTables; $newData['tables']['plugins'] = isset($data["tables"]["plugins"]) ? $data["tables"]["plugins"] : []; $newData['files']['workflow'] = $arrayWorkflowFiles; + + $definition = new \ProcessMaker\BusinessModel\Migrator\ProcessDefinitionMigrator(); + $definition->afterImport($newData['tables']); + $this->regeneratedUids = $result; return array( From cd8b782bcc247b8a8a5a6532bf89fed8d223b8fb Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Mena Date: Wed, 15 Nov 2017 10:25:50 -0400 Subject: [PATCH 5/7] Code Style --- .../Migrator/GranularImporter.php | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php b/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php index 4c0df6ed8..fbcbbc9e9 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php @@ -6,8 +6,11 @@ namespace ProcessMaker\BusinessModel\Migrator; +use ProcessMaker\BusinessModel\Migrator\ProcessDefinitionMigrator; use ProcessMaker\Importer\XmlImporter; use ProcessMaker\Project\Adapter; +use ProcessMaker\Project\Workflow; + class GranularImporter { @@ -300,7 +303,9 @@ class GranularImporter } /** - * @param $data + * Regenerate All UIDs of process and Import + * + * @param array $data * @param bool $generateUid * @return array * @throws \Exception @@ -308,37 +313,39 @@ class GranularImporter public function regenerateAllUids($data, $generateUid = true) { try { - $newData = array(); - $arrayBpmnTables = $data["tables"]["bpmn"]; - $arrayWorkflowTables = $data["tables"]["workflow"]; - $arrayWorkflowFiles = $data["files"]["workflow"]; + $newData = []; + $arrayBpmnTables = $data['tables']['bpmn']; + $arrayWorkflowTables = $data['tables']['workflow']; + $arrayWorkflowFiles = $data['files']['workflow']; $arrayBpmnTablesFormat = $this->structureBpmnData($arrayBpmnTables); $arrayBpmnTablesFormat['prj_type'] = $arrayWorkflowTables['process']['PRO_TYPE']; $arrayBpmnTablesFormat['pro_status'] = $arrayWorkflowTables['process']['PRO_STATUS']; $result = $this->bpmn->createFromStruct($arrayBpmnTablesFormat, $generateUid); - $projectUidOld = $arrayBpmnTables["project"][0]["prj_uid"]; - $projectUid = ($generateUid) ? $result[0]["new_uid"] : $result; + $projectUidOld = $arrayBpmnTables['project'][0]['prj_uid']; + $projectUid = ($generateUid) ? $result[0]['new_uid'] : $result; if ($generateUid) { - $result[0]["object"] = "project"; - $result[0]["old_uid"] = $projectUidOld; - $result[0]["new_uid"] = $projectUid; + $result[0]['object'] = 'project'; + $result[0]['old_uid'] = $projectUidOld; + $result[0]['new_uid'] = $projectUid; - $workflow = new \ProcessMaker\Project\Workflow(); + $workflow = new Workflow(); list($arrayWorkflowTables, $arrayWorkflowFiles) = $workflow->updateDataUidByArrayUid($arrayWorkflowTables, $arrayWorkflowFiles, $result); } $newData['tables']['workflow'] = $arrayWorkflowTables; - $newData['tables']['plugins'] = isset($data["tables"]["plugins"]) ? $data["tables"]["plugins"] : []; + $newData['tables']['plugins'] = isset($data['tables']['plugins']) ? $data['tables']['plugins'] : []; $newData['files']['workflow'] = $arrayWorkflowFiles; - $definition = new \ProcessMaker\BusinessModel\Migrator\ProcessDefinitionMigrator(); + //Process Definition + $definition = new ProcessDefinitionMigrator(); $definition->afterImport($newData['tables']); - + $this->regeneratedUids = $result; - return array( + return [ 'data' => $newData, - 'new_uid' => $projectUid); + 'new_uid' => $projectUid + ]; } catch (\Exception $e) { throw $e; From 6ca0ee7153c7a088e7ac927ce8f07e59ed4a2ba7 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Mena Date: Wed, 15 Nov 2017 15:34:29 -0400 Subject: [PATCH 6/7] Fix CR --- .../ProcessMaker/BusinessModel/Migrator/GranularImporter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php b/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php index fbcbbc9e9..f9ad433e5 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Migrator/GranularImporter.php @@ -336,7 +336,8 @@ class GranularImporter $newData['tables']['plugins'] = isset($data['tables']['plugins']) ? $data['tables']['plugins'] : []; $newData['files']['workflow'] = $arrayWorkflowFiles; - //Process Definition + //Update Process Definition after import + //@todo We need check and improve the "Granular Importer", some methods and classes probably can be simplified. $definition = new ProcessDefinitionMigrator(); $definition->afterImport($newData['tables']); From ca37e30b9ae311a0f30fe71b3959850dcfba0df6 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Thu, 16 Nov 2017 14:39:43 -0400 Subject: [PATCH 7/7] HOR-4073 --- workflow/engine/src/ProcessMaker/BusinessModel/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/User.php b/workflow/engine/src/ProcessMaker/BusinessModel/User.php index ede0ba28b..320963294 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/User.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/User.php @@ -807,7 +807,7 @@ class User } //Update in rbac - $rbac->load($userUid); + $rbac->userObj = new RbacUsers(); if (isset($arrayData["USR_ROLE"])) { $rbac->updateUser($arrayData, $arrayData["USR_ROLE"]); } else {