= __d('information','ExternalIdentitySourceRecords.metadata') ?>
diff --git a/app/templates/ExternalIdentitySources/search.php b/app/templates/ExternalIdentitySources/search.php
index a7b841cec..65c166613 100644
--- a/app/templates/ExternalIdentitySources/search.php
+++ b/app/templates/ExternalIdentitySources/search.php
@@ -42,7 +42,10 @@
- = $this->Alert->alert(__d('information', 'ExternalIdentitySources.search.attrs.none'), 'information', false) ?>
+ = $this->element('notify/alert', [
+ 'message' => __d('information', 'ExternalIdentitySources.search.attrs.none'),
+ 'type' => 'information'
+ ]) ?>
Form->hidden('person_id', ['value' => $vv_selected_person['id']]);
+ $hidden = [
+ 'person_id' => $vv_selected_person['id']
+ ];
- // Present the person information in the view:
-?>
-
-
-
-
- = __d('field','name') ?>
-
-
-
-
- = $vv_selected_person['name'] ?>
-
-
- (= __d('information', 'entity.id', [$vv_selected_person['id']]) ?>)
-
-
-
-
-element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => '',
+ 'fieldLabel' => __d('field','name'),
+ 'groupmember' => $vv_selected_person
+ ]
+ ]);
} else {
// Produce the autocomplete people selector on 'add'
- print $this->Field->peopleAutocompleteControl('person_id', [
- 'for' => 'GroupMembers',
- 'action' => $vv_action,
- 'groupId' => $this->getRequest()?->getQuery('group_id')
- ]);
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'person_id',
+ 'fieldOptions' => [
+ 'class' => 'form-control people-autocomplete',
+ 'placeholder' => __d('operation','autocomplete.people.placeholder'),
+ 'id' => 'person_id',
+ ],
+ 'autocomplete' => [
+ 'configuration' => [
+ 'for' => 'GroupMembers',
+ 'action' => $vv_action,
+ 'groupId' => $this->getRequest()?->getQuery('group_id')
+ ]
+ ]
+ ]
+ ]);
}
-
- // XXX As a temporary hack for development, we accept a manually entered Person ID
- // XXX leave here temporarily.
- //print $this->Field->control('person_id', ['type' => 'text']);
} else {
- print $this->Form->hidden('person_id');
+ $hidden = [
+ 'person_id' => $vv_obj->person_id
+ ];
}
-print $this->Field->dateControl('valid_from');
+print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'valid_from',
+ ]
+]);
-print $this->Field->dateControl('valid_through');
+print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'valid_through',
+ ]
+]);
// XXX RFE: Add links to EIS or Nesting info
\ No newline at end of file
diff --git a/app/templates/GroupNestings/fields.inc b/app/templates/GroupNestings/fields.inc
index f913a1f21..673e5b005 100644
--- a/app/templates/GroupNestings/fields.inc
+++ b/app/templates/GroupNestings/fields.inc
@@ -26,22 +26,47 @@
*/
if($vv_action == 'add') {
- print $this->Field->control('target_group_id');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'target_group_id',
+ ]
+ ]);
} elseif($vv_action == 'edit') {
+ $link = [
+ 'url' => [
+ 'controller' => 'groups',
+ 'action' => 'edit',
+ $vv_obj->target_group_id]
+ ];
// The target group can't be changed after adding
- print $this->Field->statusControl('target_group_id',
- $vv_obj->target_group->name,
- ['url' => ['controller' => 'groups',
- 'action' => 'edit',
- $vv_obj->target_group_id]]);
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'target_group_id',
+ 'status' => $vv_obj->target_group->name,
+ 'link' => $link,
+ ]
+ ]);
}
if($vv_action == 'add' || $vv_action == 'edit') {
- print $this->Field->statusControl('group_id',
- $vv_bc_parent_obj->name,
- ['url' => ['controller' => 'groups',
- 'action' => 'edit',
- $vv_bc_parent_obj->id]]);
-
- print $this->Field->control('negate');
+ $link = [
+ 'url' => [
+ 'controller' => 'groups',
+ 'action' => 'edit',
+ $vv_bc_parent_obj->id]
+ ];
+ // The target group can't be changed after adding
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'group_id',
+ 'status' => $vv_bc_parent_obj->name,
+ 'link' => $link,
+ ]
+ ]);
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'negate',
+ ]
+ ]);
}
\ No newline at end of file
diff --git a/app/templates/Groups/fields.inc b/app/templates/Groups/fields.inc
index 6669ba563..fb408df14 100644
--- a/app/templates/Groups/fields.inc
+++ b/app/templates/Groups/fields.inc
@@ -32,50 +32,53 @@ if($vv_obj->isOwners()) {
$options['readonly'] = true;
}
-print $this->Field->control(
- fieldName: 'name',
- options: $options
-);
-
-print $this->Field->control(
- fieldName: 'description',
- options: $options
-);
-
-print $this->Field->control(
- fieldName: 'status',
- options: $options
-);
-
-print $this->Field->control(
- fieldName: 'open',
- options: $options
-);
+foreach(['name',
+ 'description',
+ 'status',
+ 'open',] as $field) {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $field,
+ 'fieldOptions' => $options
+ ]
+ ]);
+}
-print $this->Field->control('nesting_mode_all');
+print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'nesting_mode_all',
+ ]
+]);
if($vv_action != 'add') {
- print $this->Field->control(
- fieldName: 'group_type',
- options: ['readonly' => true]
- );
-
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'group_type',
+ 'fieldOptions' => [
+ 'readonly' => true
+ ]
+ ]
+ ]);
+
if($vv_obj->isOwners()) {
// Link to the main group
if(!empty($vv_obj->owners_for_group)) {
- print $this->Field->statusControl(
- fieldName: 'owners_group_id',
- status: $vv_obj->owners_for_group->name,
- link: ['url' => ['controller' => 'groups', 'action' => 'edit', $vv_obj->owners_for_group->id]]
- );
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'owners_group_id',
+ 'status' => $vv_obj->owners_for_group->name,
+ 'link' => ['url' => ['controller' => 'groups', 'action' => 'edit', $vv_obj->owners_for_group->id]],
+ ]
+ ]);
}
} else {
// Link to the owners group
-
- print $this->Field->statusControl(
- fieldName: 'owners_group_id',
- status: $vv_obj->owners_group->name ?? '',
- link: ['url' => ['controller' => 'groups', 'action' => 'edit', $vv_obj->owners_group_id]]
- );
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'owners_group_id',
+ 'status' => $vv_obj->owners_group->name ?? '',
+ 'link' => ['url' => ['controller' => 'groups', 'action' => 'edit', $vv_obj->owners_group_id]]
+ ]
+ ]);
}
}
diff --git a/app/templates/HistoryRecords/fields.inc b/app/templates/HistoryRecords/fields.inc
index 45c57a180..2bc8d628c 100644
--- a/app/templates/HistoryRecords/fields.inc
+++ b/app/templates/HistoryRecords/fields.inc
@@ -27,7 +27,10 @@
// This view does not support edit
if($vv_action == 'add' || $vv_action == 'view') {
- print $this->Field->control('comment');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'comment',
+ ]]);
if($vv_action == 'add') {
// On manual add insert action
@@ -39,7 +42,10 @@ if($vv_action == 'add' || $vv_action == 'view') {
}
if($vv_action == 'view') {
- print $this->Field->control('action');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'action',
+ ]]);
if(!empty($vv_obj->person->primary_name)) {
$viewLink = [
@@ -49,12 +55,14 @@ if($vv_action == 'add' || $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->person_role_id)) {
@@ -65,12 +73,14 @@ if($vv_action == 'add' || $vv_action == 'view') {
$vv_obj->person_role_id
],
];
-
- print $this->Field->statusControl(
- 'person_role_id',
- $vv_obj->person_role_id,
- $viewLink
- );
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'person_role_id',
+ 'status' => $vv_obj->person_role_id,
+ 'link' => $viewLink
+ ]
+ ]);
}
if(!empty($vv_obj->external_identity->primary_name)) {
@@ -81,12 +91,14 @@ if($vv_action == 'add' || $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
+ ]
+ ]);
}
if(!empty($vv_obj->external_identity_role_id)) {
@@ -97,12 +109,14 @@ if($vv_action == 'add' || $vv_action == 'view') {
$vv_obj->external_identity_role_id
],
];
-
- print $this->Field->statusControl(
- 'external_identity_role_id',
- $vv_obj->external_identity_role_id,
- $viewLink
- );
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'external_identity_role_id',
+ 'status' => $vv_obj->external_identity_role_id,
+ 'link' => $viewLink
+ ]
+ ]);
}
if(!empty($vv_obj->group_id)) {
@@ -113,12 +127,14 @@ if($vv_action == 'add' || $vv_action == 'view') {
$vv_obj->group_id
],
];
-
- print $this->Field->statusControl(
- 'group_id',
- $vv_obj->group->name,
- $viewLink
- );
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'group_id',
+ 'status' => $vv_obj->group->name,
+ 'link' => $viewLink
+ ]
+ ]);
}
if(!empty($vv_obj->actor_person->names)) {
@@ -129,15 +145,20 @@ if($vv_action == 'add' || $vv_action == 'view') {
$vv_obj->actor_person->id
],
];
-
- print $this->Field->statusControl(
- 'actor_person_id',
- $vv_obj->actor_person->names[0]->full_name,
- $viewLink,
- __d('field', 'actor')
- );
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'actor_person_id',
+ 'status' => $vv_obj->actor_person->names[0]->full_name,
+ 'link' => $viewLink,
+ 'fieldLabel' => __d('field', 'actor')
+ ]
+ ]);
}
-
- print $this->Field->control('created');
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'created',
+ ]]);
}
}
diff --git a/app/templates/IdentifierAssignments/fields.inc b/app/templates/IdentifierAssignments/fields.inc
index 864157b9b..93ca8e381 100644
--- a/app/templates/IdentifierAssignments/fields.inc
+++ b/app/templates/IdentifierAssignments/fields.inc
@@ -1,6 +1,6 @@
Field->control('description');
+ foreach([
+ 'description',
+ 'status',
+ 'plugin'
+ ] as $field) {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $field,
+ ]]);
+ }
- print $this->Field->control('status');
-
- print $this->Field->control('plugin');
-
- print $this->Field->control(
- fieldName: 'context',
- options: [
- 'onChange' => 'updateGadgets()'
- ]
- );
-
- print $this->Field->control(
- fieldName: 'identifier_type_id',
- options: [
- 'onChange' => 'resetType("email-address-type-id")'
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'context',
+ 'fieldOptions' => [
+ 'onChange' => 'updateGadgets()'
+ ]
]
- );
-
- print $this->Field->control(
- fieldName: 'login',
- cssClass: 'subfield'
- );
+ ]);
- print $this->Field->control(
- fieldName: 'email_address_type_id',
- options: [
- 'onChange' => 'resetType("identifier-type-id")'
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'identifier_type_id',
+ 'fieldOptions' => [
+ 'onChange' => 'resetType("email-address-type-id")'
+ ]
]
- );
+ ]);
- print $this->Field->control('group_id');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'login'
+ ]
+ ]);
- print $this->Field->control('allow_empty');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'email_address_type_id',
+ 'fieldOptions' => [
+ 'onChange' => 'resetType("identifier-type-id")'
+ ]
+ ]
+ ]);
- print $this->Field->control('ordr');
+ foreach(['group_id',
+ 'allow_empty',
+ 'ordr'
+ ] as $field) {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $field,
+ ]]);
+ }
}
\ No newline at end of file
diff --git a/app/templates/Identifiers/fields.inc b/app/templates/Identifiers/fields.inc
index 532f29865..5d0b03a34 100644
--- a/app/templates/Identifiers/fields.inc
+++ b/app/templates/Identifiers/fields.inc
@@ -26,20 +26,45 @@
*/
if($vv_action == 'add' || $vv_action == 'edit' || $vv_action == 'view') {
- print $this->Field->control('identifier');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'identifier',
+ ]]);
- print $this->Field->control('type_id', ['default' => $vv_default_type]);
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'type_id',
+ 'fieldOptions' => [
+ 'default' => $vv_default_type
+ ]
+ ]]);
if($vv_primary_link_attr == 'person_id') {
// AR-Identifier-1 Only Persons can have a login flag
- print $this->Field->control('login');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'login',
+ ]]);
} else {
+ // Will be used by add-edit-view.php to append the hidden fields in the form
$hidden['login'] = false;
}
-
- print $this->Field->control('status', ['empty' => false]);
- print $this->Field->control('frozen');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'status',
+ ]]);
- print $this->Field->sourceControl($vv_obj);
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'frozen'
+ ]]);
+}
+
+if($vv_action == 'edit' || $vv_action == 'view') {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'source',
+ 'entity' => $vv_obj
+ ]]);
}
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 238a9da85..bd6d9f1a7 100644
--- a/app/templates/Jobs/fields.inc
+++ b/app/templates/Jobs/fields.inc
@@ -1,6 +1,6 @@
Field->control('plugin', labelText: __d('controller', 'Jobs', [1]));
-
- print $this->Field->control('status');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'plugin',
+ 'fieldLabel' => __d('controller', 'Jobs', [1])
+ ]
+ ]);
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'status'
+ ]
+ ]);
if($vv_obj->status == \App\Lib\Enum\JobStatusEnum::InProgress) {
- print $this->Field->statusControl(
- fieldName: 'percent_complete',
- status: (string)$vv_obj->percent_complete
- );
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'percent_complete',
+ 'status' => (string)$vv_obj->percent_complete
+ ]
+ ]);
}
-
- $beforeField = '
-
-
-
- ' .
- __d('field','format')
- . '
-
-
- ';
- $afterField = '
-
- ';
- print $this->Field->control('parameters', beforeField: $beforeField, afterField: $afterField);
-
- print $this->Field->control('register_time');
-
- print $this->Field->control('register_summary');
-
- print $this->Field->control('assigned_host');
-
- print $this->Field->control('assigned_pid');
-
- print $this->Field->control('start_after_time');
- print $this->Field->control('start_time');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'parameters',
+ 'check' => true
+ ]
+ ]);
- print $this->Field->control('start_summary');
-
- print $this->Field->control('finish_time');
-
- print $this->Field->control('finish_summary');
-
- print $this->Field->control('requeue_interval');
-
- print $this->Field->control('retry_interval');
+ foreach([
+ 'register_time',
+ 'register_summary',
+ 'assigned_host',
+ 'assigned_pid',
+ 'start_after_time',
+ 'start_time',
+ 'start_summary',
+ 'finish_time',
+ 'finish_summary',
+ 'requeue_interval',
+ 'retry_interval',
+ ] as $field) {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $field,
+ ]
+ ]);
+ }
if(!empty($vv_obj->requeued_from_job->id)) {
- print $this->Field->statusControl(
- fieldName: 'requeued_from_job_id',
- status: (string)$vv_obj->requeued_from_job->id,
- link: [
- 'url' => [
- 'controller' => 'jobs',
- 'action' => 'view',
- $vv_obj->requeued_from_job->id
- ]
+ $link = [
+ 'url' => [
+ 'controller' => 'jobs',
+ 'action' => 'view',
+ $vv_obj->requeued_from_job->id
+ ]
+ ];
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'requeued_from_job_id',
+ 'status' => (string)$vv_obj->requeued_from_job->id,
+ 'link' => $link,
]
- );
+ ]);
}
}
diff --git a/app/templates/MessageTemplates/fields.inc b/app/templates/MessageTemplates/fields.inc
index c52d7e61b..a88f5e691 100644
--- a/app/templates/MessageTemplates/fields.inc
+++ b/app/templates/MessageTemplates/fields.inc
@@ -28,25 +28,23 @@
Field->control('description');
-
- print $this->Field->control('status');
-
- print $this->Field->control('context');
-
- print $this->Field->control('format');
-
- print $this->Field->control('subject');
-
+ foreach ([
+ 'description',
+ 'status',
+ 'context',
+ 'format',
+ 'subject',
// XXX auto show/hide based on format
- print $this->Field->control('body_text');
-
+ 'body_text',
// XXX auto show/hide based on format
- print $this->Field->control('body_html');
-
- print $this->Field->control('cc');
-
- print $this->Field->control('bcc');
-
- print $this->Field->control('reply_to');
+ 'body_html',
+ 'cc',
+ 'bcc',
+ 'reply_to',
+ ] as $field) {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $field
+ ]]);
+ }
}
diff --git a/app/templates/Names/fields.inc b/app/templates/Names/fields.inc
index 3b16e5804..f4a19b41d 100644
--- a/app/templates/Names/fields.inc
+++ b/app/templates/Names/fields.inc
@@ -31,22 +31,54 @@ if($vv_action == 'add' || $vv_action == 'edit' || $vv_action == 'view') {
foreach(['honorific', 'given', 'middle', 'family', 'suffix'] as $f) {
if(in_array($f, $vv_permitted_fields)) {
- print $this->Field->control($f);
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $f
+ ]]);
}
}
- print $this->Field->control('type_id', ['default' => $vv_default_type]);
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'type_id',
+ 'fieldOptions' => [
+ 'default' => $vv_default_type
+ ]
+ ]]);
- print $this->Field->control('language');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'language'
+ ]]);
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'display_name'
+ ]]);
- print $this->Field->control('display_name');
// We don't allow unsetting of primary_name here because we need to know what
// the new primary_name is, but we do allow this name to become primary
// because afterSave will unset the old one.
- print $this->Field->control('primary_name', ['readonly' => $vv_obj->primary_name]);
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'description',
+ 'fieldOptions' => [
+ 'readonly' => $vv_obj->primary_name
+ ]
+ ]]);
- print $this->Field->control('frozen');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'frozen'
+ ]]);
- print $this->Field->sourceControl($vv_obj);
}
+
+if($vv_action == 'edit' || $vv_action == 'view') {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'source',
+ 'entity' => $vv_obj
+ ]]);
+}
\ No newline at end of file
diff --git a/app/templates/Notifications/fields.inc b/app/templates/Notifications/fields.inc
index 6409a736c..c6a5819bd 100644
--- a/app/templates/Notifications/fields.inc
+++ b/app/templates/Notifications/fields.inc
@@ -30,96 +30,109 @@ use \App\Lib\Enum\NotificationStatusEnum;
Field->control('comment');
-
- print $this->Field->control('action');
-
- print $this->Field->control('source');
-
- print $this->Field->control('created');
+ foreach ([
+ 'comment',
+ 'action',
+ 'source',
+ 'created',
+ ] as $field) {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $field
+ ]]);
+ }
if($vv_obj->status == NotificationStatusEnum::PendingAcknowledgment) {
- print $this->Field->statusControl(
- fieldName: 'status',
- status: __d('enumeration', 'NotificationStatusEnum.PA'),
- link: [
- 'url' => [
- 'action' => 'acknowledge',
- $vv_obj->id
- ],
- 'label' => __d('operation', 'acknowledge'),
- 'confirm' => __d('operation', 'Notifications.acknowledge.confirm')
- ]
- );
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'status',
+ 'status' => __d('enumeration', 'NotificationStatusEnum.PA'),
+ 'link' => [
+ 'url' => [
+ 'action' => 'acknowledge',
+ $vv_obj->id
+ ],
+ 'label' => __d('operation', 'acknowledge'),
+ 'confirm' => __d('operation', 'Notifications.acknowledge.confirm')
+ ]
+ ]
+ ]);
} else {
print $this->Field->control('status');
- }
-
- print $this->Field->statusControl(
- fieldName: 'subject_person_id',
- status: !empty($vv_obj->subject_person->primary_name)
- ? $vv_obj->subject_person->primary_name->full_name
- : "",
- link: !empty($vv_obj->subject_person)
- ? ['url' => [
- 'controller' => 'people',
- 'action' => 'edit',
- $vv_obj->subject_person->id
- ]]
- : []
- );
-
- print $this->Field->statusControl(
- fieldName: 'recipient_person_id',
- status: !empty($vv_obj->recipient_person->primary_name)
- ? $vv_obj->recipient_person->primary_name->full_name
- : "",
- link: !empty($vv_obj->recipient_person)
- ? ['url' => [
- 'controller' => 'people',
- 'action' => 'edit',
- $vv_obj->recipient_person->id
- ]]
- : []
- );
-
- print $this->Field->statusControl(
- fieldName: 'actor_person_id',
- status: !empty($vv_obj->actor_person->primary_name)
- ? $vv_obj->actor_person->primary_name->full_name
- : "",
- link: !empty($vv_obj->actor_person)
- ? ['url' => [
- 'controller' => 'people',
- 'action' => 'edit',
- $vv_obj->actor_person->id
- ]]
- : []
- );
-
- print $this->Field->control('resolution_time');
+ }
- print $this->Field->statusControl(
- fieldName: 'resolver_person_id',
- status: !empty($vv_obj->resolver_person->primary_name)
- ? $vv_obj->resolver_person->primary_name->full_name
- : "",
- link: !empty($vv_obj->resolver_person)
- ? ['url' => [
- 'controller' => 'people',
- 'action' => 'edit',
- $vv_obj->resolver_person->id
- ]]
- : []
- );
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'subject_person_id',
+ 'status' => $vv_obj->subject_person->primary_name?->full_name ?? '',
+ 'link' => !empty($vv_obj->subject_person)
+ ? ['url' => [
+ 'controller' => 'people',
+ 'action' => 'edit',
+ $vv_obj->subject_person->id
+ ]]
+ : []
+ ]
+ ]);
- print $this->Field->control('notification_time');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'recipient_person_id',
+ 'status' => $vv_obj->recipient_person->primary_name?->full_name ?? '',
+ 'link' => !empty($vv_obj->recipient_person)
+ ? ['url' => [
+ 'controller' => 'people',
+ 'action' => 'edit',
+ $vv_obj->recipient_person->id
+ ]]
+ : []
+ ]
+ ]);
- print $this->Field->control('email_subject');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'actor_person_id',
+ 'status' => $vv_obj->actor_person->primary_name?->full_name ?? '',
+ 'link' => !empty($vv_obj->actor_person)
+ ? ['url' => [
+ 'controller' => 'people',
+ 'action' => 'edit',
+ $vv_obj->actor_person->id
+ ]]
+ : []
+ ]
+ ]);
- print $this->Field->control('email_body_text');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'resolution_time',
+ ]
+ ]);
- print $this->Field->control('resolution_subject');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'resolver_person_id',
+ 'status' => $vv_obj->resolver_person->primary_name?->full_name ?? '',
+ 'link' => !empty($vv_obj->resolver_person)
+ ? ['url' => [
+ 'controller' => 'people',
+ 'action' => 'edit',
+ $vv_obj->resolver_person->id
+ ]]
+ : []
+ ]
+ ]);
- print $this->Field->control('resolution_body');
+ foreach ([
+ 'notification_time',
+ 'email_subject',
+ 'email_body_text',
+ 'resolution_subject',
+ 'resolution_body',
+ ] as $field) {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $field
+ ]]);
+ }
}
diff --git a/app/templates/People/fields.inc b/app/templates/People/fields.inc
index dee3cd5be..016c50412 100644
--- a/app/templates/People/fields.inc
+++ b/app/templates/People/fields.inc
@@ -33,19 +33,25 @@ if($vv_action == 'add') {
foreach(['honorific', 'given', 'middle', 'family', 'suffix'] as $f) {
if(in_array($f, $vv_permitted_name_fields)) {
- print $this->Field->control(
- fieldName: 'names.0.'.$f,
- options: ['required' => in_array($f, $vv_required_name_fields)],
- controlType: 'string'
- );
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'names.0.'.$f,
+ 'fieldOptions' => [
+ 'required' => in_array($f, $vv_required_name_fields)
+ ],
+ 'fieldType' => 'string'
+ ]]);
}
}
-
- print $this->Field->control(
- fieldName: 'names.0.type_id',
- options: ['empty' => false, 'default' => $vv_default_name_type],
- controlType: 'string'
- );
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'names.0.type_id',
+ 'fieldOptions' => [
+ 'default' => $vv_default_name_type
+ ],
+ 'fieldType' => 'string'
+ ]]);
// AR-Name-1 Since this is the first name for this Person, it must be
// designated primary
@@ -58,7 +64,13 @@ if($vv_action == 'add') {
}
if($vv_action == 'add' || $vv_action == 'edit') {
- print $this->Field->control('status', ['empty' => false]);
-
- print $this->Field->dateControl('date_of_birth', \App\Lib\Enum\DateTypeEnum::DateOnly);
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'status'
+ ]]);
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'date_of_birth'
+ ]]);
}
\ No newline at end of file
diff --git a/app/templates/PersonRoles/fields.inc b/app/templates/PersonRoles/fields.inc
index 4748921f3..3a103add4 100644
--- a/app/templates/PersonRoles/fields.inc
+++ b/app/templates/PersonRoles/fields.inc
@@ -26,19 +26,35 @@
*/
if($vv_action == 'add' || $vv_action == 'edit' || $vv_action == 'view') {
- print $this->Field->control('cou_id');
-
- print $this->Field->control('affiliation_type_id', labelText: __d('field', 'affiliation'));
-
- print $this->Field->control('status', ['empty' => false]);
-
- print $this->Field->control('ordr');
-
- print $this->Field->control('title');
-
- print $this->Field->control('organization');
-
- print $this->Field->control('department');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'cou_id',
+ ]
+ ]);
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' =>'affiliation_type_id',
+ 'fieldLabel' => __d('field', 'affiliation')
+ ]
+ ]);
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' =>'status'
+ ]
+ ]);
+
+ foreach(['ordr',
+ 'title',
+ 'organization',
+ 'department'] as $field) {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $field,
+ ]
+ ]);
+ }
// For now, we render sponsor and manager as read only.
// XXX Need People Picker (CFM-150)
@@ -52,15 +68,39 @@ if($vv_action == 'add' || $vv_action == 'edit' || $vv_action == 'view') {
$fname = $vv_obj->$fp->names[0]->full_name;
$flink = ['url' => ['controller' => 'people', 'action' => 'edit', $vv_obj->$fp->id]];
}
-
- print $this->Field->statusControl($f.'_person_id', $fname, $flink, __d('field', $f));
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $f.'_person_id',
+ 'status' => $fname,
+ 'link' => $flink,
+ 'fieldLabel' => __d('field', $f)
+ ]
+ ]);
}
-
- print $this->Field->dateControl('valid_from');
-
- print $this->Field->dateControl('valid_through');
- print $this->Field->control('frozen');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'valid_from', // timestamp
+ ]
+ ]);
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'valid_through', // timestamp
+ ]
+ ]);
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'frozen'
+ ]]);
+}
- print $this->Field->sourceControl($vv_obj);
+if($vv_action == 'edit' || $vv_action == 'view') {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'source',
+ 'entity' => $vv_obj
+ ]]);
}
diff --git a/app/templates/Pipelines/fields.inc b/app/templates/Pipelines/fields.inc
index e4efd0ca2..58a956008 100644
--- a/app/templates/Pipelines/fields.inc
+++ b/app/templates/Pipelines/fields.inc
@@ -50,37 +50,46 @@
Field->control('description');
-
- print $this->Field->control('status');
-
- // Match Strategy
- print $this->Field->control(
- fieldName: 'match_strategy',
- controlType: 'select',
- options: [
- 'onChange' => 'updateGadgets()'
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'description'
]
- );
-
- print $this->Field->control('match_email_address_type_id');
-
- print $this->Field->control('match_identifier_type_id');
-
- // Sync Strategy
-// print $this->Field->control('sync_on_update');
-
-// print $this->Field->control('sync_on_delete');
+ ]);
- print $this->Field->control('sync_status_on_delete', ['empty' => false]);
-
- print $this->Field->control('sync_cou_id');
-
- print $this->Field->control('sync_replace_cou_id');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'status'
+ ]
+ ]);
- print $this->Field->control('sync_affiliation_type_id');
+ // Match Strategy
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'match_strategy',
+ 'fieldOptions' => [
+ 'onChange' => 'updateGadgets()'
+ ],
+ 'fieldType' => 'select'
+ ]
+ ]);
- print $this->Field->control('sync_identifier_type_id');
+ foreach([
+ 'match_email_address_type_id',
+ 'match_identifier_type_id',
+// 'sync_on_update',
+// 'sync_on_delete',
+ 'sync_status_on_delete',
+ 'sync_cou_id',
+ 'sync_replace_cou_id',
+ 'sync_affiliation_type_id',
+ 'sync_identifier_type_id',
+ ] as $field) {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $field,
+ ]
+ ]);
+ }
// Connections
//XXX
diff --git a/app/templates/Pronouns/fields.inc b/app/templates/Pronouns/fields.inc
index a5361fc5e..0104a3b7f 100644
--- a/app/templates/Pronouns/fields.inc
+++ b/app/templates/Pronouns/fields.inc
@@ -26,13 +26,34 @@
*/
if($vv_action == 'add' || $vv_action == 'edit' || $vv_action == 'view') {
- print $this->Field->control('pronouns');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'pronouns'
+ ]]);
- print $this->Field->control('type_id', ['default' => $vv_default_type]);
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'type_id',
+ 'fieldOptions' => [
+ 'default' => $vv_default_type
+ ]
+ ]]);
- print $this->Field->control('language');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'language'
+ ]]);
- print $this->Field->control('frozen');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'frozen'
+ ]]);
+}
- print $this->Field->sourceControl($vv_obj);
+if($vv_action == 'edit' || $vv_action == 'view') {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'source',
+ 'entity' => $vv_obj
+ ]]);
}
diff --git a/app/templates/ProvisioningHistoryRecords/fields.inc b/app/templates/ProvisioningHistoryRecords/fields.inc
index d6b9ca9ec..027766e58 100644
--- a/app/templates/ProvisioningHistoryRecords/fields.inc
+++ b/app/templates/ProvisioningHistoryRecords/fields.inc
@@ -27,9 +27,15 @@
// This view does not support add or edit
if($vv_action == 'view') {
- print $this->Field->control('comment');
-
- print $this->Field->control('status');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'comment'
+ ]]);
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'status'
+ ]]);
// Currently these records only apply to People and Groups, but that will probably change
if(!empty($vv_obj->person->primary_name)) {
@@ -40,29 +46,41 @@ 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,
+ ]
+ ]);
} else {
- print $this->Field->statusControl(
- 'group_id',
- $vv_obj->group->name,
- [
- 'url' => [
- 'controller' => 'groups',
- 'action' => 'edit',
- $vv_obj->group->id
- ]
+ $viewLink = [
+ 'url' => [
+ 'controller' => 'groups',
+ 'action' => 'edit',
+ $vv_obj->group->id
]
- );
- }
+ ];
- print $this->Field->control('subject_model');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'group_id',
+ 'status' => $vv_obj->group->name,
+ 'link' => $viewLink,
+ ]
+ ]);
+ }
- print $this->Field->control('subjectid');
-
- print $this->Field->control('created');
+ foreach([
+ 'subject_model',
+ 'subjectid',
+ 'created',
+ ] as $field) {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $field
+ ]
+ ]);
+ }
}
diff --git a/app/templates/ProvisioningTargets/fields.inc b/app/templates/ProvisioningTargets/fields.inc
index fd4ed02cf..1e3b025de 100644
--- a/app/templates/ProvisioningTargets/fields.inc
+++ b/app/templates/ProvisioningTargets/fields.inc
@@ -49,28 +49,41 @@ alert("Queue modes not yet implemented"); // XXX CFM-26
Field->control('description');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'description'
+ ]]);
- print $this->Field->control(
- fieldName: 'status',
- options: [
- 'onChange' => 'updateGadgets()',
- 'default' => \App\Lib\Enum\ProvisionerModeEnum::QueueOnError
- ]
- );
-
- print $this->Field->control(
- fieldName: 'retry_interval',
- options: [
- 'default' => 900
- ],
- cssClass: 'subfield'
- );
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'status',
+ 'fieldOptions' => [
+ 'onChange' => 'updateGadgets()',
+ 'default' => \App\Lib\Enum\ProvisionerModeEnum::QueueOnError
+ ]
+ ]]);
- print $this->Field->control('plugin');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'retry_interval',
+ 'fieldOptions' => [
+ 'default' => 900
+ ]
+ ]]);
-// Not yet implemented (CFM-26)
-// print $this->Field->control('provisioning_group_id');
-
- print $this->Field->control('ordr');
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'plugin'
+ ]]);
+
+// // todo: Not yet implemented (CFM-26)
+// print $this->element('form/listItem', [
+// 'arguments' => [
+// 'fieldName' => 'provisioning_group_id'
+// ]]);
+
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => 'ordr'
+ ]]);
}
diff --git a/app/templates/ProvisioningTargets/status.php b/app/templates/ProvisioningTargets/status.php
index 6df0f712a..b22ac3d26 100644
--- a/app/templates/ProvisioningTargets/status.php
+++ b/app/templates/ProvisioningTargets/status.php
@@ -40,13 +40,13 @@
- = $this->Alert->alert($b, 'warning') ?>
+ = $this->element('notify/alert', ['message' => $b]) ?>
- = $this->Alert->alert($b, 'warning') ?>
+ = $this->element('notify/alert', ['message' => $b]) ?>
diff --git a/app/templates/Servers/fields.inc b/app/templates/Servers/fields.inc
index ea9c1e85d..0e27460e0 100644
--- a/app/templates/Servers/fields.inc
+++ b/app/templates/Servers/fields.inc
@@ -28,9 +28,14 @@
Field->control('description');
+ foreach (['description',
+ 'status',
+ 'plugin'
+ ] as $field) {
+ print $this->element('form/listItem', [
+ 'arguments' => [
+ 'fieldName' => $field
+ ]]);
+ }
- print $this->Field->control('status');
-
- print $this->Field->control('plugin');
}
diff --git a/app/templates/Standard/add-edit-view.php b/app/templates/Standard/add-edit-view.php
index e0afbbd7a..bce04253c 100644
--- a/app/templates/Standard/add-edit-view.php
+++ b/app/templates/Standard/add-edit-view.php
@@ -176,10 +176,6 @@
Form->create($vv_obj);
-
$linkId = null;
if(!empty($vv_primary_link)) {
@@ -192,52 +188,29 @@
}
}
-print $this->Field->startControlSet(
- modelName: $this->name,
- action: $vv_action,
- // XXX We need a model specific mechanism to disable read-only
- editable: ($vv_action == 'add' || $vv_action == 'edit'),
- reqFields: $vv_required_fields,
- pluginName: $this->getPlugin()
-);
-
-// We allow the fields.inc file to be specified for Controllers that have more
-// complicated/non-default actions.
-$fieldsFile = "fields.inc";
-
-if(!empty($vv_fields_inc)) {
- $fieldsFile = $vv_fields_inc;
-}
-
-// The controller will calculate the template path for us, since it could be
-// in one of several paths if we are in a plugin context.
-include($vv_template_path . DS . $fieldsFile);
+/*
+ * Views have a set() method that is analogous to the set() found in Controller objects.
+ * Using set() from your view file will add the variables to the layout and elements
+ * that will be rendered later.
+ */
-if(!empty($hidden)) {
- // Inject any hidden variables set by the include file
- foreach($hidden as $attr => $v) {
- print $this->Form->hidden($attr, ['value' => $v]);
- }
-}
+// By default, the form will POST to the current controller
+// Note we need to open the form for view so Cake will autopopulate values
+print $this->Form->create($vv_obj);
-if($vv_action != 'add') {
- print '
+ element('form/nameDiv');
+
+ // Info Div
+ if(isset($vv_field_arguments['fieldPrefix'])) {
+ print $this->element('form/infoDiv/withPrefix');
+ } elseif(isset($vv_field_arguments['status'])) {
+ print $this->element('form/infoDiv/status');
+ } elseif(isset($vv_field_arguments['groupedControls'])) {
+ 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');
+ } elseif(isset($vv_field_arguments['groupmember'])) {
+ print $this->element('form/infoDiv/groupMember');
+ } elseif(isset($vv_field_arguments['autocomplete'])) {
+ print $this->element('form/infoDiv/autocomplete');
+ } else {
+ print $this->element('form/infoDiv/default');
+ }
+ ?>
+
\ No newline at end of file
diff --git a/app/templates/element/form/infoDiv/autocomplete.php b/app/templates/element/form/infoDiv/autocomplete.php
new file mode 100644
index 000000000..787a54c1a
--- /dev/null
+++ b/app/templates/element/form/infoDiv/autocomplete.php
@@ -0,0 +1,59 @@
+Form->unlockField($fieldName);
+$this->Form->unlockField($autoCompleteFieldName);
+
+$autocompleteArgs = [
+ 'type' => 'field',
+ 'fieldName' => $fieldName,
+ 'personType' => 'person',
+ 'htmlId' => $autoCompleteFieldName,
+ 'viewConfigParameters' => $vv_field_arguments['autocomplete']['configuration']
+];
+
+?>
+
+
+Form->hidden($fieldName, $vv_field_arguments['fieldOptions']) . $this->element('peopleAutocomplete', $autocompleteArgs);
+?>
+
- = $this->Alert->alert(__d('information','cmp.config.notice', $noticeUrls), 'information', true) ?>
+ = $this->element('notify/alert', [
+ 'message' => __d('information','cmp.config.notice', $noticeUrls),
+ 'type' => 'information',
+ 'dismissible' => true
+ ]) ?>