Merge remote-tracking branch 'upstream/3.1' into HOR-1007
Conflicts: gulliver/system/class.rbac.php rbac/engine/data/mysql/insert.sql
This commit is contained in:
@@ -229,7 +229,9 @@ class RBAC
|
|||||||
"Delete process cases"
|
"Delete process cases"
|
||||||
), array("PER_UID" => "00000000000000000000000000000037", "PER_CODE" => "PM_EDITPERSONALINFO_CALENDAR",
|
), array("PER_UID" => "00000000000000000000000000000037", "PER_CODE" => "PM_EDITPERSONALINFO_CALENDAR",
|
||||||
"PER_NAME" => "Edit personal info Calendar"
|
"PER_NAME" => "Edit personal info Calendar"
|
||||||
), array("PER_UID" => "00000000000000000000000000000038", "PER_CODE" => "PM_REST_API_APPLICATIONS",
|
), array("PER_UID" => "00000000000000000000000000000038", "PER_CODE" => "PM_UNCANCELCASE",
|
||||||
|
"PER_NAME" => "Undo cancel case"
|
||||||
|
), array("PER_UID" => "00000000000000000000000000000039", "PER_CODE" => "PM_REST_API_APPLICATIONS",
|
||||||
"PER_NAME" => "Create rest API Aplications"
|
"PER_NAME" => "Create rest API Aplications"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ INSERT INTO `RBAC_PERMISSIONS` VALUES
|
|||||||
('00000000000000000000000000000035','PM_SETUP_LOGS','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
|
('00000000000000000000000000000035','PM_SETUP_LOGS','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
|
||||||
('00000000000000000000000000000036','PM_DELETE_PROCESS_CASES','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
|
('00000000000000000000000000000036','PM_DELETE_PROCESS_CASES','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
|
||||||
('00000000000000000000000000000037','PM_EDITPERSONALINFO_CALENDAR','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
|
('00000000000000000000000000000037','PM_EDITPERSONALINFO_CALENDAR','2016-03-01 00:00:00','2016-03-01 00:00:00',1,'00000000000000000000000000000002'),
|
||||||
('00000000000000000000000000000038','PM_REST_API_APPLICATIONS','2016-06-14 00:00:00','2016-06-14 00:00:00',1,'00000000000000000000000000000002');
|
('00000000000000000000000000000038','PM_UNCANCELCASE','2016-06-14 00:00:00','2016-06-14 00:00:00',1,'00000000000000000000000000000002'),
|
||||||
|
('00000000000000000000000000000039','PM_REST_API_APPLICATIONS','2016-06-14 00:00:00','2016-06-14 00:00:00',1,'00000000000000000000000000000002');
|
||||||
|
|
||||||
INSERT INTO `RBAC_ROLES` VALUES
|
INSERT INTO `RBAC_ROLES` VALUES
|
||||||
('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1),
|
||||||
@@ -84,6 +85,7 @@ INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
|
|||||||
('00000000000000000000000000000002','00000000000000000000000000000036'),
|
('00000000000000000000000000000002','00000000000000000000000000000036'),
|
||||||
('00000000000000000000000000000002','00000000000000000000000000000037'),
|
('00000000000000000000000000000002','00000000000000000000000000000037'),
|
||||||
('00000000000000000000000000000002','00000000000000000000000000000038'),
|
('00000000000000000000000000000002','00000000000000000000000000000038'),
|
||||||
|
('00000000000000000000000000000002','00000000000000000000000000000039'),
|
||||||
('00000000000000000000000000000003','00000000000000000000000000000001'),
|
('00000000000000000000000000000003','00000000000000000000000000000001'),
|
||||||
('00000000000000000000000000000003','00000000000000000000000000000005'),
|
('00000000000000000000000000000003','00000000000000000000000000000005'),
|
||||||
('00000000000000000000000000000004','00000000000000000000000000000001'),
|
('00000000000000000000000000000004','00000000000000000000000000000001'),
|
||||||
@@ -119,7 +121,8 @@ INSERT INTO `RBAC_ROLES_PERMISSIONS` VALUES
|
|||||||
('00000000000000000000000000000004','00000000000000000000000000000035'),
|
('00000000000000000000000000000004','00000000000000000000000000000035'),
|
||||||
('00000000000000000000000000000004','00000000000000000000000000000036'),
|
('00000000000000000000000000000004','00000000000000000000000000000036'),
|
||||||
('00000000000000000000000000000004','00000000000000000000000000000037'),
|
('00000000000000000000000000000004','00000000000000000000000000000037'),
|
||||||
('00000000000000000000000000000004','00000000000000000000000000000038');
|
('00000000000000000000000000000004','00000000000000000000000000000038'),
|
||||||
|
('00000000000000000000000000000004','00000000000000000000000000000039');
|
||||||
|
|
||||||
INSERT INTO `RBAC_SYSTEMS` VALUES ('00000000000000000000000000000001','RBAC','2007-07-31 19:10:22','2007-08-03 12:24:36',1),('00000000000000000000000000000002','PROCESSMAKER','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
INSERT INTO `RBAC_SYSTEMS` VALUES ('00000000000000000000000000000001','RBAC','2007-07-31 19:10:22','2007-08-03 12:24:36',1),('00000000000000000000000000000002','PROCESSMAKER','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
||||||
INSERT INTO `RBAC_USERS` VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','','');
|
INSERT INTO `RBAC_USERS` VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','','');
|
||||||
|
|||||||
@@ -4396,6 +4396,132 @@ class Cases
|
|||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Un cancel case
|
||||||
|
*
|
||||||
|
* @param string $caseUID
|
||||||
|
* @param string $userUID
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function unCancelCase($appUID, $userUID)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
global $RBAC;
|
||||||
|
if ($RBAC->userCanAccess('PM_UNCANCELCASE') !== 1) {
|
||||||
|
throw new Exception(G::LoadTranslation('ID_YOU_DO_NOT_HAVE_PERMISSION'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$application = new Application();
|
||||||
|
$rowApplication = $application->load($appUID);
|
||||||
|
if ($rowApplication["APP_STATUS"] !== "CANCELLED") {
|
||||||
|
throw new Exception(G::LoadTranslation('ID_THE_APPLICATION_IS_NOT_CANCELED', [$appUID]));
|
||||||
|
}
|
||||||
|
|
||||||
|
$criteriaAppDelay = new Criteria('workflow');
|
||||||
|
$criteriaAppDelay->add(AppDelayPeer::APP_UID, $appUID);
|
||||||
|
$criteriaAppDelay->add(AppDelayPeer::APP_STATUS, 'CANCELLED');
|
||||||
|
$criteriaAppDelay->add(AppDelayPeer::PRO_UID, $rowApplication['PRO_UID']);
|
||||||
|
$criteriaAppDelay->addDescendingOrderByColumn(AppDelayPeer::APP_ENABLE_ACTION_DATE);
|
||||||
|
$resultSetAppDelay = AppDelayPeer::doSelectRS($criteriaAppDelay);
|
||||||
|
$resultSetAppDelay->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$resultSetAppDelay->next();
|
||||||
|
$rowAppDelay = $resultSetAppDelay->getRow();
|
||||||
|
if (!isset($rowAppDelay['APP_STATUS'])) {
|
||||||
|
throw new Exception(G::LoadTranslation('ID_THREAD_STATUS_DOES_NOT_EXIST_FOR_THE_APPLICATION.', [$appUID]));
|
||||||
|
}
|
||||||
|
|
||||||
|
$users = new Users();
|
||||||
|
$rowUsers = $users->load($userUID);
|
||||||
|
|
||||||
|
//Application
|
||||||
|
$rowApplication['APP_STATUS'] = 'TO_DO';
|
||||||
|
$rowApplication['APP_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||||
|
$application->update($rowApplication);
|
||||||
|
|
||||||
|
//AppDelegation
|
||||||
|
$appDelegation = new AppDelegation();
|
||||||
|
$rowAppDelegation = $appDelegation->Load($appUID, $rowAppDelay['APP_DEL_INDEX']);
|
||||||
|
|
||||||
|
$appDelegation = new AppDelegation();
|
||||||
|
$delIndex = $appDelegation->createAppDelegation($rowAppDelegation['PRO_UID'], $rowAppDelegation['APP_UID'], $rowAppDelegation['TAS_UID'], $userUID, $rowAppDelay['APP_THREAD_INDEX']);
|
||||||
|
|
||||||
|
//AppThread
|
||||||
|
$dataAppThread = [
|
||||||
|
'APP_UID' => $rowApplication['APP_UID'],
|
||||||
|
'APP_THREAD_INDEX' => $rowAppDelay['APP_THREAD_INDEX'],
|
||||||
|
'APP_THREAD_STATUS' => 'OPEN',
|
||||||
|
'DEL_INDEX' => $delIndex
|
||||||
|
];
|
||||||
|
$appThread = new AppThread();
|
||||||
|
$appThread->update($dataAppThread);
|
||||||
|
|
||||||
|
//AppDelay
|
||||||
|
$dataAppDelay = [
|
||||||
|
'PRO_UID' => $rowApplication['PRO_UID'],
|
||||||
|
'APP_UID' => $rowApplication['APP_UID'],
|
||||||
|
'APP_THREAD_INDEX' => $rowAppDelay['APP_THREAD_INDEX'],
|
||||||
|
'APP_DELINDEX' => $delIndex,
|
||||||
|
'APP_TYPE' => 'UNCANCEL',
|
||||||
|
'APP_STATUS' => $rowApplication['APP_STATUS'],
|
||||||
|
'APP_NEXT_TASK' => 0,
|
||||||
|
'APP_DELEGATION_USER' => $userUID,
|
||||||
|
'APP_ENABLE_ACTION_USER' => $userUID,
|
||||||
|
'APP_ENABLE_ACTION_DATE' => date('Y-m-d H:i:s'),
|
||||||
|
'APP_DISABLE_ACTION_USER' => 0
|
||||||
|
];
|
||||||
|
$appDelay = new AppDelay();
|
||||||
|
$appDelay->create($dataAppDelay);
|
||||||
|
|
||||||
|
//ListCanceled
|
||||||
|
$criteriaListCanceled = new Criteria("workflow");
|
||||||
|
$criteriaListCanceled->add(ListCanceledPeer::APP_UID, $appUID);
|
||||||
|
$resultSetListCanceled = ListCanceledPeer::doSelectRS($criteriaListCanceled);
|
||||||
|
$resultSetListCanceled->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$resultSetListCanceled->next();
|
||||||
|
$rowListCanceled = $resultSetListCanceled->getRow();
|
||||||
|
ListCanceledPeer::doDelete($criteriaListCanceled);
|
||||||
|
$usrTotalCancelled = $rowUsers['USR_TOTAL_CANCELLED'] - 1;
|
||||||
|
|
||||||
|
//ListInbox
|
||||||
|
$rowListCanceled['DEL_PREVIOUS_USR_USERNAME'] = $rowListCanceled['DEL_CURRENT_USR_USERNAME'];
|
||||||
|
$rowListCanceled['DEL_PREVIOUS_USR_FIRSTNAME'] = $rowListCanceled['DEL_CURRENT_USR_FIRSTNAME'];
|
||||||
|
$rowListCanceled['DEL_PREVIOUS_USR_LASTNAME'] = $rowListCanceled['DEL_CURRENT_USR_LASTNAME'];
|
||||||
|
$rowListCanceled['APP_STATUS'] = 'TO_DO';
|
||||||
|
$rowListCanceled['APP_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||||
|
$rowListCanceled['DEL_RISK_DATE'] = date('Y-m-d H:i:s');
|
||||||
|
$rowListCanceled['DEL_INDEX'] = $delIndex;
|
||||||
|
unset($rowListCanceled['DEL_CURRENT_USR_USERNAME']);
|
||||||
|
unset($rowListCanceled['DEL_CURRENT_USR_FIRSTNAME']);
|
||||||
|
unset($rowListCanceled['DEL_CURRENT_USR_LASTNAME']);
|
||||||
|
unset($rowListCanceled['APP_CANCELED_DATE']);
|
||||||
|
$listInbox = new ListInbox();
|
||||||
|
$listInbox->create($rowListCanceled);
|
||||||
|
$usrTotalInbox = $rowUsers['USR_TOTAL_INBOX'] + 1;
|
||||||
|
|
||||||
|
//Users
|
||||||
|
$users->update([
|
||||||
|
'USR_UID' => $userUID,
|
||||||
|
'USR_TOTAL_INBOX' => $usrTotalInbox,
|
||||||
|
'USR_TOTAL_CANCELLED' => $usrTotalCancelled
|
||||||
|
]);
|
||||||
|
|
||||||
|
//ListParticipatedLast
|
||||||
|
$criteriaListParticipatedLast = new Criteria("workflow");
|
||||||
|
$criteriaListParticipatedLast->add(ListParticipatedLastPeer::APP_UID, $appUID);
|
||||||
|
$resultSetListParticipatedLast = ListParticipatedLastPeer::doSelectRS($criteriaListParticipatedLast);
|
||||||
|
$resultSetListParticipatedLast->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
$resultSetListParticipatedLast->next();
|
||||||
|
$rowListParticipatedLast = $resultSetListParticipatedLast->getRow();
|
||||||
|
$rowListParticipatedLast['APP_STATUS'] = 'TO_DO';
|
||||||
|
$rowListParticipatedLast['DEL_THREAD_STATUS'] = 'OPEN';
|
||||||
|
$rowListParticipatedLast['DEL_INIT_DATE'] = null;
|
||||||
|
$listParticipatedLast = new ListParticipatedLast();
|
||||||
|
$listParticipatedLast->update($rowListParticipatedLast);
|
||||||
|
} catch (Exception $oException) {
|
||||||
|
throw $oException;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* reactive a case
|
* reactive a case
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -3084,6 +3084,26 @@ function PMFGeti18nText($id, $category, $lang = "en")
|
|||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method
|
||||||
|
* The requested text in the specified language | If not found returns false
|
||||||
|
* @name PMFUnCancelCase
|
||||||
|
* @label PMF Un Cancel Case
|
||||||
|
* @param string | $caseUID | ID Case | Is the unique UID of the case
|
||||||
|
* @param string | $userUID | ID User | Is the unique ID of the user who will uncancel the case
|
||||||
|
* @return int | $value | Return | Returns 1 if the case was successfully uncancelled, otherwise returns 0 if an error ocurred
|
||||||
|
*/
|
||||||
|
function PMFUnCancelCase($caseUID, $userUID)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$cases = new Cases();
|
||||||
|
$cases->unCancelCase($caseUID, $userUID);
|
||||||
|
return 1;
|
||||||
|
} catch (Exception $oException) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
* Function to return an array of objects containing the properties of the fields
|
* Function to return an array of objects containing the properties of the fields
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ SELECT 'PER_NAME','','00000000000000000000000000000034','en','Setup User Authent
|
|||||||
SELECT 'PER_NAME','','00000000000000000000000000000035','en','Setup Logs' UNION ALL
|
SELECT 'PER_NAME','','00000000000000000000000000000035','en','Setup Logs' UNION ALL
|
||||||
SELECT 'PER_NAME','','00000000000000000000000000000036','en','Delete process cases' UNION ALL
|
SELECT 'PER_NAME','','00000000000000000000000000000036','en','Delete process cases' UNION ALL
|
||||||
SELECT 'PER_NAME','','00000000000000000000000000000037','en','Edit personal info Calendar' UNION ALL
|
SELECT 'PER_NAME','','00000000000000000000000000000037','en','Edit personal info Calendar' UNION ALL
|
||||||
|
SELECT 'PER_NAME','','00000000000000000000000000000038','en','Undo cancel case' UNION ALL
|
||||||
SELECT 'PER_NAME','','00000000000000000000000000000013','en','Delete cases' UNION ALL
|
SELECT 'PER_NAME','','00000000000000000000000000000013','en','Delete cases' UNION ALL
|
||||||
SELECT 'PER_NAME','','00000000000000000000000000000012','en','WebDav' UNION ALL
|
SELECT 'PER_NAME','','00000000000000000000000000000012','en','WebDav' UNION ALL
|
||||||
SELECT 'PER_NAME','','00000000000000000000000000000011','en','Dashboard' UNION ALL
|
SELECT 'PER_NAME','','00000000000000000000000000000011','en','Dashboard' UNION ALL
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ INSERT INTO CONTENT (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG,CON_VALUE) VALUES
|
|||||||
('PER_NAME','','00000000000000000000000000000034','en','Setup User Authentication Sources'),
|
('PER_NAME','','00000000000000000000000000000034','en','Setup User Authentication Sources'),
|
||||||
('PER_NAME','','00000000000000000000000000000035','en','Setup Logs'),
|
('PER_NAME','','00000000000000000000000000000035','en','Setup Logs'),
|
||||||
('PER_NAME','','00000000000000000000000000000036','en','Delete process cases'),
|
('PER_NAME','','00000000000000000000000000000036','en','Delete process cases'),
|
||||||
('PER_NAME','','00000000000000000000000000000037','en','Edit personal info Calendar');
|
('PER_NAME','','00000000000000000000000000000037','en','Edit personal info Calendar'),
|
||||||
|
('PER_NAME','','00000000000000000000000000000038','en','Undo cancel case');
|
||||||
|
|
||||||
INSERT INTO LANGUAGE (LAN_ID,LAN_LOCATION,LAN_NAME,LAN_NATIVE_NAME,LAN_DIRECTION,LAN_WEIGHT,LAN_ENABLED,LAN_CALENDAR) VALUES
|
INSERT INTO LANGUAGE (LAN_ID,LAN_LOCATION,LAN_NAME,LAN_NATIVE_NAME,LAN_DIRECTION,LAN_WEIGHT,LAN_ENABLED,LAN_CALENDAR) VALUES
|
||||||
('aa','','Afar','','L','0','0','GREGORIAN'),
|
('aa','','Afar','','L','0','0','GREGORIAN'),
|
||||||
|
|||||||
Reference in New Issue
Block a user