From 6b68fda97a7c89aec7ae15e9175071283c4359b3 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Fri, 4 Aug 2017 08:11:58 -0400 Subject: [PATCH] Resolve conflict in G --- gulliver/system/class.g.php | 52 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 8563fc5aa..4f2080b21 100644 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -5676,36 +5676,36 @@ class G } /** - * Direct case link mobile - * @access public - * - * @param string - * @param int - * - * @return string + * Add log of execution of triggers + * @param $data + * @param string $error + * @param string $typeError + * @param int $executionTime */ - public static function caseLinkMobile($applicationUid, $delIndex = 0) + public static function logTriggerExecution($data, $error = 'NO-ERROR', $typeError = '', $executionTime = 0) { - $application = ApplicationPeer::retrieveByPK($applicationUid); + if ((!empty($data['_CODE_']) || $typeError == 'FATAL_ERROR') && isset($data['_DATA_TRIGGER_']) && + !isset($data['_DATA_TRIGGER_']['_TRI_LOG_']) + ) { + $lg = Bootstrap::getDefaultContextLog(); + $lg['TRI_TITLE'] = isset($data['_DATA_TRIGGER_']['TRI_TITLE']) ? $data['_DATA_TRIGGER_']['TRI_TITLE'] : ''; + $lg['TRI_UID'] = isset($data['_DATA_TRIGGER_']['TRI_UID']) ? $data['_DATA_TRIGGER_']['TRI_UID'] : ''; + $lg['TRI_CODE'] = isset($data['_DATA_TRIGGER_']['TRI_WEBBOT']) ? $data['_DATA_TRIGGER_']['TRI_WEBBOT'] : ''; + $lg['TRI_EXECUTION_TIME'] = $executionTime; + $lg['TRI_MSG_ERROR'] = $error; + $lg['APP_UID'] = isset($data['APPLICATION']) ? $data['APPLICATION'] : ''; + $lg['PRO_UID'] = isset($data['PROCESS']) ? $data['PROCESS'] : ''; + $lg['TAS_UID'] = isset($data['TASK']) ? $data['TASK'] : ''; + $lg['USR_UID'] = isset($data['USER_LOGGED']) ? $data['USER_LOGGED'] : ''; - if (is_null($application) || !is_numeric($delIndex) || $delIndex < 0) { - return false; + Bootstrap::registerMonolog( + (empty($sError)) ? 'TriggerExecution' : 'TriggerExecutionError', + (empty($sError)) ? 200 : 400, + (empty($sError)) ? 'Trigger Execution' : 'Trigger Execution Error', + $lg, $lg['workspace'], 'processmaker.log'); + + $_SESSION['_DATA_TRIGGER_']['_TRI_LOG_'] = true; } - - if ($delIndex != 0) { - $appDelegation = AppDelegationPeer::retrieveByPK($applicationUid, $delIndex); - - if (is_null($appDelegation)) { - return false; - } - - $uri = 'processmakerMobile://' . $applicationUid . '/' . $delIndex; - } else { - $uri = 'processmakerMobile://' . $applicationUid; - } - - //Return - return $uri; } }