From 4682133d829db6ed2da1f77edb0c78f5c72d7b26 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 14 Sep 2007 10:31:08 +0000 Subject: [PATCH] "fixed not shown calendar if custom fields are selected too" --- addressbook/inc/class.uicontacts.inc.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/addressbook/inc/class.uicontacts.inc.php b/addressbook/inc/class.uicontacts.inc.php index 230750de33..9582d253e2 100644 --- a/addressbook/inc/class.uicontacts.inc.php +++ b/addressbook/inc/class.uicontacts.inc.php @@ -831,16 +831,19 @@ class uicontacts extends bocontacts // do we need to read the custom fields, depends on the column is enabled and customfields exist $columselection = $this->prefs['nextmatch-addressbook.'.($do_email ? 'email' : 'index').'.rows']; if ($columselection) $columselection = explode(',',$columselection); - if (!$id_only && $rows && ( - ($show_custom_fields = (!$columselection || in_array('customfields',$columselection)) && $this->customfields) || - ($show_calendar = !$columselection || in_array('calendar',$columselection)))) + if (!$id_only && $rows) { - foreach((array) $rows as $n => $val) + $show_custom_fields = (!$columselection || in_array('customfields',$columselection)) && $this->customfields; + $show_calendar = !$columselection || in_array('calendar',$columselection); + if ($show_calendar || $show_custom_fields) { - if ($val && (int)$val['id']) $ids[] = $val['id']; + foreach($rows as $val) + { + $ids[] = $val['id']; + } + if ($show_custom_fields) $customfields = $this->read_customfields($ids); + if ($show_calendar) $calendar = $this->read_calendar($ids); } - if ($ids && $show_custom_fields) $customfields = $this->read_customfields($ids); - if ($ids && $show_calendar) $calendar = $this->read_calendar($ids); } } if (!$rows) $rows = array();