Skip to content

Commit

Permalink
Merge pull request #2058 from department-of-veterans-affairs/remove-r…
Browse files Browse the repository at this point in the history
…edundant-argument

Leaf 3891 - Remove unused empUID argument
  • Loading branch information
Pelentan authored Aug 2, 2023
2 parents c7737d5 + 0981a36 commit 323d6fb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
17 changes: 16 additions & 1 deletion LEAF_Nexus/api/controllers/EmployeeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function post($act)
return print_r($args, true) . print_r($_GET, true);
});


// Deprecated
$this->index['POST']->register('employee/refresh/[text]/[digit]', function ($args) use ($employee, $national_db) {
if (!$national_db) {
$return_value = $employee->refresh($args[0]);
Expand All @@ -84,6 +84,21 @@ public function post($act)
return json_encode($return_value);
});

$this->index['POST']->register('employee/refresh/[text]', function ($args) use ($employee, $national_db) {
if (!$national_db) {
$return_value = $employee->refresh($args[0]);
} else {
$return_value = array(
'status' => array(
'code' => 4,
'message' => 'You can\'t update the national orgchart'
)
);
}

return json_encode($return_value);
});

$this->index['POST']->register('employee/refresh/batch', function ($args) use ($employee, $national_db) {
if (!$national_db) {
$return_value = $employee->refreshBatch();
Expand Down
6 changes: 3 additions & 3 deletions LEAF_Nexus/templates/view_employee.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="toolbar" class="toolbar_right toolbar noprint">
<div id="tools"><h1>Tools</h1>
<!--{if $is_admin == true}-->
<div onclick="refreshEmp('<!--{$summary.employee.userName|escape:"quotes"}-->', '<!--{$empUID}-->');"><img src="dynicons/?img=system-software-update.svg&w=32" style="vertical-align: middle" alt="Refresh Employee" title="Refresh Employee" /> Refresh Employee</div>
<div onclick="refreshEmp('<!--{$summary.employee.userName|escape:"quotes"}-->');"><img src="dynicons/?img=system-software-update.svg&w=32" style="vertical-align: middle" alt="Refresh Employee" title="Refresh Employee" /> Refresh Employee</div>
<br />
<!--{/if}-->
<div onclick="assignBackup();"><img src="dynicons/?img=gnome-system-users.svg&amp;w=32" style="vertical-align: middle" alt="Set Backup" title="Set Backup" /> Assign Backup</div>
Expand Down Expand Up @@ -80,12 +80,12 @@
<!--{include file="site_elements/genericJS_toolbarAlignment.tpl"}-->
function refreshEmp(userName, empUID) {
function refreshEmp(userName) {
var CSRFToken = '<!--{$CSRFToken}-->';
$.ajax({
type: 'POST',
url: "./api/employee/refresh/_" + userName + "/" + empUID,
url: "./api/employee/refresh/_" + userName,
dataType: "json",
data: {CSRFToken: CSRFToken},
success: function(res) {
Expand Down

0 comments on commit 323d6fb

Please sign in to comment.