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
|
||||
debug($row);
|
||||
debug($row['organisation']);
|
||||
debug($this->Hash->extract($row, 'organisation'));
|
||||
debug($field['data_path']);
|
||||
$orgs = $this->Hash->extract($row, $field['data_path']);
|
||||
$orgs = $row[$field['data_path']];
|
||||
if (!isset($field['fields']['allow_picture'])) {
|
||||
$field['fields']['allow_picture'] = true;
|
||||
}
|
||||
|
@ -11,8 +7,8 @@ debug($field['data_path']);
|
|||
$field['fields']['default_org'] = '';
|
||||
}
|
||||
if (!empty($orgs)) {
|
||||
if (!isset($orgs[0])) {
|
||||
$orgs = array($orgs);
|
||||
if (!empty($orgs['id'])) {
|
||||
$orgs = [$orgs];
|
||||
}
|
||||
$count = count($orgs);
|
||||
$i = 0;
|
||||
|
@ -20,6 +16,11 @@ debug($field['data_path']);
|
|||
$i++;
|
||||
if (!empty($org['id']) || !empty($org['name'])) {
|
||||
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));
|
||||
} else {
|
||||
echo sprintf(
|
||||
|
@ -34,6 +35,11 @@ debug($field['data_path']);
|
|||
}
|
||||
} else {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue