__('Request Sent'), 'icon' => 'paper-plane', 'title' => __(''), 'confirmButton' => __('Accept Request'), 'canDiscard' => true, ], [ 'text' => __('Request Accepted'), 'icon' => 'check-square', 'title' => __(''), 'confirmButton' => __('Finalize Connection') ], [ 'text' => __('Connection done'), 'icon' => 'exchange-alt', 'title' => __(''), ] ]; $footerButtons = []; $progressVariant = !empty($progressVariant) ? $progressVariant : 'info'; $finalSteps = array_replace($defaultSteps, $steps ?? []); $currentStep = $finalSteps[$progressStep]; $progress = $this->Bootstrap->progressTimeline([ 'variant' => $progressVariant, 'selected' => !empty($progressStep) ? $progressStep : 0, 'steps' => $finalSteps, ]); $footerButtons[] = [ 'clickFunction' => 'cancel', 'variant' => 'secondary', 'text' => __('Cancel'), ]; if (!empty($currentStep['canDiscard'])) { $footerButtons[] = [ 'clickFunction' => 'discard', 'variant' => 'danger', 'text' => __('Decline Request'), ]; } $footerButtons[] = [ 'clickFunction' => 'accept', 'text' => $currentStep['confirmButton'] ?? __('Submit'), ]; $table = $this->Bootstrap->table(['small' => true, 'bordered' => false, 'striped' => false, 'hover' => false], [ 'fields' => [ ['key' => 'connector', 'label' => __('Tool Name'), 'formatter' => function($connector, $row) { return sprintf('%s', $this->Url->build(['controller' => 'localTools', 'action' => 'viewConnector', $connector['name']]), sprintf('%s (v%s)', h($connector['name']), h($connector['connector_version'])) ); }], ['key' => 'created', 'label' => __('Date'), 'formatter' => function($value, $row) { return $value->i18nFormat('yyyy-MM-dd HH:mm:ss'); }], ['key' => 'origin', 'label' => __('Origin')], ['key' => 'brood', 'label' => __('Brood'), 'formatter' => function($brood, $row) { return sprintf('%s', $this->Url->build(['controller' => 'broods', 'action' => 'view', $brood['id']]), h($brood['name']) ); }] ], 'items' => [$request->toArray()], ]); $form = $this->element('genericElements/Form/genericForm', [ 'entity' => null, 'ajax' => false, 'raw' => true, 'data' => [ 'model' => 'Inbox', 'fields' => [ [ 'field' => 'is_discard', 'type' => 'checkbox', 'default' => false ] ], 'submit' => [ 'action' => $this->request->getParam('action') ] ] ]); $requestData = $this->Bootstrap->collapse( [ 'title' => __('Inter-connection data'), 'open' => true, ], sprintf('
%s
', json_encode($request['data'], JSON_PRETTY_PRINT))
);
$bodyHtml = sprintf('