Skip to content

Commit

Permalink
Merge pull request #5133 from ProcessMaker/feature/FOUR-9499
Browse files Browse the repository at this point in the history
feature/four-9499:Task Preview
  • Loading branch information
pmPaulis committed Aug 11, 2023
2 parents 27e337b + 25bd0be commit 9f4b31a
Show file tree
Hide file tree
Showing 5 changed files with 766 additions and 209 deletions.
13 changes: 12 additions & 1 deletion ProcessMaker/Http/Controllers/TaskController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function index()
return view('tasks.index', compact('title'));
}

public function edit(ProcessRequestToken $task)
public function edit(ProcessRequestToken $task, string $preview = '')
{
$task = $task->loadTokenInstance();
$dataManager = new DataManager();
Expand Down Expand Up @@ -73,6 +73,17 @@ public function edit(ProcessRequestToken $task)
if ($element instanceof ScriptTaskInterface) {
return redirect(route('requests.show', ['request' => $task->processRequest->getKey()]));
} else {
if (!empty($preview)) {
return view('tasks.preview', [
'task' => $task,
'dueLabels' => self::$dueLabels,
'manager' => $manager,
'submitUrl' => $submitUrl,
'files' => $task->processRequest->requestFiles(),
'addons' => $this->getPluginAddons('edit', []),
'assignedToAddons' => $this->getPluginAddons('edit.assignedTo', []),
]);
}
return view('tasks.edit', [
'task' => $task,
'dueLabels' => self::$dueLabels,
Expand Down
Loading

0 comments on commit 9f4b31a

Please sign in to comment.