File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -834,18 +834,21 @@ public function reportSunburstTicketByCategories($config = [])
834834 //get full parent list
835835 krsort ($ flat_datas );
836836 $ itilcategory = new ITILCategory ();
837- foreach ($ flat_datas as $ cat_id => $ current_datas ) {
838- if (!isset ($ flat_datas [$ current_datas ['parent ' ]])) {
839- if (
840- $ current_datas ['parent ' ] != 0
841- && $ itilcategory ->getFromDB (intval ($ current_datas ['parent ' ]))
842- ) {
843- $ flat_datas [$ current_datas ['parent ' ]] = [
844- 'id ' => $ current_datas ['parent ' ],
845- 'name ' => $ itilcategory ->fields ['name ' ],
846- 'parent ' => $ itilcategory ->fields ['itilcategories_id ' ],
847- 'count ' => 0 ,
848- ];
837+ foreach ($ flat_datas as $ current_datas ) {
838+ $ ancestors = getAncestorsOf (ITILCategory::getTable (), $ current_datas ['id ' ]);
839+ foreach ($ ancestors as $ ancestor ) {
840+ if (!isset ($ flat_datas [$ ancestor ])) {
841+ if (
842+ $ ancestor != 0
843+ && $ itilcategory ->getFromDB (intval ($ ancestor ))
844+ ) {
845+ $ flat_datas [$ ancestor ] = [
846+ 'id ' => $ ancestor ,
847+ 'name ' => $ itilcategory ->fields ['name ' ],
848+ 'parent ' => $ itilcategory ->fields ['itilcategories_id ' ],
849+ 'count ' => 0 ,
850+ ];
851+ }
849852 }
850853 }
851854 }
You can’t perform that action at this time.
0 commit comments