Skip to content

Commit 3836cde

Browse files
committed
Saving progress
1 parent d2bc1e2 commit 3836cde

3 files changed

Lines changed: 25 additions & 5 deletions

File tree

ProcessMaker/Http/Controllers/TaskController.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,25 @@ public function edit(ProcessRequestToken $task, string $preview = '')
190190
'datetime_format',
191191
]);
192192
$userConfiguration = (new UserConfigurationController())->index();
193+
$hitlEnabled = config('smart-extract.hitl_enabled', false) && $isSmartExtractTask;
194+
195+
// Build the iframe source
196+
$iframeSrc = null;
197+
if ($hitlEnabled) {
198+
$dashboardUrl = config('smart-extract.dashboard_url');
199+
$requestData = $task->processRequest->data ?? [];
200+
201+
$documentToken = $requestData['documentToken'] ?? null;
202+
$fileId = $requestData['fileId'] ?? null;
203+
204+
if ($documentToken && $fileId) {
205+
$queryParams = http_build_query([
206+
'documentToken' => $documentToken,
207+
'fileId' => $fileId,
208+
]);
209+
$iframeSrc = $dashboardUrl . '?' . $queryParams;
210+
}
211+
}
193212

194213
return view('tasks.edit', [
195214
'task' => $task,
@@ -204,7 +223,8 @@ public function edit(ProcessRequestToken $task, string $preview = '')
204223
'screenFields' => $screenFields,
205224
'taskDraftsEnabled' => $taskDraftsEnabled,
206225
'userConfiguration' => $userConfiguration,
207-
'hitlEnabled' => config('smart-extract.hitl_enabled', false) && $isSmartExtractTask,
226+
'hitlEnabled' => $hitlEnabled,
227+
'iframeSrc' => $iframeSrc,
208228
]);
209229
}
210230
}

resources/views/tasks/edit.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class="card border-0"
108108
@redirect="redirectToTask"
109109
@form-data-changed="handleFormDataChange" />
110110
@else
111-
@include('tasks.partials.hitl-iframe')
111+
@include('tasks.partials.hitl-iframe', ['iframeSrc' => $iframeSrc ?? null])
112112
@endunless
113113
@endcan
114114
<div v-if="taskHasComments">

resources/views/tasks/partials/hitl-iframe.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{-- Smart Extract Manual Edit content when HITL is enabled --}}
22
@php
3-
// Note: This URL will be obtained from request data in future implementation.
4-
$iframeSrc = null
3+
// The $iframeSrc variable is received as a parameter from edit.blade.php
4+
$iframeSrc = $iframeSrc ?? null;
55
@endphp
66

77
@if (!empty($iframeSrc))
@@ -19,4 +19,4 @@
1919
<div class="alert alert-warning">
2020
{{ __('No iframe source provided for Manual Edit.') }}
2121
</div>
22-
@endif
22+
@endif

0 commit comments

Comments
 (0)