Skip to content

Commit

Permalink
LEAF 4639 custom data method empUID update
Browse files Browse the repository at this point in the history
  • Loading branch information
aerinkayne committed Jan 16, 2025
1 parent 3756468 commit a8d33d6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions LEAF_Request_Portal/sources/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a8d33d6

Please sign in to comment.