Merged in bugfix/HOR-4500 (pull request #6445)

HOR-4500

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2018-04-17 13:13:19 +00:00
committed by Julio Cesar Laura Avendaño
7 changed files with 49 additions and 36 deletions

View File

@@ -1106,11 +1106,11 @@ class Cases
* @param string $applicationUid Unique id of Case * @param string $applicationUid Unique id of Case
* @param string $userUid Unique id of User * @param string $userUid Unique id of User
* @param string $delIndex * @param string $delIndex
* @param string $bExecuteTriggersBeforeAssignment * @param boolean $executeTriggersBeforeAssignment
* *
* return array Return an array with Task Case * return array Return an array with Task Case
*/ */
public function updateRouteCase($applicationUid, $userUid, $delIndex) public function updateRouteCase($applicationUid, $userUid, $delIndex, $executeTriggersBeforeAssignment)
{ {
try { try {
if (!$delIndex) { if (!$delIndex) {
@@ -1124,8 +1124,7 @@ class Cases
} }
$ws = new WsBase(); $ws = new WsBase();
$fields = $ws->derivateCase($userUid, $applicationUid, $delIndex, $fields = $ws->derivateCase($userUid, $applicationUid, $delIndex, $executeTriggersBeforeAssignment);
$bExecuteTriggersBeforeAssignment = false);
$array = json_decode(json_encode($fields), true); $array = json_decode(json_encode($fields), true);
if ($array ["status_code"] != 0) { if ($array ["status_code"] != 0) {
throw (new Exception($array ["message"])); throw (new Exception($array ["message"]));

View File

@@ -547,12 +547,12 @@ class Light
* @param string $applicationUid Unique id of Case * @param string $applicationUid Unique id of Case
* @param string $userUid Unique id of User * @param string $userUid Unique id of User
* @param string $delIndex * @param string $delIndex
* @param array $tasks * @param string $tasks
* @param string $bExecuteTriggersBeforeAssignment * @param boolean $executeTriggersBeforeAssignment
* *
* return array Return an array with Task Case * return array Return an array with Task Case
*/ */
public function updateRouteCase($applicationUid, $userUid, $delIndex, $tasks) public function updateRouteCase($applicationUid, $userUid, $delIndex, $tasks, $executeTriggersBeforeAssignment)
{ {
try { try {
if (!$delIndex) { if (!$delIndex) {
@@ -560,8 +560,15 @@ class Light
} }
$ws = new \WsBase(); $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 = json_decode(json_encode($fields), true);
$array['message'] = trim(strip_tags($array['message'])); $array['message'] = trim(strip_tags($array['message']));
if ($array ["status_code"] != 0) { if ($array ["status_code"] != 0) {

View File

@@ -337,7 +337,7 @@ class WebEntry
* *
* return void * return void
*/ */
protected function setWeData($webEntryUid, $arrayData) protected function setWeData($webEntryUid)
{ {
try { try {
//Verify data //Verify data
@@ -559,17 +559,15 @@ class WebEntry
} }
//Update //Update
if (!isset($arrayData['WE_LINK_GENERATION']) || $arrayData['WE_LINK_GENERATION']==='DEFAULT') { //Update where
//Update where $criteriaWhere = new \Criteria("workflow");
$criteriaWhere = new \Criteria("workflow"); $criteriaWhere->add(\WebEntryPeer::WE_UID, $webEntryUid);
$criteriaWhere->add(\WebEntryPeer::WE_UID, $webEntryUid);
//Update set //Update set
$criteriaSet = new \Criteria("workflow"); $criteriaSet = new \Criteria("workflow");
$criteriaSet->add(\WebEntryPeer::WE_DATA, $webEntryData); $criteriaSet->add(\WebEntryPeer::WE_DATA, $webEntryData);
\BasePeer::doUpdate($criteriaWhere, $criteriaSet, \Propel::getConnection("workflow")); \BasePeer::doUpdate($criteriaWhere, $criteriaSet, \Propel::getConnection("workflow"));
}
} catch (\Exception $e) { } catch (\Exception $e) {
throw $e; throw $e;
} }
@@ -639,7 +637,7 @@ class WebEntry
} }
//Set WE_DATA //Set WE_DATA
$this->setWeData($webEntryUid, $arrayData); $this->setWeData($webEntryUid);
//Return //Return
return $this->getWebEntry($webEntryUid); return $this->getWebEntry($webEntryUid);
@@ -720,7 +718,7 @@ class WebEntry
} }
//Set WE_DATA //Set WE_DATA
$this->setWeData($webEntryUid, $arrayData); $this->setWeData($webEntryUid);
//Return //Return
if (!$this->formatFieldNameInUppercase) { if (!$this->formatFieldNameInUppercase) {

View File

@@ -400,6 +400,13 @@ class WebEntryEvent
$languages[] = $mLang['LANG_ID']; $languages[] = $mLang['LANG_ID'];
} }
$this->arrayFieldDefinition['WE_LINK_LANGUAGE']['defaultValues'] = $languages; $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(); $process = new BusinessModelProcess();

View File

@@ -860,18 +860,19 @@ class Cases extends Api
* *
* @param string $app_uid {@min 32}{@max 32} * @param string $app_uid {@min 32}{@max 32}
* @param string $del_index {@from body} * @param string $del_index {@from body}
* @param boolean $executeTriggersBeforeAssignment {@from body}
* *
* @throws RestException * @throws RestException
* *
* @access protected * @access protected
* @class AccessControl {@permission PM_CASES} * @class AccessControl {@permission PM_CASES}
*/ */
public function doPutRouteCase($app_uid, $del_index = null) public function doPutRouteCase($app_uid, $del_index = null, $executeTriggersBeforeAssignment = false)
{ {
try { try {
$userUid = $this->getUserId(); $userUid = $this->getUserId();
$cases = new BmCases(); $cases = new BmCases();
$cases->updateRouteCase($app_uid, $userUid, $del_index); $cases->updateRouteCase($app_uid, $userUid, $del_index, $executeTriggersBeforeAssignment);
} catch (Exception $e) { } catch (Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} }

View File

@@ -1196,6 +1196,7 @@ class Light extends Api
* @param string $app_uid {@min 32}{@max 32} * @param string $app_uid {@min 32}{@max 32}
* @param int $del_index {@from body} * @param int $del_index {@from body}
* @param array $tasks {@from body} * @param array $tasks {@from body}
* @param boolean $executeTriggersBeforeAssignment {@from body}
* *
* @return array * @return array
* @throws RestException * @throws RestException
@@ -1203,11 +1204,11 @@ class Light extends Api
* @access protected * @access protected
* @class AccessControl {@permission PM_CASES} * @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 { try {
$oMobile = new BusinessModelLight(); $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) { } catch (Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} }

View File

@@ -342,7 +342,7 @@ class Server implements iAuthenticate
$pmAccessToken = new \PmoauthUserAccessTokens(); $pmAccessToken = new \PmoauthUserAccessTokens();
$session = $pmAccessToken->getSessionData($token['ACCESS_TOKEN']); $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 // increase the timeout for local php session cookie
$config = \Bootstrap::getSystemConfiguration(); $config = \Bootstrap::getSystemConfiguration();
if (isset($config['session.gc_maxlifetime'])) { 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); setcookie($session->getSessionName(), $_COOKIE[$session->getSessionName()], time() + $lifetime, "/", null, false, true);
} }
}
//Set User Time Zone //Set User Time Zone
$user = \UsersPeer::retrieveByPK(self::$userId); $user = \UsersPeer::retrieveByPK(self::$userId);
if (!is_null($user)) { if (!is_null($user)) {
$userTimeZone = $user->getUsrTimeZone(); $userTimeZone = $user->getUsrTimeZone();
if (trim($userTimeZone) == '') { if (trim($userTimeZone) == '') {
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace")); $arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
$userTimeZone = $arraySystemConfiguration['time_zone']; $userTimeZone = $arraySystemConfiguration['time_zone'];
}
$_SESSION['USR_TIME_ZONE'] = $userTimeZone;
} }
$_SESSION['USR_TIME_ZONE'] = $userTimeZone;
} }
return $allowed; return $allowed;