From 36ca3dd0247968aae3313af5c35bfee150f49e96 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 15 Apr 2019 12:12:20 +0200 Subject: [PATCH] Fix calendar report not taking all categories into account --- .../inc/class.calendar_category_report.inc.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_category_report.inc.php b/calendar/inc/class.calendar_category_report.inc.php index 72f9d5bf19..5998291ed2 100644 --- a/calendar/inc/class.calendar_category_report.inc.php +++ b/calendar/inc/class.calendar_category_report.inc.php @@ -224,7 +224,7 @@ class calendar_category_report extends calendar_ui{ $api_cats = new Api\Categories($GLOBALS['egw_info']['user']['account_id'],'calendar'); if (is_null($content)) { - $cats = $api_cats->return_sorted_array($start=0, false, '', 'ASC', 'cat_name', true, 0, true); + $cats = $api_cats->return_sorted_array($start=0, false, '', 'ASC', 'cat_name', 'all_no_acl', 0, true); $cats_status = $GLOBALS['egw_info']['user']['preferences']['calendar']['category_report']; foreach ($cats as &$value) { @@ -238,9 +238,19 @@ class calendar_category_report extends calendar_ui{ 'enable' => true ); } + if (is_array($cats_status)) { - $content['grid'] = array_replace_recursive($content['grid'], $cats_status); + foreach ($content['grid'] as &$row) + { + foreach ($cats_status as $value) + { + if ($row['cat_id'] == $value['cat_id']) + { + $row = $value; + } + } + } } } else