fix: [org] field in the index table fixed
- removed debug - correct extraction of the data - show links for the orgs to the org viewpull/38/head
parent
7a195aed93
commit
d6bef47ce9
|
@ -1,9 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
debug($row);
|
$orgs = $row[$field['data_path']];
|
||||||
debug($row['organisation']);
|
|
||||||
debug($this->Hash->extract($row, 'organisation'));
|
|
||||||
debug($field['data_path']);
|
|
||||||
$orgs = $this->Hash->extract($row, $field['data_path']);
|
|
||||||
if (!isset($field['fields']['allow_picture'])) {
|
if (!isset($field['fields']['allow_picture'])) {
|
||||||
$field['fields']['allow_picture'] = true;
|
$field['fields']['allow_picture'] = true;
|
||||||
}
|
}
|
||||||
|
@ -11,8 +7,8 @@ debug($field['data_path']);
|
||||||
$field['fields']['default_org'] = '';
|
$field['fields']['default_org'] = '';
|
||||||
}
|
}
|
||||||
if (!empty($orgs)) {
|
if (!empty($orgs)) {
|
||||||
if (!isset($orgs[0])) {
|
if (!empty($orgs['id'])) {
|
||||||
$orgs = array($orgs);
|
$orgs = [$orgs];
|
||||||
}
|
}
|
||||||
$count = count($orgs);
|
$count = count($orgs);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
@ -20,6 +16,11 @@ debug($field['data_path']);
|
||||||
$i++;
|
$i++;
|
||||||
if (!empty($org['id']) || !empty($org['name'])) {
|
if (!empty($org['id']) || !empty($org['name'])) {
|
||||||
if ($field['fields']['allow_picture'] && !empty($org['id'])) {
|
if ($field['fields']['allow_picture'] && !empty($org['id'])) {
|
||||||
|
echo sprintf(
|
||||||
|
'<a href="%s">%s</a>',
|
||||||
|
$baseurl . '/organisations/view/' . h($org['id']),
|
||||||
|
h($org['name'])
|
||||||
|
);
|
||||||
//echo $this->OrgImg->getOrgImg(array('name' => $org['name'], 'id' => $org['id'], 'size' => 24));
|
//echo $this->OrgImg->getOrgImg(array('name' => $org['name'], 'id' => $org['id'], 'size' => 24));
|
||||||
} else {
|
} else {
|
||||||
echo sprintf(
|
echo sprintf(
|
||||||
|
@ -34,6 +35,11 @@ debug($field['data_path']);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($field['fields']['allow_picture']) {
|
if ($field['fields']['allow_picture']) {
|
||||||
|
echo sprintf(
|
||||||
|
'<a href="%s">%s</a>',
|
||||||
|
$baseurl . '/organisations/view/' . h($org['id']),
|
||||||
|
h($org['name'])
|
||||||
|
);
|
||||||
//echo $this->OrgImg->getOrgImg(array('name' => $field['fields']['default_org'], 'size' => 24));
|
//echo $this->OrgImg->getOrgImg(array('name' => $field['fields']['default_org'], 'size' => 24));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue