From c5852cd602c74d65f77d0f9dbdd47ee305ecdcc0 Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Wed, 18 Dec 2024 14:07:13 -0500 Subject: [PATCH] LEAF 4258 orgchart group and pos, report builder display when not found --- LEAF_Request_Portal/sources/Form.php | 28 ++++++--- .../templates/subindicators.tpl | 63 ++++++++++--------- 2 files changed, 54 insertions(+), 37 deletions(-) diff --git a/LEAF_Request_Portal/sources/Form.php b/LEAF_Request_Portal/sources/Form.php index d92116efd..16db02001 100644 --- a/LEAF_Request_Portal/sources/Form.php +++ b/LEAF_Request_Portal/sources/Form.php @@ -2671,17 +2671,27 @@ public function getCustomData(array $recordID_list, string|null $indicatorID_lis } break; case 'orgchart_position': - $positionTitle = $this->position->getTitle($item['data']); - $positionData = $this->position->getAllData($item['data']); - - $item['dataOrgchart'] = $positionData; - $item['dataOrgchart']['positionID'] = $item['data']; - $item['data'] = "{$positionTitle} ({$positionData[2]['data']}-{$positionData[13]['data']}-{$positionData[14]['data']})"; + $dataDisplay = ""; + if(!empty(trim($item['data']))) { + $positionTitle = $this->position->getTitle($item['data']); + if ($positionTitle !== false) { + $positionData = $this->position->getAllData($item['data']); + $dataDisplay = "{$positionTitle} ({$positionData[2]['data']}-{$positionData[13]['data']}-{$positionData[14]['data']})"; + $item['dataOrgchart'] = $positionData; + $item['dataOrgchart']['positionID'] = $item['data']; + } else { + $dataDisplay = "Position #" . $item['data'] ." no longer available"; + } + } + $item['data'] = $dataDisplay; break; case 'orgchart_group': - $groupTitle = $this->group->getTitle($item['data']); - - $item['data'] = $groupTitle; + $dataDisplay = ""; + if(!empty(trim($item['data']))) { + $groupTitle = $this->group->getTitle($item['data']); + $dataDisplay = $groupTitle !== false ? $groupTitle : "Group #" . $item['data'] ." no longer available"; + } + $item['data'] = $dataDisplay; break; case 'raw_data': if($indicators[$item['indicatorID']]['htmlPrint'] != '') { diff --git a/LEAF_Request_Portal/templates/subindicators.tpl b/LEAF_Request_Portal/templates/subindicators.tpl index 697fec56c..9e1437de8 100644 --- a/LEAF_Request_Portal/templates/subindicators.tpl +++ b/LEAF_Request_Portal/templates/subindicators.tpl @@ -979,39 +979,46 @@
Loading...