Skip to content

Commit

Permalink
Addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 26, 2024
1 parent 2875d79 commit cb2c371
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 19 deletions.
54 changes: 35 additions & 19 deletions app/templates/Addresses/fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,42 @@
if($vv_action == 'add' || $vv_action == 'edit' || $vv_action == 'view') {
// Dynamic required fields is automatically handled by FormHelper via the
// validation rules

print $this->Field->control('street');
foreach (['street',
'room',
'locality',
'state',
'postal_code',
'country',
] as $field) {
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => $field
]]);
}

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

print $this->Field->control('locality');
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'type_id',
'options' => [
'default' => $vv_default_type
]
]]);

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

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

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

print $this->Field->control('type_id', ['default' => $vv_default_type]);

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

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

print $this->Field->control('frozen');
foreach (['language',
'description',
'frozen',
] as $field) {
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => $field
]]);
}
}

print $this->Field->sourceControl($vv_obj);
if($vv_action == 'edit' || $vv_action == 'view') {
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'source',
'entity' => $vv_obj
]]);
}
34 changes: 34 additions & 0 deletions app/templates/element/form/infoDiv/source.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* COmanage Registry Info Div Source Element
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/


declare(strict_types = 1);
?>
<div>
<?= $this->Fieeld->sourceLink($entity) ?>
</div>

0 comments on commit cb2c371

Please sign in to comment.