From: <lei...@us...> - 2007-11-27 12:12:43
|
Author: leithoff Date: Tue Nov 27 12:49:55 2007 New Revision: 24712 URL: http://www.egroupware.org/viewvc?rev=3D3D24712&view=3D3Drev Log: adaption of the customfields feature to the distinction of detailed/non-det= =3D ailed prefs of the columnselection Modified: branches/1.4/infolog/inc/class.uiinfolog.inc.php Modified: branches/1.4/infolog/inc/class.uiinfolog.inc.php URL: http://www.egroupware.org/viewvc/branches/1.4/infolog/inc/class.uiinfo= =3D log.inc.php?rev=3D3D24712&r1=3D3D24711&r2=3D3D24712&view=3D3Ddiff =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D --- branches/1.4/infolog/inc/class.uiinfolog.inc.php (original) +++ branches/1.4/infolog/inc/class.uiinfolog.inc.php Tue Nov 27 12:49:55 20= =3D 07 @@ -341,13 +341,22 @@ } //echo "<p align=3D3Dright>template =3D3D'".'infolog.index.rows.'.$quer= y['c=3D ol_filter']['info_type']."'".(!$query['template'] ? ' not' : '')." found</p= =3D >\n"; } - // do we need to read the custom fields, depends on the column is enable= =3D d and customfields exist - $columselection =3D3D $this->prefs['nextmatch-infolog.index.rows']; + // do we need to read the custom fields, depends on the column is enable= =3D d and customfields exist, prefs are filter specific + // so we have to check that as well + $details =3D3D $query['filter2'] =3D3D=3D3D 'all'; + $columselection =3D3D $this->prefs['nextmatch-infolog.index.rows'.($deta= il=3D s?'-details':'')]; //_debug_array($columselection); if ($columselection) =3D { - if (!isset($query['selectcols'])) $query['selectcols']=3D3D$columselect= io=3D n; =3D + $query['selectcols']=3D3D$columselection; =3D $columselection =3D3D explode(',',$columselection); + } else { + if (isset($query['selectcols'])) + { + $columselection =3D3Dexplode(',',$query['selectcols']); + } else { + $columselection=3D3Darray(); + } } $show_custom_fields =3D3D (!$columselection || in_array('customfields',$= co=3D lumselection)) && $this->bo->customfields; $lv_customfields=3D3Darray(); // used to set the visible columns @@ -366,13 +375,11 @@ { $lv_customfields[$cf]=3D3D$cfa; $readonlys['#'.$cf] =3D3D true; - if (stripos($query['selectcols'],'#'.$cf)=3D3D=3D3D=3D3DFALSE) $que= ry['se=3D lectcols'].=3D3D",#".$cf; } } else { if ($showallcustfields=3D3D=3D3D1 || in_array('#'.$cf,$columselectio= n)) { $lv_customfields[$cf]=3D3D$cfa; $readonlys['#'.$cf] =3D3D true; - if (stripos($query['selectcols'],'#'.$cf)=3D3D=3D3D=3D3DFALSE) $que= ry['se=3D lectcols'].=3D3D",#".$cf; } } // set the array for the available cust-cols @@ -387,7 +394,6 @@ $lv_customfields[$name]=3D3D$value; //echo $name."->". $value['label']."<br>"; $readonlys['#'.$name] =3D3D true; - if (stripos($query['selectcols'],'#'.$name)!=3D3D=3D3DFALSE) $query[= 'sel=3D ectcols'].=3D3D",#".$name; } //set the array for the available cust-cols $cvp['#'.$name] =3D3D $value['label']; @@ -637,9 +643,17 @@ if ($action =3D3D=3D3D 'sp') { $pref =3D3D 'nextmatch-infolog.index.rows'.($values['nm']['filter2']=3D= 3D=3D =3D3D'all'?'-details':''); - foreach(array('info_used_time_info_planned_time','info_datemodified','i= =3D nfo_owner_info_responsible') as $name) + foreach(array('info_used_time_info_planned_time','info_datemodified','i= =3D nfo_owner_info_responsible','customfields') as $name) { $values['main']['no_'.$name] =3D3D strpos($this->prefs[$pref],$name) = =3D3D=3D =3D3D=3D3D false; + } + if (!$values['main']['no_customfields']) =3D + { + // set the column-header of the main table for the customfields. + foreach($this->bo->customfields as $lname =3D3D> $data) + { + $values['main']['customfields'].=3D3D$lname."\n"; + } } } $values['nm']['header_right'] =3D3D 'infolog.index.header_right'; |