From 4adf181b0d5b2976ca0619ed057ea8e2e557eb0d Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Tue, 21 Mar 2017 16:12:20 -0400 Subject: [PATCH 01/25] HOR-2679 --- workflow/engine/templates/cases/casesList.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/workflow/engine/templates/cases/casesList.js b/workflow/engine/templates/cases/casesList.js index 145c2ada9..a858becb3 100644 --- a/workflow/engine/templates/cases/casesList.js +++ b/workflow/engine/templates/cases/casesList.js @@ -1932,9 +1932,6 @@ Ext.onReady ( function() { var toolbarUnassigned = [ optionMenuOpen, - btnRead, - '-', - btnUnread, '-', btnAll, '->', // begin using the right-justified button container From b5a6a48d80904ed9e4a9f231ead9f5202aa4438e Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Mon, 27 Mar 2017 13:36:26 -0400 Subject: [PATCH 02/25] HOR-2880 --- gulliver/system/class.rbac.php | 2 ++ rbac/engine/data/mysql/insert.sql | 4 +++- workflow/engine/data/mysql/insert.sql | 3 ++- workflow/engine/menus/setup.php | 4 +++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gulliver/system/class.rbac.php b/gulliver/system/class.rbac.php index 257539841..9d5938f4b 100644 --- a/gulliver/system/class.rbac.php +++ b/gulliver/system/class.rbac.php @@ -283,6 +283,8 @@ class RBAC "PER_NAME" => "Edit User profile Default Cases Menu Options" ), array("PER_UID" => "00000000000000000000000000000064", "PER_CODE" => "PM_REASSIGNCASE_SUPERVISOR", "PER_NAME" => "Reassign case supervisor" + ), array("PER_UID" => "00000000000000000000000000000065", "PER_CODE" => "PM_SETUP_CUSTOM_CASES_LIST", + "PER_NAME" => "Setup Custom Cases List" ) ); return $permissionsAdmin; diff --git a/rbac/engine/data/mysql/insert.sql b/rbac/engine/data/mysql/insert.sql index 639a50eb3..87f76ab87 100644 --- a/rbac/engine/data/mysql/insert.sql +++ b/rbac/engine/data/mysql/insert.sql @@ -62,7 +62,8 @@ INSERT INTO `RBAC_PERMISSIONS` VALUES ('00000000000000000000000000000061','PM_EDIT_USER_PROFILE_PHOTO','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000062','PM_EDIT_USER_PROFILE_DEFAULT_MAIN_MENU_OPTIONS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'), ('00000000000000000000000000000063','PM_EDIT_USER_PROFILE_DEFAULT_CASES_MENU_OPTIONS','2016-07-18 00:00:00','2016-07-18 00:00:00',1,'00000000000000000000000000000002'), -('00000000000000000000000000000064','PM_REASSIGNCASE_SUPERVISOR','2016-09-01 00:00:00','2016-09-01 00:00:00',1,'00000000000000000000000000000002'); +('00000000000000000000000000000064','PM_REASSIGNCASE_SUPERVISOR','2016-09-01 00:00:00','2016-09-01 00:00:00',1,'00000000000000000000000000000002'), +('00000000000000000000000000000065','PM_SETUP_CUSTOM_CASES_LIST','2017-03-27 00:00:00','2017-03-27 00:00:00',1,'00000000000000000000000000000002'); INSERT INTO `RBAC_ROLES` VALUES ('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1), @@ -136,6 +137,7 @@ INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES ('00000000000000000000000000000002','00000000000000000000000000000062'), ('00000000000000000000000000000002','00000000000000000000000000000063'), ('00000000000000000000000000000002','00000000000000000000000000000064'), +('00000000000000000000000000000002','00000000000000000000000000000065'), ('00000000000000000000000000000003','00000000000000000000000000000001'), ('00000000000000000000000000000003','00000000000000000000000000000005'), ('00000000000000000000000000000003','00000000000000000000000000000040'), diff --git a/workflow/engine/data/mysql/insert.sql b/workflow/engine/data/mysql/insert.sql index 39c9117d5..1bc2e1ba4 100644 --- a/workflow/engine/data/mysql/insert.sql +++ b/workflow/engine/data/mysql/insert.sql @@ -68,7 +68,8 @@ INSERT INTO CONTENT (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG,CON_VALUE) VALUES ('PER_NAME','','00000000000000000000000000000061','en','Edit User profile Photo'), ('PER_NAME','','00000000000000000000000000000062','en','Edit User profile Default Main Menu Options'), ('PER_NAME','','00000000000000000000000000000063','en','Edit User profile Default Cases Menu Options'), -('PER_NAME','','00000000000000000000000000000064','en','Reassign case supervisor'); +('PER_NAME','','00000000000000000000000000000064','en','Reassign case supervisor'), +('PER_NAME','','00000000000000000000000000000065','en','Setup Custom Cases List'); INSERT INTO LANGUAGE (LAN_ID,LAN_LOCATION,LAN_NAME,LAN_NATIVE_NAME,LAN_DIRECTION,LAN_WEIGHT,LAN_ENABLED,LAN_CALENDAR) VALUES ('aa','','Afar','','L','0','0','GREGORIAN'), diff --git a/workflow/engine/menus/setup.php b/workflow/engine/menus/setup.php index b30304596..b7e8d941f 100644 --- a/workflow/engine/menus/setup.php +++ b/workflow/engine/menus/setup.php @@ -280,9 +280,11 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1) { if ($RBAC->userCanAccess('PM_SETUP_CASES_LIST_CACHE_BUILDER') == 1) { $G_TMP_MENU->AddIdRawOption( 'PMENTERPRISE', '../enterprise/addonsStore', - G::LoadTranslation('ID_MENU_NAME') .$licStatusMsg, + G::LoadTranslation('ID_MENU_NAME') . $licStatusMsg, '', '', 'plugins' ); + } + if ($RBAC->userCanAccess('PM_SETUP_CUSTOM_CASES_LIST') == 1) { $G_TMP_MENU->AddIdRawOption( 'CASES_LIST_SETUP', '../cases/casesListSetup', G::LoadTranslation('ID_CUSTOM_CASES_LISTS'), From d1ddfdbd2993778dd334d5067aa76045cd517c45 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Tue, 28 Mar 2017 08:48:00 -0400 Subject: [PATCH 03/25] HOR-2765 [3.3] SQL query error inside "Cases List Cache Builder" --- workflow/engine/methods/setup/appCacheViewAjax.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/workflow/engine/methods/setup/appCacheViewAjax.php b/workflow/engine/methods/setup/appCacheViewAjax.php index 454f084f7..4c6f758d0 100644 --- a/workflow/engine/methods/setup/appCacheViewAjax.php +++ b/workflow/engine/methods/setup/appCacheViewAjax.php @@ -165,16 +165,6 @@ switch ($request) { } else { $result->info[] = array('name' => 'Error', 'value' => $res['msg']); } - - $res = $appCache->setSuperForUser($currentUser); - if (!isset($res['error'])) { - $result->info[] = array('name' => G::LoadTranslation('ID_SETTING_SUPER'), 'value' => G::LoadTranslation('ID_SUCCESSFULLY')); - } else { - $result->error = true; - $result->errorMsg = $res['msg']; - } - $currentUserIsSuper = true; - } //now check if table APPCACHEVIEW exists, and it have correct number of fields, etc. From 31e5e5cb5de1c88e35450213ea38a0fde92560a0 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Wed, 5 Apr 2017 15:46:49 -0400 Subject: [PATCH 04/25] HOR-2627 Update Trigger Wizard to include all parameters in the PMFGenerateOutputDocument() function --- workflow/engine/classes/class.pmFunctions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index c608d430b..ba56e520c 100644 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -1722,6 +1722,9 @@ function PMFAddInputDocument( * @label PMF Generate Output Document * * @param string(32) | $outputID | Output ID | Output Document ID + * @param string(32) | $sApplication = null | Case ID | The unique ID for a case + * @param string(32) | $index = null | Index | Value for Index + * @param string(32) | $sUserLogged = null | User UID | User Logged UID * @return none | $none | None | None * */ From 75964f946a804d2ba67ec2fda90481e5b39c6167 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Tue, 4 Apr 2017 15:24:25 -0400 Subject: [PATCH 05/25] HOR-2431 0021805: Email Alias not working in Email Notifications --- workflow/engine/classes/class.spool.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.spool.php b/workflow/engine/classes/class.spool.php index ce9b24f77..5df8cb1bd 100644 --- a/workflow/engine/classes/class.spool.php +++ b/workflow/engine/classes/class.spool.php @@ -86,8 +86,8 @@ class spoolRun $this->ExceptionCode['WARNING'] = 2; $this->ExceptionCode['NOTICE'] = 3; - $this->longMailEreg = "/(.*)(<([\w\-\.']+@[\w\-_\.]+\.\w{2,5})+>)/"; - $this->mailEreg = "/^([\w\-_\.']+@[\w\-_\.]+\.\w{2,5}+)$/"; + $this->longMailEreg = "/(.*)(<([\w\-\+\.']+@[\w\-_\.]+\.\w{2,5})+>)/"; + $this->mailEreg = "/^([\w\-_\+\.']+@[\w\-_\.]+\.\w{2,5}+)$/"; } /** From 2599f48cede9fd681d8d959f6fe3b84132e8d887 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Mon, 10 Apr 2017 11:38:30 -0400 Subject: [PATCH 06/25] HOR-1799 Trigger Wizard: Si se dejan en blanco algunos campos no requeridos los triggers no funcionan correctamente --- workflow/engine/classes/class.pmFunctions.php | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index c608d430b..f48eaaf88 100644 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -2540,7 +2540,7 @@ function PMFRedirectToStep ($sApplicationUID, $iDelegation, $sStepType, $sStepUi * @return array | $array | List of users | Return a list of users * */ -function PMFGetNextAssignedUser ($application, $task, $delIndex = null, $userUid = null) +function PMFGetNextAssignedUser($application, $task, $delIndex = null, $userUid = null) { require_once 'classes/model/AppDelegation.php'; @@ -2551,33 +2551,34 @@ function PMFGetNextAssignedUser ($application, $task, $delIndex = null, $userUid require_once 'classes/model/GroupUser.php'; $oTask = new Task(); - $TaskFields = $oTask->load( $task ); + $TaskFields = $oTask->load($task); $typeTask = $TaskFields['TAS_ASSIGN_TYPE']; $g = new G(); $g->sessionVarSave(); - $_SESSION['INDEX'] = (!is_null($delIndex) ? $delIndex : (isset($_SESSION['INDEX']) ? $_SESSION['INDEX'] : null)); - $_SESSION['USER_LOGGED'] = (!is_null($userUid) ? $userUid : (isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : null)); + $_SESSION['INDEX'] = (!empty($delIndex) ? $delIndex : (isset($_SESSION['INDEX']) ? $_SESSION['INDEX'] : null)); + $_SESSION['USER_LOGGED'] = (!empty($userUid) ? $userUid : (isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] + : null)); if ($typeTask == 'BALANCED' && !is_null($_SESSION['INDEX']) && !is_null($_SESSION['USER_LOGGED'])) { - G::LoadClass( 'derivation' ); + G::LoadClass('derivation'); $oDerivation = new Derivation(); - $aDeriv = $oDerivation->prepareInformation( array ('USER_UID' => $_SESSION['USER_LOGGED'],'APP_UID' => $application,'DEL_INDEX' => $_SESSION['INDEX'] - ) ); + $aDeriv = $oDerivation->prepareInformation(array('USER_UID' => $_SESSION['USER_LOGGED'], 'APP_UID' => $application, 'DEL_INDEX' => $_SESSION['INDEX'] + )); foreach ($aDeriv as $derivation) { - $aUser = array ('USR_UID' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_UID'],'USR_USERNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_USERNAME'],'USR_FIRSTNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_FIRSTNAME'],'USR_LASTNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_LASTNAME'],'USR_EMAIL' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_EMAIL'] + $aUser = array('USR_UID' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_UID'], 'USR_USERNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_USERNAME'], 'USR_FIRSTNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_FIRSTNAME'], 'USR_LASTNAME' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_LASTNAME'], 'USR_EMAIL' => $derivation['NEXT_TASK']['USER_ASSIGNED']['USR_EMAIL'] ); $aUsers[] = $aUser; } $g->sessionVarRestore(); - if (count( $aUsers ) == 1) { + if (count($aUsers) == 1) { return $aUser; } else { return $aUsers; @@ -3279,10 +3280,10 @@ function PMFGetDynaformUID($dynaFormName, $processUid = null) return false; } - $arrayResult = PMFGetUidFromText($dynaFormName, 'DYN_TITLE', (!is_null($processUid))? $processUid : $_SESSION['PROCESS']); + $arrayResult = PMFGetUidFromText($dynaFormName, 'DYN_TITLE', (!empty($processUid)) ? $processUid : $_SESSION['PROCESS']); //Return - return (!empty($arrayResult))? array_shift($arrayResult) : false; + return (!empty($arrayResult)) ? array_shift($arrayResult) : false; } /** @@ -3347,7 +3348,8 @@ function PMFGetTaskUID($taskName, $processUid = null) $criteria->addSelectColumn(TaskPeer::TAS_UID); $criteria->add(TaskPeer::TAS_TITLE, $taskName, Criteria::EQUAL); - $criteria->add(TaskPeer::PRO_UID, (!is_null($processUid))? $processUid : $_SESSION['PROCESS'], Criteria::EQUAL); + $criteria->add(TaskPeer::PRO_UID, (!empty($processUid)) ? $processUid : $_SESSION['PROCESS'], + Criteria::EQUAL); $rsCriteria = TaskPeer::doSelectRS($criteria); $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); @@ -3359,7 +3361,7 @@ function PMFGetTaskUID($taskName, $processUid = null) } //Return - return ($taskUid != '')? $taskUid : false; + return ($taskUid != '') ? $taskUid : false; } /** @@ -3501,15 +3503,14 @@ function PMFCaseLink($caseUid, $workspace = null, $language = null, $skin = null if ($arrayApplicationData === false) { return false; } - - $workspace = (!is_null($workspace))? $workspace : SYS_SYS; - $language = (!is_null($language))? $language : SYS_LANG; - $skin = (!is_null($skin))? $skin : SYS_SKIN; + $workspace = (!empty($workspace)) ? $workspace : SYS_SYS; + $language = (!empty($language)) ? $language : SYS_LANG; + $skin = (!empty($skin)) ? $skin : SYS_SKIN; $uri = '/sys' . $workspace . '/' . $language . '/' . $skin . '/cases/opencase/' . $caseUid; //Return - return ((G::is_https())? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $uri; + return ((G::is_https()) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $uri; } catch (Exception $e) { throw $e; } @@ -3707,7 +3708,7 @@ function PMFCopyDocumentCase($appDocUid, $versionNumber, $targetCaseUid, $inputD "APP_UID" => $targetCaseUid, "DEL_INDEX" => $dataFields['DEL_INDEX'], "USR_UID" => $dataFields['USR_UID'], - "DOC_UID" => ($inputDocumentUid != null) ? $inputDocumentUid : $dataFields['DOC_UID'], + "DOC_UID" => (!empty($inputDocumentUid)) ? $inputDocumentUid : $dataFields['DOC_UID'], "APP_DOC_TYPE" => $dataFields['APP_DOC_TYPE'], "APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"), "APP_DOC_COMMENT" => $dataFields['APP_DOC_COMMENT'], From 174f4d632e876c10baddb49edb06abf9ba9e4712 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Fri, 21 Apr 2017 15:03:02 -0400 Subject: [PATCH 07/25] HOR-2307 --- workflow/engine/src/ProcessMaker/BusinessModel/User.php | 8 ++++++-- workflow/engine/src/ProcessMaker/Services/Api/User.php | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/User.php b/workflow/engine/src/ProcessMaker/BusinessModel/User.php index 6fdb70486..49877e155 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/User.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/User.php @@ -1140,6 +1140,7 @@ class User * @param bool $flagRecord Flag that set the "getting" of record * @param bool $throwException Flag to throw the exception (This only if the parameters are invalid) * (TRUE: throw the exception; FALSE: returns FALSE) + * @param string $status The user's status, which can be "ACTIVE", "INACTIVE" or "VACATION" * * @return array Return an array with all Users, ThrowTheException/FALSE otherwise */ @@ -1150,7 +1151,8 @@ class User $start = null, $limit = null, $flagRecord = true, - $throwException = true + $throwException = true, + $status = null ) { try { $arrayUser = array(); @@ -1210,7 +1212,9 @@ class User $criteria->add($value[0], $value[1], $value[2]); } } else { - $criteria->add(\UsersPeer::USR_STATUS, 'ACTIVE', \Criteria::EQUAL); + if (!is_null($status)) { + $criteria->add(\UsersPeer::USR_STATUS, uppercase($status), \Criteria::EQUAL); + } } if ($flagFilter && trim($arrayWhere['filter']) != '') { diff --git a/workflow/engine/src/ProcessMaker/Services/Api/User.php b/workflow/engine/src/ProcessMaker/Services/Api/User.php index 6f0b6081e..cc5c50985 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/User.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/User.php @@ -21,7 +21,7 @@ class User extends Api * @class AccessControl {@permission PM_USERS,PM_FACTORY} * @url GET */ - public function index($filter = null, $lfilter = null, $rfilter = null, $start = null, $limit = null) + public function index($filter = null, $lfilter = null, $rfilter = null, $start = null, $limit = null, $status = null) { try { $user = new \ProcessMaker\BusinessModel\User(); @@ -32,7 +32,7 @@ class User extends Api "filterOption" => (!is_null($filter))? "" : ((!is_null($lfilter))? "LEFT" : ((!is_null($rfilter))? "RIGHT" : "")) ); - $response = $user->getUsers($arrayFilterData, null, null, $start, $limit, false); + $response = $user->getUsers($arrayFilterData, null, null, $start, $limit, false, true, $status); return \ProcessMaker\Util\DateTime::convertUtcToIso8601($response['data'], $this->arrayFieldIso8601); } catch (\Exception $e) { From eab5c8411f58bc4acf375110146c1fd6e95ff9e9 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Fri, 21 Apr 2017 15:35:04 -0400 Subject: [PATCH 08/25] HOR-3017 --- workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php | 1 + workflow/engine/templates/processes/webentryPost.tpl | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php index d6e6add93..a87056233 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php @@ -406,6 +406,7 @@ class WebEntry $fileContent .= "\$_SESSION[\"PROCESS\"] = \"" . $processUid . "\";\n"; $fileContent .= "\$_SESSION[\"CURRENT_DYN_UID\"] = \"" . $dynaFormUid . "\";\n"; $fileContent .= "\$G_PUBLISH = new Publisher();\n"; + $fileContent .= "\$_SESSION[\"__submitFormWebEntry__\"] = false;\n"; $fileContent .= "G::LoadClass(\"pmDynaform\");\n"; $fileContent .= "\$a = new pmDynaform(array(\"CURRENT_DYNAFORM\" => \"" . $arrayWebEntryData["DYN_UID"] . "\"));\n"; diff --git a/workflow/engine/templates/processes/webentryPost.tpl b/workflow/engine/templates/processes/webentryPost.tpl index 85c80bee2..b9f29befe 100644 --- a/workflow/engine/templates/processes/webentryPost.tpl +++ b/workflow/engine/templates/processes/webentryPost.tpl @@ -16,6 +16,11 @@ define("WS_USER_PASS", "{wsPass}"); define("WS_ROUNDROBIN", "{wsRoundRobin}"); try { + if (isset($_SESSION["__submitFormWebEntry__"]) && $_SESSION["__submitFormWebEntry__"] === true) { + header("location:/sysworkflow/en/neoclassic/84823022258da8428b8bae5013752026/11315111158da8453481cb0056624392.php"); + exit(); + } + @include_once ("wsClient.php"); if (!function_exists("ws_open")){ @@ -196,6 +201,7 @@ try { $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent("xmlform", "xmlform", "login/showInfo", "", $aMessage); G::RenderPage("publish", "blank"); + $_SESSION["__submitFormWebEntry__"] = true; } catch (Exception $e) { $G_PUBLISH = new Publisher(); $suggest_message = "This web entry should be regenerated, please contact to your system administrator."; From 90a8a96c02329f0e23bb890d0cb0a7a2cef9c807 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Fri, 21 Apr 2017 16:14:19 -0400 Subject: [PATCH 09/25] HOR-3017 --- workflow/engine/templates/processes/webentryPost.tpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/workflow/engine/templates/processes/webentryPost.tpl b/workflow/engine/templates/processes/webentryPost.tpl index b9f29befe..2cbccfb60 100644 --- a/workflow/engine/templates/processes/webentryPost.tpl +++ b/workflow/engine/templates/processes/webentryPost.tpl @@ -17,7 +17,9 @@ define("WS_ROUNDROBIN", "{wsRoundRobin}"); try { if (isset($_SESSION["__submitFormWebEntry__"]) && $_SESSION["__submitFormWebEntry__"] === true) { - header("location:/sysworkflow/en/neoclassic/84823022258da8428b8bae5013752026/11315111158da8453481cb0056624392.php"); + $G_PUBLISH = new Publisher(); + $G_PUBLISH->AddContent("xmlform", "xmlform", "login/showInfo", "", $_SESSION["__submitFormWebEntryData__"]); + G::RenderPage("publish", "blank"); exit(); } @@ -202,6 +204,7 @@ try { $G_PUBLISH->AddContent("xmlform", "xmlform", "login/showInfo", "", $aMessage); G::RenderPage("publish", "blank"); $_SESSION["__submitFormWebEntry__"] = true; + $_SESSION["__submitFormWebEntryData__"] = $aMessage; } catch (Exception $e) { $G_PUBLISH = new Publisher(); $suggest_message = "This web entry should be regenerated, please contact to your system administrator."; From fc10cccd79be014493e9078d6d05d01dcc484ab1 Mon Sep 17 00:00:00 2001 From: qronald Date: Mon, 24 Apr 2017 09:42:47 -0400 Subject: [PATCH 10/25] HOR-1043 --- workflow/engine/classes/class.case.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 51837f16f..46344aec7 100644 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -2331,7 +2331,9 @@ class Cases $rs->next(); $row = $rs->getRow(); $iLastStep = intval($row[0]); - + if($iPosition > $iLastStep) { + throw (new Exception(G::LoadTranslation("ID_NO_RECORDS_FOUND"))); + } $iPosition += 1; $aNextStep = null; if ($iPosition <= $iLastStep) { From f341e2a8e606b0369e9cf44db1f6c60e754dae6b Mon Sep 17 00:00:00 2001 From: qronald Date: Tue, 25 Apr 2017 09:49:02 -0400 Subject: [PATCH 11/25] up observations --- workflow/engine/classes/class.case.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 46344aec7..828c1e9f4 100644 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -2331,8 +2331,8 @@ class Cases $rs->next(); $row = $rs->getRow(); $iLastStep = intval($row[0]); - if($iPosition > $iLastStep) { - throw (new Exception(G::LoadTranslation("ID_NO_RECORDS_FOUND"))); + if ($iPosition > $iLastStep) { + throw (new Exception(G::LoadTranslation('ID_STEP_DOES_NOT_EXIST', array(G::LoadTranslation('ID_POSITION'), $iPosition)))); } $iPosition += 1; $aNextStep = null; From 548b481a1e84344103b4ae193c2678a0ac4d9508 Mon Sep 17 00:00:00 2001 From: qronald Date: Tue, 25 Apr 2017 12:13:42 -0400 Subject: [PATCH 12/25] HOR-1231 --- workflow/engine/classes/class.case.php | 4 +--- workflow/engine/classes/model/Application.php | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 51837f16f..8f1640476 100644 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -2299,9 +2299,7 @@ class Cases G::LoadClass('pmScript'); $oPMScript = new PMScript(); $oApplication = new Application(); - //$aFields = $oApplication->load($sAppUid); - $oApplication = ApplicationPeer::retrieveByPk($sAppUid); - $aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME); + $aFields = $oApplication->Load($sAppUid); if (!is_array($aFields['APP_DATA'])) { $aFields['APP_DATA'] = G::array_merges(G::getSystemConstants(), unserialize($aFields['APP_DATA'])); } diff --git a/workflow/engine/classes/model/Application.php b/workflow/engine/classes/model/Application.php index 1159ea10e..562bef8c2 100644 --- a/workflow/engine/classes/model/Application.php +++ b/workflow/engine/classes/model/Application.php @@ -189,9 +189,6 @@ class Application extends BaseApplication try { $oApplication = ApplicationPeer::retrieveByPK( $AppUid ); - if (!$oApplication) { - return false; - } if (is_object($oApplication) && get_class ($oApplication) == 'Application' ) { $aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME); $this->fromArray($aFields, BasePeer::TYPE_FIELDNAME); From 6964b2e9c2ea85ff96b1f56388e776e2edd36963 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Thu, 27 Apr 2017 07:26:30 -0400 Subject: [PATCH 13/25] HOR-748 --- .../engine/src/ProcessMaker/Services/Api/Project/Activity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity.php index 27929c6f4..e55585094 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity.php @@ -318,7 +318,7 @@ class ActivityPropertiesStructure public $tas_calendar; /** - * @var string {@from body} {@choice NORMAL,ADHOC} + * @var string {@from body} {@choice NORMAL,ADHOC,SUBPROCESS} */ public $tas_type; From e6f89e1b88d8ad8e57820abedfa770acac8e0c94 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Wed, 3 May 2017 10:44:37 -0400 Subject: [PATCH 14/25] HOR-3082 --- workflow/engine/classes/class.derivation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php index 716954179..60e226529 100644 --- a/workflow/engine/classes/class.derivation.php +++ b/workflow/engine/classes/class.derivation.php @@ -1016,8 +1016,8 @@ class Derivation $criteria->addSelectColumn(RoutePeer::TAS_UID); $criteria->addJoin(RoutePeer::TAS_UID, AppDelegationPeer::TAS_UID); $criteria->add(RoutePeer::PRO_UID, $appFields['PRO_UID']); - $criteria->add(RoutePeer::ROU_NEXT_TASK, $nextDel['ROU_PREVIOUS_TASK']); - $criteria->add(RoutePeer::ROU_TYPE, $nextDel['ROU_PREVIOUS_TYPE']); + $criteria->add(RoutePeer::ROU_NEXT_TASK, isset($nextDel['ROU_PREVIOUS_TASK']) ? $nextDel['ROU_PREVIOUS_TASK'] : ''); + $criteria->add(RoutePeer::ROU_TYPE, isset($nextDel['ROU_PREVIOUS_TYPE']) ? $nextDel['ROU_PREVIOUS_TYPE'] : ''); $criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN'); $rsCriteria = RoutePeer::doSelectRS($criteria); $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); From 650d7051a72f1f4efdad73b289dd2085d6e33b55 Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Thu, 4 May 2017 09:56:34 -0400 Subject: [PATCH 15/25] HOR-1697 System Settings: Se aceptan valores reales/negativos en los campos: "MemoryLimit, CookieLifetime y DefaultUserExpiryDate" --- workflow/engine/controllers/adminProxy.php | 65 +++++++++---- workflow/engine/templates/admin/system.js | 106 ++++++++++----------- 2 files changed, 97 insertions(+), 74 deletions(-) diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index df7d0b660..22c365dc6 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -27,28 +27,18 @@ class adminProxy extends HttpProxyController { const hashunlink = 'unlink'; + /** + * Save configurations of systemConf + * @param $httpData + * @throws Exception + */ public function saveSystemConf($httpData) { G::loadClass('system'); $envFile = PATH_CONFIG . 'env.ini'; $updateRedirector = false; $restart = false; - - if (!file_exists($envFile) ) { - if (!is_writable(PATH_CONFIG)) { - throw new Exception('The enviroment config directory is not writable.
Please give write permission to directory: /workflow/engine/config'); - } - $content = ";\r\n"; - $content .= "; ProcessMaker System Bootstrap Configuration\r\n"; - $content .= ";\r\n"; - file_put_contents($envFile, $content); - //@chmod($envFile, 0777); - } else { - if (!is_writable($envFile)) { - throw new Exception('The enviroment ini file file is not writable.
Please give write permission to file: /workflow/engine/config/env.ini'); - } - } - + self::validateDataSystemConf($httpData, $envFile); $sysConf = System::getSystemConfiguration($envFile); $updatedConf = array(); @@ -1536,5 +1526,46 @@ class adminProxy extends HttpProxyController G::streamFile($support, true); G::rm_dir($support); } -} + /** + * Validate data before saving + * @param $httpData + * @param $envFile + * @throws Exception + */ + public static function validateDataSystemConf($httpData, $envFile) + { + if (!((is_numeric($httpData->memory_limit)) && ((int)$httpData->memory_limit == $httpData->memory_limit) && + ((int)$httpData->memory_limit >= -1)) + ) { + throw new Exception('The Memory Limit has to be either a positive integer or -1 '); + } + + if (!((is_numeric($httpData->max_life_time)) && ((int)$httpData->max_life_time == $httpData->max_life_time) && + ((int)$httpData->max_life_time > 0)) + ) { + throw new Exception('The Max Lifetime has to be either a positive integer '); + } + + if (!((is_numeric($httpData->expiration_year)) && ((int)$httpData->expiration_year == $httpData->expiration_year) && + ((int)$httpData->expiration_year > 0)) + ) { + throw new Exception('The Default Expiration Year has to be either a positive integer'); + } + + if (!file_exists($envFile)) { + if (!is_writable(PATH_CONFIG)) { + throw new Exception('The enviroment config directory is not writable.
Please give write permission to directory: /workflow/engine/config'); + } + $content = ";\r\n"; + $content .= "; ProcessMaker System Bootstrap Configuration\r\n"; + $content .= ";\r\n"; + file_put_contents($envFile, $content); + //@chmod($envFile, 0777); + } else { + if (!is_writable($envFile)) { + throw new Exception('The enviroment ini file is not writable.
Please give write permission to file: /workflow/engine/config/env.ini'); + } + } + } +} \ No newline at end of file diff --git a/workflow/engine/templates/admin/system.js b/workflow/engine/templates/admin/system.js index 0b6879df7..7dc38aa8e 100644 --- a/workflow/engine/templates/admin/system.js +++ b/workflow/engine/templates/admin/system.js @@ -85,32 +85,6 @@ Ext.onReady(function(){ cmbTimeZone.setValue(sysConf.time_zone); - txtExpirationYear = new Ext.form.TextField({ - xtype: 'numberfield', - id : 'expiration_year', - name : 'expiration_year', - fieldLabel: _('ID_DEFAULT_EXPIRATION_YEAR'), - allowBlank: false, - allowNegative: false, - value: 1, - maxlength: 15, - minValue: 1, - validator: function(value){ - if(value > 0) { - return true; - } else { - PMExt.error( _('ID_ERROR'), _('ID_INVALID_VALUE_EXPECTING_POSITIVE_INTEGER', _('ID_DEFAULT_EXPIRATION_YEAR'))); - return false; - } - }, - listeners:{ - change: function(){ - changeSettings(); - } - } - }); - txtExpirationYear.setValue(sysConf.expiration_year); - saveButton = new Ext.Action({ text : _('ID_SAVE_SETTINGS'), disabled : true, @@ -118,38 +92,56 @@ Ext.onReady(function(){ }); xfieldsUp = new Ext.form.FieldSet({ - title: _('ID_SYSTEM_SETTINGS'), - items : [ - cmbTimeZone, - { - xtype: 'numberfield', - id : 'memory_limit', - name : 'memory_limit', - fieldLabel: _('ID_MEMORY_LIMIT'), - allowBlank: false, - autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15 }, - value: sysConf.memory_limit, - listeners:{ - change: function(){ - changeSettings(); + title: _('ID_SYSTEM_SETTINGS'), + items: [ + cmbTimeZone, + { + xtype: 'numberfield', + id: 'memory_limit', + name: 'memory_limit', + fieldLabel: _('ID_MEMORY_LIMIT'), + allowBlank: false, + allowDecimals: false, + minValue: -1, + autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15}, + value: sysConf.memory_limit, + listeners: { + change: function () { + changeSettings(); + } + } + }, { + xtype: 'numberfield', + id: 'max_life_time', + name: 'max_life_time', + fieldLabel: _('ID_MAX_LIFETIME'), + allowNegative: false, + allowDecimals: false, + autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15}, + value: sysConf.session_gc_maxlifetime, + listeners: { + change: function () { + changeSettings(); + } + } + }, { + xtype: 'numberfield', + id: 'expiration_year', + name: 'expiration_year', + fieldLabel: _('ID_DEFAULT_EXPIRATION_YEAR'), + allowBlank: false, + allowNegative: false, + allowDecimals: false, + value: sysConf.expiration_year, + maxlength: 15, + minValue: 1, + listeners: { + change: function () { + changeSettings(); + } + } } - } - }, { - xtype: 'numberfield', - id : 'max_life_time', - name : 'max_life_time', - fieldLabel: _('ID_MAX_LIFETIME'), - // allowBlank: false, - autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15 }, - value: sysConf.session_gc_maxlifetime, - listeners:{ - change: function(){ - changeSettings(); - } - } - } - ,txtExpirationYear - ] + ] }); xfieldsBelow = new Ext.form.FieldSet({ From 87de43d90acff22e56162da5b2e5c96eecaa2593 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Thu, 4 May 2017 10:59:38 -0400 Subject: [PATCH 16/25] HOR-3017 --- workflow/engine/classes/class.processMap.php | 4 +- .../processes/processes_webEntryGenerate.php | 24 +++++++++++- .../ProcessMaker/BusinessModel/WebEntry.php | 38 ++++++++++++++----- .../templates/processes/webentryPost.tpl | 19 ++-------- 4 files changed, 59 insertions(+), 26 deletions(-) diff --git a/workflow/engine/classes/class.processMap.php b/workflow/engine/classes/class.processMap.php index e25409106..b5546c23f 100644 --- a/workflow/engine/classes/class.processMap.php +++ b/workflow/engine/classes/class.processMap.php @@ -2916,13 +2916,15 @@ class processMap if ($archivo != '..') { $one = 0; $two = 0; + $three = 0; $alink = $link . $archivo; $one = count(explode('wsClient.php', $archivo)); $two = count(explode('Post.php', $archivo)); + $three = count(explode('Info.php', $archivo)); - if ($one == 1 && $two == 1) { + if ($one == 1 && $two == 1 && $three == 1) { $arlink = "" . $alink . ""; $linkdelete = sprintf("delete", $alink, $archivo, $sProcessUID); $row[] = array('W_LINK' => $arlink, 'W_FILENAME' => $archivo, 'W_PRO_UID' => $sProcessUID ); diff --git a/workflow/engine/methods/processes/processes_webEntryGenerate.php b/workflow/engine/methods/processes/processes_webEntryGenerate.php index 551c0cd87..7e42df04b 100644 --- a/workflow/engine/methods/processes/processes_webEntryGenerate.php +++ b/workflow/engine/methods/processes/processes_webEntryGenerate.php @@ -60,7 +60,28 @@ try { $sContent .= "\$G_PUBLISH->AddContent('dynaform', 'xmlform', '" . $sPRO_UID . '/' . $sDYNAFORM . "', '', array(), '" . $dynTitle . 'Post.php' . "');\n"; $sContent .= "G::RenderPage('publish', 'blank');"; file_put_contents( $pathProcess . $dynTitle . '.php', $sContent ); - //creating the second file, the post file who receive the post form. + + //Create file to display information and prevent resubmission data (Post/Redirect/Get). + $fileNamePreventResubmission = $pathProcess . $dynTitle . "Info.php"; + $filePreventResubmission = "" + . "AddContent(\"xmlform\", \"xmlform\", \$show, \"\", \$message);\n" + . "G::RenderPage(\"publish\", \"blank\");\n" + . "\n"; + file_put_contents($fileNamePreventResubmission, $filePreventResubmission); + +//creating the second file, the post file who receive the post form. $pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl'; $template = new TemplatePower( $pluginTpl ); $template->prepare(); @@ -72,6 +93,7 @@ try { $template->assign( 'wsUser', $sWS_USER ); $template->assign( 'wsPass', Bootstrap::hashPassword($sWS_PASS, '', true) ); $template->assign( 'wsRoundRobin', $sWS_ROUNDROBIN ); + $template->assign( 'weTitle', $dynTitle); G::auditLog('WebEntry','Generate web entry with web services ('.$dynTitle.'.php) in process "'.$resultProcess['PRO_TITLE'].'"'); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php index a87056233..91c5ef326 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php @@ -398,27 +398,46 @@ class WebEntry $weTitle = $this->sanitizeFilename($arrayWebEntryData["WE_TITLE"]); $fileName = $weTitle; - $fileContent = " \"" . $arrayWebEntryData["DYN_UID"] . "\"));\n"; - $fileContent .= "if (\$a->isResponsive()) {"; - $fileContent .= " \$a->printWebEntry(\"" . $fileName . "Post.php\");"; - $fileContent .= "} else {"; - $fileContent .= " \$G_PUBLISH->AddContent(\"dynaform\", \"xmlform\", \"" . $processUid . PATH_SEP . $dynaFormUid . "\", \"\", array(), \"" . $fileName . "Post.php\");\n"; - $fileContent .= " G::RenderPage(\"publish\", \"blank\");"; - $fileContent .= "}"; + $fileContent .= "if (\$a->isResponsive()) {\n"; + $fileContent .= " \$a->printWebEntry(\"" . $fileName . "Post.php\");\n"; + $fileContent .= "} else {\n"; + $fileContent .= " \$G_PUBLISH->AddContent(\"dynaform\", \"xmlform\", \"" . $processUid . PATH_SEP . $dynaFormUid . "\", \"\", array(), \"" . $fileName . "Post.php\");\n"; + $fileContent .= " G::RenderPage(\"publish\", \"blank\");\n"; + $fileContent .= "}\n"; file_put_contents($pathDataPublicProcess . PATH_SEP . $fileName . ".php", $fileContent); + //Create file to display information and prevent resubmission data (Post/Redirect/Get). + $fileNamePreventResubmission = $pathDataPublicProcess . PATH_SEP . $weTitle . "Info.php"; + $filePreventResubmission = "" + . "AddContent(\"xmlform\", \"xmlform\", \$show, \"\", \$message);\n" + . "G::RenderPage(\"publish\", \"blank\");\n" + . "\n"; + file_put_contents($fileNamePreventResubmission, $filePreventResubmission); + //Creating the second file, the post file who receive the post form. $pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentryPost.tpl"; @@ -433,6 +452,7 @@ class WebEntry $template->assign("wsUser", $usrUsername); $template->assign("wsPass", \Bootstrap::getPasswordHashType() . ':' . $usrPassword); $template->assign("wsRoundRobin", $wsRoundRobin); + $template->assign("weTitle", $weTitle); if ($webEntryInputDocumentAccess == 0) { //Restricted to process permissions diff --git a/workflow/engine/templates/processes/webentryPost.tpl b/workflow/engine/templates/processes/webentryPost.tpl index 92785f237..ae6b5f0a2 100644 --- a/workflow/engine/templates/processes/webentryPost.tpl +++ b/workflow/engine/templates/processes/webentryPost.tpl @@ -16,13 +16,6 @@ define("WS_USER_PASS", "{wsPass}"); define("WS_ROUNDROBIN", "{wsRoundRobin}"); try { - if (isset($_SESSION["__submitFormWebEntry__"]) && $_SESSION["__submitFormWebEntry__"] === true) { - $G_PUBLISH = new Publisher(); - $G_PUBLISH->AddContent("xmlform", "xmlform", "login/showInfo", "", $_SESSION["__submitFormWebEntryData__"]); - G::RenderPage("publish", "blank"); - exit(); - } - @include_once ("wsClient.php"); if (!function_exists("ws_open")){ @@ -200,15 +193,11 @@ try { exit( 0 ); } /*----------------------------------********---------------------------------*/ - $G_PUBLISH = new Publisher(); - $G_PUBLISH->AddContent("xmlform", "xmlform", "login/showInfo", "", $aMessage); - G::RenderPage("publish", "blank"); - $_SESSION["__submitFormWebEntry__"] = true; - $_SESSION["__submitFormWebEntryData__"] = $aMessage; + $_SESSION["__webEntrySuccess__"] = $aMessage; + header("location:{weTitle}Info.php"); } catch (Exception $e) { - $G_PUBLISH = new Publisher(); $suggest_message = "This web entry should be regenerated, please contact to your system administrator."; $aMessage["MESSAGE"] = "
" . $e->getMessage() . "
" . $suggest_message . "
"; - $G_PUBLISH->AddContent("xmlform", "xmlform", "login/showMessage", "", $aMessage); - G::RenderPage("publish", "blank"); + $_SESSION["__webEntryError__"] = $aMessage; + header("location:{weTitle}Info.php"); } From a4d894ea8b3ace24e28fe6eaa61905f8884b5c5e Mon Sep 17 00:00:00 2001 From: dheeyi william Date: Thu, 4 May 2017 15:51:54 -0400 Subject: [PATCH 17/25] HOR-1697 System Settings: Se aceptan valores reales/negativos en los campos: "MemoryLimit, CookieLifetime y DefaultUserExpiryDate" --- .../translations/english/processmaker.en.po | 18 ++++++++++++++++++ workflow/engine/controllers/adminProxy.php | 6 +++--- workflow/engine/data/mysql/insert.sql | 3 +++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/workflow/engine/content/translations/english/processmaker.en.po b/workflow/engine/content/translations/english/processmaker.en.po index c61836c54..e3c24a29d 100644 --- a/workflow/engine/content/translations/english/processmaker.en.po +++ b/workflow/engine/content/translations/english/processmaker.en.po @@ -2113,6 +2113,24 @@ msgstr "This case does not exist" msgid "Application ID or Delegation Index is missing!. The System can not open the case." msgstr "Application ID or Delegation Index is missing!. The System can not open the case." +# TRANSLATION +# LABEL/ID_MEMORY_LIMIT_VALIDATE +#: LABEL/ID_MEMORY_LIMIT_VALIDATE +msgid "Memory Limit value has to be either a positive integer or -1." +msgstr "Memory Limit value has to be either a positive integer or -1." + +# TRANSLATION +# LABEL/ID_LIFETIME_VALIDATE +#: LABEL/ID_LIFETIME_VALIDATE +msgid "Max Lifetime value has to be a positive integer." +msgstr "Max Lifetime value has to be a positive integer." + +# TRANSLATION +# LABEL/ID_DEFAULT_EXPIRATION_YEAR_VALIDATE +#: LABEL/ID_DEFAULT_EXPIRATION_YEAR_VALIDATE +msgid "Default Expiration Year value has to be a positive integer." +msgstr "Default Expiration Year value has to be a positive integer." + # TRANSLATION # LABEL/ID_PLEASE_SELECT_UPGRADE_FILE #: LABEL/ID_PLEASE_SELECT_UPGRADE_FILE diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index 22c365dc6..dc3c22f7f 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -1538,19 +1538,19 @@ class adminProxy extends HttpProxyController if (!((is_numeric($httpData->memory_limit)) && ((int)$httpData->memory_limit == $httpData->memory_limit) && ((int)$httpData->memory_limit >= -1)) ) { - throw new Exception('The Memory Limit has to be either a positive integer or -1 '); + throw new Exception(G::LoadTranslation('ID_MEMORY_LIMIT_VALIDATE')); } if (!((is_numeric($httpData->max_life_time)) && ((int)$httpData->max_life_time == $httpData->max_life_time) && ((int)$httpData->max_life_time > 0)) ) { - throw new Exception('The Max Lifetime has to be either a positive integer '); + throw new Exception(G::LoadTranslation('ID_LIFETIME_VALIDATE')); } if (!((is_numeric($httpData->expiration_year)) && ((int)$httpData->expiration_year == $httpData->expiration_year) && ((int)$httpData->expiration_year > 0)) ) { - throw new Exception('The Default Expiration Year has to be either a positive integer'); + throw new Exception(G::LoadTranslation('ID_DEFAULT_EXPIRATION_YEAR_VALIDATE')); } if (!file_exists($envFile)) { diff --git a/workflow/engine/data/mysql/insert.sql b/workflow/engine/data/mysql/insert.sql index 5d64cdb0f..fb6c052e6 100644 --- a/workflow/engine/data/mysql/insert.sql +++ b/workflow/engine/data/mysql/insert.sql @@ -1793,6 +1793,9 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','ID_IN','en','in','2014-01-15') , ( 'LABEL','ID_CASE_DOES_NOT_EXISTS','en','This case does not exist','2014-01-15') , ( 'LABEL','ID_APPLICATION_OR_INDEX_MISSING','en','Application ID or Delegation Index is missing!. The System can not open the case.','2017-03-30') , +( 'LABEL','ID_MEMORY_LIMIT_VALIDATE','en','Memory Limit value has to be either a positive integer or -1','2017-04-05') , +( 'LABEL','ID_LIFETIME_VALIDATE','en','Max Lifetime value has to be a positive integer','2017-04-05') , +( 'LABEL','ID_DEFAULT_EXPIRATION_YEAR_VALIDATE','en','Default Expiration Year value has to be a positive integer','2017-04-05') , ( 'LABEL','ID_PLEASE_SELECT_UPGRADE_FILE','en','Please select the upgrade file','2014-01-15') , ( 'LABEL','ID_PLEASE_SELECT_MAX_X_FIELDS','en','Please select 80 fields at most','2014-01-15') , ( 'LABEL','ID_UPGRADE_READY','en','System upgraded from revision','2014-01-15') , From 6a0e1afc659df7cb486250e9f6a6c5c2745ca041 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Fri, 5 May 2017 10:18:04 -0400 Subject: [PATCH 18/25] HOR-3017 --- .../processes/processes_webEntryGenerate.php | 21 +-------- .../ProcessMaker/BusinessModel/WebEntry.php | 44 +++++++++++-------- .../templates/processes/webentryPost.tpl | 2 +- 3 files changed, 29 insertions(+), 38 deletions(-) diff --git a/workflow/engine/methods/processes/processes_webEntryGenerate.php b/workflow/engine/methods/processes/processes_webEntryGenerate.php index 7e42df04b..6d24135fe 100644 --- a/workflow/engine/methods/processes/processes_webEntryGenerate.php +++ b/workflow/engine/methods/processes/processes_webEntryGenerate.php @@ -62,26 +62,9 @@ try { file_put_contents( $pathProcess . $dynTitle . '.php', $sContent ); //Create file to display information and prevent resubmission data (Post/Redirect/Get). - $fileNamePreventResubmission = $pathProcess . $dynTitle . "Info.php"; - $filePreventResubmission = "" - . "AddContent(\"xmlform\", \"xmlform\", \$show, \"\", \$message);\n" - . "G::RenderPage(\"publish\", \"blank\");\n" - . "\n"; - file_put_contents($fileNamePreventResubmission, $filePreventResubmission); + \ProcessMaker\BusinessModel\WebEntry::createFileInfo($pathProcess . $dynTitle . "Info.php"); -//creating the second file, the post file who receive the post form. + //creating the second file, the post file who receive the post form. $pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl'; $template = new TemplatePower( $pluginTpl ); $template->prepare(); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php index 91c5ef326..bc8fb90c1 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php @@ -419,24 +419,7 @@ class WebEntry file_put_contents($pathDataPublicProcess . PATH_SEP . $fileName . ".php", $fileContent); //Create file to display information and prevent resubmission data (Post/Redirect/Get). - $fileNamePreventResubmission = $pathDataPublicProcess . PATH_SEP . $weTitle . "Info.php"; - $filePreventResubmission = "" - . "AddContent(\"xmlform\", \"xmlform\", \$show, \"\", \$message);\n" - . "G::RenderPage(\"publish\", \"blank\");\n" - . "\n"; - file_put_contents($fileNamePreventResubmission, $filePreventResubmission); + self::createFileInfo($pathDataPublicProcess . PATH_SEP . $weTitle . "Info.php"); //Creating the second file, the post file who receive the post form. $pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentryPost.tpl"; @@ -1054,5 +1037,30 @@ class WebEntry return $result; } + /** + * Create file to display information and prevent resubmission data (Post/Redirect/Get). + * @param string $pathFileName + */ + public static function createFileInfo($pathFileName) + { + $code = "" + . "AddContent(\"xmlform\", \"xmlform\", \$show, \"\", \$message);\n" + . "G::RenderPage(\"publish\", \"blank\");\n" + . "\n"; + file_put_contents($pathFileName, $code); + } + } diff --git a/workflow/engine/templates/processes/webentryPost.tpl b/workflow/engine/templates/processes/webentryPost.tpl index ae6b5f0a2..c7942063c 100644 --- a/workflow/engine/templates/processes/webentryPost.tpl +++ b/workflow/engine/templates/processes/webentryPost.tpl @@ -194,7 +194,7 @@ try { } /*----------------------------------********---------------------------------*/ $_SESSION["__webEntrySuccess__"] = $aMessage; - header("location:{weTitle}Info.php"); + G::header("location:{weTitle}Info.php"); } catch (Exception $e) { $suggest_message = "This web entry should be regenerated, please contact to your system administrator."; $aMessage["MESSAGE"] = "
" . $e->getMessage() . "
" . $suggest_message . "
"; From e6326dc1d934bb4c945e19a8a651eb5517afc551 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Fri, 5 May 2017 10:19:48 -0400 Subject: [PATCH 19/25] HOR-3017 --- workflow/engine/templates/processes/webentryPost.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/templates/processes/webentryPost.tpl b/workflow/engine/templates/processes/webentryPost.tpl index c7942063c..772f5d021 100644 --- a/workflow/engine/templates/processes/webentryPost.tpl +++ b/workflow/engine/templates/processes/webentryPost.tpl @@ -199,5 +199,5 @@ try { $suggest_message = "This web entry should be regenerated, please contact to your system administrator."; $aMessage["MESSAGE"] = "
" . $e->getMessage() . "
" . $suggest_message . "
"; $_SESSION["__webEntryError__"] = $aMessage; - header("location:{weTitle}Info.php"); + G::header("location:{weTitle}Info.php"); } From dfb623d82f77664fc7d779459c4263310819c1a0 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Fri, 5 May 2017 12:25:12 -0400 Subject: [PATCH 20/25] HOR-3178 --- workflow/public_html/sysGeneric.php | 1 + 1 file changed, 1 insertion(+) diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 28609084f..b8e8b661d 100644 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -962,6 +962,7 @@ if (! defined( 'EXECUTE_BY_CRON' )) { $noLoginFiles[] = 'licenseUpdate'; $noLoginFiles[] = 'casesStreamingFile'; $noLoginFiles[] = 'opencase'; + $noLoginFiles[] = 'defaultAjaxDynaform'; $noLoginFolders[] = 'services'; $noLoginFolders[] = 'tracker'; From ca9d3d30e159d9113e2a83223e156ad058e0e3d8 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Fri, 5 May 2017 13:15:49 -0400 Subject: [PATCH 21/25] HOR-2880 --- workflow/engine/menus/setup.php | 39 ++++++++++++--------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/workflow/engine/menus/setup.php b/workflow/engine/menus/setup.php index b7e8d941f..7a4b1c820 100644 --- a/workflow/engine/menus/setup.php +++ b/workflow/engine/menus/setup.php @@ -63,16 +63,6 @@ if ($RBAC->userCanAccess('PM_SETUP') === 1) { } } -if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1) { - if ($RBAC->userCanAccess('PM_SETUP_LANGUAGE') === 1) { - $G_TMP_MENU->AddIdRawOption( - 'LANGUAGES', 'languages', - G::LoadTranslation('ID_LANGUAGES'), - 'icon-language.png','', 'settings' - ); - } -} - if ($RBAC->userCanAccess('PM_SETUP') === 1) { if ($RBAC->userCanAccess('PM_SETUP_SKIN') === 1) { $G_TMP_MENU->AddIdRawOption( @@ -103,14 +93,6 @@ if ($RBAC->userCanAccess('PM_SETUP') === 1) { } } -if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1) { - $G_TMP_MENU->AddIdRawOption( - 'APPCACHEVIEW_SETUP', '../setup/appCacheViewConf', - G::LoadTranslation('ID_APPCACHE_SETUP'), - "", '', 'settings' - ); -} - if ($RBAC->userCanAccess('PM_SETUP') === 1) { if ($RBAC->userCanAccess('PM_SETUP_CLEAR_CACHE') === 1) { $G_TMP_MENU->AddIdRawOption( @@ -159,6 +141,20 @@ if ($RBAC->userCanAccess('PM_SETUP') === 1) { } //tools options if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1) { + if ($RBAC->userCanAccess('PM_SETUP_LANGUAGE') === 1) { + $G_TMP_MENU->AddIdRawOption( + 'LANGUAGES', 'languages', + G::LoadTranslation('ID_LANGUAGES'), + 'icon-language.png','', 'settings' + ); + } + if ($RBAC->userCanAccess('PM_SETUP_CASES_LIST_CACHE_BUILDER') === 1) { + $G_TMP_MENU->AddIdRawOption( + 'APPCACHEVIEW_SETUP', '../setup/appCacheViewConf', + G::LoadTranslation('ID_APPCACHE_SETUP'), + "", '', 'settings' + ); + } if (!$partnerFlag) { if ($RBAC->userCanAccess('PM_SETUP_PLUGINS') === 1) { $G_TMP_MENU->AddIdRawOption( @@ -277,13 +273,6 @@ if ($licenseStatusInfo["message"] != "") { /*----------------------------------********---------------------------------*/ if ($RBAC->userCanAccess('PM_SETUP') == 1) { /*----------------------------------********---------------------------------*/ - if ($RBAC->userCanAccess('PM_SETUP_CASES_LIST_CACHE_BUILDER') == 1) { - $G_TMP_MENU->AddIdRawOption( - 'PMENTERPRISE', '../enterprise/addonsStore', - G::LoadTranslation('ID_MENU_NAME') . $licStatusMsg, - '', '', 'plugins' - ); - } if ($RBAC->userCanAccess('PM_SETUP_CUSTOM_CASES_LIST') == 1) { $G_TMP_MENU->AddIdRawOption( 'CASES_LIST_SETUP', '../cases/casesListSetup', From 10f2c1961edbc9111a22fbef9ba7da75f27a0a46 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Fri, 5 May 2017 14:13:08 -0400 Subject: [PATCH 22/25] HOR-2679 --- workflow/engine/templates/cases/casesList.js | 1 - 1 file changed, 1 deletion(-) diff --git a/workflow/engine/templates/cases/casesList.js b/workflow/engine/templates/cases/casesList.js index a858becb3..299425b2c 100644 --- a/workflow/engine/templates/cases/casesList.js +++ b/workflow/engine/templates/cases/casesList.js @@ -1933,7 +1933,6 @@ Ext.onReady ( function() { var toolbarUnassigned = [ optionMenuOpen, '-', - btnAll, '->', // begin using the right-justified button container _("ID_CATEGORY"), comboCategory, From 25b8fe9e35a86d73478b1d3d550880699bad17d6 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Fri, 5 May 2017 16:39:40 -0400 Subject: [PATCH 23/25] HOR-2307 --- 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 49877e155..9efbfaa4a 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/User.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/User.php @@ -1213,7 +1213,7 @@ class User } } else { if (!is_null($status)) { - $criteria->add(\UsersPeer::USR_STATUS, uppercase($status), \Criteria::EQUAL); + $criteria->add(\UsersPeer::USR_STATUS, strtoupper($status), \Criteria::EQUAL); } } From 17ac746cfeede98e500946c46f46fb2ee8000553 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Mon, 8 May 2017 11:11:16 -0400 Subject: [PATCH 24/25] HOR-3184 --- workflow/engine/menus/setup.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/workflow/engine/menus/setup.php b/workflow/engine/menus/setup.php index 7a4b1c820..a9952367e 100644 --- a/workflow/engine/menus/setup.php +++ b/workflow/engine/menus/setup.php @@ -273,6 +273,11 @@ if ($licenseStatusInfo["message"] != "") { /*----------------------------------********---------------------------------*/ if ($RBAC->userCanAccess('PM_SETUP') == 1) { /*----------------------------------********---------------------------------*/ + $G_TMP_MENU->AddIdRawOption( + 'PMENTERPRISE', '../enterprise/addonsStore', + G::LoadTranslation('ID_MENU_NAME') . $licStatusMsg, + '', '', 'plugins' + ); if ($RBAC->userCanAccess('PM_SETUP_CUSTOM_CASES_LIST') == 1) { $G_TMP_MENU->AddIdRawOption( 'CASES_LIST_SETUP', '../cases/casesListSetup', From 9d163ab737b45ae1600d6280fcd34586ae0446f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20Cesar=20Laura=20Avenda=C3=B1o?= Date: Mon, 8 May 2017 13:33:34 -0400 Subject: [PATCH 25/25] HOR-3183 --- workflow/engine/classes/class.case.php | 2 +- workflow/engine/methods/cases/cases_Step.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 828c1e9f4..f3827949d 100644 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -2331,7 +2331,7 @@ class Cases $rs->next(); $row = $rs->getRow(); $iLastStep = intval($row[0]); - if ($iPosition > $iLastStep) { + if ($iPosition != 10000 && $iPosition > $iLastStep) { throw (new Exception(G::LoadTranslation('ID_STEP_DOES_NOT_EXIST', array(G::LoadTranslation('ID_POSITION'), $iPosition)))); } $iPosition += 1; diff --git a/workflow/engine/methods/cases/cases_Step.php b/workflow/engine/methods/cases/cases_Step.php index 4a79402f1..d5edbe044 100644 --- a/workflow/engine/methods/cases/cases_Step.php +++ b/workflow/engine/methods/cases/cases_Step.php @@ -278,6 +278,7 @@ try { $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] ); $aPreviousStep = $oCase->getPreviousStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] ); } catch (Exception $e) { + throw $e; } //Obtain previous and next step - End