2020-06-04 10:05:45 +02:00
|
|
|
<?php
|
2021-03-15 22:47:13 +01:00
|
|
|
$type = $this->Hash->extract($row, $field['owner_model_path'])[0];
|
2020-06-04 10:05:45 +02:00
|
|
|
$owner = $row[$type];
|
|
|
|
$types = [
|
|
|
|
'individual' => [
|
|
|
|
'uri' => 'individuals',
|
|
|
|
'name' => __('Individual'),
|
|
|
|
'identityField' => 'email'
|
|
|
|
],
|
|
|
|
'organisation' => [
|
|
|
|
'uri' => 'organisations',
|
|
|
|
'name' => __('Organisation'),
|
|
|
|
'identityField' => 'name'
|
|
|
|
]
|
|
|
|
];
|
|
|
|
echo sprintf(
|
2021-09-17 13:04:37 +02:00
|
|
|
'<span class="fw-bold">%s</span>: %s',
|
2020-06-04 10:05:45 +02:00
|
|
|
$types[$type]['name'],
|
|
|
|
$this->Html->link(
|
|
|
|
sprintf(
|
|
|
|
'(%s) %s',
|
|
|
|
h($owner['id']),
|
|
|
|
h($owner[$types[$type]['identityField']])
|
|
|
|
),
|
|
|
|
['controller' => $types[$type]['uri'], 'action' => 'view', $owner['id']],
|
|
|
|
[
|
|
|
|
'class' => 'link-unstyled'
|
|
|
|
]
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
?>
|