Merged in dheeyi/processmaker/MT-58 (pull request #3970)

MT-58
This commit is contained in:
Gustavo Cruz
2016-03-29 10:17:18 -04:00
5 changed files with 38 additions and 5 deletions

View File

@@ -72,6 +72,9 @@ class AssignmentRulesMigrator implements Importable, Exportable
$oAssignRules = new \StdClass();
$oAssignRulesTasks = $this->processes->getTaskRows($prj_uid);
$oAssignRules->taskusers = $this->processes->getTaskUserRows($oAssignRulesTasks);
//groups - task
$oDataTaskUsers = $this->processes->getTaskUserRows($oAssignRulesTasks);
$oAssignRules->groupwfs = $this->processes->getGroupwfRows($oDataTaskUsers);
$result = array(
'workflow-definition' => (array)$oAssignRules

View File

@@ -139,11 +139,39 @@ class GranularExporter
$this->data = $data;
}
/**
* @param $migratorData
*/
protected function mergeData($migratorData)
{
$migratorData = $this->verifyConsistenceData($migratorData);
$this->data = array_merge_recursive($this->data, $migratorData);
}
/**
* @param $migratorData
* @return mixed
*/
protected function verifyConsistenceData($migratorData)
{
//verifying data consistency group
switch (true) {
case $migratorData['workflow-definition']['groupwfs']:
foreach ($this->data['workflow-definition']['groupwfs'] as $rowGroup) {
foreach ($migratorData['workflow-definition']['groupwfs'] as $key => $row) {
if ($rowGroup['GRP_UID'] == $row['GRP_UID']) {
array_splice($migratorData['workflow-definition']['groupwfs'], $key);
}
}
}
break;
default:
$migratorData = $migratorData;
break;
}
return $migratorData;
}
public function publish()
{
return $this->publisher->publish(

View File

@@ -69,8 +69,12 @@ class PermissionsMigrator implements Importable, Exportable
$processData->groupwfs = $this->processes->getGroupwfRows($processData->taskusers);
$processData->steptriggers = $this->processes->getStepTriggerRows($processData->tasks);
$processData->reportTablesVars = $this->processes->getReportTablesVarsRows($prj_uid);
$oData = new \StdClass();
$oData->objectPermissions = $this->processes->getObjectPermissionRows($prj_uid, $processData);
//groups - permissions
$oData->groupwfs = $this->processes->getGroupwfRows($oData->objectPermissions);
$result = array(
'workflow-definition' => (array)$oData

View File

@@ -95,15 +95,10 @@ class ProcessDefinitionMigrator implements Importable, Exportable
$oData = new \StdClass();
$oData->tasks = $this->processes->getTaskRows($prj_uid);
$oDataTask = new \StdClass();
$oDataTask->taskusers = $this->processes->getTaskUserRows($oData->tasks);
$oData->routes = $this->processes->getRouteRows($prj_uid);
$oData->lanes = $this->processes->getLaneRows($prj_uid);
$oData->gateways = $this->processes->getGatewayRows($prj_uid);
$oData->steps = $this->processes->getStepRows($prj_uid);
$oData->groupwfs = $this->processes->getGroupwfRows($oDataTask->taskusers);
$oData->steptriggers = $this->processes->getStepTriggerRows($oData->tasks);
$oData->subProcess = $this->processes->getSubProcessRow($prj_uid);
$oData->caseTracker = $this->processes->getCaseTrackerRow($prj_uid);

View File

@@ -59,6 +59,9 @@ class SupervisorsMigrator implements Importable, Exportable
try {
$oData = new \StdClass();
$oData->processUser = $this->processes->getProcessUser($prj_uid);
//groups - supervisor
$oData->groupwfs = $this->processes->getGroupwfRows($oData->processUser);
$result = array(
'workflow-definition' => (array)$oData