Upgrade PHP files
This commit is contained in:
@@ -7,9 +7,7 @@ use ProcessMaker\BusinessModel\Task as BusinessModelTask;
|
||||
use ProcessMaker\BusinessModel\User as BusinessModelUser;
|
||||
use ProcessMaker\BusinessModel\WebEntryEvent;
|
||||
use ProcessMaker\Cases\CasesTrait;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\ChangeLog\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Model\AppDelay as Delay;
|
||||
use ProcessMaker\Model\AppThread as Thread;
|
||||
@@ -858,7 +856,6 @@ class Cases
|
||||
$aFieldsHistory['APP_DATA'] = serialize($FieldsDifference);
|
||||
$appHistory->insertHistory($aFieldsHistory);
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$type = isset($Fields['OBJECT_TYPE']) ?
|
||||
$Fields['OBJECT_TYPE'] : ChangeLog::getChangeLog()->getObjectNameById(ChangeLog::DYNAFORM);
|
||||
ChangeLog::getChangeLog()
|
||||
@@ -870,7 +867,6 @@ class Cases
|
||||
->getTasIdByTasUid($Fields['TAS_UID'])
|
||||
->getObjectIdByUidAndObjType($Fields['CURRENT_DYNAFORM'], $type)
|
||||
->register();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
}
|
||||
// End Save History
|
||||
@@ -922,7 +918,6 @@ class Cases
|
||||
$appAssignSelfServiceValue->remove($appUid);
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (!isset($Fields['DEL_INDEX'])) {
|
||||
$Fields['DEL_INDEX'] = 1;
|
||||
}
|
||||
@@ -930,7 +925,6 @@ class Cases
|
||||
unset($Fields['DEL_INIT_DATE']);
|
||||
unset($Fields['DEL_DELEGATE_DATE']);
|
||||
$inbox->update($Fields);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
return $Fields;
|
||||
} catch (Exception $e) {
|
||||
@@ -1042,7 +1036,6 @@ class Cases
|
||||
if ($this->appSolr != null) {
|
||||
$this->appSolr->deleteApplicationSearchIndex($sAppUid);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ListInboxPeer::APP_UID, $sAppUid);
|
||||
ListInboxPeer::doDelete($oCriteria);
|
||||
@@ -1061,7 +1054,7 @@ class Cases
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ListUnassignedPeer::APP_UID, $sAppUid);
|
||||
ListUnassignedPeer::doDelete($oCriteria);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
//Logger deleteCase
|
||||
$nameFiles = '';
|
||||
foreach (debug_backtrace() as $node) {
|
||||
@@ -1097,10 +1090,10 @@ class Cases
|
||||
$oAppDel = AppDelegationPeer::retrieveByPk($sAppUid, $iDelIndex);
|
||||
$oAppDel->setDelInitDate("now");
|
||||
$oAppDel->save();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$inbox = new ListInbox();
|
||||
$inbox->update(array('APP_UID' => $sAppUid, 'DEL_INDEX' => $iDelIndex, 'DEL_INIT_DATE' => Date("Y-m-d H:i:s")));
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
//update searchindex
|
||||
if ($this->appSolr != null) {
|
||||
$this->appSolr->updateApplicationSearchIndex($sAppUid);
|
||||
@@ -1137,9 +1130,8 @@ class Cases
|
||||
|
||||
//Delete record of the table APP_ASSIGN_SELF_SERVICE_VALUE
|
||||
$appAssignSelfServiceValue = new AppAssignSelfServiceValue();
|
||||
|
||||
$appAssignSelfServiceValue->remove($sAppUid, $iDelIndex);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
//Delete record of the table LIST_UNASSIGNED
|
||||
$unassigned = new ListUnassigned();
|
||||
$unassigned->remove($sAppUid, $iDelIndex);
|
||||
@@ -1148,7 +1140,6 @@ class Cases
|
||||
$aFields['APP_STATUS'] = 'TO_DO';
|
||||
$inbox = new ListInbox();
|
||||
$inbox->update($aFields, true);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
} catch (exception $e) {
|
||||
throw ($e);
|
||||
}
|
||||
@@ -1932,7 +1923,6 @@ class Cases
|
||||
throw (new PropelException('The row cannot be created!', new PropelException($msg)));
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$delIndex = $appDel->getDelIndex();
|
||||
$inbox = new ListInbox();
|
||||
$inbox->remove($appUid, $delIndex);
|
||||
@@ -1942,7 +1932,6 @@ class Cases
|
||||
$data['USR_UID'] = $appDel->getUsrUid();
|
||||
$listParticipatedLast = new ListParticipatedLast();
|
||||
$listParticipatedLast->refresh($data);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
/** Update search index */
|
||||
@@ -1990,7 +1979,6 @@ class Cases
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$inbox = new ListInbox();
|
||||
$data = [];
|
||||
$inbox->remove($appUid, $delIndex);
|
||||
@@ -2000,7 +1988,6 @@ class Cases
|
||||
$data['USR_UID'] = $user;
|
||||
$listParticipatedLast = new ListParticipatedLast();
|
||||
$listParticipatedLast->refresh($data);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
/** Update search index */
|
||||
if ($this->appSolr != null) {
|
||||
@@ -2181,7 +2168,6 @@ class Cases
|
||||
$this->appSolr->updateApplicationSearchIndex($appUid);
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$fields['TAS_UID'] = $tasUid;
|
||||
$fields['USR_UID'] = $usrUid;
|
||||
$fields['DEL_INDEX'] = $delIndex;
|
||||
@@ -2202,7 +2188,6 @@ class Cases
|
||||
$inbox = new ListInbox();
|
||||
$inbox->newRow($fields, $usrUid, $isSelfService);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
} catch (Exception $e) {
|
||||
throw ($e);
|
||||
}
|
||||
@@ -3403,14 +3388,12 @@ class Cases
|
||||
//Execute the trigger defined in the step
|
||||
$lastFields = $this->executeTriggerFromList($triggersList, $fieldsCase, $stepType, $stepUidObj, $triggerType);
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$usrUid = empty($_SESSION['USER_LOGGED']) ? '' : $_SESSION['USER_LOGGED'];
|
||||
ChangeLog::getChangeLog()
|
||||
->setObjectUid($stepUidObj)
|
||||
->getUsrIdByUsrUid($usrUid, true)
|
||||
->getTasIdByTasUid($tasUid, true)
|
||||
->getExecutedAtIdByTriggerType($triggerType);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
return $lastFields;
|
||||
}
|
||||
@@ -3462,21 +3445,17 @@ class Cases
|
||||
$oPMScript = new PMScript();
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$cs = new CodeScanner(config("system.workspace"));
|
||||
$foundDisabledCode = "";
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$varInAfterRouting = false;
|
||||
$fieldsTrigger = [];
|
||||
foreach ($triggersList as $trigger) {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$disabledCode = $this->codeScannerReview($cs, $trigger["TRI_WEBBOT"], $trigger["TRI_TITLE"]);
|
||||
if (!empty($disabledCode)) {
|
||||
$foundDisabledCode .= $disabledCode;
|
||||
continue;
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$oPMScript->setFields($fieldsCase);
|
||||
$execute = true;
|
||||
@@ -3531,7 +3510,6 @@ class Cases
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (!empty($foundDisabledCode)) {
|
||||
G::SendTemporalMessage(
|
||||
G::LoadTranslation("ID_DISABLED_CODE_TRIGGER_TO_EXECUTE", [$foundDisabledCode]),
|
||||
@@ -3539,7 +3517,6 @@ class Cases
|
||||
"string"
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
return $fieldsCase;
|
||||
@@ -3578,9 +3555,8 @@ class Cases
|
||||
private function codeScannerReview(CodeScanner $cs, $code, $triTitle)
|
||||
{
|
||||
$foundDisabledCode = "";
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=") &&
|
||||
in_array('trigger', $cs->getScope())) {
|
||||
|
||||
if (in_array('trigger', $cs->getScope())) {
|
||||
//Check disabled code
|
||||
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $code);
|
||||
|
||||
@@ -3593,7 +3569,6 @@ class Cases
|
||||
$foundDisabledCode .= "<br />- " . $triTitle . ": " . $codeAndLine;
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
return $foundDisabledCode;
|
||||
}
|
||||
@@ -4170,7 +4145,6 @@ class Cases
|
||||
/** Execute the trigger */
|
||||
$this->getExecuteTriggerProcess($appUid, 'PAUSED');
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$threadTitle = Delegation::getDeltitle($appNumber, $index);
|
||||
$data = [
|
||||
'APP_UID' => $appUid,
|
||||
@@ -4182,7 +4156,6 @@ class Cases
|
||||
$data = array_merge($fields, $data);
|
||||
$listPaused = new ListPaused();
|
||||
$listPaused->create($data);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4292,11 +4265,9 @@ class Cases
|
||||
|
||||
$this->getExecuteTriggerProcess($appUid, "UNPAUSE");
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$row = array_merge($delRow, $row);
|
||||
$listPaused = new ListPaused();
|
||||
$listPaused->remove($appUid, $index, $row);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4347,7 +4318,6 @@ class Cases
|
||||
/** Execute a trigger when a case is cancelled */
|
||||
$this->getExecuteTriggerProcess($appUid, 'CANCELED', $executeSameCase);
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$dataList = [
|
||||
'APP_UID' => $appUid,
|
||||
'DEL_INDEX' => $value['DEL_INDEX'],
|
||||
@@ -4359,7 +4329,6 @@ class Cases
|
||||
$listCanceled = new ListCanceled();
|
||||
// This action requires interaction with IndicatorsCalculator class
|
||||
$listCanceled->create($dataList);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4378,11 +4347,9 @@ class Cases
|
||||
|
||||
/** Close all the threads in APP_DELEGATION and APP_THREAD */
|
||||
if (is_null($delIndex)) {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$result = $delegation->LoadParallel($appUid);
|
||||
$this->closeAllDelegations($appUid);
|
||||
$this->closeAllThreads($appUid);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
} else {
|
||||
/** Close the specific delIndex in APP_DELEGATION and APP_THREAD */
|
||||
@@ -4655,7 +4622,6 @@ class Cases
|
||||
//Execute trigger
|
||||
$this->getExecuteTriggerProcess($appUid, 'REASSIGNED');
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$participated = new ListParticipatedLast();
|
||||
$participated->remove($newData['APP_UID'], $newUserUid, $delIndex);
|
||||
|
||||
@@ -4674,7 +4640,6 @@ class Cases
|
||||
$criteriaSet = new Criteria("workflow");
|
||||
$criteriaSet->add(ListInboxPeer::DEL_INDEX, $newData['DEL_INDEX']);
|
||||
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
//Delete record of the table LIST_UNASSIGNED
|
||||
$unassigned = new ListUnassigned();
|
||||
@@ -5972,9 +5937,7 @@ class Cases
|
||||
$resultAttachments = array_merge($resultAttachments, $listAttachment);
|
||||
|
||||
$resultCaseNotes = 1;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$resultSummary = 1;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
//Message History
|
||||
$listMessage = $objectPermission->objectPermissionMessage(
|
||||
@@ -6034,11 +5997,9 @@ class Cases
|
||||
case 'CASES_NOTES':
|
||||
$resultCaseNotes = 1;
|
||||
break;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
case 'SUMMARY_FORM':
|
||||
$resultSummary = 1;
|
||||
break;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
case 'MSGS_HISTORY':
|
||||
$listMessage = $objectPermission->objectPermissionMessage(
|
||||
$appUid,
|
||||
@@ -6052,12 +6013,10 @@ class Cases
|
||||
);
|
||||
$resultMessages = array_merge($resultMessages, $listMessage);
|
||||
break;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
case 'REASSIGN_MY_CASES':
|
||||
$listReassign = $objectPermission->objectPermissionByReassignCases($appUid, $proUid, $tasUid);
|
||||
$resultReassignCases = array_merge($resultReassignCases, $listReassign);
|
||||
break;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6069,10 +6028,8 @@ class Cases
|
||||
"OUTPUT_DOCUMENTS" => $resultOutputs,
|
||||
"CASES_NOTES" => $resultCaseNotes,
|
||||
"MSGS_HISTORY" => $resultMessages
|
||||
/*----------------------------------********---------------------------------*/
|
||||
, "REASSIGN_MY_CASES" => $resultReassignCases
|
||||
, "SUMMARY_FORM" => $resultSummary
|
||||
/*----------------------------------********---------------------------------*/
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user