Added ability to unlock Corrective Actions when locked for editing.
This commit is contained in:
parent
adad38b849
commit
a2b2e04f1f
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -321,6 +321,25 @@ namespace Fab2ApprovalSystem.Controllers
|
|||||||
|
|
||||||
return View(ca);
|
return View(ca);
|
||||||
|
|
||||||
|
}
|
||||||
|
public void ReleaseLockOnDocumentAdmin(int issueID)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
caDMO.ReleaseLockOnDocument(-1, issueID);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Functions.WriteEvent(@User.Identity.Name + "\r\n ReleaseLockOnDocument CA\r\n" + issueID.ToString() + "\r\n" + e.Message, System.Diagnostics.EventLogEntryType.Error);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
caDMO.ReleaseLockOnDocument(-1, issueID);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -884,6 +884,7 @@ namespace Fab2ApprovalSystem.DMO
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<IssuesViewModel> GetECNList()
|
public IEnumerable<IssuesViewModel> GetECNList()
|
||||||
{
|
{
|
||||||
var parameters = new DynamicParameters();
|
var parameters = new DynamicParameters();
|
||||||
|
@ -213,6 +213,7 @@ namespace Fab2ApprovalSystem.Models
|
|||||||
public DateTime? ApprovedDate { get; set; }
|
public DateTime? ApprovedDate { get; set; }
|
||||||
public bool RecordLockIndicator { get; set; }
|
public bool RecordLockIndicator { get; set; }
|
||||||
public int RecordLockedBy { get; set; }
|
public int RecordLockedBy { get; set; }
|
||||||
|
public string RecordLockByName { get; set; }
|
||||||
public bool RecordLocked { get; set; }
|
public bool RecordLocked { get; set; }
|
||||||
public DateTime RecordLockedDate { get; set; }
|
public DateTime RecordLockedDate { get; set; }
|
||||||
public DateTime LastUpdateDate { get; set; }
|
public DateTime LastUpdateDate { get; set; }
|
||||||
|
@ -160,6 +160,32 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<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="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
@ -465,6 +491,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
function toggleDelegate() {
|
||||||
|
document.getElementById("delegateControl").classList.toggle("hiddenDelegate");
|
||||||
|
document.getElementById("delegateLabel").classList.toggle("hiddenDelegate");
|
||||||
|
}
|
||||||
|
|
||||||
function error_handler(e) {
|
function error_handler(e) {
|
||||||
alert("Error during the operation");
|
alert("Error during the operation");
|
||||||
@ -577,10 +607,16 @@
|
|||||||
$('#SaveOOOInfo').on('click', function () {
|
$('#SaveOOOInfo').on('click', function () {
|
||||||
var bfound = false;
|
var bfound = false;
|
||||||
//var currentDate = new Date();
|
//var currentDate = new Date();
|
||||||
|
var delegate = "";
|
||||||
|
var isChecked = $("#AssignDelegate").is(":checked");
|
||||||
|
|
||||||
|
if (isChecked === true)
|
||||||
|
delegate = $("#DelegateTo").data("kendoDropDownList").value();
|
||||||
|
|
||||||
if (userid == $("#DelegateTo").data("kendoDropDownList").value())
|
else
|
||||||
{
|
delegate = "0";
|
||||||
|
|
||||||
|
if (userid == delegate) {
|
||||||
alert('The OOO person cannot be same as the delegate to person');
|
alert('The OOO person cannot be same as the delegate to person');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -630,7 +666,7 @@
|
|||||||
url: urlString,
|
url: urlString,
|
||||||
data: {
|
data: {
|
||||||
oooUserID: userid,
|
oooUserID: userid,
|
||||||
delegatedTo: $("#DelegateTo").data("kendoDropDownList").value(),
|
delegatedTo: delegate,
|
||||||
startDate: $("#txtStartDate").val(),
|
startDate: $("#txtStartDate").val(),
|
||||||
endDate: $("#txtEndDate").val(),
|
endDate: $("#txtEndDate").val(),
|
||||||
},
|
},
|
||||||
|
@ -44,18 +44,66 @@
|
|||||||
<div class="panel panel-default center-block" data-spy="affix">
|
<div class="panel panel-default center-block" data-spy="affix">
|
||||||
<input type="button" value="Back to CA List" class="btn btn-primary btn-xs" id="CAList" />
|
<input type="button" value="Back to CA List" class="btn btn-primary btn-xs" id="CAList" />
|
||||||
<input type="button" value="Section Approval Log" class="btn btn-primary btn-xs" id="ShowSectionApprovalLog" />
|
<input type="button" value="Section Approval Log" class="btn btn-primary btn-xs" id="ShowSectionApprovalLog" />
|
||||||
|
@if (Session[GlobalVars.IS_ADMIN] != null)
|
||||||
|
{
|
||||||
|
<input type="button" value="Unlock Document" class="btn btn-primary btn-xs" id="UnlockDocumentBtn" onclick="UnlockDocument()" />
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel panel-default center-block" style="font-size: 10px">
|
<div class="panel panel-default" style="font-size: 10px">
|
||||||
<div class="panel-body bg-warning">
|
<div class="panel-body bg-warning">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12 text-center">
|
<div class="col-sm-4">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4 text-center">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
<font style="color: crimson; font-size:24px;font-weight: bolder">
|
<font style="color: crimson; font-size:24px;font-weight: bolder">
|
||||||
Corrective Action
|
Corrective Action
|
||||||
</font>
|
</font>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-sm-4 text-right">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<font style="color:crimson">
|
||||||
|
@if (Model.RecordLockByName == null)
|
||||||
|
{
|
||||||
|
<h4>
|
||||||
|
<font style="color:red">
|
||||||
|
Mode: [Readonly]
|
||||||
|
</font>
|
||||||
|
</h4>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<h4>
|
||||||
|
<font style="color:red">
|
||||||
|
Mode: [Readonly] - Locked for Editing by <font style="color: green; font-weight:bold; font-style:italic">@Model.RecordLockByName</font>
|
||||||
|
</font>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
}
|
||||||
|
</font>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel panel-default" style="font-size: 10px">
|
<div class="panel panel-default" style="font-size: 10px">
|
||||||
<div class="panel-body bg-danger">
|
<div class="panel-body bg-danger">
|
||||||
@ -1559,7 +1607,6 @@
|
|||||||
)
|
)
|
||||||
.Resizable(resize => resize.Columns(true))
|
.Resizable(resize => resize.Columns(true))
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1681,7 +1728,25 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function UnlockDocument() {
|
||||||
|
$.ajax({
|
||||||
|
url: "/CorrectiveAction/ReleaseLockOnDocumentAdmin",
|
||||||
|
type: "GET",
|
||||||
|
datatype: "json",
|
||||||
|
data: {
|
||||||
|
issueID: ("@Model.CANo")
|
||||||
|
},
|
||||||
|
success: function () {
|
||||||
|
alert('Document Unlocked!');
|
||||||
|
var url = '@Url.Action("ReadOnlyCA", "CorrectiveAction", new { caNo = "__id__" })';
|
||||||
|
url = url.replace('amp;', '');
|
||||||
|
window.location.href = url.replace('__id__', @Model.CANo);
|
||||||
|
},
|
||||||
|
error: function (result) {
|
||||||
|
alert("ReleaseLockOnDocument - Failed " + result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@
|
|||||||
.Value(ViewBag.Nothing)
|
.Value(ViewBag.Nothing)
|
||||||
)
|
)
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6" style="left:40%;color:red;">
|
<div class="col-sm-6 col-sm-offset-4" style="color:red;">
|
||||||
Add minimum of Quality, Si Production, and Dept Specfic
|
Add minimum of Quality, Si Production, and Dept Specfic
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -371,17 +371,12 @@
|
|||||||
var delegate = "";
|
var delegate = "";
|
||||||
var isChecked = $("#AssignDelegate").is(":checked");
|
var isChecked = $("#AssignDelegate").is(":checked");
|
||||||
|
|
||||||
console.log(isChecked);
|
|
||||||
|
|
||||||
if (isChecked === true)
|
if (isChecked === true)
|
||||||
delegate = $("#DelegateTo").data("kendoDropDownList").value();
|
delegate = $("#DelegateTo").data("kendoDropDownList").value();
|
||||||
|
|
||||||
else
|
else
|
||||||
delegate = "0";
|
delegate = "0";
|
||||||
|
|
||||||
console.log(delegate);
|
|
||||||
|
|
||||||
|
|
||||||
if (userid == delegate)
|
if (userid == delegate)
|
||||||
{
|
{
|
||||||
alert('The OOO person cannot be same as the delegate to person');
|
alert('The OOO person cannot be same as the delegate to person');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user