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:
@@ -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"]));
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user