Skip to content

Commit

Permalink
Merge pull request #2653 from department-of-veterans-affairs/issue/LE…
Browse files Browse the repository at this point in the history
…AF-4639/orgchart_empUID_property

LEAF 4639 - custom data orgchart empUID
  • Loading branch information
Pelentan authored Jan 16, 2025
2 parents bc051d8 + a8d33d6 commit f7ace60
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 f7ace60

Please sign in to comment.