Skip to content

Commit

Permalink
Merge pull request #2646 from department-of-veterans-affairs/vapo
Browse files Browse the repository at this point in the history
Vapo
  • Loading branch information
Pelentan authored Jan 13, 2025
2 parents 0c51868 + 2c7d455 commit c366db3
Show file tree
Hide file tree
Showing 19 changed files with 566 additions and 122 deletions.
327 changes: 300 additions & 27 deletions LEAF_Nexus/sources/Employee.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions LEAF_Request_Portal/admin/css/mod_templates_reports.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
margin-bottom: 1px;
height: 100vh !important;
}
#divSubject .CodeMirror,
#divSubject .CodeMirror:not(.CodeMirror-fullscreen),
#divSubject .CodeMirror-merge {
height: 80px !important;
}
#emailBodyCode .CodeMirror,
#emailBodyCode .CodeMirror:not(.CodeMirror-fullscreen),
#emailBodyCode .CodeMirror-merge {
height: 400px !important;
}
Expand Down
4 changes: 3 additions & 1 deletion LEAF_Request_Portal/js/dialogController.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ function dialogController(containerID, contentID, loadIndicatorID, btnSaveID, bt
$('#' + this.btnCancelID).on('click', function() {
t.hide();
});
document.querySelector('#' + this.btnCancelID).removeAttribute('disabled');
if(document.getElementById(this.btnCancelID) !== null) {
document.getElementById(this.btnCancelID).removeAttribute('disabled');
}
$('button.ui-dialog-titlebar-close').on('click', function() {
t.hide();
});
Expand Down
35 changes: 24 additions & 11 deletions LEAF_Request_Portal/sources/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -2661,27 +2661,40 @@ public function getCustomData(array $recordID_list, string|null $indicatorID_lis
}
break;
case 'orgchart_employee': //report builder cells
$item['data'] = '';
$dataDisplay = "";
if (isset($item['metadata'])) {
$orgchartInfo = json_decode($item['metadata'], true);
if(!empty(trim($orgchartInfo['lastName']))) {
$item['data'] = "{$orgchartInfo['firstName']} {$orgchartInfo['lastName']}";
$dataDisplay = "{$orgchartInfo['firstName']} {$orgchartInfo['lastName']}";
$item['dataOrgchart'] = $orgchartInfo;
} else {
$dataDisplay = "Employee #" . $item['data'] ." no longer available";
}
}
$item['data'] = $dataDisplay;
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'] != '') {
Expand Down
4 changes: 4 additions & 0 deletions LEAF_Request_Portal/sources/FormStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ private function importIndicator($indicatorPackage, $categoryID, $parentID = nul
{
$indicatorPackage['categoryID'] = $categoryID;
$indicatorPackage['parentID'] = $parentID;
//an issue on conditions editor release could cause some form packets to have 'null' instead of null.
if($indicatorPackage['conditions'] === 'null') {
$indicatorPackage['conditions'] = null;
}

if (is_array($indicatorPackage['options']))
{
Expand Down
10 changes: 6 additions & 4 deletions LEAF_Request_Portal/templates/print_subindicators.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
<!--{foreach from=$form item=indicator}-->
<!--{if $indicator.conditions != '' && $indicator.conditions !== 'null'}-->
<script type="text/javascript">
formPrintConditions["id<!--{$indicator.indicatorID}-->"] = {
conditions:<!--{$indicator.conditions|strip_tags}-->,
format:'<!--{$indicator.format}-->'
};
if (typeof formPrintConditions !== 'undefined') {
formPrintConditions["id<!--{$indicator.indicatorID}-->"] = {
conditions:<!--{$indicator.conditions|strip_tags}-->,
format:'<!--{$indicator.format}-->'
};
}
</script>
<!--{/if}-->
<!--{if $indicator.format == null || $indicator.format == 'textarea'}-->
Expand Down
8 changes: 7 additions & 1 deletion LEAF_Request_Portal/templates/print_subindicators_ajax.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
<!--{if $indicator.value != ''}-->
<!--{if $indicator.displayedValue != ''}-->
<!--{$indicator.displayedValue|sanitize}-->
<!--{else}-->
Group #:<!--{$indicator.value|escape }--> not found<br>
Recorded on <!--{$indicator.timestamp|date_format}--> by <!--{$indicator.userID|escape}-->
<!--{/if}-->
<!--{else}-->
Unassigned
Expand Down Expand Up @@ -206,7 +209,10 @@
}
}
else {
$('#data_<!--{$indicator.indicatorID}-->_<!--{$indicator.series}-->').html('Position not found.');
$('#data_<!--{$indicator.indicatorID}-->_<!--{$indicator.series}-->').html(
`Position #:<!--{$indicator.value|escape}--> not found<br>
Recorded on <!--{$indicator.timestamp|date_format}--> by <!--{$indicator.userID|escape}-->`
);
}
}
});
Expand Down
69 changes: 40 additions & 29 deletions LEAF_Request_Portal/templates/subindicators.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@
statusEl.innerHTML = `${err?.responseText ? err?.responseText : ''}`;
}
statusEl.classList.add('status_error');
statusEl.style.display = 'block';
},
processData: false,
contentType: false
Expand Down Expand Up @@ -979,39 +980,46 @@
<div id="indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->" style="padding: 0px">
<script>
$(function() {
$.ajax({
type: 'GET',
url: "<!--{$orgchartPath}-->/api/position/<!--{$indicator.value|strip_tags}-->",
dataType: 'json',
success: function(data) {
$('#indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->').html('<b>' + data.title + '</b>'
/* Pay Plan, Series, Pay Grade */ + '<br />' + data[2].data + '-' + data[13].data + '-' + data[14].data);
const displayValue = '<!--{$indicator.displayedValue|strip_tags}-->';
if(displayValue !== '') {
$.ajax({
type: 'GET',
url: "<!--{$orgchartPath}-->/api/position/<!--{$indicator.value|strip_tags}-->",
dataType: 'json',
success: function(data) {
$('#indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->').html('<b>' + data.title + '</b>'
/* Pay Plan, Series, Pay Grade */ + '<br />' + data[2].data + '-' + data[13].data + '-' + data[14].data);
if(data[3].data != '') {
for(i in data[3].data) {
var pdLink = document.createElement('a');
pdLink.innerHTML = data[3].data[i];
pdLink.setAttribute('href', '<!--{$orgchartPath}-->/file.php?categoryID=2&UID=<!--{$indicator.value|strip_tags}-->&indicatorID=3&file=' + encodeURIComponent(data[3].data[i]));
pdLink.setAttribute('class', 'printResponse');
pdLink.setAttribute('target', '_blank');
if(data[3].data != '') {
for(i in data[3].data) {
var pdLink = document.createElement('a');
pdLink.innerHTML = data[3].data[i];
pdLink.setAttribute('href', '<!--{$orgchartPath}-->/file.php?categoryID=2&UID=<!--{$indicator.value|strip_tags}-->&indicatorID=3&file=' + encodeURIComponent(data[3].data[i]));
pdLink.setAttribute('class', 'printResponse');
pdLink.setAttribute('target', '_blank');
$('#indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->').append('<br />Position Description: ');
$('#indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->').append(pdLink);
$('#indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->').append('<br />Position Description: ');
$('#indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->').append(pdLink);
}
}
}
br = document.createElement('br');
$('#indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->').append(br);
br = document.createElement('br');
$('#indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->').append(br);
var ocLink = document.createElement('div');
ocLink.innerHTML = '<img src="dynicons/?img=preferences-system-windows.svg&w=32" alt="" /> View Details in Org. Chart';
ocLink.setAttribute('onclick', "window.open('<!--{$orgchartPath}-->/?a=view_position&positionID=<!--{$indicator.value|strip_tags}-->','Resource_Request','width=870,resizable=yes,scrollbars=yes,menubar=yes');");
ocLink.setAttribute('class', 'buttonNorm');
ocLink.setAttribute('style', 'margin-top: 8px');
$('#indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->').append(ocLink);
},
cache: false
});
var ocLink = document.createElement('div');
ocLink.innerHTML = '<img src="dynicons/?img=preferences-system-windows.svg&w=32" alt="" /> View Details in Org. Chart';
ocLink.setAttribute('onclick', "window.open('<!--{$orgchartPath}-->/?a=view_position&positionID=<!--{$indicator.value|strip_tags}-->','Resource_Request','width=870,resizable=yes,scrollbars=yes,menubar=yes');");
ocLink.setAttribute('class', 'buttonNorm');
ocLink.setAttribute('style', 'margin-top: 8px');
$('#indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->').append(ocLink);
},
cache: false
});
} else {
$('#indata_<!--{$indicator.indicatorID|strip_tags}-->_<!--{$indicator.series|strip_tags}-->').html(
`Position #<!--{$indicator.value|strip_tags}--> no longer available`
);
}
});
</script>
Loading...
Expand Down Expand Up @@ -1153,6 +1161,9 @@
console.log(err);
}
});
} else {
$('#loadingIndicator_<!--{$indicator.indicatorID|strip_tags}-->').html("");
$("#"+ empSel.prefixID+"input").val("#" + "<!--{$indicator.value}-->");
}
}
}
Expand Down Expand Up @@ -1237,7 +1248,7 @@
<!--{$indicator.html}-->
<!--{/if}-->
<!--{include file=$subindicatorsTemplate form=$indicator.child depth=$depth+4 recordID=$recordID}-->
<!--{if $indicator.conditions != ''}-->
<!--{if $indicator.conditions != '' && $indicator.conditions != 'null'}-->
<script type="text/javascript">
formConditions["id<!--{$indicator.indicatorID}-->"] = {
conditions:<!--{$indicator.conditions|strip_tags}-->, //no quotes. send as object
Expand Down
64 changes: 63 additions & 1 deletion app/Leaf/VAMCActiveDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function importADData(string $file): string
$this->users[$id]['loginName'] = $employee['loginName'];
$this->users[$id]['objectGUID'] = null;
$this->users[$id]['mobile'] = $employee['mobile'];
$this->users[$id]['domain'] = $employee['domain'];
$this->users[$id]['domain'] = $this->parseVAdomain($employee['domain']);
$this->users[$id]['source'] = 'ad';
//echo "Grabbing data for $employee['lname'], $employee['fname']\n";
$count++;
Expand Down Expand Up @@ -394,4 +394,66 @@ private function fixIfHex(string $stringToFix): string

return $stringToFix;
}

private function parseVAdomain($adPath) {
$dc = '';
$dcSrc = explode(',', $adPath);
foreach($dcSrc as $adElement) {
if(strpos($adElement, 'DC=') !== false) {
$dc .= substr($adElement, 3) . '.';
}
}
$dc = trim($dc, '.');

switch($dc) {
case 'v01.med.va.gov':
return 'VHA01';
case 'v02.med.va.gov':
return 'VHA02';
case 'v03.med.va.gov':
return 'VHA03';
case 'v04.med.va.gov':
return 'VHA04';
case 'v05.med.va.gov':
return 'VHA05';
case 'v06.med.va.gov':
return 'VHA06';
case 'v07.med.va.gov':
return 'VHA07';
case 'v08.med.va.gov':
return 'VHA08';
case 'v09.med.va.gov':
return 'VHA09';
case 'v10.med.va.gov':
return 'VHA10';
case 'v11.med.va.gov':
return 'VHA11';
case 'v12.med.va.gov':
return 'VHA12';
case 'v13.med.va.gov':
return 'VHA13';
case 'v14.med.va.gov':
return 'VHA14';
case 'v15.med.va.gov':
return 'VHA15';
case 'v16.med.va.gov':
return 'VHA16';
case 'v17.med.va.gov':
return 'VHA17';
case 'v18.med.va.gov':
return 'VHA18';
case 'v19.med.va.gov':
return 'VHA19';
case 'v20.med.va.gov':
return 'VHA20';
case 'v21.med.va.gov':
return 'VHA21';
case 'v22.med.va.gov':
return 'VHA22';
case 'v23.med.va.gov':
return 'VHA23';
default:
return $dc;
}
}
}
2 changes: 1 addition & 1 deletion app/libs/js/vue-dest/form_editor/LEAF_FormEditor.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/libs/js/vue-dest/form_editor/LEAF_FormEditor.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/libs/js/vue-dest/site_designer/LEAF_Designer.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docker/vue-app/src/common/LEAF_Vue_Dialog__Common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ li.is_being_dragged {
ul[id^="base_drop_area"] {
position: relative;
padding: 1px 0; //top and bottom padding needed for base drop area visibility
li {
li[id^="index_listing_"] {
position: relative;
transition: margin 0.4s ease;
}
Expand Down
7 changes: 5 additions & 2 deletions docker/vue-app/src/form_editor/LEAF_FormEditor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ table[class$="SelectorTable"] th {
flex-direction: column;
background-clip: content-box;
}
li {
li[id^="index_listing_"] {
margin: 0.5rem 0;
border-radius: 4px;
border: 1px solid #c1c1c1;
Expand Down Expand Up @@ -612,8 +612,11 @@ table[class$="SelectorTable"] th {
&.preview.form-header > ul {
padding: 0.5em;
}
&.preview.form-header li {
&.preview.form-header li[id^="index_listing_"] {
margin: 0;
border: 0;
box-shadow: none;
transition: none;
}
&.preview {
border: 0;
Expand Down
Loading

0 comments on commit c366db3

Please sign in to comment.