Skip to content

Commit

Permalink
ExternalIdentitySourceRecords,IdentifierAssignments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 27, 2024
1 parent f802f0f commit b4ffb4c
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 51 deletions.
3 changes: 2 additions & 1 deletion app/src/Controller/ApiUsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public function generate(string $id) {
'Cous', 'ApiUsers', 'CoSettings', 'Cos', 'Addresses', 'EmailAddresses',
'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords',
'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities',
'ExternalIdentityRoles', 'ExternalIdentitySources'
'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords',
'IdentifierAssignments'
])
) {
$this->render('/Standard/add-edit-view-new');
Expand Down
9 changes: 6 additions & 3 deletions app/src/Controller/StandardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ public function add() {
'Cous', 'ApiUsers', 'CoSettings', 'Cos', 'Addresses', 'EmailAddresses',
'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords',
'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities',
'ExternalIdentityRoles', 'ExternalIdentitySources'
'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords',
'IdentifierAssignments'
])
) {
$this->render('/Standard/add-edit-view-new');
Expand Down Expand Up @@ -435,7 +436,8 @@ public function edit(string $id) {
'Cous', 'CoSettings', 'ApiUsers', 'Cos', 'Addresses', 'EmailAddresses',
'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords',
'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities',
'ExternalIdentityRoles', 'ExternalIdentitySources'
'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords',
'IdentifierAssignments'
])
) {
$this->render('/Standard/add-edit-view-new');
Expand Down Expand Up @@ -893,7 +895,8 @@ public function view($id = null) {
'Cous', 'ApiUsers', 'CoSettings', 'Cos', 'Addresses', 'EmailAddresses',
'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords',
'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities',
'ExternalIdentityRoles', 'ExternalIdentitySources'
'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords',
'IdentifierAssignments'
])
) {
$this->render('/Standard/add-edit-view-new');
Expand Down
19 changes: 11 additions & 8 deletions app/templates/ExtIdentitySourceRecords/fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@ print $this->Alert->alert($noticeText, 'information', false);
// This view does not support add or edit
if($vv_action == 'view') {
// Link to External Identity, if known

print $this->Field->control('source_key');

print $this->Field->control('last_update');

print $this->Field->control('reference_identifier');

print $this->Field->control(fieldName: 'source_record', cssClass: 'source-record');
foreach([
'source_key',
'last_update',
'reference_identifier',
'source_record'
] as $field) {
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => $field,
]]);
}
}
83 changes: 51 additions & 32 deletions app/templates/IdentifierAssignments/fields.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* COmanage Registry Identifier Assignment Fields
* COmanage Registry Identifier Assignments Fields
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
Expand Down Expand Up @@ -56,7 +56,10 @@
}

function resetType(id) {
document.getElementById(id).value = "";
const dropDown = document.getElementById(id);
dropDown.value = "";
dropDown.selectedIndex = 0;

updateGadgets();
}

Expand All @@ -68,41 +71,57 @@
<?php
// This view does not support read-only
if($vv_action == 'add' || $vv_action == 'edit') {
print $this->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',
'options' => [
'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',
'options' => [
'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',
'options' => [
'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,
]]);
}
}
15 changes: 9 additions & 6 deletions app/templates/element/form/listItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@
$this->set('vv_field_arguments', $arguments);

// Additional classes calculation
$classes = '';
// XXX Even though i set the view vars above i can not access their values here/yet.
if(in_array($this->Fieeld->getFieldType($arguments['fieldName']), ['date', 'datetime', 'timestamp'])) {
$classes .= 'fields-datepicker ';
}
$classes = match ($arguments['fieldName']) {
'date',
'datetime',
'timestamp' => 'fields-datepicker ',
'source_record' => 'source-record ',
'login' => 'subfield ',
default => ''
};

?>

<li class="<?= $classes ?>">
<li class="<?= trim($classes) ?>">
<?= $this->element('form/fieldDiv')?>
</li>
5 changes: 4 additions & 1 deletion app/templates/element/form/nameDiv.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
?>

<div class="field-name <?= $classes ?>">
<!-- We print the login checkbox along with the Identifier type. As a result, the label is redundant -->
<?php if($fieldName != 'login'): ?>
<div class="field-title">
<!-- Will this work for accessibility? -->
<?php if((isset($labelIsTextOnly) && !$labelIsTextOnly)
Expand All @@ -81,5 +83,6 @@
</div>
<?php if(isset($desc)): ?>
<div class="field-desc"><?= $desc ?></div>
<?php endif; ?>
<?php endif; // description?>
<?php endif; // login?>
</div>

0 comments on commit b4ffb4c

Please sign in to comment.