Merged in develop (pull request #5810)

Develop

Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
Paula Quispe
2017-07-24 15:37:41 +00:00
7 changed files with 49 additions and 23 deletions

View File

@@ -1494,4 +1494,36 @@ class ProcessSupervisor
}
return false;
}
/**
* This function define if the supervisor can be review and edit
* The appStatus can be:TO_DO, DRAFT, COMPLETED, CANCELLED
* The thread status can be: PAUSED
* @param string $appUid
* @param integer $delIndex
* @return array
*/
public function reviewCaseStatusForSupervisor($appUid, $delIndex = 0)
{
$oApp = new \Application();
$oApp->Load($appUid);
$canEdit = false;
switch ($oApp->getAppStatus()) {
case 'TO_DO':
//Verify if the case is paused because the supervisor can not edit the PAUSED case
$oDelay = new \AppDelay();
if ($oDelay->isPaused($appUid, $delIndex)) {
$canEdit = false;
} else {
$canEdit = true;
}
break;
case 'COMPLETED':
case 'CANCELLED':
default:
$canEdit = false;
}
return $canEdit;
}
}

View File

@@ -844,18 +844,6 @@ class BpmnWorkflow extends Project\Bpmn
"TAS_POSY" => $taskPosY
));
if ($elementType == "bpmnEvent" &&
in_array($key, array("end-message-event", "start-message-event", "intermediate-catch-message-event"))
) {
if (in_array($key, array("start-message-event", "intermediate-catch-message-event"))) {
//Task - User
//Assign to admin
$task = new \Tasks();
$result = $task->assignUser($taskUid, "00000000000000000000000000000001", 1);
}
}
//Element-Task-Relation - Create
$elementTaskRelation = new \ProcessMaker\BusinessModel\ElementTaskRelation();