diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 3b6549e..4b03973 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -56,7 +56,8 @@ "from": "Workflow", "permission": { "permission": 4, "category": null, "element": null }, "parent": 1005501001, - "children": [] + "children": [], + "status": 3 } ] } diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 0f82dcb..679d12d 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -65,7 +65,7 @@ final class BackendController extends Controller ->with('tags/title') ->where('virtualPath', $path) ->where('tags/title/language', $response->header->l11n->language) - ->execute(); + ->executeGetArray(); list($collection, $parent) = CollectionMapper::getCollectionsByPath($path); @@ -185,7 +185,7 @@ final class BackendController extends Controller /** @var \Modules\Workflow\Models\WorkflowInstanceAbstract $instances */ $instances = WorkflowInstanceAbstractMapper::getAll() ->with('template') - ->execute(); + ->executeGetArray(); $view->data['instances'] = $instances; @@ -210,25 +210,23 @@ final class BackendController extends Controller $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005501001, $request, $response); /** @var \Modules\Workflow\Models\WorkflowInstanceAbstract $instance */ - $instance = WorkflowInstanceAbstractMapper::get() + $view->data['instance'] = WorkflowInstanceAbstractMapper::get() ->where('id', (int) $request->getData('id')) ->execute(); /** @var \Modules\Workflow\Models\WorkflowTemplate $template */ - $template = WorkflowTemplateMapper::get() + $view->data['template'] = WorkflowTemplateMapper::get() ->with('source') ->with('source/sources') - ->where('id', $instance->template->id) + ->where('id', $view->data['instance']->template->id) ->limit() ->execute(); - $view->data['template'] = $template; - - if ($template->source->findFile('instance-profile.tpl.php')->id > 0) { - require_once $template->source->findFile('WorkflowController.php')->getPath(); + if ($view->data['template']->source->findFile('instance-profile.tpl.php')->id > 0) { + require_once $view->data['template']->source->findFile('WorkflowController.php')->getPath(); /** @var WorkflowControllerInterface $controller */ - $controller = new \Modules\Workflow\Controller\WorkflowController($this->app, $template); + $controller = new \Modules\Workflow\Controller\WorkflowController($this->app, $view->data['template']); $controller->createInstanceViewFromRequest($view, $request, $response); } else { $view->setTemplate('/Modules/Workflow/Theme/Backend/workflow-instance'); diff --git a/Controller/CliController.php b/Controller/CliController.php index 25ca9c1..593c16a 100755 --- a/Controller/CliController.php +++ b/Controller/CliController.php @@ -50,7 +50,7 @@ final class CliController extends Controller public function runWorkflowFromHook(mixed ...$data) : void { /** @var \Modules\Workflow\Models\WorkflowTemplate[] $workflows */ - $workflows = WorkflowTemplateMapper::getAll()->where('status', WorkflowStatus::ACTIVE)->execute(); + $workflows = WorkflowTemplateMapper::getAll()->where('status', WorkflowStatus::ACTIVE)->executeGetArray(); foreach ($workflows as $workflow) { $hooks = $workflow->getHooks(); diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index 9a86545..6665bbc 100755 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -37,5 +37,8 @@ return ['Workflow' => [ 'Updated' => 'Upddate', 'Upload' => 'Hochladen', 'Workflow' => 'Arbeitsablauf', - 'Workflows' => 'Workflows.', + 'Workflows' => 'Workflows', + 'Data' => 'Daten', + 'End' => 'Ende', + 'Instance' => 'Instanz', ]]; diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 0e2652d..08be147 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -38,4 +38,7 @@ return ['Workflow' => [ 'Upload' => 'Upload', 'Workflow' => 'Workflow', 'Workflows' => 'Workflows', + 'Data' => 'Data', + 'End' => 'End', + 'Instance' => 'Instance', ]]; diff --git a/Theme/Backend/workflow-instance.tpl.php b/Theme/Backend/workflow-instance.tpl.php index a46c3d7..a3bdc05 100755 --- a/Theme/Backend/workflow-instance.tpl.php +++ b/Theme/Backend/workflow-instance.tpl.php @@ -14,3 +14,32 @@ declare(strict_types=1); /** @var \phpOMS\Views\View $this */ echo $this->data['nav']->render(); +?> +
| = $this->getHtml('Workflow'); ?> + | = $this->printHtml($this->data['template']->name); ?> + |
|---|---|
| = $this->getHtml('Title'); ?> + | = $this->printHtml($this->data['instance']->title); ?> + |
| = $this->getHtml('Created'); ?> + | = $this->data['instance']->createdAt->format('Y-m-d H:i:s'); ?> + |
| = $this->getHtml('End'); ?> + | = $this->data['instance']->end?->format('Y-m-d H:i:s'); ?> + |
| = $this->getHtml('Status'); ?> + | = $this->getHtml(':istatus-' . $this->data['instance']->status); ?> + |
| = $this->getHtml('Data'); ?> + | |
= $this->printHtml($this->data['instance']->data); ?>+ | |