From 6514233c188d5ceec145aa43d87933fb234ce7d7 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Sat, 27 Apr 2024 19:08:37 +0300 Subject: [PATCH] JobHistoryRecords --- app/src/Controller/ApiUsersController.php | 2 +- app/src/Controller/StandardController.php | 6 +-- app/templates/JobHistoryRecords/fields.inc | 49 ++++++++++++------- app/templates/Jobs/fields.inc | 5 +- app/templates/element/form/fieldDiv.php | 2 + app/templates/element/form/infoDiv/check.php | 42 ++++++++-------- .../element/form/infoDiv/default.php | 5 -- 7 files changed, 61 insertions(+), 50 deletions(-) diff --git a/app/src/Controller/ApiUsersController.php b/app/src/Controller/ApiUsersController.php index b119806b1..5e97f13e3 100644 --- a/app/src/Controller/ApiUsersController.php +++ b/app/src/Controller/ApiUsersController.php @@ -69,7 +69,7 @@ public function generate(string $id) { 'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords', 'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities', 'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords', - 'IdentifierAssignments' + 'IdentifierAssignments', 'Jobs', 'JobHistoryRecords' ]) ) { $this->render('/Standard/add-edit-view-new'); diff --git a/app/src/Controller/StandardController.php b/app/src/Controller/StandardController.php index e2507b2e5..e80fc55ca 100644 --- a/app/src/Controller/StandardController.php +++ b/app/src/Controller/StandardController.php @@ -131,7 +131,7 @@ public function add() { 'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords', 'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities', 'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords', - 'IdentifierAssignments' + 'IdentifierAssignments', 'Jobs', 'JobHistoryRecords' ]) ) { $this->render('/Standard/add-edit-view-new'); @@ -437,7 +437,7 @@ public function edit(string $id) { 'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords', 'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities', 'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords', - 'IdentifierAssignments' + 'IdentifierAssignments', 'Jobs', 'JobHistoryRecords' ]) ) { $this->render('/Standard/add-edit-view-new'); @@ -896,7 +896,7 @@ public function view($id = null) { 'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords', 'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities', 'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords', - 'IdentifierAssignments' + 'IdentifierAssignments', 'Jobs', 'JobHistoryRecords' ]) ) { $this->render('/Standard/add-edit-view-new'); diff --git a/app/templates/JobHistoryRecords/fields.inc b/app/templates/JobHistoryRecords/fields.inc index ea26401a1..f742fcdaf 100644 --- a/app/templates/JobHistoryRecords/fields.inc +++ b/app/templates/JobHistoryRecords/fields.inc @@ -27,11 +27,16 @@ // This view does not support add or edit if($vv_action == 'view') { - print $this->Field->control('record_key'); - - print $this->Field->control('comment'); - - print $this->Field->control('status'); + foreach(['record_key', + 'comment', + 'status' + ] as $field) { + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => $field, + ] + ]); + } // Rewrite these to always emit the column even if the field is blank if(!empty($vv_obj->person->primary_name)) { @@ -42,12 +47,14 @@ if($vv_action == 'view') { $vv_obj->person->id ], ]; - - print $this->Field->statusControl( - 'person_id', - $vv_obj->person->primary_name->full_name, - $viewLink - ); + + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'person_id', + 'status' => $vv_obj->person->primary_name->full_name, + 'link' => $viewLink, + ] + ]); } if(!empty($vv_obj->external_identity->primary_name)) { @@ -58,13 +65,19 @@ if($vv_action == 'view') { $vv_obj->external_identity->id ], ]; - - print $this->Field->statusControl( - 'external_identity_id', - $vv_obj->external_identity->primary_name->full_name, - $viewLink - ); + + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'external_identity_id', + 'status' => $vv_obj->external_identity->primary_name->full_name, + 'link' => $viewLink, + ] + ]); } - print $this->Field->control('created'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'created' + ] + ]); } diff --git a/app/templates/Jobs/fields.inc b/app/templates/Jobs/fields.inc index 6e5157983..2f839227a 100644 --- a/app/templates/Jobs/fields.inc +++ b/app/templates/Jobs/fields.inc @@ -1,6 +1,6 @@ Field->control('parameters'); + print $this->element('form/listItem', [ 'arguments' => [ 'fieldName' => 'parameters', diff --git a/app/templates/element/form/fieldDiv.php b/app/templates/element/form/fieldDiv.php index e676faa28..bc3b63bc5 100644 --- a/app/templates/element/form/fieldDiv.php +++ b/app/templates/element/form/fieldDiv.php @@ -43,6 +43,8 @@ print $this->element('form/infoDiv/grouped'); } elseif(isset($vv_field_arguments['entity'])) { print $this->element('form/infoDiv/source'); + } elseif(isset($vv_field_arguments['check']) && $vv_field_arguments['check']) { + print $this->element('form/infoDiv/check'); } else { print $this->element('form/infoDiv/default'); } diff --git a/app/templates/element/form/infoDiv/check.php b/app/templates/element/form/infoDiv/check.php index 7f19f34c8..d70790494 100644 --- a/app/templates/element/form/infoDiv/check.php +++ b/app/templates/element/form/infoDiv/check.php @@ -30,24 +30,26 @@ ?> - - -
-
- - +
+
+
+ + +
-
+ Fieeld->formField(...$vv_field_arguments) ?> + +
\ No newline at end of file diff --git a/app/templates/element/form/infoDiv/default.php b/app/templates/element/form/infoDiv/default.php index 806e627d9..9d1e86eb7 100644 --- a/app/templates/element/form/infoDiv/default.php +++ b/app/templates/element/form/infoDiv/default.php @@ -29,10 +29,5 @@ declare(strict_types = 1); ?>
- element('form/infoDiv/check'); - } - ?> Fieeld->formField(...$vv_field_arguments) ?>
\ No newline at end of file