Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Testing assignee
|
||||
Feature: Project Properties Assignee Resources
|
||||
|
||||
Background:
|
||||
Given that I have a valid acess_token
|
||||
|
||||
Scenario: Get a list of available users and groups to be assigned to an activity
|
||||
Given that I have a valid access_token
|
||||
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/available-assignee"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
|
||||
|
||||
Scenario: List assignees of an activity
|
||||
Given that I have a valid access_token
|
||||
And I request "project/14414793652a5d718b65590036026581/activity/13508932952a5d718ef56f6044945775/assignee"
|
||||
@@ -13,18 +26,7 @@ Feature: Testing assignee
|
||||
And the "aas_username" property in row 0 equals "admin"
|
||||
And the "aas_type" property in row 0 equals "user"
|
||||
|
||||
Scenario: Get a list of available users and groups to be assigned to an activity
|
||||
Given that I have a valid access_token
|
||||
And I request "project/14414793652a5d718b65590036026581/activity/13508932952a5d718ef56f6044945775/available-assignee"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the "aas_uid" property in row 0 equals "1283376915224e7e5ccbfa0059627023"
|
||||
And the "aas_name" property in row 0 equals "Juana"
|
||||
And the "aas_lastname" property in row 0 equals "De Arco"
|
||||
And the "aas_username" property in row 0 equals "juana"
|
||||
And the "aas_type" property in row 0 equals "user"
|
||||
|
||||
|
||||
Scenario: Get a single user or group of an activity
|
||||
Given that I have a valid access_token
|
||||
@@ -39,18 +41,7 @@ Feature: Testing assignee
|
||||
And the "aas_username" property equals "admin"
|
||||
And the "aas_type" property equals "user"
|
||||
|
||||
Scenario: Assign a user or group to an activity
|
||||
Given that I have a valid access_token
|
||||
And POST this data:
|
||||
"""
|
||||
{
|
||||
"ass_uid": "42713393551f2a8aae1fde2096962777",
|
||||
"ass_type": "group"
|
||||
}
|
||||
"""
|
||||
And I request "project/14414793652a5d718b65590036026581/activity/13508932952a5d718ef56f6044945775/assignee"
|
||||
Then the response status code should be 201
|
||||
# And store "aas_uid" in session array
|
||||
|
||||
|
||||
# Scenario: Unassign a user or group to an activity
|
||||
# Given that I have a valid access_token
|
||||
|
||||
@@ -1,21 +1,122 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Project Properties - Ad hoc Assignee Resources
|
||||
Feature: Project Properties - Assignee Resources
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
Scenario: List AdHoc assignees of an activity
|
||||
Given this scenario is not implemented yet
|
||||
|
||||
Scenario: Get a list of available AdHoc users and groups to be assigned to an activity
|
||||
Given this scenario is not implemented yet
|
||||
|
||||
Scenario: Get a single AdHoc user or group of an activity
|
||||
Given this scenario is not implemented yet
|
||||
|
||||
Scenario: Assign an AdHoc user or group to an activity
|
||||
Given this scenario is not implemented yet
|
||||
|
||||
Scenario: Remove an AdHoc assignee from an activity
|
||||
Given this scenario is not implemented yet
|
||||
Scenario: Get a list of available users and groups to be assigned to an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-available-assignee"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 79 records
|
||||
And the "aas_uid" property in row 0 equals "35762872152cda4323207c6035916735"
|
||||
And the "aas_type" property in row 0 equals "group"
|
||||
|
||||
Scenario: Get a list of available users and groups to be assigned to an activity with filter
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-available-assignee?filter=departa&start=0&limit=50"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 3 records
|
||||
And the "aas_uid" property in row 0 equals "90268877852b7b4b9f134b1096735994"
|
||||
And the "aas_type" property in row 0 equals "group"
|
||||
|
||||
Scenario: Assign a user or group to an activity
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"ass_uid": "84643774552cda42dabb732033709262",
|
||||
"ass_type": "user"
|
||||
}
|
||||
"""
|
||||
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee"
|
||||
Then the response status code should be 201
|
||||
And the type is "object"
|
||||
|
||||
Scenario: Assign a user or group to an activity
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"ass_uid": "95888918452cda41a2b5d11013819411",
|
||||
"ass_type": "user"
|
||||
}
|
||||
"""
|
||||
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee"
|
||||
Then the response status code should be 201
|
||||
And the type is "object"
|
||||
|
||||
Scenario: Assign a user or group to an activity
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"ass_uid": "16698718252cda431814024050455569",
|
||||
"ass_type": "group"
|
||||
}
|
||||
"""
|
||||
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee"
|
||||
Then the response status code should be 201
|
||||
And the type is "object"
|
||||
|
||||
Scenario: Assign a user or group to an activity
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"ass_uid": "90706007452cda42ed1c326093152317",
|
||||
"ass_type": "group"
|
||||
}
|
||||
"""
|
||||
And I request "project/4224292655297723eb98691001100052/activity/68911670852a22d93c22c06005808422/adhoc-assignee"
|
||||
Then the response status code should be 201
|
||||
And the type is "object"
|
||||
|
||||
Scenario: List assignees of an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 7 records
|
||||
And the "aas_uid" property in row 0 equals "10732248352cda434c43997043577116"
|
||||
And the "aas_type" property in row 0 equals "group"
|
||||
|
||||
Scenario: List assignees of an activity with filter
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee?filter=emi"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 1 record
|
||||
And the "aas_uid" property in row 0 equals "84643774552cda42dabb732033709262"
|
||||
And the "aas_type" property in row 0 equals "user"
|
||||
|
||||
Scenario: Get a single user or group of an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee/95888918452cda41a2b5d11013819411"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "object"
|
||||
And the "aas_uid" property equals "95888918452cda41a2b5d11013819411"
|
||||
And the "aas_name" property equals "Mike"
|
||||
And the "aas_lastname" property equals "Balisi"
|
||||
And the "aas_username" property equals "mike"
|
||||
And the "aas_type" property equals "user"
|
||||
|
||||
Scenario: Remove assignee from an activity
|
||||
Given that I want to delete a resource with the key "aas_uid" stored in session array
|
||||
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee/91968412052cda4097270a3085279286"
|
||||
Then the response status code should be 200
|
||||
|
||||
Scenario: List assignees of an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 6 records
|
||||
|
||||
Scenario: List assignees of an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/12345/adhoc-assignee"
|
||||
Then the response status code should be 400
|
||||
|
||||
@@ -4,18 +4,123 @@ Feature: Project Properties - Assignee Resources
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
Scenario: List assignees of an activity
|
||||
Given this scenario is not implemented yet
|
||||
|
||||
Scenario: Get a list of available users and groups to be assigned to an activity
|
||||
Given this scenario is not implemented yet
|
||||
|
||||
Scenario: Get a single user or group of an activity
|
||||
Given this scenario is not implemented yet
|
||||
|
||||
Scenario: Assign a user or group to an activity
|
||||
Given this scenario is not implemented yet
|
||||
|
||||
Scenario: Remove assignee from an activity
|
||||
Given this scenario is not implemented yet
|
||||
Scenario: Get a list of available users and groups to be assigned to an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/available-assignee"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 79 records
|
||||
And the "aas_uid" property in row 0 equals "35762872152cda4323207c6035916735"
|
||||
And the "aas_type" property in row 0 equals "group"
|
||||
|
||||
Scenario: Get a list of available users and groups to be assigned to an activity with filter
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/available-assignee?filter=departa&start=0&limit=50"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 3 records
|
||||
And the "aas_uid" property in row 0 equals "90268877852b7b4b9f134b1096735994"
|
||||
And the "aas_type" property in row 0 equals "group"
|
||||
|
||||
Scenario: Assign a user or group to an activity
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"ass_uid": "66386662252cda3f9a63226052377198",
|
||||
"ass_type": "user"
|
||||
}
|
||||
"""
|
||||
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee"
|
||||
Then the response status code should be 201
|
||||
And the type is "object"
|
||||
|
||||
Scenario: Assign a user or group to an activity
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"ass_uid": "69191356252cda41acde328048794164",
|
||||
"ass_type": "user"
|
||||
}
|
||||
"""
|
||||
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee"
|
||||
Then the response status code should be 201
|
||||
And the type is "object"
|
||||
|
||||
Scenario: Assign a user or group to an activity
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"ass_uid": "35762872152cda4323207c6035916735",
|
||||
"ass_type": "group"
|
||||
}
|
||||
"""
|
||||
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee"
|
||||
Then the response status code should be 201
|
||||
And the type is "object"
|
||||
|
||||
Scenario: Assign a user or group to an activity
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"ass_uid": "90706007452cda42ed1c326093152317",
|
||||
"ass_type": "group"
|
||||
}
|
||||
"""
|
||||
And I request "project/4224292655297723eb98691001100052/activity/68911670852a22d93c22c06005808422/assignee"
|
||||
Then the response status code should be 201
|
||||
And the type is "object"
|
||||
|
||||
Scenario: List assignees of an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 7 records
|
||||
And the "aas_uid" property in row 0 equals "35762872152cda4323207c6035916735"
|
||||
And the "aas_type" property in row 0 equals "group"
|
||||
|
||||
Scenario: List assignees of an activity with filter
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee?filter=oli"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 1 record
|
||||
And the "aas_uid" property in row 0 equals "69191356252cda41acde328048794164"
|
||||
And the "aas_type" property in row 0 equals "user"
|
||||
|
||||
Scenario: Get a single user or group of an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee/69191356252cda41acde328048794164"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "object"
|
||||
And the "aas_uid" property equals "69191356252cda41acde328048794164"
|
||||
And the "aas_name" property equals "Olivia"
|
||||
And the "aas_lastname" property equals "Austin"
|
||||
And the "aas_username" property equals "olivia"
|
||||
And the "aas_type" property equals "user"
|
||||
|
||||
Scenario: Remove assignee from an activity
|
||||
Given that I want to delete a resource with the key "aas_uid" stored in session array
|
||||
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee/69191356252cda41acde328048794164"
|
||||
Then the response status code should be 200
|
||||
|
||||
Scenario: List assignees of an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 6 records
|
||||
|
||||
Scenario: List assignees of an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/12345/assignee"
|
||||
Then the response status code should be 400
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Projects End Point.
|
||||
Lists available projects/processes for an specific workspace
|
||||
|
||||
Scenario: Get a list of projects
|
||||
Given that I have a valid access_token
|
||||
And I request "projects"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
|
||||
|
||||
@@ -1092,6 +1092,21 @@ class RestContext extends BehatContext
|
||||
{
|
||||
throw new PendingException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^the response has (\d+) records$/
|
||||
* @Then /^the response has (\d+) record$/
|
||||
*/
|
||||
public function theResponseHasRecords($quantityOfRecords)
|
||||
{
|
||||
$data = $this->_data;
|
||||
if (!is_array($data)) {
|
||||
throw new Exception("the Response data is not an array!\n\n" );
|
||||
}
|
||||
$currentRecordsCount=count($data);
|
||||
if($currentRecordsCount!=$quantityOfRecords){
|
||||
throw new Exception('Records quantity not match ' . $quantityOfRecords . ' (actual: ' . $currentRecordsCount . ")\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
23
features/test/test_scenario_outline.feature
Normal file
23
features/test/test_scenario_outline.feature
Normal file
@@ -0,0 +1,23 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Project Properties - Assignee Resources
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
Scenario Outline: Get a list of available users and groups to be assigned to an activity with filter
|
||||
Given that I want to make a new "test"
|
||||
And his "name" is "<name>"
|
||||
And his "lastname" is "<lastname>"
|
||||
When I request "test"
|
||||
Then the response status code should be 200
|
||||
And the response should be JSON
|
||||
#And that "id" is set to "<id>"
|
||||
And the "id" property equals "<id>"
|
||||
|
||||
Examples:
|
||||
| name | lastname | age | id |
|
||||
| erik | sample1 | 7 | 2 |
|
||||
| wendy | sample2 | 15 | 3 |
|
||||
| wendy2 | sample22 | 15 | 4 |
|
||||
| wendy3 | sample23 | 15 | 5 |
|
||||
|
||||
161
workflow/engine/src/BusinessModel/ProcessPermissions.php
Normal file
161
workflow/engine/src/BusinessModel/ProcessPermissions.php
Normal file
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
namespace BusinessModel;
|
||||
|
||||
use \G;
|
||||
use \Cases;
|
||||
use \Criteria;
|
||||
use \ObjectPermissionPeer;
|
||||
|
||||
/**
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
class ProcessPermissions
|
||||
{
|
||||
/**
|
||||
* Get list for ProcessPermissions
|
||||
* @var string $sProcessUID. Uid for Process
|
||||
* @var string $filter.
|
||||
* @var string $sEventUID. Uid for Process
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getProcessPermissions($sProcessUID)
|
||||
{
|
||||
G::LoadClass('case');
|
||||
Cases::verifyTable();
|
||||
$aObjectsPermissions = array();
|
||||
//$aObjectsPermissions[] = array('OP_UID' => 'char', 'TASK_TARGET' => 'char', 'GROUP_USER' => 'char', 'TASK_SOURCE' => 'char', 'OBJECT_TYPE' => 'char', 'OBJECT' => 'char', 'PARTICIPATED' => 'char', 'ACTION' => 'char', 'OP_CASE_STATUS' => 'char');
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->add(ObjectPermissionPeer::PRO_UID, $sProcessUID);
|
||||
$oDataset = ObjectPermissionPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
//Obtain task target
|
||||
if (($aRow['TAS_UID'] != '') && ($aRow['TAS_UID'] != '0')) {
|
||||
try {
|
||||
$oTask = new \Task();
|
||||
$aFields = $oTask->load($aRow['TAS_UID']);
|
||||
$sTaskTarget = $aFields['TAS_TITLE'];
|
||||
} catch (\Exception $oError) {
|
||||
$sTaskTarget = 'All Tasks';
|
||||
}
|
||||
} else {
|
||||
$sTaskTarget = G::LoadTranslation('ID_ANY_TASK');
|
||||
}
|
||||
//Obtain user or group
|
||||
if ($aRow['OP_USER_RELATION'] == 1) {
|
||||
$oUser = new \Users();
|
||||
$aFields = $oUser->load($aRow['USR_UID']);
|
||||
$sUserGroup = $aFields['USR_FIRSTNAME'] . ' ' . $aFields['USR_LASTNAME'] . ' (' . $aFields['USR_USERNAME'] . ')';
|
||||
} else {
|
||||
$oGroup = new \Groupwf();
|
||||
if ($aRow['USR_UID'] != '') {
|
||||
try {
|
||||
$aFields = $oGroup->load($aRow['USR_UID']);
|
||||
$sUserGroup = $aFields['GRP_TITLE'];
|
||||
} catch (\Exception $oError) {
|
||||
$sUserGroup = '(GROUP DELETED)';
|
||||
}
|
||||
} else {
|
||||
$sUserGroup = G::LoadTranslation('ID_ANY');
|
||||
}
|
||||
}
|
||||
//Obtain task source
|
||||
if (($aRow['OP_TASK_SOURCE'] != '') && ($aRow['OP_TASK_SOURCE'] != '0')) {
|
||||
try {
|
||||
$oTask = new \Task();
|
||||
$aFields = $oTask->load($aRow['OP_TASK_SOURCE']);
|
||||
$sTaskSource = $aFields['TAS_TITLE'];
|
||||
} catch (\Exception $oError) {
|
||||
$sTaskSource = 'All Tasks';
|
||||
}
|
||||
} else {
|
||||
$sTaskSource = G::LoadTranslation('ID_ANY_TASK');
|
||||
}
|
||||
//Obtain object and type
|
||||
switch ($aRow['OP_OBJ_TYPE']) {
|
||||
case 'ALL':
|
||||
$sObjectType = G::LoadTranslation('ID_ALL');
|
||||
$sObject = G::LoadTranslation('ID_ALL');
|
||||
break;
|
||||
case 'ANY': //For backward compatibility (some process with ANY instead of ALL
|
||||
$sObjectType = G::LoadTranslation('ID_ALL');
|
||||
$sObject = G::LoadTranslation('ID_ALL');
|
||||
break;
|
||||
/* case 'ANY_DYNAFORM':
|
||||
$sObjectType = G::LoadTranslation('ID_ANY_DYNAFORM');
|
||||
$sObject = G::LoadTranslation('ID_ALL');
|
||||
break;
|
||||
case 'ANY_INPUT':
|
||||
$sObjectType = G::LoadTranslation('ID_ANY_INPUT');
|
||||
$sObject = G::LoadTranslation('ID_ALL');
|
||||
break;
|
||||
case 'ANY_OUTPUT':
|
||||
$sObjectType = G::LoadTranslation('ID_ANY_OUTPUT');
|
||||
$sObject = G::LoadTranslation('ID_ALL');
|
||||
break; */
|
||||
case 'DYNAFORM':
|
||||
$sObjectType = G::LoadTranslation('ID_DYNAFORM');
|
||||
if (($aRow['OP_OBJ_UID'] != '') && ($aRow['OP_OBJ_UID'] != '0')) {
|
||||
$oDynaform = new \Dynaform();
|
||||
$aFields = $oDynaform->load($aRow['OP_OBJ_UID']);
|
||||
$sObject = $aFields['DYN_TITLE'];
|
||||
} else {
|
||||
$sObject = G::LoadTranslation('ID_ALL');
|
||||
}
|
||||
break;
|
||||
case 'INPUT':
|
||||
$sObjectType = G::LoadTranslation('ID_INPUT_DOCUMENT');
|
||||
if (($aRow['OP_OBJ_UID'] != '') && ($aRow['OP_OBJ_UID'] != '0')) {
|
||||
$oInputDocument = new \InputDocument();
|
||||
$aFields = $oInputDocument->load($aRow['OP_OBJ_UID']);
|
||||
$sObject = $aFields['INP_DOC_TITLE'];
|
||||
} else {
|
||||
$sObject = G::LoadTranslation('ID_ALL');
|
||||
}
|
||||
break;
|
||||
case 'OUTPUT':
|
||||
$sObjectType = G::LoadTranslation('ID_OUTPUT_DOCUMENT');
|
||||
if (($aRow['OP_OBJ_UID'] != '') && ($aRow['OP_OBJ_UID'] != '0')) {
|
||||
$oOutputDocument = new \OutputDocument();
|
||||
$aFields = $oOutputDocument->load($aRow['OP_OBJ_UID']);
|
||||
$sObject = $aFields['OUT_DOC_TITLE'];
|
||||
} else {
|
||||
$sObject = G::LoadTranslation('ID_ALL');
|
||||
}
|
||||
break;
|
||||
case 'CASES_NOTES':
|
||||
$sObjectType = G::LoadTranslation('ID_CASES_NOTES');
|
||||
$sObject = 'N/A';
|
||||
break;
|
||||
case 'MSGS_HISTORY':
|
||||
$sObjectType = G::LoadTranslation('MSGS_HISTORY');
|
||||
$sObject = G::LoadTranslation('ID_ALL');
|
||||
break;
|
||||
default:
|
||||
$sObjectType = G::LoadTranslation('ID_ALL');
|
||||
$sObject = G::LoadTranslation('ID_ALL');
|
||||
break;
|
||||
}
|
||||
//Participated
|
||||
if ($aRow['OP_PARTICIPATE'] == 0) {
|
||||
$sParticipated = G::LoadTranslation('ID_NO');
|
||||
} else {
|
||||
$sParticipated = G::LoadTranslation('ID_YES');
|
||||
}
|
||||
//Obtain action (permission)
|
||||
$sAction = G::LoadTranslation('ID_' . $aRow['OP_ACTION']);
|
||||
//Add to array
|
||||
$aObjectsPermissions[] = array_merge($aRow, array('OP_UID' => $aRow['OP_UID'], 'TASK_TARGET' => $sTaskTarget, 'GROUP_USER' => $sUserGroup, 'TASK_SOURCE' => $sTaskSource, 'OBJECT_TYPE' => $sObjectType, 'OBJECT' => $sObject, 'PARTICIPATED' => $sParticipated, 'ACTION' => $sAction, 'OP_CASE_STATUS' => $aRow['OP_CASE_STATUS']));
|
||||
$oDataset->next();
|
||||
}
|
||||
return $aObjectsPermissions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
namespace Services\Api\ProcessMaker\Project;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
/**
|
||||
* Project\Activity\Step\ProcessPermissions Api Controller
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class ProcessPermissions extends Api
|
||||
{
|
||||
/**
|
||||
* @param string $projectUid {@min 1} {@max 32}
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @url GET /:projectUid/process-permissions
|
||||
*/
|
||||
public function doGetProcessPermissions($projectUid)
|
||||
{
|
||||
try {
|
||||
$processPermissions = new \BusinessModel\ProcessPermissions();
|
||||
$response = $processPermissions->getProcessPermissions($projectUid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ debug = 1
|
||||
input-document = "Services\Api\ProcessMaker\Project\InputDocument"
|
||||
output-documents = "Services\Api\ProcessMaker\Project\OutputDocuments"
|
||||
supervisors = "Services\Api\ProcessMaker\Project\ProcessSupervisors"
|
||||
process-permissions = "Services\Api\ProcessMaker\Project\ProcessPermissions"
|
||||
|
||||
[alias: projects]
|
||||
project = "Services\Api\ProcessMaker\Project"
|
||||
|
||||
Reference in New Issue
Block a user