using a type-specific template in the list, if it exists

This commit is contained in:
Ralf Becker 2006-10-21 13:07:32 +00:00
parent c98a675df0
commit 2f3d566207
2 changed files with 21 additions and 7 deletions

View File

@ -601,6 +601,14 @@ class soinfolog // DB-Layer
$ids[$info['info_id']] = $info; $ids[$info['info_id']] = $info;
} }
if ($ids && $query['custom_fields'])
{
$this->db->select($this->extra_table,'*',array('info_id'=>array_keys($ids)),__LINE__,__FILE__);
while ($row = $this->db->row(true))
{
$ids[$row['info_id']]['#'.$row['info_extra_name']] = $row['info_extra_value'];
}
}
} }
else else
{ {

View File

@ -292,6 +292,19 @@ class uiinfolog
$this->save_sessiondata($query); $this->save_sessiondata($query);
// check if we have a custom, type-specific template
unset($query['template']);
unset($query['custom_fields']);
if ($query['col_filter']['info_type'])
{
$tpl =& new etemplate;
if ($tpl->read('infolog.index.rows.'.$query['col_filter']['info_type']))
{
$query['template'] =& $tpl;
$query['custom_fields'] = true; // read the custom fields too
}
//echo "<p align=right>template ='".'infolog.index.rows.'.$query['col_filter']['info_type']."'".(!$query['template'] ? ' not' : '')." found</p>\n";
}
$ids = $this->bo->search($query); $ids = $this->bo->search($query);
if (!is_array($ids)) if (!is_array($ids))
{ {
@ -324,13 +337,6 @@ class uiinfolog
$GLOBALS['egw_info']['flags']['app_header'] = lang('Infolog').($query['filter'] == 'none' ? '' : $GLOBALS['egw_info']['flags']['app_header'] = lang('Infolog').($query['filter'] == 'none' ? '' :
' - '.lang($this->filters[$query['filter']])); ' - '.lang($this->filters[$query['filter']]));
} }
unset($query['template']);
if ($query['col_filter']['info_type'])
{
$tpl =& new etemplate;
if ($tpl->read('infolog.index.rows.'.$query['col_filter']['info_type'])) $query['template'] =& $tpl;
//echo "<p align=right>template ='".'infolog.index.rows.'.$query['col_filter']['info_type']."'".(!$query['template'] ? ' not' : '')." found</p>\n";
}
return $query['total']; return $query['total'];
} }