diff --git a/LEAF_Request_Portal/sources/Form.php b/LEAF_Request_Portal/sources/Form.php index 16072561a..05c4e56eb 100644 --- a/LEAF_Request_Portal/sources/Form.php +++ b/LEAF_Request_Portal/sources/Form.php @@ -2660,16 +2660,19 @@ public function getCustomData(array $recordID_list, string|null $indicatorID_lis } } break; - case 'orgchart_employee': //report builder cells + case 'orgchart_employee': //report builder cells, form/query $dataDisplay = ""; - if (isset($item['metadata'])) { - $orgchartInfo = json_decode($item['metadata'], true); - if(!empty(trim($orgchartInfo['lastName']))) { - $dataDisplay = "{$orgchartInfo['firstName']} {$orgchartInfo['lastName']}"; - $item['dataOrgchart'] = $orgchartInfo; - } else { - $dataDisplay = "Employee #" . $item['data'] ." no longer available"; + if(!empty($item['data'])) { + $orgchartInfo = array('empUID' => (int)$item['data']); + if (isset($item['metadata'])) { + $orgchartInfo = array_merge($orgchartInfo, json_decode($item['metadata'], true)); + if(!empty(trim($orgchartInfo['lastName']))) { + $dataDisplay = "{$orgchartInfo['firstName']} {$orgchartInfo['lastName']}"; + } else { + $dataDisplay = "Employee #" . $item['data'] ." no longer available"; + } } + $item['dataOrgchart'] = $orgchartInfo; } $item['data'] = $dataDisplay; break;