diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index ca7a33919..b6a644b7c 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1106,11 +1106,11 @@ class Cases * @param string $applicationUid Unique id of Case * @param string $userUid Unique id of User * @param string $delIndex - * @param string $bExecuteTriggersBeforeAssignment + * @param boolean $executeTriggersBeforeAssignment * * return array Return an array with Task Case */ - public function updateRouteCase($applicationUid, $userUid, $delIndex) + public function updateRouteCase($applicationUid, $userUid, $delIndex, $executeTriggersBeforeAssignment) { try { if (!$delIndex) { @@ -1124,8 +1124,7 @@ class Cases } $ws = new WsBase(); - $fields = $ws->derivateCase($userUid, $applicationUid, $delIndex, - $bExecuteTriggersBeforeAssignment = false); + $fields = $ws->derivateCase($userUid, $applicationUid, $delIndex, $executeTriggersBeforeAssignment); $array = json_decode(json_encode($fields), true); if ($array ["status_code"] != 0) { throw (new Exception($array ["message"])); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php index 0ae439238..8b1c4ef9a 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php @@ -547,12 +547,12 @@ class Light * @param string $applicationUid Unique id of Case * @param string $userUid Unique id of User * @param string $delIndex - * @param array $tasks - * @param string $bExecuteTriggersBeforeAssignment + * @param string $tasks + * @param boolean $executeTriggersBeforeAssignment * * return array Return an array with Task Case */ - public function updateRouteCase($applicationUid, $userUid, $delIndex, $tasks) + public function updateRouteCase($applicationUid, $userUid, $delIndex, $tasks, $executeTriggersBeforeAssignment) { try { if (!$delIndex) { @@ -560,8 +560,15 @@ class Light } $ws = new \WsBase(); - $fields = $ws->derivateCase($userUid, $applicationUid, $delIndex, $bExecuteTriggersBeforeAssignment = false, - $tasks); + + $fields = $ws->derivateCase( + $userUid, + $applicationUid, + $delIndex, + $executeTriggersBeforeAssignment, + $tasks + ); + $array = json_decode(json_encode($fields), true); $array['message'] = trim(strip_tags($array['message'])); if ($array ["status_code"] != 0) { diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php index 2421ddd95..f5e3f721d 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php @@ -337,7 +337,7 @@ class WebEntry * * return void */ - protected function setWeData($webEntryUid, $arrayData) + protected function setWeData($webEntryUid) { try { //Verify data @@ -559,17 +559,15 @@ class WebEntry } //Update - if (!isset($arrayData['WE_LINK_GENERATION']) || $arrayData['WE_LINK_GENERATION']==='DEFAULT') { - //Update where - $criteriaWhere = new \Criteria("workflow"); - $criteriaWhere->add(\WebEntryPeer::WE_UID, $webEntryUid); + //Update where + $criteriaWhere = new \Criteria("workflow"); + $criteriaWhere->add(\WebEntryPeer::WE_UID, $webEntryUid); - //Update set - $criteriaSet = new \Criteria("workflow"); - $criteriaSet->add(\WebEntryPeer::WE_DATA, $webEntryData); + //Update set + $criteriaSet = new \Criteria("workflow"); + $criteriaSet->add(\WebEntryPeer::WE_DATA, $webEntryData); - \BasePeer::doUpdate($criteriaWhere, $criteriaSet, \Propel::getConnection("workflow")); - } + \BasePeer::doUpdate($criteriaWhere, $criteriaSet, \Propel::getConnection("workflow")); } catch (\Exception $e) { throw $e; } @@ -639,7 +637,7 @@ class WebEntry } //Set WE_DATA - $this->setWeData($webEntryUid, $arrayData); + $this->setWeData($webEntryUid); //Return return $this->getWebEntry($webEntryUid); @@ -720,7 +718,7 @@ class WebEntry } //Set WE_DATA - $this->setWeData($webEntryUid, $arrayData); + $this->setWeData($webEntryUid); //Return if (!$this->formatFieldNameInUppercase) { diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php index e34cca01e..713bf91d1 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php @@ -400,6 +400,13 @@ class WebEntryEvent $languages[] = $mLang['LANG_ID']; } $this->arrayFieldDefinition['WE_LINK_LANGUAGE']['defaultValues'] = $languages; + } else { + $this->arrayFieldDefinition['WE_LINK_SKIN']['required'] = false; + $this->arrayFieldDefinition['WE_LINK_LANGUAGE']['required'] = false; + $this->arrayFieldDefinition['WE_LINK_DOMAIN']['required'] = false; + $this->arrayFieldDefinition['WE_LINK_SKIN']['empty'] = true; + $this->arrayFieldDefinition['WE_LINK_LANGUAGE']['empty'] = true; + $this->arrayFieldDefinition['WE_LINK_DOMAIN']['empty'] = true; } $process = new BusinessModelProcess(); diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php index 88eee5761..96c89c39e 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php @@ -860,18 +860,19 @@ class Cases extends Api * * @param string $app_uid {@min 32}{@max 32} * @param string $del_index {@from body} + * @param boolean $executeTriggersBeforeAssignment {@from body} * * @throws RestException * * @access protected * @class AccessControl {@permission PM_CASES} */ - public function doPutRouteCase($app_uid, $del_index = null) + public function doPutRouteCase($app_uid, $del_index = null, $executeTriggersBeforeAssignment = false) { try { $userUid = $this->getUserId(); $cases = new BmCases(); - $cases->updateRouteCase($app_uid, $userUid, $del_index); + $cases->updateRouteCase($app_uid, $userUid, $del_index, $executeTriggersBeforeAssignment); } catch (Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); } diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Light.php b/workflow/engine/src/ProcessMaker/Services/Api/Light.php index f1ead8885..1d5360d38 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Light.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Light.php @@ -1196,6 +1196,7 @@ class Light extends Api * @param string $app_uid {@min 32}{@max 32} * @param int $del_index {@from body} * @param array $tasks {@from body} + * @param boolean $executeTriggersBeforeAssignment {@from body} * * @return array * @throws RestException @@ -1203,11 +1204,11 @@ class Light extends Api * @access protected * @class AccessControl {@permission PM_CASES} */ - public function doPutRouteCase($app_uid, $del_index = null, $tasks = array()) + public function doPutRouteCase($app_uid, $del_index = null, $tasks = array(), $executeTriggersBeforeAssignment = false) { try { $oMobile = new BusinessModelLight(); - $response = $oMobile->updateRouteCase($app_uid, $this->getUserId(), $del_index, $tasks); + $response = $oMobile->updateRouteCase($app_uid, $this->getUserId(), $del_index, $tasks, $executeTriggersBeforeAssignment); } catch (Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); } diff --git a/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php b/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php index 9269c4dc2..866baef3d 100644 --- a/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php +++ b/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php @@ -342,7 +342,7 @@ class Server implements iAuthenticate $pmAccessToken = new \PmoauthUserAccessTokens(); $session = $pmAccessToken->getSessionData($token['ACCESS_TOKEN']); - if ($session !== false && array_key_exists($session->getSessionName(), $_COOKIE)) { + if ($session !== false && array_key_exists($session->getSessionName(), $_COOKIE)) { // increase the timeout for local php session cookie $config = \Bootstrap::getSystemConfiguration(); if (isset($config['session.gc_maxlifetime'])) { @@ -356,21 +356,21 @@ class Server implements iAuthenticate setcookie($session->getSessionName(), $_COOKIE[$session->getSessionName()], time() + $lifetime, "/", null, false, true); } + } - //Set User Time Zone - $user = \UsersPeer::retrieveByPK(self::$userId); + //Set User Time Zone + $user = \UsersPeer::retrieveByPK(self::$userId); - if (!is_null($user)) { - $userTimeZone = $user->getUsrTimeZone(); + if (!is_null($user)) { + $userTimeZone = $user->getUsrTimeZone(); - if (trim($userTimeZone) == '') { - $arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace")); + if (trim($userTimeZone) == '') { + $arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace")); - $userTimeZone = $arraySystemConfiguration['time_zone']; - } - - $_SESSION['USR_TIME_ZONE'] = $userTimeZone; + $userTimeZone = $arraySystemConfiguration['time_zone']; } + + $_SESSION['USR_TIME_ZONE'] = $userTimeZone; } return $allowed;