diff --git a/infolog/inc/class.uiinfolog.inc.php b/infolog/inc/class.uiinfolog.inc.php index d47e3db399..46db2dc853 100644 --- a/infolog/inc/class.uiinfolog.inc.php +++ b/infolog/inc/class.uiinfolog.inc.php @@ -341,13 +341,22 @@ class uiinfolog } //echo "

template ='".'infolog.index.rows.'.$query['col_filter']['info_type']."'".(!$query['template'] ? ' not' : '')." found

\n"; } - // do we need to read the custom fields, depends on the column is enabled and customfields exist - $columselection = $this->prefs['nextmatch-infolog.index.rows']; + // do we need to read the custom fields, depends on the column is enabled and customfields exist, prefs are filter specific + // so we have to check that as well + $details = $query['filter2'] == 'all'; + $columselection = $this->prefs['nextmatch-infolog.index.rows'.($details?'-details':'')]; //_debug_array($columselection); if ($columselection) { - if (!isset($query['selectcols'])) $query['selectcols']=$columselection; + $query['selectcols']=$columselection; $columselection = explode(',',$columselection); + } else { + if (isset($query['selectcols'])) + { + $columselection =explode(',',$query['selectcols']); + } else { + $columselection=array(); + } } $show_custom_fields = (!$columselection || in_array('customfields',$columselection)) && $this->bo->customfields; $lv_customfields=array(); // used to set the visible columns @@ -366,13 +375,11 @@ class uiinfolog { $lv_customfields[$cf]=$cfa; $readonlys['#'.$cf] = true; - if (stripos($query['selectcols'],'#'.$cf)===FALSE) $query['selectcols'].=",#".$cf; } } else { if ($showallcustfields==1 || in_array('#'.$cf,$columselection)) { $lv_customfields[$cf]=$cfa; $readonlys['#'.$cf] = true; - if (stripos($query['selectcols'],'#'.$cf)===FALSE) $query['selectcols'].=",#".$cf; } } // set the array for the available cust-cols @@ -387,7 +394,6 @@ class uiinfolog $lv_customfields[$name]=$value; //echo $name."->". $value['label']."
"; $readonlys['#'.$name] = true; - if (stripos($query['selectcols'],'#'.$name)!==FALSE) $query['selectcols'].=",#".$name; } //set the array for the available cust-cols $cvp['#'.$name] = $value['label']; @@ -637,10 +643,18 @@ class uiinfolog if ($action == 'sp') { $pref = 'nextmatch-infolog.index.rows'.($values['nm']['filter2']=='all'?'-details':''); - foreach(array('info_used_time_info_planned_time','info_datemodified','info_owner_info_responsible') as $name) + foreach(array('info_used_time_info_planned_time','info_datemodified','info_owner_info_responsible','customfields') as $name) { $values['main']['no_'.$name] = strpos($this->prefs[$pref],$name) === false; } + if (!$values['main']['no_customfields']) + { + // set the column-header of the main table for the customfields. + foreach($this->bo->customfields as $lname => $data) + { + $values['main']['customfields'].=$lname."\n"; + } + } } $values['nm']['header_right'] = 'infolog.index.header_right'; if ($extra_app_header)