Added ability to unlock Corrective Actions when locked for editing.

This commit is contained in:
Daniel Wathen
2023-03-02 11:54:50 -07:00
parent adad38b849
commit a2b2e04f1f
12 changed files with 382 additions and 265 deletions

View File

@ -160,6 +160,32 @@
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-12">
<div class="control-group">
<div class="controls">
<div class="controls">
<label for="AssignDelegate">Assign Delegate?</label>
<input type="checkbox" name="AssignDelegate" id="AssignDelegate" value="false" onclick="toggleDelegate()" />
<p>*Please assign a delegate if this user will be assigned tasks while Out of Office.</p>
</div>
</div>
</div>
</div>
</div>
<br />
<div class="row hiddenDelegate" id="delegateLabel">
<div class="col-sm-12">
<div class="control-group">
<div class="controls">
<div class="controls">
<label for="CurrentUser">Delegate To:</label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@ -465,6 +491,10 @@
<script>
function toggleDelegate() {
document.getElementById("delegateControl").classList.toggle("hiddenDelegate");
document.getElementById("delegateLabel").classList.toggle("hiddenDelegate");
}
function error_handler(e) {
alert("Error during the operation");
@ -577,10 +607,16 @@
$('#SaveOOOInfo').on('click', function () {
var bfound = false;
//var currentDate = new Date();
var delegate = "";
var isChecked = $("#AssignDelegate").is(":checked");
if (userid == $("#DelegateTo").data("kendoDropDownList").value())
{
if (isChecked === true)
delegate = $("#DelegateTo").data("kendoDropDownList").value();
else
delegate = "0";
if (userid == delegate) {
alert('The OOO person cannot be same as the delegate to person');
return false;
}
@ -594,7 +630,7 @@
var tempCurrentDate = twoDigitMonth + "/" + fullDate.getDate() + "/" + fullDate.getFullYear();
var arrCurrDate = tempCurrentDate.split('/');
var currentDate = new Date(arrCurrDate[2], arrCurrDate[0] - 1, arrCurrDate[1]);
if (!$("#txtStartDate").val() || !$("#txtEndDate").val()) {
alert('Start or the End Date cannot be blank');
@ -615,7 +651,7 @@
return false;
}
if (endDate <= stDate) {
alert("The End Date should be greater than the Start Date ");
@ -630,7 +666,7 @@
url: urlString,
data: {
oooUserID: userid,
delegatedTo: $("#DelegateTo").data("kendoDropDownList").value(),
delegatedTo: delegate,
startDate: $("#txtStartDate").val(),
endDate: $("#txtEndDate").val(),
},