From 92e86f62cbb4dc6f05c08fcbb06ff7b4304aa9f1 Mon Sep 17 00:00:00 2001 From: m3ik0 Date: Fri, 9 Jan 2015 15:45:24 -0400 Subject: [PATCH 1/5] Were added the right input data. --- .../admin_setup/calendar/basic_sequence_calendar.feature | 4 ++-- .../admin_setup/calendar/main_tests_calendar.feature | 6 +++--- .../admin_setup/calendar/negative_tests_calendar.feature | 2 +- .../admin_setup/category/basic_sequence_category.feature | 6 +++--- .../admin_setup/category/main_tests_category.feature | 6 +++--- .../admin_setup/category/negative_tests_category.feature | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/features/backend/admin_setup/calendar/basic_sequence_calendar.feature b/features/backend/admin_setup/calendar/basic_sequence_calendar.feature index 5f4671381..021fa8480 100644 --- a/features/backend/admin_setup/calendar/basic_sequence_calendar.feature +++ b/features/backend/admin_setup/calendar/basic_sequence_calendar.feature @@ -14,7 +14,7 @@ Feature: Calendar Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 1 records + And the response has 2 records # POST /api/1.0/{workspace}/calendar @@ -121,4 +121,4 @@ Feature: Calendar Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 1 records \ No newline at end of file + And the response has 2 records \ No newline at end of file diff --git a/features/backend/admin_setup/calendar/main_tests_calendar.feature b/features/backend/admin_setup/calendar/main_tests_calendar.feature index 2050e44ed..d6429d219 100644 --- a/features/backend/admin_setup/calendar/main_tests_calendar.feature +++ b/features/backend/admin_setup/calendar/main_tests_calendar.feature @@ -14,7 +14,7 @@ Feature: Calendar Main Tests Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 1 records + And the response has 2 records # GET /api/1.0/{workspace}/calendar/ @@ -239,7 +239,7 @@ Feature: Calendar Main Tests Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 8 records + And the response has 9 records # DELETE /api/1.0/{workspace}/calendar @@ -268,4 +268,4 @@ Feature: Calendar Main Tests Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 1 records \ No newline at end of file + And the response has 2 records \ No newline at end of file diff --git a/features/backend/admin_setup/calendar/negative_tests_calendar.feature b/features/backend/admin_setup/calendar/negative_tests_calendar.feature index c761f9a44..60edfa0d7 100644 --- a/features/backend/admin_setup/calendar/negative_tests_calendar.feature +++ b/features/backend/admin_setup/calendar/negative_tests_calendar.feature @@ -182,4 +182,4 @@ Feature: Calendar Negative Tests Given that I want to delete a "Calendar" And I request "calendar/14606161052f50839307899033145440" Then the response status code should be 400 - And the response status message should have the following text "does not exist" \ No newline at end of file + And the response status message should have the following text "cannot be deleted" \ No newline at end of file diff --git a/features/backend/admin_setup/category/basic_sequence_category.feature b/features/backend/admin_setup/category/basic_sequence_category.feature index 08c39793a..b57d256f1 100644 --- a/features/backend/admin_setup/category/basic_sequence_category.feature +++ b/features/backend/admin_setup/category/basic_sequence_category.feature @@ -16,7 +16,7 @@ Feature: Process Category And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 0 records + And the response has 1 records # POST /api/1.0/{workspace}/project/category @@ -44,7 +44,7 @@ Feature: Process Category And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 1 records + And the response has 2 records # PUT /api/1.0/{workspace}/project/categories @@ -93,4 +93,4 @@ Feature: Process Category And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 0 records \ No newline at end of file + And the response has 1 records \ No newline at end of file diff --git a/features/backend/admin_setup/category/main_tests_category.feature b/features/backend/admin_setup/category/main_tests_category.feature index 63d0e35bc..2c73e4411 100644 --- a/features/backend/admin_setup/category/main_tests_category.feature +++ b/features/backend/admin_setup/category/main_tests_category.feature @@ -16,7 +16,7 @@ Feature: Process Category Main Test And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 0 records + And the response has 1 records # POST /api/1.0/{workspace}/project/category @@ -54,7 +54,7 @@ Feature: Process Category Main Test And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 7 records + And the response has 8 records # POST /api/1.0/{workspace}/project/category @@ -156,4 +156,4 @@ Feature: Process Category Main Test And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 0 records \ No newline at end of file + And the response has 1 records \ No newline at end of file diff --git a/features/backend/admin_setup/category/negative_tests_category.feature b/features/backend/admin_setup/category/negative_tests_category.feature index 0c9420dca..c4c8aff06 100644 --- a/features/backend/admin_setup/category/negative_tests_category.feature +++ b/features/backend/admin_setup/category/negative_tests_category.feature @@ -30,4 +30,4 @@ Feature: Process Category Negative Tests Given that I want to delete a "Category" And I request "project/category/4177095085330818c324501061677193" Then the response status code should be 400 - And the response status message should have the following text "does not exist" \ No newline at end of file + And the response status message should have the following text "cannot be deleted" \ No newline at end of file From dd8df0b82ce7995b28216568f2cf02384d2ea617 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Mon, 12 Jan 2015 09:46:10 -0400 Subject: [PATCH 2/5] PMDynaform --- workflow/engine/templates/cases/cases_Step_Pmdynaform.html | 1 - .../engine/templates/cases/cases_Step_Pmdynaform_Preview.html | 1 - workflow/engine/templates/cases/cases_Step_Pmdynaform_View.html | 1 - 3 files changed, 3 deletions(-) diff --git a/workflow/engine/templates/cases/cases_Step_Pmdynaform.html b/workflow/engine/templates/cases/cases_Step_Pmdynaform.html index c619734ba..1ee6b7148 100644 --- a/workflow/engine/templates/cases/cases_Step_Pmdynaform.html +++ b/workflow/engine/templates/cases/cases_Step_Pmdynaform.html @@ -9,7 +9,6 @@ - diff --git a/workflow/engine/templates/cases/cases_Step_Pmdynaform_Preview.html b/workflow/engine/templates/cases/cases_Step_Pmdynaform_Preview.html index e60e0ae33..e40bb2118 100644 --- a/workflow/engine/templates/cases/cases_Step_Pmdynaform_Preview.html +++ b/workflow/engine/templates/cases/cases_Step_Pmdynaform_Preview.html @@ -9,7 +9,6 @@ - diff --git a/workflow/engine/templates/cases/cases_Step_Pmdynaform_View.html b/workflow/engine/templates/cases/cases_Step_Pmdynaform_View.html index d3b74669c..87f9095c0 100644 --- a/workflow/engine/templates/cases/cases_Step_Pmdynaform_View.html +++ b/workflow/engine/templates/cases/cases_Step_Pmdynaform_View.html @@ -9,7 +9,6 @@ - From 2d915ff264998dea8af49ab023211cd7f227a802 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Mon, 12 Jan 2015 15:58:52 -0400 Subject: [PATCH 3/5] PMDynaform --- workflow/engine/classes/class.pmDynaform.php | 25 ----------- .../js/cases/core/cases_Step_Pmdynaform.js | 42 ++++++++++--------- .../cases/casesHistoryDynaformPage_Ajax.php | 2 - workflow/engine/methods/cases/cases_Step.php | 1 - .../cases/cases_Step_Pmdynaform_View.html | 25 ++++++++++- 5 files changed, 46 insertions(+), 49 deletions(-) diff --git a/workflow/engine/classes/class.pmDynaform.php b/workflow/engine/classes/class.pmDynaform.php index 396899e9e..9b84789c0 100644 --- a/workflow/engine/classes/class.pmDynaform.php +++ b/workflow/engine/classes/class.pmDynaform.php @@ -42,31 +42,6 @@ class pmDynaform return $this->record; } - public function getMergeValues() - { - $dataJSON = G::json_decode($this->record["DYN_CONTENT"]); - $dt = $dataJSON->items[0]->items; - $n = count($dt); - for ($i = 0; $i < $n; $i++) { - $dr = $dt[$i]; - $n2 = count($dr); - for ($j = 0; $j < $n2; $j++) { - if (isset($dr[$j]->name)) { - $valueField = isset($this->app_data[$dr[$j]->name]) ? $this->app_data[$dr[$j]->name] : ""; - $dataJSON->items[0]->items[$i][$j]->defaultValue = $valueField; - } - } - } - $a = G::json_encode($dataJSON); - $a = str_replace("\/", "/", $a); - return $a; - } - - public function mergeValues() - { - $this->record["DYN_CONTENT"] = $this->getMergeValues(); - } - public function isResponsive() { return $this->record != null && $this->record["DYN_VERSION"] == 2 ? true : false; diff --git a/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js b/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js index c00f8e6aa..9d6ab62f8 100644 --- a/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js +++ b/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js @@ -22,18 +22,6 @@ function dynaFormChanged(frm) { return false; } $(window).load(function () { - var data = jsondata; - window.dynaform = new PMDynaform.core.Project({ - data: data, - keys: { - server: location.host, - projectId: prj_uid, - workspace: workspace - }, - token: credentials, - submitRest: false - }); - if (pm_run_outside_main_app === 'true') { if (parent.showCaseNavigatorPanel) { parent.showCaseNavigatorPanel('DRAFT'); @@ -44,38 +32,54 @@ $(window).load(function () { } } - var form = document.getElementsByTagName("form")[0]; + var data = jsondata; + window.project = new PMDynaform.core.Project({ + data: data, + keys: { + server: location.host, + projectId: prj_uid, + workspace: workspace + }, + token: credentials, + submitRest: false + }); + new PMDynaform.core.Proxy({ + url: "http://" + window.project.keys.server + "/" + window.project.keys.apiName + "/" + window.project.keys.apiVersion + "/" + window.project.keys.workspace + "/cases/" + app_uid + "/variables", + method: 'GET', + data: {}, + keys: window.project.token, + successCallback: function (xhr, response) { + if (response[jsondata.name] && window.project.setData2) { + window.project.setData2(response[jsondata.name]); + } + } + }); var type = document.createElement("input"); type.type = "hidden"; type.name = "TYPE"; type.value = "ASSIGN_TASK"; - var uid = document.createElement("input"); uid.type = "hidden"; uid.name = "UID"; uid.value = dyn_uid; - var position = document.createElement("input"); position.type = "hidden"; position.name = "POSITION"; position.value = "10000"; - var action = document.createElement("input"); action.type = "hidden"; action.name = "ACTION"; action.value = "ASSIGN"; - var dynaformname = document.createElement("input"); dynaformname.type = "hidden"; dynaformname.name = "__DynaformName__"; dynaformname.value = __DynaformName__; - var appuid = document.createElement("input"); appuid.type = "hidden"; appuid.name = "APP_UID"; appuid.value = app_uid; - + var form = document.getElementsByTagName("form")[0]; form.action = "cases_SaveData?UID=" + dyn_uid + "&APP_UID=" + app_uid; form.method = "post"; form.appendChild(type); diff --git a/workflow/engine/methods/cases/casesHistoryDynaformPage_Ajax.php b/workflow/engine/methods/cases/casesHistoryDynaformPage_Ajax.php index 010eb4435..d48c7a3d0 100644 --- a/workflow/engine/methods/cases/casesHistoryDynaformPage_Ajax.php +++ b/workflow/engine/methods/cases/casesHistoryDynaformPage_Ajax.php @@ -385,7 +385,6 @@ if ($actionAjax == 'dynaformChangeLogViewHistory') { G::LoadClass('pmDynaform'); $a = new pmDynaform($_GET['DYN_UID'], $Fields['APP_DATA']); if ($a->isResponsive()) { - $a->mergeValues(); $a->printView((!isset($_SESSION["PM_RUN_OUTSIDE_MAIN_APP"])) ? "true" : "false", $_SESSION['APPLICATION']); } else { $G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view'); @@ -475,7 +474,6 @@ if ($actionAjax == 'historyDynaformGridPreview') { G::LoadClass('pmDynaform'); $a = new pmDynaform($_GET['DYN_UID'], $Fields['APP_DATA']); if ($a->isResponsive()) { - $a->mergeValues(); $a->printView((!isset($_SESSION["PM_RUN_OUTSIDE_MAIN_APP"])) ? "true" : "false", $_SESSION['APPLICATION']); } else { $G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view'); diff --git a/workflow/engine/methods/cases/cases_Step.php b/workflow/engine/methods/cases/cases_Step.php index c6e6748e3..7c524ea8c 100755 --- a/workflow/engine/methods/cases/cases_Step.php +++ b/workflow/engine/methods/cases/cases_Step.php @@ -264,7 +264,6 @@ try { G::LoadClass('pmDynaform'); $a = new pmDynaform($_GET['UID'], $Fields['APP_DATA']); if ($a->isResponsive()) { - $a->mergeValues(); $a->printEdit((!isset($_SESSION["PM_RUN_OUTSIDE_MAIN_APP"])) ? "true" : "false", $_SESSION['APPLICATION'], $array); } else { $G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['UID'], '', $Fields['APP_DATA'], 'cases_SaveData?UID=' . $_GET['UID'] . '&APP_UID=' . $_SESSION['APPLICATION'], '', (strtolower($oStep->getStepMode()) != 'edit' ? strtolower($oStep->getStepMode()) : '')); diff --git a/workflow/engine/templates/cases/cases_Step_Pmdynaform_View.html b/workflow/engine/templates/cases/cases_Step_Pmdynaform_View.html index 87f9095c0..cc553b6bd 100644 --- a/workflow/engine/templates/cases/cases_Step_Pmdynaform_View.html +++ b/workflow/engine/templates/cases/cases_Step_Pmdynaform_View.html @@ -24,10 +24,31 @@ var dyn_uid = '{DYN_UID}'; var __DynaformName__ = '{DYNAFORMNAME}'; var app_uid = '{APP_UID}'; + var prj_uid = '{PRJ_UID}'; + var workspace = '{WORKSPACE}'; + var credentials = {credentials}; $(window).load(function () { var data = jsondata; - window.dynaform = new PMDynaform.core.Project({ - data: data + window.project = new PMDynaform.core.Project({ + data: data, + keys: { + server: location.host, + projectId: prj_uid, + workspace: workspace + }, + token: credentials, + submitRest: false + }); + new PMDynaform.core.Proxy({ + url: "http://" + window.project.keys.server + "/" + window.project.keys.apiName + "/" + window.project.keys.apiVersion + "/" + window.project.keys.workspace + "/cases/" + app_uid + "/variables", + method: 'GET', + data: {}, + keys: window.project.token, + successCallback: function (xhr, response) { + if (response[jsondata.name] && window.project.setData2) { + window.project.setData2(response[jsondata.name]); + } + } }); $(document).find('form').submit(function (e) { e.preventDefault(); From ff322551f210bf67f22fbd577deba72e4fe38585 Mon Sep 17 00:00:00 2001 From: norahmollo Date: Tue, 13 Jan 2015 16:09:01 -0400 Subject: [PATCH 4/5] PM-1215 En IE no funciona el default flow. DOCTYPE html declarado --- workflow/engine/templates/designer/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/workflow/engine/templates/designer/index.html b/workflow/engine/templates/designer/index.html index 1bb60caac..ec8d3cc1a 100644 --- a/workflow/engine/templates/designer/index.html +++ b/workflow/engine/templates/designer/index.html @@ -1,3 +1,4 @@ + From 1b67af5a8553ad9c6be0d5c7ca4ecc5e7589d8fa Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Wed, 14 Jan 2015 10:31:38 -0400 Subject: [PATCH 5/5] PM-1165 "Fix Fatal error: Call to a member function getDynVersion()" --- workflow/engine/src/ProcessMaker/BusinessModel/Cases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index a042bc107..20d26716a 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1439,7 +1439,7 @@ class Cases $fields = $case->loadCase($app_uid); $_POST['form'] = $app_data; - if (!is_null($dyn_uid)) { + if (!is_null($dyn_uid) && $dyn_uid != '') { $oDynaform = \DynaformPeer::retrieveByPK($dyn_uid); if ($oDynaform->getDynVersion() < 2) {