Fix infolog home portlet

This commit is contained in:
Nathan Gray 2015-02-24 19:35:42 +00:00
parent 1c72e1c2a1
commit 2ea4330033
2 changed files with 16 additions and 1 deletions

View File

@ -63,6 +63,16 @@ class infolog_favorite_portlet extends home_favorite_portlet
*/
public static function get_rows(&$query, &$rows, &$readonlys)
{
// Make sure we pass the type check
if ($query['col_filter']['info_type'])
{
$tpl = new etemplate_new;
if ($tpl->read('infolog.index.rows.'.$query['col_filter']['info_type']))
{
$query['template'] = $tpl->name;
$query['custom_fields'] = true; // read the custom fields too
}
}
$ui = new infolog_ui();
$total = $ui->get_rows($query, $rows, $readonlys);
// infolog_ui overwrites what we set in constructor

View File

@ -388,7 +388,12 @@ class infolog_ui
// check if we have a custom, type-specific template
$old_template = $query['template'];
$query['template'] = 'infolog.index.rows';
// Reset custom, type-specific template if type was cleared (without changing it for home)
if(!$query['template'] || stripos($query['template'], 'infolog.index.rows') === 0)
{
$query['template'] = 'infolog.index.rows';
}
unset($query['custom_fields']);
if ($query['col_filter']['info_type'])
{