Merge branch 'develop' of bitbucket.org:colosa/processmaker into develop
This commit is contained in:
@@ -5876,11 +5876,11 @@ class Cases
|
||||
$opObjUid = $row['OP_OBJ_UID'];
|
||||
$obCaseStatus = $row['OP_CASE_STATUS'];
|
||||
|
||||
//The values of obCaseStatus is [ALL, COMPLETED, DRAFT, TO_DO, PAUSED]
|
||||
//If the case is todo and we need the participate
|
||||
//but we did not participated did not validate nothing and return array empty
|
||||
// The values of obCaseStatus is [ALL, COMPLETED, DRAFT, TO_DO, PAUSED]
|
||||
// If the case is todo and we need the participate
|
||||
// but we did not participated did not validate nothing and return array empty
|
||||
$swParticipate = false; // must be false for default
|
||||
if ($obCaseStatus != 'COMPLETED' && $opParticipated == 1) {
|
||||
if ($opParticipated === 1) {
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(AppDelegationPeer::USR_UID, $usrUid);
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $appUid);
|
||||
|
||||
@@ -801,9 +801,11 @@ class Derivation
|
||||
* @param bool $removeList
|
||||
*
|
||||
* @return void
|
||||
* @deprecated function deprecated in Release 3.6.x
|
||||
*/
|
||||
private function updateList(array $arrayCurrentDelegationData, array $arrayNextDelegationData, $taskNextDelegation, array $arrayApplicationData, $delIndexNew, $aSp, $removeList)
|
||||
{
|
||||
return;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
try {
|
||||
if ($arrayNextDelegationData["TAS_UID"] != "-1") {
|
||||
|
||||
@@ -3383,6 +3383,12 @@ msgstr "You can not delete the template {0} because it has a relationship with E
|
||||
msgid "It is not possible to delete the department because it has subdepartments."
|
||||
msgstr "It is not possible to delete the department because it has subdepartments."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_CANT_DELETE_SUB_PROCESS_PARENT_HAS_ACTIVE_CASES
|
||||
#: LABEL/ID_CANT_DELETE_SUB_PROCESS_PARENT_HAS_ACTIVE_CASES
|
||||
msgid "Is not possible to delete sub-process cases, while the master process has active cases."
|
||||
msgstr "Is not possible to delete sub-process cases, while the master process has active cases."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_CANT_DELETE_DEPARTMENT_HAS_USERS
|
||||
#: LABEL/ID_CANT_DELETE_DEPARTMENT_HAS_USERS
|
||||
|
||||
@@ -57371,6 +57371,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
|
||||
( 'LABEL','ID_CANNOT_IMPORT','en','CANNOT IMPORT','2017-10-03') ,
|
||||
( 'LABEL','ID_CANNOT_REMOVE_TEMPLATE_EMAIL_EVENT','en','You can not delete the template {0} because it has a relationship with Email Event','2016-07-05') ,
|
||||
( 'LABEL','ID_CANT_DELETE_DEPARTMENT_HAS_CHILDREN','en','It is not possible to delete the department because it has subdepartments.','2014-10-21') ,
|
||||
( 'LABEL','ID_CANT_DELETE_SUB_PROCESS_PARENT_HAS_ACTIVE_CASES','en','Is not possible to delete sub-process cases, while the master process has active cases.','2021-03-23') ,
|
||||
( 'LABEL','ID_CANT_DELETE_DEPARTMENT_HAS_USERS','en','Department cannot be deleted while it has assigned users.','2015-03-23') ,
|
||||
( 'LABEL','ID_CANT_RESOLVE_APPLICATION','en','Can''t resolve the Aplication ID for this request.','2014-01-15') ,
|
||||
( 'LABEL','ID_CANT_SAVE_TRIGGER','en','A trigger with the same name already exists in this process.','2014-05-29') ,
|
||||
|
||||
@@ -246,7 +246,17 @@ class Ajax
|
||||
|| in_array($appUid, $userAuthorization['objectPermissions']['REASSIGN_MY_CASES'])
|
||||
) {
|
||||
if (!AppDelay::isPaused($appUid, $index)) {
|
||||
$options[] = ['text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign'];
|
||||
$subprocess = SubProcess::getSubProcessConfiguration(
|
||||
$proUid,
|
||||
$_SESSION['CURRENT_TASK']
|
||||
);
|
||||
if (empty($subprocess)) {
|
||||
$options[] = ['text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign'];
|
||||
} else {
|
||||
if ($subprocess['SP_SYNCHRONOUS'] == 0) {
|
||||
$options[] = ['text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -48,7 +48,7 @@ if ($actionAjax == 'historyDynaformGrid_Ajax') {
|
||||
$c = $oCase->getallDynaformsCriteria(
|
||||
$_SESSION['PROCESS'],
|
||||
$_SESSION['APPLICATION'],
|
||||
$_SESSION['CURRENT_TASK'],
|
||||
$_SESSION['TASK'],
|
||||
$_SESSION['USER_LOGGED'],
|
||||
$_SESSION['INDEX']
|
||||
);
|
||||
|
||||
@@ -1053,7 +1053,7 @@ try {
|
||||
// Swap temporary APP_NUMBER
|
||||
$newAppNumber = $bmWebEntry->swapTemporaryAppNumber($caseId);
|
||||
$Fields['APP_NUMBER'] = $Fields['APP_DATA']['APP_NUMBER'] = $newAppNumber;
|
||||
$derivationResponse = PMFDerivateCase($caseId, $delIndex, true);
|
||||
$derivationResponse = PMFDerivateCase($caseId, $delIndex, false);
|
||||
if ($derivationResponse) {
|
||||
$webEntryUrl = $bmWebEntry->getCallbackUrlByTask($currentTask['TAS_UID']);
|
||||
$delegationData = $Fields['APP_DATA'];
|
||||
|
||||
@@ -136,7 +136,8 @@ $pmDynaform = new PmDynaform();
|
||||
ScriptVariables::add('defaultOption', $defaultOption);
|
||||
ScriptVariables::add('_nodeId', isset($confDefaultOption) ? $confDefaultOption : "PM_USERS");
|
||||
ScriptVariables::add('SYS_CREDENTIALS', $pmDynaform->getCredentials());
|
||||
ScriptVariables::add('SYS_SERVER', System::getHttpServerHostnameRequestsFrontEnd());
|
||||
ScriptVariables::add('SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
|
||||
ScriptVariables::add('SYS_SERVER_AJAX', System::getServerProtocolHost());
|
||||
ScriptVariables::add('SYS_WORKSPACE', config("system.workspace"));
|
||||
ScriptVariables::add('SYS_URI', SYS_URI);
|
||||
ScriptVariables::add('SYS_LANG', SYS_LANG);
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Model\Delegation;
|
||||
use ProcessMaker\Model\SubProcess;
|
||||
|
||||
/**
|
||||
* processes_DeleteCases.php
|
||||
*
|
||||
@@ -14,6 +18,15 @@ try {
|
||||
$uids = explode(',', $_POST['PRO_UIDS']);
|
||||
$process = new Process();
|
||||
foreach ($uids as $uid) {
|
||||
$parents = SubProcess::getProParents($uid);
|
||||
if (!empty($parents)) {
|
||||
if (Delegation::hasActiveParentsCases($parents)) {
|
||||
$resp->status = false;
|
||||
$resp->msg = G::LoadTranslation('ID_CANT_DELETE_SUB_PROCESS_PARENT_HAS_ACTIVE_CASES');
|
||||
echo G::json_encode($resp);
|
||||
die();
|
||||
}
|
||||
}
|
||||
$process->deleteProcessCases($uid);
|
||||
}
|
||||
|
||||
@@ -21,11 +34,9 @@ try {
|
||||
$resp->msg = G::LoadTranslation('ID_ALL_RECORDS_DELETED_SUCESSFULLY');
|
||||
|
||||
echo G::json_encode($resp);
|
||||
|
||||
} catch (Exception $e) {
|
||||
$resp->status = false;
|
||||
$resp->msg = $e->getMessage();
|
||||
$resp->trace = $e->getTraceAsString();
|
||||
echo G::json_encode($resp);
|
||||
}
|
||||
|
||||
|
||||
@@ -4275,7 +4275,7 @@ class Cases
|
||||
$query->where('APPLICATION.APP_UID', '=', $appUid);
|
||||
|
||||
// Filter by source task
|
||||
if ($caseStatus != 'COMPLETED' && $sourceTask != '' && (int)$sourceTask != 0) {
|
||||
if (!empty($sourceTask) && (int)$sourceTask != 0) {
|
||||
$query->where('STEP.TAS_UID', '=', $sourceTask);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
use Exception;
|
||||
use G;
|
||||
use ProcessMaker\Model\Groupwf;
|
||||
use ProcessMaker\Model\TaskUser;
|
||||
use ProcessMaker\Model\User;
|
||||
use ProcessMaker\Plugins\Interfaces\StepDetail;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
use \ProcessMaker\Util;
|
||||
use ProcessMaker\Util;
|
||||
|
||||
class Task
|
||||
{
|
||||
@@ -1245,68 +1249,49 @@ class Task
|
||||
/**
|
||||
* Assign a user or group to an activity
|
||||
*
|
||||
* @param string $sProcessUID {@min 32} {@max 32}
|
||||
* @param string $sTaskUID {@min 32} {@max 32}
|
||||
* @param string $sAssigneeUID {@min 32} {@max 32}
|
||||
* @param string $assType {@choice user,group}
|
||||
* @param string $proUid {@min 32} {@max 32}
|
||||
* @param string $tasUid {@min 32} {@max 32}
|
||||
* @param string $uid {@min 32} {@max 32}
|
||||
* @param string $type {@choice user,group}
|
||||
*
|
||||
* return array
|
||||
* @return array
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function addTaskAssignee($sProcessUID, $sTaskUID, $sAssigneeUID, $assType)
|
||||
public function addTaskAssignee($proUid, $tasUid, $uid, $type)
|
||||
{
|
||||
try {
|
||||
Validator::proUid($sProcessUID, '$prj_uid');
|
||||
$this->validateActUid($sTaskUID);
|
||||
$iType = 1;
|
||||
$iRelation = '';
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn( \TaskUserPeer::TU_RELATION );
|
||||
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID );
|
||||
$oCriteria->add(\TaskUserPeer::TAS_UID, $sTaskUID );
|
||||
$oCriteria->add(\TaskUserPeer::TU_TYPE, $iType );
|
||||
$oTaskUser = \TaskUserPeer::doSelectRS( $oCriteria );
|
||||
$oTaskUser->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
while ($oTaskUser->next()) {
|
||||
$aRow = $oTaskUser->getRow();
|
||||
$iRelation = $aRow['TU_RELATION'];
|
||||
}
|
||||
$oTaskUser = \TaskUserPeer::retrieveByPK( $sTaskUID, $sAssigneeUID, $iType, $iRelation );
|
||||
if (! is_null( $oTaskUser )) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_ALREADY_ASSIGNED", array($sAssigneeUID, $sTaskUID)));
|
||||
Validator::proUid($proUid, '$prj_uid');
|
||||
$this->validateActUid($tasUid);
|
||||
$taskUser = new TaskUser();
|
||||
$response = $taskUser->getAssigment($tasUid, $uid);
|
||||
if (!empty($response)) {
|
||||
throw new Exception(G::LoadTranslation("ID_ALREADY_ASSIGNED", [$uid, $tasUid]));
|
||||
} else {
|
||||
$oTypeAssigneeG = \GroupwfPeer::retrieveByPK( $sAssigneeUID );
|
||||
$oTypeAssigneeU = \UsersPeer::retrieveByPK( $sAssigneeUID );
|
||||
if (is_null( $oTypeAssigneeG ) && is_null( $oTypeAssigneeU ) ) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_DOES_NOT_CORRESPOND", array($sAssigneeUID, $assType)));
|
||||
$groupUid = Groupwf::query()->select()->group($uid)->get()->toArray();
|
||||
$userUid = User::query()->select()->user($uid)->get()->toArray();
|
||||
if (empty($groupUid) && empty($userUid)) {
|
||||
throw new Exception(G::LoadTranslation("ID_DOES_NOT_CORRESPOND", [$uid, $type]));
|
||||
}
|
||||
if (is_null( $oTypeAssigneeG ) && ! is_null( $oTypeAssigneeU) ) {
|
||||
$type = "user";
|
||||
if ( $type != $assType ) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_DOES_NOT_CORRESPOND", array($sAssigneeUID, $assType)));
|
||||
}
|
||||
if (empty($groupUid) && !empty($userUid) && $type !== "user") {
|
||||
throw new Exception(G::LoadTranslation("ID_DOES_NOT_CORRESPOND", [$uid, $type]));
|
||||
}
|
||||
if (! is_null( $oTypeAssigneeG ) && is_null( $oTypeAssigneeU ) ) {
|
||||
$type = "group";
|
||||
if ( $type != $assType ) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_DOES_NOT_CORRESPOND", array($sAssigneeUID, $assType)));
|
||||
}
|
||||
}
|
||||
$oTaskUser = new \TaskUser();
|
||||
if ( $assType == "user" ) {
|
||||
$oTaskUser->create(array('TAS_UID' => $sTaskUID,
|
||||
'USR_UID' => $sAssigneeUID,
|
||||
'TU_TYPE' => $iType,
|
||||
'TU_RELATION' => 1));
|
||||
} else {
|
||||
$oTaskUser->create(array('TAS_UID' => $sTaskUID,
|
||||
'USR_UID' => $sAssigneeUID,
|
||||
'TU_TYPE' => $iType,
|
||||
'TU_RELATION' => 2));
|
||||
if (!empty($groupUid) && empty($userUid) && $type !== "group") {
|
||||
throw new Exception(G::LoadTranslation("ID_DOES_NOT_CORRESPOND", [$uid, $type]));
|
||||
}
|
||||
// Register the assigment
|
||||
$attributes = [
|
||||
'TAS_UID' => $tasUid,
|
||||
'USR_UID' => $uid,
|
||||
'TU_TYPE' => 1,
|
||||
'TU_RELATION' => ($type === "user") ? 1 : 2
|
||||
];
|
||||
$assigment = TaskUser::create($attributes);
|
||||
// Register the action in audit log
|
||||
$assignTask = ($type === "user") ? 'AssignUserTask' : 'AssignGroupTask';
|
||||
G::auditlog($assignTask, 'Assign ' . $type . ' to Task -> ' . $tasUid . ',' . $type . ' Uid -> ' . $uid);
|
||||
}
|
||||
} catch ( \Exception $e ) {
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,16 +29,21 @@ class AuditLog
|
||||
$this->columns = ['date', 'workspace', 'ip', 'id', 'user', 'action', 'description'];
|
||||
|
||||
$this->actions = [
|
||||
// User
|
||||
"CreateUser" => G::LoadTranslation("ID_CREATE_USER"),
|
||||
"UpdateUser" => G::LoadTranslation("ID_UPDATE_USER"),
|
||||
"DeleteUser" => G::LoadTranslation("ID_DELETE_USER"),
|
||||
"EnableUser" => G::LoadTranslation("ID_ENABLE_USER"),
|
||||
"DisableUser" => G::LoadTranslation("ID_DISABLE_USER"),
|
||||
"AssignAuthenticationSource" => G::LoadTranslation("ID_ASSIGN_AUTHENTICATION_SOURCE"),
|
||||
"AssignUserToGroup" => G::LoadTranslation("ID_ASSIGN_USER_TO_GROUP"),
|
||||
"RemoveUser" => G::LoadTranslation("ID_REMOVE_USER"),
|
||||
// Authentication
|
||||
"AssignAuthenticationSource" => G::LoadTranslation("ID_ASSIGN_AUTHENTICATION_SOURCE"),
|
||||
"CreateAuthSource" => G::LoadTranslation("ID_CREATE_AUTH_SOURCE"),
|
||||
"UpdateAuthSource" => G::LoadTranslation("ID_UPDATE_AUTH_SOURCE"),
|
||||
"DeleteAuthSource" => G::LoadTranslation("ID_DELETE_AUTH_SOURCE"),
|
||||
// Role
|
||||
"AssignRole" => G::LoadTranslation("ID_ASSIGN_ROLE"),
|
||||
"CreateRole" => G::LoadTranslation("ID_CREATE_ROLE"),
|
||||
"UpdateRole" => G::LoadTranslation("ID_UPDATE_ROLE"),
|
||||
"DeleteRole" => G::LoadTranslation("ID_DELETE_ROLE"),
|
||||
@@ -46,70 +51,83 @@ class AuditLog
|
||||
"DeleteUserToRole" => G::LoadTranslation("ID_DELETE_USER_TO_ROLE"),
|
||||
"AddPermissionToRole" => G::LoadTranslation("ID_ADD_PERMISSION_TO_ROLE"),
|
||||
"DeletePermissionToRole" => G::LoadTranslation("ID_DELETE_PERMISSION_TO_ROLE"),
|
||||
// Skin
|
||||
"CreateSkin" => G::LoadTranslation("ID_CREATE_SKIN"),
|
||||
"ImportSkin" => G::LoadTranslation("ID_IMPORT_SKIN"),
|
||||
"ExportSkin" => G::LoadTranslation("ID_EXPORT_SKIN"),
|
||||
"DeleteSkin" => G::LoadTranslation("ID_DELETE_SKIN"),
|
||||
// Group
|
||||
"CreateGroup" => G::LoadTranslation("ID_CREATE_GROUP"),
|
||||
"UpdateGroup" => G::LoadTranslation("ID_UPDATE_GROUP"),
|
||||
"DeleteGroup" => G::LoadTranslation("ID_DELETE_GROUP"),
|
||||
// Category
|
||||
"CreateCategory" => G::LoadTranslation("ID_CREATE_CATEGORY"),
|
||||
"UpdateCategory" => G::LoadTranslation("ID_UPDATE_CATEGORY"),
|
||||
"DeleteCategory" => G::LoadTranslation("ID_DELETE_CATEGORY"),
|
||||
// Cache
|
||||
"BuildCache" => G::LoadTranslation("ID_BUILD_CACHE"),
|
||||
"ClearCache" => G::LoadTranslation("ID_CLEAR_CACHE"),
|
||||
// Cron
|
||||
"ClearCron" => G::LoadTranslation("ID_CLEAR_CRON"),
|
||||
"UpdateEnvironmentSettings" => G::LoadTranslation("ID_UPDATE_ENVIRONMENT_SETTINGS"),
|
||||
"UpdateLoginSettings" => G::LoadTranslation("ID_UPDATE_LOGIN_SETTINGS"),
|
||||
"EnableHeartBeat" => G::LoadTranslation("ID_ENABLE_HEART_BEAT"),
|
||||
"DisableHeartBeat" => G::LoadTranslation("ID_DISABLE_HEART_BEAT"),
|
||||
// PmTables
|
||||
"CreatePmtable" => G::LoadTranslation("ID_CREATE_PMTABLE"),
|
||||
"UpdatePmtable" => G::LoadTranslation("ID_UPDATE_PMTABLE"),
|
||||
"DeletePmtable" => G::LoadTranslation("ID_DELETE_PMTABLE"),
|
||||
"AddDataPmtable" => G::LoadTranslation("ID_ADD_DATA_PMTABLE"),
|
||||
"UpdateDataPmtable" => G::LoadTranslation("ID_UPDATE_DATA_PMTABLE"),
|
||||
"DeleteDataPmtable" => G::LoadTranslation("ID_DELETE_DATA_PMTABLE"),
|
||||
"ImportTable" => G::LoadTranslation("ID_IMPORT_TABLE"),
|
||||
"ExportTable" => G::LoadTranslation("ID_EXPORT_TABLE"),
|
||||
"ImportPmTable" => G::LoadTranslation("ID_IMPORT_TABLE"),
|
||||
"ExportPmTable" => G::LoadTranslation("ID_EXPORT_TABLE"),
|
||||
// Calendar
|
||||
"CreateCalendar" => G::LoadTranslation("ID_CREATE_CALENDAR"),
|
||||
"UpdateCalendar" => G::LoadTranslation("ID_UPDATE_CALENDAR"),
|
||||
"DeleteCalendar" => G::LoadTranslation("ID_DELETE_CALENDAR"),
|
||||
// Dashlet
|
||||
"CreateDashletInstance" => G::LoadTranslation("ID_CREATE_DASHLET_INSTANCE"),
|
||||
"UpdateDashletInstance" => G::LoadTranslation("ID_UPDATE_DASHLET_INSTANCE"),
|
||||
"DeleteDashletInstance" => G::LoadTranslation("ID_DELETE_DASHLET_INSTANCE"),
|
||||
"CreateDepartament" => G::LoadTranslation("ID_CREATE_DEPARTAMENT"),
|
||||
"CreateSubDepartament" => G::LoadTranslation("ID_CREATE_SUB_DEPARTAMENT"),
|
||||
"UpdateDepartament" => G::LoadTranslation("ID_UPDATE_DEPARTAMENT"),
|
||||
"UpdateSubDepartament" => G::LoadTranslation("ID_UPDATE_SUB_DEPARTAMENT"),
|
||||
"DeleteDepartament" => G::LoadTranslation("ID_DELETE_DEPARTAMENT"),
|
||||
"AssignManagerToDepartament" => G::LoadTranslation("ID_ASSIGN_MANAGER_TO_DEPARTAMENT"),
|
||||
"AssignUserToDepartament" => G::LoadTranslation("ID_ASSIGN_USER_TO_DEPARTAMENT"),
|
||||
"RemoveUsersFromDepartament" => G::LoadTranslation("ID_REMOVE_USERS_FROM_DEPARTAMENT"),
|
||||
"AssignUserToGroup" => G::LoadTranslation("ID_ASSIGN_USER_TO_GROUP"),
|
||||
// Department
|
||||
"CreateDepartment" => G::LoadTranslation("ID_CREATE_DEPARTAMENT"),
|
||||
"CreateSubDepartment" => G::LoadTranslation("ID_CREATE_SUB_DEPARTAMENT"),
|
||||
"UpdateDepartment" => G::LoadTranslation("ID_UPDATE_DEPARTAMENT"),
|
||||
"UpdateSubDepartment" => G::LoadTranslation("ID_UPDATE_SUB_DEPARTAMENT"),
|
||||
"DeleteDepartment" => G::LoadTranslation("ID_DELETE_DEPARTAMENT"),
|
||||
"AssignManagerToDepartment" => G::LoadTranslation("ID_ASSIGN_MANAGER_TO_DEPARTAMENT"),
|
||||
"AssignUserToDepartment" => G::LoadTranslation("ID_ASSIGN_USER_TO_DEPARTAMENT"),
|
||||
"RemoveUsersFromDepartment" => G::LoadTranslation("ID_REMOVE_USERS_FROM_DEPARTAMENT"),
|
||||
// Language
|
||||
"UploadLanguage" => G::LoadTranslation("ID_UPLOAD_LANGUAGE"),
|
||||
"ExportLanguage" => G::LoadTranslation("ID_EXPORT_LANGUAGE"),
|
||||
"DeleteLanguage" => G::LoadTranslation("ID_DELETE_LAGUAGE"),
|
||||
// Settings
|
||||
"UploadSystemSettings" => G::LoadTranslation("ID_UPLOAD_SYSTEM_SETTINGS"),
|
||||
"UpdateEmailSettings" => G::LoadTranslation("ID_UPDATE_EMAIL_SETTINGS"),
|
||||
"CreateEmailSettings" => G::LoadTranslation("ID_CREATE_EMAIL_SETTINGS"),
|
||||
// Logo
|
||||
"UploadLogo" => G::LoadTranslation("ID_UPLOAD_LOGO"),
|
||||
"DeleteLogo" => G::LoadTranslation("ID_DELETE_LOGO"),
|
||||
"RestoreLogo" => G::LoadTranslation("ID_RESTORE_LOGO"),
|
||||
"ReplaceLogo" => G::LoadTranslation("ID_REPLACE_LOGO"),
|
||||
// Plugin
|
||||
"InstallPlugin" => G::LoadTranslation("ID_INSTALL_PLUGIN"),
|
||||
"EnablePlugin" => G::LoadTranslation("ID_ENABLE_PLUGIN"),
|
||||
"DisablePlugin" => G::LoadTranslation("ID_DISABLE_PLUGIN"),
|
||||
"RemovePlugin" => G::LoadTranslation("ID_REMOVE_PLUGIN"),
|
||||
"SetColumns" => G::LoadTranslation("ID_SET_COLUMNS"),
|
||||
// AuditLog
|
||||
"EnableAuditLog" => G::LoadTranslation("ID_ENABLE_AUDIT_LOG"),
|
||||
"DisableAuditLog" => G::LoadTranslation("ID_DISABLE_AUDIT_LOG"),
|
||||
// Process
|
||||
"EditProcess" => G::LoadTranslation("ID_EDIT_PROCESS"),
|
||||
"ExportProcess" => G::LoadTranslation("ID_EXPORT_PROCESS"),
|
||||
"ImportProcess" => G::LoadTranslation("ID_IMPORT_PROCESS"),
|
||||
"DeleteProcess" => G::LoadTranslation("ID_DELETE_PROCESS"),
|
||||
// Web entry
|
||||
"WebEntry" => G::LoadTranslation("ID_WEB_ENTRY"),
|
||||
"AssignRole" => G::LoadTranslation("ID_ASSIGN_ROLE"),
|
||||
"RemoveUser" => G::LoadTranslation("ID_REMOVE_USER"),
|
||||
"AddTask" => G::LoadTranslation("ID_ADD_TASK"),
|
||||
"AddSubProcess" => G::LoadTranslation("ID_ADD_SUB_PROCESS"),
|
||||
// Diagram
|
||||
"SaveTaskPosition" => G::LoadTranslation("ID_SAVE_TASK_POSITION"),
|
||||
"AddHorizontalLine" => G::LoadTranslation("ID_ADD_HORIZONTAL_LINE"),
|
||||
"AddVerticalLine" => G::LoadTranslation("ID_ADD_VERTICAL_LINE"),
|
||||
@@ -120,60 +138,75 @@ class AuditLog
|
||||
"UpdateText" => G::LoadTranslation("ID_UPDATE_TEXT"),
|
||||
"SaveTextPosition" => G::LoadTranslation("ID_SAVE_TEXT_POSITION"),
|
||||
"DeleteText" => G::LoadTranslation("ID_DELETE_TEXT"),
|
||||
"EditEvent" => G::LoadTranslation("ID_EDIT_EVENT"),
|
||||
"DeleteEvent" => G::LoadTranslation("ID_EVENT_DELETED"),
|
||||
// File Manager
|
||||
"ProcessFileManager" => G::LoadTranslation("ID_PROCESS_FILE_MANAGER"),
|
||||
// Process Permission
|
||||
"ProcessPermissions" => G::LoadTranslation("ID_PROCESS_PERMISSIONS"),
|
||||
"DeletePermissions" => G::LoadTranslation("ID_DELETE_PERMISSIONS"),
|
||||
// Supervising
|
||||
"AssignSupervisorDynaform" => G::LoadTranslation("ID_ASSIGN_SUPERVISOR_DYNAFORM"),
|
||||
"RemoveSupervisorDynaform" => G::LoadTranslation("ID_REMOVE_SUPERVISOR_DYNAFORM"),
|
||||
"AssignSupervisorInput" => G::LoadTranslation("ID_ASSIGN_SUPERVISOR_INPUT"),
|
||||
"RemoveSupervisorInput" => G::LoadTranslation("ID_REMOVE_SUPERVISOR_INPUT"),
|
||||
// Case Tracker
|
||||
"CaseTrackers" => G::LoadTranslation("ID_CASE_TRACKERS"),
|
||||
"EditEvent" => G::LoadTranslation("ID_EDIT_EVENT"),
|
||||
"DeleteEvent" => G::LoadTranslation("ID_EVENT_DELETED"),
|
||||
// Dynaform
|
||||
"CreateDynaform" => G::LoadTranslation("ID_CREATE_DYNAFORM"),
|
||||
"UpdateDynaform" => G::LoadTranslation("ID_UPDATE_DYNAFORM"),
|
||||
"DeleteDynaform" => G::LoadTranslation("ID_DELETE_DYNAFORM"),
|
||||
"ConditionsEditorDynaform" => G::LoadTranslation("ID_CONDITIONS_EDITOR_DYNAFORM"),
|
||||
"SetColumns" => G::LoadTranslation("ID_SET_COLUMNS"),
|
||||
// Case Scheduler
|
||||
"CreateCaseScheduler" => G::LoadTranslation("ID_CREATE_CASE_SCHEDULER"),
|
||||
"UpdateCaseScheduler" => G::LoadTranslation("ID_UPDATE_CASE_SCHEDULER"),
|
||||
"DeleteCaseScheduler" => G::LoadTranslation("ID_DELETE_CASE_SCHEDULER"),
|
||||
// Database Connection
|
||||
"CreateDatabaseConnection" => G::LoadTranslation("ID_CREATE_DATABASE_CONNECTION"),
|
||||
"UpdateDatabaseConnection" => G::LoadTranslation("ID_UPDATE_DATABASE_CONNECTION"),
|
||||
"DeleteDatabaseConnection" => G::LoadTranslation("ID_DELETE_DATABASE_CONNECTION"),
|
||||
// Input Document
|
||||
"CreateInputDocument" => G::LoadTranslation("ID_CREATE_INPUT_DOCUMENT"),
|
||||
"UpdateInputDocument" => G::LoadTranslation("ID_UPDATE_INPUT_DOCUMENT"),
|
||||
"DeleteInputDocument" => G::LoadTranslation("ID_DELETE_INPUT_DOCUMENT"),
|
||||
// Output Document
|
||||
"CreateOutputDocument" => G::LoadTranslation("ID_CREATE_OUTPUT_DOCUMENT"),
|
||||
"UpdateOutputDocument" => G::LoadTranslation("ID_UPDATE_OUTPUT_DOCUMENT"),
|
||||
"DeleteOutputDocument" => G::LoadTranslation("ID_DELETE_OUTPUT_DOCUMENT"),
|
||||
// Trigger
|
||||
"CreateTrigger" => G::LoadTranslation("ID_CREATE_TRIGGER"),
|
||||
"UpdateTrigger" => G::LoadTranslation("ID_UPDATE_TRIGGER"),
|
||||
"DeleteTrigger" => G::LoadTranslation("ID_DELETE_TRIGGER"),
|
||||
"DerivationRule" => G::LoadTranslation("ID_DERIVATION_RULE"),
|
||||
"DeleteTask" => G::LoadTranslation("ID_DELETE_TASK"),
|
||||
"DeleteSubProcess" => G::LoadTranslation("ID_DELETE_SUB_PROCESS"),
|
||||
"OptionsMenuTask" => G::LoadTranslation("ID_OPTIONS_MENU_TASK"),
|
||||
"SaveTaskProperties" => G::LoadTranslation("ID_SAVE_TASK_PROPERTIES"),
|
||||
"DeleteRoutes" => G::LoadTranslation("ID_DELETE_ROUTES"),
|
||||
"NewConditionFromStep" => G::LoadTranslation("ID_NEW_CONDITION_FROM_STEP"),
|
||||
"AssignTrigger" => G::LoadTranslation("ID_ASSIGN_TRIGGER"),
|
||||
"UpTrigger" => G::LoadTranslation("ID_UP_TRIGGER"),
|
||||
"DownTrigger" => G::LoadTranslation("ID_DOWN_TRIGGER"),
|
||||
"DerivationRule" => G::LoadTranslation("ID_DERIVATION_RULE"),
|
||||
"OptionsMenuTask" => G::LoadTranslation("ID_OPTIONS_MENU_TASK"),
|
||||
"DeleteRoutes" => G::LoadTranslation("ID_DELETE_ROUTES"),
|
||||
// Steps
|
||||
"NewConditionFromStep" => G::LoadTranslation("ID_NEW_CONDITION_FROM_STEP"),
|
||||
"StepDelete" => G::LoadTranslation("ID_STEP_DELETE"),
|
||||
"StepUp" => G::LoadTranslation("ID_STEP_UP"),
|
||||
"StepDown" => G::LoadTranslation("ID_STEP_DOWN"),
|
||||
"SaveNewStep" => G::LoadTranslation("ID_SAVE_NEW_STEP"),
|
||||
// Task
|
||||
"AddTask" => G::LoadTranslation("ID_ADD_TASK"),
|
||||
"AddSubProcess" => G::LoadTranslation("ID_ADD_SUB_PROCESS"),
|
||||
"AssignUserTask" => G::LoadTranslation("ID_ASSIGN_USER_TASK"),
|
||||
"AssignGroupTask" => G::LoadTranslation("ID_ASSIGN_GROUP_TASK"),
|
||||
"DeleteUserTask" => G::LoadTranslation("ID_DELETE_USER_TASK"),
|
||||
"DeleteGroupTask" => G::LoadTranslation("ID_DELETE_GROUP_TASK"),
|
||||
"ImportProcess" => G::LoadTranslation("ID_IMPORT_PROCESS"),
|
||||
"DeleteProcess" => G::LoadTranslation("ID_DELETE_PROCESS"),
|
||||
"DeleteTask" => G::LoadTranslation("ID_DELETE_TASK"),
|
||||
"DeleteSubProcess" => G::LoadTranslation("ID_DELETE_SUB_PROCESS"),
|
||||
"SaveTaskProperties" => G::LoadTranslation("ID_SAVE_TASK_PROPERTIES"),
|
||||
// GSuite
|
||||
"GSuiteConfigurationSaved" => G::LoadTranslation("ID_G_SUITE_CONFIGURATION_SAVED"),
|
||||
"GSuiteConnect" => G::LoadTranslation("ID_G_SUITE_CONNECT"),
|
||||
"GSuiteDisconnect" => G::LoadTranslation("ID_G_SUITE_DISCONNECT"),
|
||||
"GSuiteLoadGroups" => G::LoadTranslation("ID_G_SUITE_LOAD_GROUPS"),
|
||||
"GSuiteSyncUsers" => G::LoadTranslation("ID_G_SUITE_SYNC_USERS"),
|
||||
// Saml
|
||||
"SamlEnable" => G::LoadTranslation("ID_SAML_ENABLE"),
|
||||
"SamlProvider" => G::LoadTranslation("ID_SAML_PROVIDER")
|
||||
];
|
||||
|
||||
@@ -834,9 +834,9 @@ class Delegation extends Model
|
||||
*/
|
||||
public function scopeJoinPreviousIndex($query)
|
||||
{
|
||||
$query->leftJoin('APP_DELEGATION AS AD', function( $leftJoin) {
|
||||
$query->leftJoin('APP_DELEGATION AS AD', function ($leftJoin) {
|
||||
$leftJoin->on('APP_DELEGATION.APP_NUMBER', '=', 'AD.APP_NUMBER')
|
||||
->on('APP_DELEGATION.DEL_PREVIOUS', '=', 'AD.DEL_INDEX');
|
||||
->on('APP_DELEGATION.DEL_PREVIOUS', '=', 'AD.DEL_INDEX');
|
||||
});
|
||||
|
||||
return $query;
|
||||
@@ -1863,7 +1863,7 @@ class Delegation extends Model
|
||||
$cases = new Cases;
|
||||
if (!is_array($caseData)) {
|
||||
$r = $cases->unserializeData($caseData);
|
||||
if($r !== false) {
|
||||
if ($r !== false) {
|
||||
$caseData = $r;
|
||||
}
|
||||
}
|
||||
@@ -1877,13 +1877,13 @@ class Delegation extends Model
|
||||
// If is empty get the previous title
|
||||
if ($delIndexPrevious > 0) {
|
||||
$thread = self::getThreadInfo($appNumber, $delIndexPrevious);
|
||||
if(empty($thread['DEL_TITLE'])) {
|
||||
$threadTitle = '# '. $appNumber;
|
||||
if (empty($thread['DEL_TITLE'])) {
|
||||
$threadTitle = '# ' . $appNumber;
|
||||
} else {
|
||||
$threadTitle = $thread['DEL_TITLE'];
|
||||
}
|
||||
} else {
|
||||
$threadTitle = '# '. $appNumber;
|
||||
$threadTitle = '# ' . $appNumber;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1949,4 +1949,24 @@ class Delegation extends Model
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a subprocess has active parent cases
|
||||
*
|
||||
* @param array $parents
|
||||
* @return bool
|
||||
*/
|
||||
public static function hasActiveParentsCases($parents)
|
||||
{
|
||||
foreach ($parents as $parent) {
|
||||
$query = Delegation::select()->where('PRO_UID', $parent['PRO_PARENT'])
|
||||
->where('TAS_UID', $parent['TAS_PARENT'])->where('DEL_THREAD_STATUS', 'OPEN')
|
||||
->limit(1);
|
||||
$res = $query->get()->values()->toArray();
|
||||
if (!empty($res)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,5 +29,18 @@ class Groupwf extends Model
|
||||
{
|
||||
return $this->belongsTo(GroupUser::class, 'GRP_ID', 'GRP_ID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope for query to get the group uid
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param string $uid
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeGroup($query, $uid)
|
||||
{
|
||||
return $query->where('GRP_UID', $uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
26
workflow/engine/src/ProcessMaker/Model/SubProcess.php
Normal file
26
workflow/engine/src/ProcessMaker/Model/SubProcess.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Model;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use ProcessMaker\Model\Application;
|
||||
|
||||
class SubProcess extends Model
|
||||
{
|
||||
protected $table = 'SUB_PROCESS';
|
||||
protected $primaryKey = 'SP_UID';
|
||||
// We do not have create/update timestamps for this table
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Get he Process parents of a subprocess
|
||||
*
|
||||
* @param string $proUid
|
||||
* @return array
|
||||
*/
|
||||
public static function getProParents($proUid)
|
||||
{
|
||||
$query = SubProcess::select('PRO_PARENT', 'TAS_PARENT')->where('PRO_UID', $proUid);
|
||||
return $query->get()->values()->toArray();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,20 @@ class TaskUser extends Model
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'TAS_UID',
|
||||
'TAS_ID',
|
||||
'USR_UID',
|
||||
'TU_TYPE',
|
||||
'TU_RELATION',
|
||||
'ASSIGNED_ID',
|
||||
];
|
||||
|
||||
/**
|
||||
* Return the task this belongs to
|
||||
*/
|
||||
@@ -26,6 +40,21 @@ class TaskUser extends Model
|
||||
return $this->belongsTo(User::class, 'USR_UID', 'USR_UID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope for query to get the assigment
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @param string $tasUid
|
||||
* @param string $usrUid
|
||||
* @param integer $type
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function scopeAssigment($query, $tasUid, $usrUid, $type = 1)
|
||||
{
|
||||
return $query->where('TAS_UID', $tasUid)->where('USR_UID', $usrUid)->where('TU_TYPE', $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the task self services related to the user
|
||||
*
|
||||
@@ -69,4 +98,22 @@ class TaskUser extends Model
|
||||
|
||||
return $tasks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the specific assigment related to the task, by default the normal assigment
|
||||
*
|
||||
* @param string $tasUid
|
||||
* @param string $uid
|
||||
* @param integer $type, can be 1 = Normal or 2 = Ad-hoc
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getAssigment($tasUid, $uid, $type = 1)
|
||||
{
|
||||
$query = TaskUser::query()->select()
|
||||
->assigment($tasUid, $uid, $type);
|
||||
$result = $query->get()->toArray();
|
||||
|
||||
return head($result);
|
||||
}
|
||||
}
|
||||
@@ -41,8 +41,7 @@ class User extends Model
|
||||
*/
|
||||
public function scopeUser($query, string $usrUid)
|
||||
{
|
||||
$result = $query->where('USR_UID', '=', $usrUid);
|
||||
return $result;
|
||||
return $query->where('USR_UID', '=', $usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user