From e99e8f0ce4070b80985b607398700dfa22bb29ae Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Tue, 14 Nov 2023 10:18:05 -0500 Subject: [PATCH 01/17] LEAF 2569 add status msg for some date filters. minor 508 fixes --- LEAF_Request_Portal/css/style.css | 2 +- LEAF_Request_Portal/js/formSearch.js | 148 ++++++++++-------- .../templates/view_reports.tpl | 4 +- 3 files changed, 82 insertions(+), 72 deletions(-) diff --git a/LEAF_Request_Portal/css/style.css b/LEAF_Request_Portal/css/style.css index fd018fecf..4469b7660 100644 --- a/LEAF_Request_Portal/css/style.css +++ b/LEAF_Request_Portal/css/style.css @@ -1107,7 +1107,7 @@ fieldset.iefix p { } legend { - color: #999999; + color: #707070; padding: 0 0.25em; font-size: 90%; font-weight: bold; diff --git a/LEAF_Request_Portal/js/formSearch.js b/LEAF_Request_Portal/js/formSearch.js index f1bfae5e5..41df496e6 100644 --- a/LEAF_Request_Portal/js/formSearch.js +++ b/LEAF_Request_Portal/js/formSearch.js @@ -27,7 +27,7 @@ var LeafFormSearch = function (containerID) { '
\ search\ Close advanced search\ -
Find items where...
\ + \ +
Find items where...
\
\ - \ - \

\ @@ -646,6 +650,39 @@ var LeafFormSearch = function (containerID) { } } + /* assesses query logic for some term filters and updates display of status message if the query can return unsubmitted requests */ + function checkDateStatus() { + let includesOnAndBefore = false; + let filtersUnsubmitted = false; + + const elSelTerms = Array.from(document.querySelectorAll(`table select[id^="${prefixID}widgetTerm_"]`)); + elSelTerms.forEach(sel => { + if(sel?.value === "dateSubmitted" || sel?.value === "stepID") { + const codID = (sel?.id || '').replace('widgetTerm_', 'widgetCod_'); + const gateID = (sel?.id || '').replace('widgetTerm_', 'widgetGate_'); + const opValue = document.getElementById(codID)?.value || ''; + const gateVal = document.getElementById(gateID)?.innerText || 'AND'; + + if(sel.value === "dateSubmitted") { + if(opValue === '<=') { + includesOnAndBefore = true; + } else { + if (gateVal === 'AND') { + filtersUnsubmitted = true; + } + } + } + if(sel.value === "stepID" && gateVal === 'AND' && opValue === '=') { + filtersUnsubmitted = true; + } + } + }); + let msgEl = document.getElementById('unsubmitted_results_notice'); + if (msgEl !== null) { + msgEl.style.display = includesOnAndBefore && !filtersUnsubmitted ? 'block' : 'none'; + } + } + /** * @memberOf LeafFormSearch */ @@ -722,16 +759,13 @@ var LeafFormSearch = function (containerID) { case "dateInitiated": case "dateSubmitted": $("#" + prefixID + "widgetCondition_" + widgetID).html( - '' + `` ); + $(`#${prefixID}widgetCod_${widgetID}`).on("change", checkDateStatus); $("#" + prefixID + "widgetMatch_" + widgetID).html( '\ - \ - \ - ' + `` ); + $(`#${prefixID}widgetCod_${widgetID}`).on("change", checkDateStatus); url = rootURL === "" ? "./api/workflow/steps" @@ -1413,53 +1444,30 @@ var LeafFormSearch = function (containerID) { if (gate === undefined) { gate = "AND"; } - let widget = - '\ - \ - ' + - gate + - '\ - \ - \ - \ - '; + let widget = ` + + + + + ${gate} + + + + + + + `; $(widget).appendTo("#" + prefixID + "searchTerms"); renderWidget(widgetCounter); firstChild(); @@ -1470,16 +1478,18 @@ var LeafFormSearch = function (containerID) { widgetCounter, function (e) { renderWidget(e.data); + checkDateStatus(e); chosenOptions(); } ); - $("#" + prefixID + "widgetRemove_" + widgetCounter).on( + $("#" + prefixID + "widgetRemoveButton_" + widgetCounter).on( "click", "", widgetCounter, function (e) { $("#" + prefixID + "widget_" + e.data).remove(); $("#" + prefixID + "widgetOp_" + e.data).remove(); + checkDateStatus(); firstChild(); } ); diff --git a/LEAF_Request_Portal/templates/view_reports.tpl b/LEAF_Request_Portal/templates/view_reports.tpl index c041bc1a0..0839e390c 100644 --- a/LEAF_Request_Portal/templates/view_reports.tpl +++ b/LEAF_Request_Portal/templates/view_reports.tpl @@ -14,7 +14,7 @@
Loading...

- +
@@ -1109,7 +1109,7 @@ $(function() { $('#' + leafSearch.getPrefixID() + 'advancedOptions').css('border', '0'); $('#' + leafSearch.getPrefixID() + 'advancedOptionsClose').css('visibility', 'hidden'); $('#' + leafSearch.getPrefixID() + 'advancedOptions>legend').css('display', 'none'); - $('#' + leafSearch.getPrefixID() + 'advancedSearchApply').html('Next Step next step'); + $('#' + leafSearch.getPrefixID() + 'advancedSearchApply').html('Next Step '); $('#' + leafSearch.getPrefixID() + 'advancedSearchApply').off(); From f3b320be3665fef7028ddb5a8bc581b80c9e52de Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Tue, 14 Nov 2023 12:14:34 -0500 Subject: [PATCH 02/17] LEAF 2569 update verbiage and mv conditional status message --- LEAF_Request_Portal/js/formSearch.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/LEAF_Request_Portal/js/formSearch.js b/LEAF_Request_Portal/js/formSearch.js index 41df496e6..e18cae1eb 100644 --- a/LEAF_Request_Portal/js/formSearch.js +++ b/LEAF_Request_Portal/js/formSearch.js @@ -51,10 +51,6 @@ var LeafFormSearch = function (containerID) { 'advancedOptionsClose" style="float: right; margin-top: -20px; margin-right: -14px; display: none; cursor: pointer; background-image:url(' + rootURL + 'dynicons/?img=process-stop.svg&w=16); height: 16px;width: 16px; border: none; background-color: transparent; text-indent: -9999em" alt="Close advanced search">Close advanced search\ - \
Find items where...
\ Or...\

\ + \ \ From 0bd832e501ecd4c1482d33c58d62d3229c91bae7 Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Tue, 14 Nov 2023 14:38:00 -0500 Subject: [PATCH 03/17] LEAF 2569 rm old arg --- LEAF_Request_Portal/js/formSearch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LEAF_Request_Portal/js/formSearch.js b/LEAF_Request_Portal/js/formSearch.js index e18cae1eb..c4c800be8 100644 --- a/LEAF_Request_Portal/js/formSearch.js +++ b/LEAF_Request_Portal/js/formSearch.js @@ -1477,7 +1477,7 @@ var LeafFormSearch = function (containerID) { widgetCounter, function (e) { renderWidget(e.data); - checkDateStatus(e); + checkDateStatus(); chosenOptions(); } ); From aa5ea4510be073717758e495e27b54016a476023 Mon Sep 17 00:00:00 2001 From: raphaelfretter Date: Tue, 21 Nov 2023 10:45:47 -0700 Subject: [PATCH 04/17] fix --- LEAF_Request_Portal/sources/FormWorkflow.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/LEAF_Request_Portal/sources/FormWorkflow.php b/LEAF_Request_Portal/sources/FormWorkflow.php index 3f0b70831..36ca81bee 100644 --- a/LEAF_Request_Portal/sources/FormWorkflow.php +++ b/LEAF_Request_Portal/sources/FormWorkflow.php @@ -1365,12 +1365,15 @@ public function handleEvents(int $workflowID, int $stepID, string $actionType, ? if (preg_match('/CustomEvent_/', $event['eventID'])) { $customEvent = $event['eventID']; } + $fields = $this->getFields(); + switch ($event['eventID']) { case 'std_email_notify_next_approver': // notify next approver $email = new Email(); $email->addSmartyVariables(array( - "comment" => $comment + "comment" => $comment, + "field" => $fields )); $dir = $this->getDirectory(); @@ -1414,7 +1417,8 @@ public function handleEvents(int $workflowID, int $stepID, string $actionType, ? "service" => $requestRecords[0]['service'], "lastStatus" => $requestRecords[0]['lastStatus'], "comment" => $comment, - "siteRoot" => $this->siteRoot + "siteRoot" => $this->siteRoot, + "field" => $fields )); $email->setTemplateByID(Email::NOTIFY_COMPLETE); @@ -1470,7 +1474,6 @@ public function handleEvents(int $workflowID, int $stepID, string $actionType, ? $email = new Email(); $title = strlen($requestRecords[0]['title']) > 45 ? substr($requestRecords[0]['title'], 0, 42) . '...' : $requestRecords[0]['title']; - $fields = $this->getFields(); $email->addSmartyVariables(array( "truncatedTitle" => $title, @@ -1540,7 +1543,9 @@ public function handleEvents(int $workflowID, int $stepID, string $actionType, ? 'workflowID' => $workflowID, 'stepID' => $stepID, 'actionType' => $actionType, - 'comment' => $comment, ); + 'comment' => $comment, + "field" => $fields + ); $customClassName = "Portal\\CustomEvent_{$event['eventID']}"; From 13c25dbb79425a027c7817f6e963454dc762ea41 Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Mon, 27 Nov 2023 11:59:52 -0500 Subject: [PATCH 05/17] LEAF 2569 match rc font color --- LEAF_Request_Portal/css/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LEAF_Request_Portal/css/style.css b/LEAF_Request_Portal/css/style.css index 4469b7660..7ee1c5816 100644 --- a/LEAF_Request_Portal/css/style.css +++ b/LEAF_Request_Portal/css/style.css @@ -1107,7 +1107,7 @@ fieldset.iefix p { } legend { - color: #707070; + color: #747474; padding: 0 0.25em; font-size: 90%; font-weight: bold; From ff75803510d8da84e64613f49e137d450bce9922 Mon Sep 17 00:00:00 2001 From: Juan Rodriguez <74881510+jrodcode@users.noreply.github.com> Date: Tue, 28 Nov 2023 08:39:55 -0800 Subject: [PATCH 06/17] LEAF-4165 - User Access Group History ### Summary: This is a Help Desk ticket issue that was brought up by a user who was not able to see the deleted timestamp in the history modal. ### Potential Impact: The user will be able to see the deleted user from the group and pruned from the group as well. ### Testing: -Removed: 1. Admin > User Access > Select User Group 2. Add Employee > Select User > Click "Save" 1. Click "Delete" > Click "View History" You should be able to see "user" removed user: "removed user" - Prune: 1. Admin > User Access > Select User Group 2. Click "Show Inactive Users" > 3. Click "Prune" > Click "View History" You should be able to see "user" pruned user: "removed user" --- LEAF_Request_Portal/sources/Group.php | 4 ++-- app/Leaf/Logger/Formatters/DataActions.php | 1 + app/Leaf/Logger/Formatters/PortalGroupFormatter.php | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/LEAF_Request_Portal/sources/Group.php b/LEAF_Request_Portal/sources/Group.php index f509f21ac..9ca47f603 100644 --- a/LEAF_Request_Portal/sources/Group.php +++ b/LEAF_Request_Portal/sources/Group.php @@ -392,7 +392,7 @@ public function deactivateMember($member, $groupID): void $vars = array(':userID' => $member, ':groupID' => $groupID, ); - $this->dataActionLogger->logAction(DataActions::MODIFY, LoggableTypes::EMPLOYEE, [ + $this->dataActionLogger->logAction(DataActions::DELETE, LoggableTypes::EMPLOYEE, [ new LogItem("users", "userID", $member, $this->getEmployeeDisplay($member)), new LogItem("users", "groupID", $groupID, $this->getGroupName($groupID)) ]); @@ -422,7 +422,7 @@ public function deactivateMember($member, $groupID): void public function removeMember($member, $groupID): void { if (is_numeric($groupID) && $member != '') { - $this->dataActionLogger->logAction(DataActions::DELETE, LoggableTypes::EMPLOYEE, [ + $this->dataActionLogger->logAction(DataActions::PRUNE, LoggableTypes::EMPLOYEE, [ new LogItem("users", "userID", $member, $this->getEmployeeDisplay($member)), new LogItem("users", "groupID", $groupID, $this->getGroupName($groupID)) ]); diff --git a/app/Leaf/Logger/Formatters/DataActions.php b/app/Leaf/Logger/Formatters/DataActions.php index f3e6a50e9..c69d3b459 100644 --- a/app/Leaf/Logger/Formatters/DataActions.php +++ b/app/Leaf/Logger/Formatters/DataActions.php @@ -11,4 +11,5 @@ class DataActions const RESTORE = 'restore'; const CREATE = 'create'; const MERGE = 'merge'; + const PRUNE = 'prune'; } diff --git a/app/Leaf/Logger/Formatters/PortalGroupFormatter.php b/app/Leaf/Logger/Formatters/PortalGroupFormatter.php index 1f1c98c19..aa3c94204 100644 --- a/app/Leaf/Logger/Formatters/PortalGroupFormatter.php +++ b/app/Leaf/Logger/Formatters/PortalGroupFormatter.php @@ -24,6 +24,10 @@ class PortalGroupFormatter{ DataActions::DELETE.'-'.LoggableTypes::EMPLOYEE => [ "message" => "removed user: %s", "variables" => "userID" + ], + DataActions::PRUNE.'-'.LoggableTypes::EMPLOYEE => [ + "message" => "pruned user: %s", + "variables" => "userID" ] ]; From 63e05d6bb44087deb36569f2766f4834293a4f3a Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Tue, 28 Nov 2023 11:52:29 -0500 Subject: [PATCH 07/17] LEAF 4166 prevent checkmark if initial value is empty --- LEAF_Request_Portal/templates/print_subindicators_ajax.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LEAF_Request_Portal/templates/print_subindicators_ajax.tpl b/LEAF_Request_Portal/templates/print_subindicators_ajax.tpl index ccb9a6c8f..09df9ddbf 100644 --- a/LEAF_Request_Portal/templates/print_subindicators_ajax.tpl +++ b/LEAF_Request_Portal/templates/print_subindicators_ajax.tpl @@ -119,7 +119,7 @@
    - +
  • checked
  • From d468d29ca332a2a19bb4eb53389f74739cba7983 Mon Sep 17 00:00:00 2001 From: mgaoVA <16783916+mgaoVA@users.noreply.github.com> Date: Tue, 28 Nov 2023 13:07:46 -0500 Subject: [PATCH 08/17] improve customizability --- LEAF_Nexus/js/employeeSelector.js | 11 +++++++++++ LEAF_Nexus/js/nationalEmployeeSelector.js | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/LEAF_Nexus/js/employeeSelector.js b/LEAF_Nexus/js/employeeSelector.js index 69cc14d38..166d344b2 100644 --- a/LEAF_Nexus/js/employeeSelector.js +++ b/LEAF_Nexus/js/employeeSelector.js @@ -19,6 +19,7 @@ function employeeSelector(containerID) { this.intervalID = null; this.selectHandler = null; this.resultHandler = null; + this.selectHandlers = []; this.selectLink = null; this.selectionData = new Object(); this.optionNoLimit = 0; @@ -108,6 +109,7 @@ employeeSelector.prototype.select = function (id) { if (this.selectHandler != null) { this.selectHandler(); } + this.selectHandlers.forEach(selectHandler => selectHandler()); }; employeeSelector.prototype.setSelectHandler = function (func) { @@ -118,6 +120,15 @@ employeeSelector.prototype.setResultHandler = function (func) { this.resultHandler = func; }; +nationalEmployeeSelector.prototype.addSelectHandler = function (func) { + if(typeof func == 'function') { + this.selectHandlers.push(func); + } + else { + console.error('argument supplied to addSelectHandler must be a function'); + } +}; + employeeSelector.prototype.setSelectLink = function (link) { this.selectLink = link; }; diff --git a/LEAF_Nexus/js/nationalEmployeeSelector.js b/LEAF_Nexus/js/nationalEmployeeSelector.js index 0b757caed..358cfaab9 100644 --- a/LEAF_Nexus/js/nationalEmployeeSelector.js +++ b/LEAF_Nexus/js/nationalEmployeeSelector.js @@ -19,6 +19,7 @@ function nationalEmployeeSelector(containerID) { this.intervalID = null; this.selectHandler = null; this.resultHandler = null; + this.selectHandlers = []; this.selectLink = null; this.selectionData = new Object(); this.optionNoLimit = 0; @@ -161,6 +162,7 @@ nationalEmployeeSelector.prototype.select = function (id) { if (this.selectHandler != null) { this.selectHandler(); } + this.selectHandlers.forEach(selectHandler => selectHandler()); }; nationalEmployeeSelector.prototype.setSelectHandler = function (func) { @@ -171,6 +173,15 @@ nationalEmployeeSelector.prototype.setResultHandler = function (func) { this.resultHandler = func; }; +nationalEmployeeSelector.prototype.addSelectHandler = function (func) { + if(typeof func == 'function') { + this.selectHandlers.push(func); + } + else { + console.error('argument supplied to addSelectHandler must be a function'); + } +}; + nationalEmployeeSelector.prototype.setSelectLink = function (link) { this.selectLink = link; }; From a6004d5457b2ef1c5747b007e4fb9035d9ee0ea2 Mon Sep 17 00:00:00 2001 From: mgaoVA <16783916+mgaoVA@users.noreply.github.com> Date: Tue, 28 Nov 2023 17:25:18 -0500 Subject: [PATCH 09/17] avoid ambiguous query when used in combination with a data query --- LEAF_Request_Portal/sources/Form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LEAF_Request_Portal/sources/Form.php b/LEAF_Request_Portal/sources/Form.php index b592ae7b8..7e88386a1 100644 --- a/LEAF_Request_Portal/sources/Form.php +++ b/LEAF_Request_Portal/sources/Form.php @@ -3001,7 +3001,7 @@ public function query(string $inQuery): mixed $vars[':' . $q['id'] . $count] = $q['match']; switch ($q['id']) { case 'recordID': - $conditions .= "{$gate}recordID {$operator} :recordID{$count}"; + $conditions .= "{$gate}records.recordID {$operator} :recordID{$count}"; break; case 'recordIDs': @@ -3017,7 +3017,7 @@ public function query(string $inQuery): mixed } $validRecordIDs = trim($validRecordIDs, ','); - $conditions .= "{$gate}recordID IN ({$validRecordIDs})"; + $conditions .= "{$gate}records.recordID IN ({$validRecordIDs})"; unset($vars[":recordIDs{$count}"]); From 7428ff54182e038f4b0239c6fdb8c95bc193d1be Mon Sep 17 00:00:00 2001 From: mgaoVA <16783916+mgaoVA@users.noreply.github.com> Date: Tue, 28 Nov 2023 18:03:55 -0500 Subject: [PATCH 10/17] prevent invalid query --- LEAF_Request_Portal/sources/FormWorkflow.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/LEAF_Request_Portal/sources/FormWorkflow.php b/LEAF_Request_Portal/sources/FormWorkflow.php index 3f0b70831..6a148b9b8 100644 --- a/LEAF_Request_Portal/sources/FormWorkflow.php +++ b/LEAF_Request_Portal/sources/FormWorkflow.php @@ -281,10 +281,12 @@ private function includeGroupDesignatedData(array $srcRecords, array $gdRecordsM }, $groupIDs); $groupIDs = implode(',', $groupIDs); - $res = $this->db->prepared_query("SELECT groupID, name FROM `groups` - WHERE groupID IN ({$groupIDs})", []); - foreach($res as $group) { - $groupNames[$group['groupID']] = $group['name']; + if($groupIDs != "") { + $res = $this->db->prepared_query("SELECT groupID, name FROM `groups` + WHERE groupID IN ({$groupIDs})", []); + foreach($res as $group) { + $groupNames[$group['groupID']] = $group['name']; + } } } From b2b329ea1ede3f11669cdc13f3bd66a5f3a58069 Mon Sep 17 00:00:00 2001 From: Juan Rodriguez <74881510+jrodcode@users.noreply.github.com> Date: Wed, 29 Nov 2023 09:57:06 -0800 Subject: [PATCH 11/17] LEAF-4107-Remove-Console-Logs-From-Editors ### Summary: Cleaned code for template editors to prevent console logs from displaying in dev tools during certain processes. ### Changes Made: - Identified and addressed the root cause of console logs appearing in dev tools. - Implemented modifications to ensure a seamless user experience during actions such as saving and deleting. Potential Impact: Users will no longer encounter console logs during specified processes, enhancing the overall user interface. ### Testing: 1. Navigate to the template editor. 2. Open the browser's developer tools (F12). 3. Select the console tab. 4. Perform actions like saving and deleting. Confirm that no console logs are visible during these processes. --- LEAF_Request_Portal/admin/templates/mod_templates.tpl | 5 ----- .../admin/templates/mod_templates_email.tpl | 8 -------- .../admin/templates/mod_templates_reports.tpl | 6 ------ 3 files changed, 19 deletions(-) diff --git a/LEAF_Request_Portal/admin/templates/mod_templates.tpl b/LEAF_Request_Portal/admin/templates/mod_templates.tpl index 2733de492..f0b59c573 100644 --- a/LEAF_Request_Portal/admin/templates/mod_templates.tpl +++ b/LEAF_Request_Portal/admin/templates/mod_templates.tpl @@ -280,7 +280,6 @@ }, url: '../api/templateFileHistory/_' + currentFile, success: function(res) { - console.log("File history has been saved."); getFileHistory(currentFile); } }) @@ -471,7 +470,6 @@ dataType: 'json', success: function(res) { if (res.length === 0) { - console.log('There are no files in the directory'); var contentMessage = '

    There are no history files.

    '; $('.file-history-res').html(contentMessage); return; @@ -482,7 +480,6 @@ }); if (fileNames.indexOf(template) === -1) { - console.log('Template file not found in directory'); return; } @@ -859,8 +856,6 @@ if (windowWidth < 1024) { $('.leaf-right-nav').css('right', '-100%'); - } else { - console.log('Please check the width of the window'); } $.ajax({ type: 'GET', diff --git a/LEAF_Request_Portal/admin/templates/mod_templates_email.tpl b/LEAF_Request_Portal/admin/templates/mod_templates_email.tpl index f7c622803..55bcd0e85 100644 --- a/LEAF_Request_Portal/admin/templates/mod_templates_email.tpl +++ b/LEAF_Request_Portal/admin/templates/mod_templates_email.tpl @@ -313,7 +313,6 @@ console.log('Error occurred during the save operation:', errorThrown); } }); - console.log('Your Template has been saved.'); } function showDialog(message, color) { @@ -382,7 +381,6 @@ currentSubjectContent = subject; currentEmailToContent = emailToData; currentEmailCcContent = emailCcData; - console.log("File history has been saved."); getFileHistory(currentFile); } }); @@ -418,7 +416,6 @@ dataType: 'json', success: function(res) { if (res.length === 0) { - console.log('There are no files in the directory'); var contentMessage = '

    There are no history files.

    '; $('.file-history-res').html(contentMessage); return; @@ -429,7 +426,6 @@ }); if (!fileNames.includes(template)) { - console.log('Template file not found in directory'); return; } @@ -630,7 +626,6 @@ dataType: 'json', cache: false, success: function(res) { - console.log(res); loadContent(currentName, currentFile, currentSubjectFile, currentEmailToFile, currentEmailCcFile); exitExpandScreen(); @@ -664,7 +659,6 @@ } else if (templateFile !== null) { loadContent(templateName, templateFile, templateSubjectFile, templateEmailToFile, templateEmailCcFile); } else { - console.log('else'); loadContent(undefined, 'LEAF_main_email_template.tpl', undefined, undefined, undefined); } } @@ -1170,8 +1164,6 @@ if (windowWidth < 1024) { $('.leaf-right-nav').css('right', '-100%'); - } else { - console.log('Please check the width of the window'); } $.ajax({ type: 'GET', diff --git a/LEAF_Request_Portal/admin/templates/mod_templates_reports.tpl b/LEAF_Request_Portal/admin/templates/mod_templates_reports.tpl index 15eca06fa..40033e1a6 100644 --- a/LEAF_Request_Portal/admin/templates/mod_templates_reports.tpl +++ b/LEAF_Request_Portal/admin/templates/mod_templates_reports.tpl @@ -218,7 +218,6 @@ }, url: '../api/applet/fileHistory/_' + currentFile, success: function(res) { - console.log("File history has been saved."); getFileHistory(currentFile); } }); @@ -404,7 +403,6 @@ url: '../api/applet/deleteHistoryFileReport/_' + templateFile + '?' + $.param({'CSRFToken': ''}), success: function() { - console.log(templateFile + ', was deleted'); location.reload(); } }); @@ -438,7 +436,6 @@ dataType: 'json', success: function(res) { if (res.length === 0) { - console.log('There are no files in the directory'); var contentMessage = '

    There are no history files.

    '; $('.file-history-res').html(contentMessage); return; @@ -449,7 +446,6 @@ }); if (fileNames.indexOf(template) === -1) { - console.log('Template file not found in directory'); return; } @@ -854,8 +850,6 @@ if (windowWidth < 1024) { $('.leaf-right-nav').css('right', '-100%'); - } else { - console.log('Please check the width of the window'); } $.ajax({ type: 'GET', From 9f55caa0e2d6bb30005492b7831a9db15121f8c6 Mon Sep 17 00:00:00 2001 From: mgaoVA <16783916+mgaoVA@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:02:32 -0500 Subject: [PATCH 12/17] fix wrong name --- LEAF_Nexus/js/employeeSelector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LEAF_Nexus/js/employeeSelector.js b/LEAF_Nexus/js/employeeSelector.js index 166d344b2..936c7fc57 100644 --- a/LEAF_Nexus/js/employeeSelector.js +++ b/LEAF_Nexus/js/employeeSelector.js @@ -120,7 +120,7 @@ employeeSelector.prototype.setResultHandler = function (func) { this.resultHandler = func; }; -nationalEmployeeSelector.prototype.addSelectHandler = function (func) { +employeeSelector.prototype.addSelectHandler = function (func) { if(typeof func == 'function') { this.selectHandlers.push(func); } From 15d618a049fdaa4586a8ecfce5d841a3359da8fa Mon Sep 17 00:00:00 2001 From: Juan Rodriguez <74881510+jrodcode@users.noreply.github.com> Date: Wed, 29 Nov 2023 12:12:55 -0800 Subject: [PATCH 13/17] LEAF-4107-Update --- LEAF_Request_Portal/admin/templates/mod_templates_reports.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/LEAF_Request_Portal/admin/templates/mod_templates_reports.tpl b/LEAF_Request_Portal/admin/templates/mod_templates_reports.tpl index 40033e1a6..be34d0d94 100644 --- a/LEAF_Request_Portal/admin/templates/mod_templates_reports.tpl +++ b/LEAF_Request_Portal/admin/templates/mod_templates_reports.tpl @@ -446,6 +446,7 @@ }); if (fileNames.indexOf(template) === -1) { + alert('Template file not found in directory'); return; } From e4451507426b636dfe96e4a7fc2b5b4561d30922 Mon Sep 17 00:00:00 2001 From: mgaoVA <16783916+mgaoVA@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:04:08 -0500 Subject: [PATCH 14/17] reset limit counter on subsequent runs --- LEAF_Request_Portal/js/formQuery.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/LEAF_Request_Portal/js/formQuery.js b/LEAF_Request_Portal/js/formQuery.js index 13b752b12..9994c40d4 100644 --- a/LEAF_Request_Portal/js/formQuery.js +++ b/LEAF_Request_Portal/js/formQuery.js @@ -11,6 +11,8 @@ var LeafFormQuery = function () { //NOTE: keeping this a var in case custom code let results = {}; let batchSize = 500; let abortSignal; + let firstRun = true; + let origLimit, origLimitOffset; clearTerms(); @@ -280,6 +282,15 @@ var LeafFormQuery = function () { //NOTE: keeping this a var in case custom code * @memberOf LeafFormQuery */ function execute() { + if(firstRun) { + firstRun = false; + origLimit = query.limit; + origLimitOffset = query.limitOffset; + } else { + query.limit = origLimit; + query.limitOffset = origLimitOffset; + } + if (query.getData != undefined && query.getData.length == 0) { delete query.getData; } From f2df3971a56f982ecb5a530eb2acac8c9131f089 Mon Sep 17 00:00:00 2001 From: mgaoVA <16783916+mgaoVA@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:15:40 -0500 Subject: [PATCH 15/17] track state --- LEAF_Request_Portal/js/formQuery.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LEAF_Request_Portal/js/formQuery.js b/LEAF_Request_Portal/js/formQuery.js index 9994c40d4..e3643b986 100644 --- a/LEAF_Request_Portal/js/formQuery.js +++ b/LEAF_Request_Portal/js/formQuery.js @@ -11,7 +11,7 @@ var LeafFormQuery = function () { //NOTE: keeping this a var in case custom code let results = {}; let batchSize = 500; let abortSignal; - let firstRun = true; + let firstRun = true; // keep track of query limit state, to align with user intent let origLimit, origLimitOffset; clearTerms(); @@ -93,6 +93,7 @@ var LeafFormQuery = function () { //NOTE: keeping this a var in case custom code * @memberOf LeafFormQuery */ function setLimit(offset = 50, limit = 0) { + firstRun = true; if (limit === 0) { query.limit = offset; } else { From 20524c1f695e84e4db6b186c846e94ef6cb56162 Mon Sep 17 00:00:00 2001 From: Jamie P Holcomb Date: Fri, 8 Dec 2023 09:34:37 -0500 Subject: [PATCH 16/17] hotfix sub email template --- LEAF_Request_Portal/utils/LEAF_exportStandardConfig.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LEAF_Request_Portal/utils/LEAF_exportStandardConfig.php b/LEAF_Request_Portal/utils/LEAF_exportStandardConfig.php index ab74d31ab..9e2a9d0a5 100644 --- a/LEAF_Request_Portal/utils/LEAF_exportStandardConfig.php +++ b/LEAF_Request_Portal/utils/LEAF_exportStandardConfig.php @@ -28,12 +28,14 @@ function exportTable($db, $tempFolder, $table) { case 'category_staples': case 'dependencies': case 'indicators': + case 'events': case 'route_events': case 'workflows': case 'workflow_steps': case 'step_dependencies': case 'workflow_routes': case 'step_modules': + case 'email_templates': break; default: exit(); @@ -48,9 +50,11 @@ function exportTable($db, $tempFolder, $table) { exportTable($db, $tempFolder, 'category_staples'); exportTable($db, $tempFolder, 'dependencies'); exportTable($db, $tempFolder, 'indicators'); +exportTable($db, $tempFolder, 'events'); exportTable($db, $tempFolder, 'route_events'); exportTable($db, $tempFolder, 'workflows'); exportTable($db, $tempFolder, 'workflow_steps'); exportTable($db, $tempFolder, 'step_dependencies'); exportTable($db, $tempFolder, 'workflow_routes'); exportTable($db, $tempFolder, 'step_modules'); +exportTable($db, $tempFolder, 'email_templates'); From a75d04fbddb2dfc54987c83776866f23479b5961 Mon Sep 17 00:00:00 2001 From: Jamie P Holcomb Date: Fri, 8 Dec 2023 11:33:16 -0500 Subject: [PATCH 17/17] modification made --- LEAF_Request_Portal/utils/LEAF_importStandardConfig.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/LEAF_Request_Portal/utils/LEAF_importStandardConfig.php b/LEAF_Request_Portal/utils/LEAF_importStandardConfig.php index 43479e03f..6941ce945 100644 --- a/LEAF_Request_Portal/utils/LEAF_importStandardConfig.php +++ b/LEAF_Request_Portal/utils/LEAF_importStandardConfig.php @@ -4,6 +4,7 @@ require_once getenv('APP_LIBS_PATH') . '/loaders/Leaf_autoloader.php'; $debug = false; +$doc_root = $_SERVER['DOCUMENT_ROOT']; // For Jira Ticket:LEAF-2471/remove-all-http-redirects-from-code //$protocol = isset($_SERVER['HTTPS']) ? 'https://' : 'http://'; @@ -11,9 +12,9 @@ $siteRootURL = $protocol . HTTP_HOST; $relativePath = trim(str_replace($siteRootURL, '', LEAF_SETTINGS['national_linkedPrimary'])); -$tempFolder = $_SERVER['DOCUMENT_ROOT'] . $relativePath . 'files/temp/'; -$copy_custom_templates = $_SERVER['DOCUMENT_ROOT'] . $relativePath . 'templates/email/custom_override/'; -$paste_custom_templates = getenv('APP_LIB_PATH') . '../' . PORTAL_PATH . '/templates/email/custom_override/'; +$tempFolder = $doc_root . $relativePath . 'files/temp/'; +$copy_custom_templates = $doc_root . $relativePath . 'templates/email/custom_override/'; +$paste_custom_templates = $doc_root . PORTAL_PATH . '/templates/email/custom_override/'; if(LEAF_SETTINGS['siteType'] != 'national_subordinate') { echo "ERROR: This is not a national subordinate site.";