2020-05-29 13:41:58 +02:00
|
|
|
<?php
|
2021-01-13 14:22:15 +01:00
|
|
|
$orgs = $row[$field['data_path']];
|
2020-05-29 13:41:58 +02:00
|
|
|
if (!isset($field['fields']['allow_picture'])) {
|
|
|
|
$field['fields']['allow_picture'] = true;
|
|
|
|
}
|
|
|
|
if (!isset($field['fields']['default_org'])) {
|
|
|
|
$field['fields']['default_org'] = '';
|
|
|
|
}
|
|
|
|
if (!empty($orgs)) {
|
2021-01-13 14:22:15 +01:00
|
|
|
if (!empty($orgs['id'])) {
|
|
|
|
$orgs = [$orgs];
|
2020-05-29 13:41:58 +02:00
|
|
|
}
|
|
|
|
$count = count($orgs);
|
|
|
|
$i = 0;
|
|
|
|
foreach ($orgs as $org) {
|
|
|
|
$i++;
|
|
|
|
if (!empty($org['id']) || !empty($org['name'])) {
|
|
|
|
if ($field['fields']['allow_picture'] && !empty($org['id'])) {
|
2021-01-13 14:22:15 +01:00
|
|
|
echo sprintf(
|
|
|
|
'<a href="%s">%s</a>',
|
2021-02-09 22:10:26 +01:00
|
|
|
$baseurl . 'organisations/view/' . h($org['id']),
|
2021-01-13 14:22:15 +01:00
|
|
|
h($org['name'])
|
|
|
|
);
|
2020-09-28 01:25:07 +02:00
|
|
|
//echo $this->OrgImg->getOrgImg(array('name' => $org['name'], 'id' => $org['id'], 'size' => 24));
|
2020-05-29 13:41:58 +02:00
|
|
|
} else {
|
|
|
|
echo sprintf(
|
2021-02-09 22:10:26 +01:00
|
|
|
'<a href="%sorganisations/view/%s">%s</a>',
|
2020-05-29 13:41:58 +02:00
|
|
|
$baseurl,
|
|
|
|
empty($org['id']) ? h($org['uuid']) : h($org['id']),
|
|
|
|
h($org['name'])
|
|
|
|
);
|
|
|
|
}
|
|
|
|
if ($i < $count) {
|
|
|
|
echo '<br />';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if ($field['fields']['allow_picture']) {
|
2021-01-13 14:22:15 +01:00
|
|
|
echo sprintf(
|
|
|
|
'<a href="%s">%s</a>',
|
2021-02-09 22:10:26 +01:00
|
|
|
$baseurl . 'organisations/view/' . h($org['id']),
|
2021-01-13 14:22:15 +01:00
|
|
|
h($org['name'])
|
|
|
|
);
|
2020-09-28 01:25:07 +02:00
|
|
|
//echo $this->OrgImg->getOrgImg(array('name' => $field['fields']['default_org'], 'size' => 24));
|
2020-05-29 13:41:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|