Phares Mike (CSC FI SPS MESLEO) f110fba4cd Merged PR 13298: Added just one approval back in after removing the method call from bug 239935
Added just one approval back in after removing the method call from bug 239935

Added IExcelDataReader support into MK Project

Changed instructions below the ECN Title field to align with Windchill

Related work items: #225480, #244087
2025-03-19 21:19:06 +01:00

2303 lines
100 KiB
Plaintext

@model Fab2ApprovalSystem.Models.ECN
@{
ViewBag.Title = "ECN Approval";
}
@{
Layout = "_ECNLayout.cshtml";
}
<link rel="stylesheet" href="/Content/kendo/kendo.blueopal.min.css" />
<style>
.AffectedProductFamily {
width: 100%;
}
@@media (min-width: 768px) {
.col-sm-6 {
padding-left: 5px;
}
.col-sm-8 {
padding-left: 5px;
}
}
@@media (min-width: 1200px) {
.AffectedProductFamily {
width: 500px;
}
}
</style>
<body onload="StartTimers();" onmousemove="ResetTimers();" onkeydown="ResetTimers();">
@using (Html.BeginForm())
{
ViewBag.CanResubmit = "false";
<input type="hidden" id="currentStep" value="@Model.CurrentStep" />
<input type="hidden" id="environment" value="@GlobalVars.DBConnection" />
<input type="hidden" id="tecnExtensionState" value="@Model.TECNExtensionState" />
<input type="hidden" id="hidCloseDate" value="@Model.CloseDate" />
<input type="hidden" id="hidOldECNType" value="" />
<input type="hidden" id="hidCancellationType" value="@Model.NotAFlowChange" />
<input type="hidden" id="hidExpirationType" value="@Model.ExpirationInProgress" />
<input type="hidden" id="txtOldExtensionDate" value="@Model.ExtensionDate" />
@Html.AntiForgeryToken()
<div data-spy="affix">
@if (ViewBag.IsApprover == "true" && Model.CancellationInProgress)
{
<input type="button" value="Save" class="btn btn-primary btn-xs" id="Save" />
<input type="button" value="Approve Cancellation" class="btn btn-success btn-xs" id="ApproveDocument" />
}
else if (ViewBag.IsApprover == "true" && Model.ExpirationInProgress)
{
<input type="button" value="Save" class="btn btn-primary btn-xs" id="Save" />
<input type="button" value="Approve Expiration" class="btn btn-success btn-xs" id="ApproveDocument" />
}
else if (
(ViewBag.IsApprover == "true" && Model.TECNExtensionState && Model.CurrentStep > 2)
|| (ViewBag.IsApprover == "true" && Model.CurrentStep == 3 && Model.ConvertedFromNumber != null)
)
{
<input type="button" value="Save" class="btn btn-primary btn-xs" id="Save" />
<input type="button" value="Approve" class="btn btn-success btn-xs" id="ApproveDocument" />
}
else if (ViewBag.IsApprover == "true")
{
<input type="button" value="Save" class="btn btn-primary btn-xs" id="Save" />
<input type="button" value="Approve" class="btn btn-success btn-xs" id="ApproveDocument" />
<input type="button" value="Reject" class="btn btn-warning btn-xs" id="RejectDocument" />
}
@if (ViewBag.IsOriginator == "true")
{
<input type="button" value="Recall Approval" class="btn btn-warning btn-xs" id="RecallDocument" />
}
@if (Model.CurrentStep <= 2 && Model.CloseDate == null && !Model.ReSubmitted && Model.ConvertedFromNumber == null && Model.TECNExtensionState == false && (ViewBag.IsOriginator == "true"))
{
<input type="button" value="Delete Document" class="btn btn-primary btn-xs" id="DeleteDocument" />
}
@if (Model.CloseDate != null)
{
if (Model.IsTECN && !Model.CancellationInProgress && !Model.CancellationApproved && !Model.ExpirationInProgress
&& !Model.ExpirationProcessed && !Model.Converted
&& !Model.LockedForConversion)
{
ViewBag.CanResubmit = "true";
<input type="button" value="Change Type" class="btn btn-primary btn-xs" id="ReSubmitDocument" disabled="disabled" />
if (Model.ExpirationDate > DateTime.Today || Model.ExtensionDate > DateTime.Today)
{
<input type="button" value="Cancel Document" class="btn btn-primary btn-xs" id="CancelDocument" />
}
else
{
<input type="button" value="Return to Process" class="btn btn-primary btn-xs" id="ReturnToProcessDocument" />
}
}
else if (Model.IsTECN && !Model.CancellationInProgress && !Model.CancellationApproved && !Model.ExpirationInProgress
&& !Model.ExpirationProcessed
&& Model.ConversionApprovalInProgress == false)
{
if (Model.ExpirationDate > DateTime.Today || Model.ExtensionDate > DateTime.Today)
{
<input type="button" value="Cancel Document" class="btn btn-primary btn-xs" id="CancelDocument" />
}
else
{
<input type="button" value="Return to Process" class="btn btn-primary btn-xs" id="ReturnToProcessDocument" />
}
}
else if (Model.IsEmergencyTECN && !Model.CancellationInProgress && !Model.CancellationApproved && !Model.ExpirationInProgress
&& !Model.ExpirationProcessed && !Model.Converted)
{
ViewBag.CanResubmit = "true";
<input type="button" value="Change Type" class="btn btn-primary btn-xs" id="ReSubmitDocument" disabled="disabled" />
if (Model.ExpirationDate > DateTime.Today || Model.ExtensionDate > DateTime.Today)
{
<input type="button" value="Cancel Document" class="btn btn-primary btn-xs" id="CancelDocument" />
}
else
{
<input type="button" value="Return to Process" class="btn btn-primary btn-xs" id="ReturnToProcessDocument" />
}
}
}
<input type="button" value="PRINT PDF" class="btn btn-primary btn-xs" id="PrintPDF" />
<input type="button" value="Approval Log History" class="btn btn-primary btn-xs" id="ApprovalLogHistoryData" />
</div>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-body bg-warning">
<div class="row">
<div class="col-sm-12 text-center">
<div class="row">
<div class="col-sm-12">
<font style="color: crimson; font-size:24px;font-weight: bolder">
Engineering Change Notice
</font>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info">
<div class="panel-heading">
<h6 style="font-weight:600"></h6>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-4">ECN #:</label>
<div class="col-sm-8">
@Html.TextBoxFor(model => model.ECNNumber, new { id = "txtECNNumber", @class = "k-textbox", disabled = "disabled", style = "background-color:lightblue" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Submit Date:</label>
<div class="col-sm-8">
@Html.TextBoxFor(model => model.SubmitedDate, new { id = "txSubmitDate", @class = "k-textbox", disabled = "disabled", style = "background-color:lightblue" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Originator Name:</label>
<div class="col-sm-6 col-sm-8">
@Html.TextBoxFor(model => model.OriginatorName, new { id = "txtOriginatorName", @class = "k-textbox", disabled = "disabled", style = "background-color:lightblue" })
@if (Session[GlobalVars.IS_ADMIN] != null)
{
<a href="javascript:undefined" id="lnkReassignOriginator" class="linkbutton edit" title="Re-assign Originator"></a>
}
</div>
</div>
@if (Model.ConvertedFromNumber != null && Model.IsTECN)
{
<div class="form-group">
<font style="color:red; font-size:12px; font-weight:bold">
<label class="control-label col-sm-4">Converted from E-TECN: </label>
<div class="col-sm-4 col-sm-4">
<a style="color:red" href="Edit?IssueID=@Model.ConvertedFromNumber">@Model.ConvertedFromNumber</a>
</div>
</font>
</div>
}
@if (Model.ConvertedFromNumber != null && Model.IsECN)
{
<div class="form-group">
<font style="color:red; font-size:12px; font-weight:bold">
<label class="control-label col-sm-4">Converted from TECN: </label>
<div class="col-sm-4 col-sm-4">
<a style="color:red" href="Edit?IssueID=@Model.ConvertedFromNumber">@Model.ConvertedFromNumber</a>
</div>
</font>
</div>
}
@if (Model.ConvertedFromNumber != null && Model.IsTECN)
{
<div class="form-group">
<font style="color:red; font-size:12px; font-weight:bold">
<label class="control-label col-sm-4">Converted from E-TECN: </label>
<div class="col-sm-4 col-sm-4">
<a style="color:red" href="Edit?IssueID=@Model.ConvertedFromNumber">@Model.ConvertedFromNumber</a>
</div>
</font>
</div>
}
@if (Model.ConvertedToNumber != null && Model.IsEmergencyTECN)
{
<div class="form-group">
<font style="color: red; font-size: 12px; font-weight: bold">
<label class="control-label col-sm-4">Converted to TECN: </label>
<div class="col-sm-4 col-sm-4">
<a style="color:red" href="Edit?IssueID=@Model.ConvertedToNumber">@Model.ConvertedToNumber</a>
</div>
</font>
</div>
}
@if (Model.ConvertedToNumber != null && Model.IsTECN)
{
<div class="form-group">
<font style="color: red; font-size: 12px; font-weight: bold">
<label class="control-label col-sm-4">Converted to ECN: </label>
<div class="col-sm-4 col-sm-4">
<a style="color:red" href="Edit?IssueID=@Model.ConvertedToNumber">@Model.ConvertedToNumber</a>
</div>
</font>
</div>
}
</div>
@*<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-4">Converted from TECN: <a href="Edit?IssueID=@Model.ConvertedFromNumber">@Model.ConvertedFromNumber</a></label>
</div>
</div>*@
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-4">ECN Title:</label>
<div class="col-sm-6 col-sm-6">
@Html.TextBoxFor(model => model.Title, new { id = "txtTitle", @class = "k-textbox", style = "width:100%", disabled = "disabled" })
</div>
<div class="col-sm-6 col-sm-offset-4" style="color: red;">
* (DO NOT USE Rev I, O, S, X, and Z)
</div>
<div class="col-sm-6 col-sm-offset-4" style="color: red;">
Revision Y is followed by AA-AY, AY is followed by BA-BY etc. YY is followed by AAA
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Approvers:</label>
<div class="col-sm-6 col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("DepartmentIDs")
.BindTo(new SelectList(ViewBag.Departments, "DepartmentID", "DepartmentName"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
<div class="col-sm-6 col-sm-offset-4" style="color:red;">
ECN: Qualtiy and Dept. Specific<br />PCRB: Quality, Production, Engineering, Dept. Specific (scope of change)
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Affected Areas:</label>
<div class="col-sm-6 col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("ModuleIDs")
.BindTo(new SelectList(ViewBag.AffectedModules, "ModuleID", "ModuleName"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-4">Category:</label>
<div cl0ass="col-sm-6 col-sm-6">
@(Html.Kendo().DropDownListFor(model => model.CategoryID)
.DataValueField("CategoryID")
.DataTextField("CategoryName")
.BindTo(ViewBag.Categories)
.HtmlAttributes(new { disabled = "disabled" }))
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">ITAR/EC:</label>
<div class="col-sm-6 col-sm-6">
@Html.CheckBoxFor(model => model.IsDocEC, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<h5 style="font-weight:600">ECN/TECN Detail</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="col-lg-4">
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">ECN:</label>
<div class="form-control-static col-sm-6">
@Html.CheckBoxFor(model => model.IsECN, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">TECN:</label>
<div class="form-control-static col-sm-6">
@Html.CheckBoxFor(model => model.IsTECN, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Emergency:</label>
<div class="form-control-static col-sm-6">
@Html.CheckBoxFor(model => model.IsEmergencyTECN, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
<div class="col-lg-8">
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Expiration Date:</label>
<div class="col-sm-6">
@(Html.Kendo().DatePickerFor(model => model.ExpirationDate)
.Name("txtExpirationDate")
.HtmlAttributes(new { disabled = "disabled", @type = "", style = "width: 11em;" })
.Format("MM/dd/yyyy")
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Extension Date:</label>
<div class="col-sm-6">
@if (
(ViewBag.IsOriginator == "true" && Model.IsTECN && Model.CloseDate != null && !Model.ExpirationProcessed && !Model.ExpirationInProgress && !Model.CancellationApproved && !Model.CancellationInProgress && Model.ConversionApprovalInProgress == false && (Model.ExpirationDate >= DateTime.Today || Model.ExtensionDate >= DateTime.Today))
||
(Model.IsTECN && (bool)Session[GlobalVars.IS_ADMIN] && (Request.IsAuthenticated) && Model.CloseDate != null && !Model.ExpirationProcessed && !Model.ExpirationInProgress && !Model.CancellationApproved && !Model.CancellationInProgress && Model.ConversionApprovalInProgress == false && (Model.ExpirationDate >= DateTime.Today || Model.ExtensionDate >= DateTime.Today))
)
{
@(Html.Kendo().DatePickerFor(model => model.ExtensionDate)
.Name("txtExtensionDate")
.HtmlAttributes(new { @type = "", style = "width: 11em;" })
.Format("MM/dd/yyyy")
)
}
else
{
@(Html.Kendo().DatePickerFor(model => model.ExtensionDate)
.Name("txtExtensionDate")
.HtmlAttributes(new { disabled = "disabled", @type = "", style = "width: 11em;" })
.Format("MM/dd/yyyy")
)
}
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Cancelled Date:</label>
<div class="col-sm-6">
@Html.TextBoxFor(model => model.CancellationApprovalDate, "{0:MM/dd/yyyy}", new { id = "txtCancellationApprovalDate", @class = "k-textbox",
style = "width: 8em;", disabled = "disabled" })
</div>
</div>
</div>
</div>
</div>
<div class="panel-body bg-warning">
<div class="col-lg-4">
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6" style="padding-left: 0px"># lots affected:</label>
<div class="form-control-static col-sm-6">
@(Html.Kendo().DropDownList()
.Name("NumberOfLotsAffected")
.Items(i =>
{
i.Add().Text("").Value("");
i.Add().Text("NA").Value("NA");
i.Add().Text("< 10").Value("< 10");
i.Add().Text("> 10").Value("> 10");
})
.HtmlAttributes(new { style = "width: 5em;", disabled = "disabled" })
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Recipe Or/And Flow Change?</label>
<div class="form-control-static col-sm-6">
@(Html.Kendo().DropDownList()
.Name("RecipeChange")
.Items(i =>
{
i.Add().Text("").Value("");
i.Add().Text("No").Value("False");
i.Add().Text("Yes").Value("True");
})
.HtmlAttributes(new { style = "width: 5em;", disabled = "disabled" })
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
</div>
</div>
<div class="col-lg-8">
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Affected Customers:</label>
<div class="form-control-static col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("ProductFamilyIDs")
.BindTo(new SelectList(ViewBag.ProductFamilies, "ProductFamilyID", "ProductFamily"))
.HtmlAttributes(new { disabled = "disabled", @class = "AffectedProductFamily" })
.Value(Model.ProductFamilyIDs)
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
</div>
<div class="form-horizontal col-sm-4">
</div>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-group">
<label class="control-label">Affected Documents:</label>
<div>
@if (
(Model.CloseDate != null && Model.IsECN)
|| ((Model.IsEmergencyTECN || Model.IsTECN) && (DateTime.Today > Model.ExpirationDate && DateTime.Today > Model.ExtensionDate))
)
{
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("AttachSave", "ECN", new { ecnNumber = Model.ECNNumber })
.AutoUpload(true)
)
.ShowFileList(false)
.Events(events => events
.Success("onFileUploadSuccess")
.Upload("checkFileType")
)
)
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.ECNAttachment>()
.Name("Attachments")
.Columns(columns =>
{
columns.Bound(a => a.AttachmentID).Visible(false);
columns.Bound(a => a.ECNNumber).Visible(false);
columns.Bound(a => a.FileName).Template(@<text> @Html.ActionLink(@item.FileName.ToString(), null)</text>);
//.ClientTemplate("<a href='' target='_blank' onclick='return AttachmentMessage()'>#=FileName#</a>");
columns.Bound(a => a.FullName);
columns.Bound(a => a.UploadDate).Format("{0:MM/dd/yy hh:mm:ss}");
columns.Command(command => command.Custom("View").Click("DownloadAttachment"));
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:157px; width:100%; font-size: 10px" })
.DataSource(dataSource => dataSource
.Ajax()
//.Batch(false)
.ServerOperation(false)
//.Events(events => events.Error("error_handler"))
.Model(model =>
{
model.Id(p => p.AttachmentID);
})
.PageSize(50)
.Read(read => read.Action("Attachment_Read", "ECN", new { ecnNumber = Model.ECNNumber }))
//.Destroy(destroy => destroy.Action("Attachment_Destroy", "ECN"))
)
)
}
else
{
@*@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("AttachSave", "ECN", new { ecnNumber = Model.ECNNumber })
.AutoUpload(true)
)
.ShowFileList(false)
.Events(events => events
.Success("onFileUploadSuccess")
.Upload("checkFileType")
)
)*@
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.ECNAttachment>()
.Name("Attachments")
.Columns(columns =>
{
columns.Bound(a => a.AttachmentID).Visible(false);
columns.Bound(a => a.ECNNumber).Visible(false);
columns.Bound(a => a.FileName).Template(@<text> @Html.ActionLink(@item.FileName.ToString(), null)</text>);
//.ClientTemplate("<a href='" + GlobalVars.AttachmentUrl + "ECN/#=ECNNumber#/#=FileName#' target='_blank'>#=FileName#</a>");
columns.Bound(a => a.FullName);
columns.Bound(a => a.UploadDate).Format("{0:MM/dd/yy hh:mm:ss}");
columns.Command(command => command.Custom("View").Click("DownloadAttachment"));
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:157px; width:100%; font-size: 10px" })
.DataSource(dataSource => dataSource
.Ajax()
//.Batch(false)
.ServerOperation(false)
//.Events(events => events.Error("error_handler"))
.Model(model =>
{
model.Id(p => p.AttachmentID);
})
.PageSize(50)
.Read(read => read.Action("Attachment_Read", "ECN", new { ecnNumber = Model.ECNNumber }))
.Destroy(destroy => destroy.Action("Attachment_Destroy", "ECN"))
)
)
}
</div>
</div>
</div>
</div>
<table class="table-condensed" style="width:100%">
<tbody>
<tr>
<td>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<table>
<tr>
<td>
<h5 style="font-weight:600">Description of Change &nbsp;&nbsp;&nbsp;</h5>
</td>
<td>
<button type="button" class="btn btn-xs btn-primary" id="UpdateDescriptionOfChange">Update Description of Change</button>
</td>
</tr>
</table>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-12">
@Html.TextAreaFor(model => model.DescriptionOfChange, 15, 30, new { id = "txtDescriptionOfChange", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
</div>
</div>
</td>
<td>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<table>
<tr>
<td>
<h5 style="font-weight:600">Reason For Change&nbsp;&nbsp;&nbsp;</h5>
</td>
<td>
<button type="button" class="btn btn-xs btn-primary" id="UpdateReasonForChange">Update Reason for Change</button>
</td>
</tr>
</table>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-12">
@Html.TextAreaFor(model => model.ReasonForChange, 15, 30, new { id = "txtReasonForChange", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info">
<div class="panel-heading">
<h5 style="font-weight:600">Training Notification</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-2">
@*<div class="form-group">
<label class="control-label col-sm-4">Acknowledgment:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.AcknowledgementRequired, new { disabled = "disabled" })
</div>
</div>*@
<div class="form-group">
<label class="control-label col-sm-4">Training:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.TrainingRequired, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-3">
@*<div class="form-group">
<label class="control-label col-sm-6">Acknowledgement Notification to:</label>
<div class="col-sm-8 col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("AcknowledgementByIDs")
.BindTo(new SelectList(ViewBag.AcknowledgementTrainingByIDs, "AcknowledgementTrainingByID", "AcknowledgementTrainingBy"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
</div>*@
<div class="form-group">
<label class="control-label col-sm-6">Training Notification to:</label>
<div class="col-sm-8 col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("TrainingByIDs")
.BindTo(new SelectList(ViewBag.AcknowledgementTrainingByIDs, "TrainingGroupID", "TrainingGroupName"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
</div>
</div>
@*<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-4">Area:</label>
<div class="col-sm-8 col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("AreaIDs")
.BindTo(new SelectList(ViewBag.AffectedAreas, "AreaID", "Area"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
</div>
</div>*@
@*<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-4">Unit Process:</label>
<div class="col-sm-8 col-sm-8">
@(Html.Kendo().MultiSelect()
.Name("TechnologyIDs")
.BindTo(new SelectList(ViewBag.AffectedTechnologies, "TechnologyID", "Technology"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
</div>
</div>*@
</div>
</div>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info">
<div class="panel-heading">
<h5 style="font-weight:600">Systems</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="col-lg-4">
<div class="form-horizontal col-sm-6 col-lg-5">
<div class="form-group">
<label class="control-label col-sm-6">PCRB Required:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.PCRBRequired, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-6 col-lg-7">
<div class="form-group">
<label class="control-label col-sm-6">PCRB#:</label>
<div class="form-control-static col-sm-6">
@Html.TextBoxFor(model => model.PCRBNumber, new { id = "txtPCRBNumber", @class = "k-textbox", disabled = "disabled", @style = "max-width: 100%" })
</div>
</div>
</div>
</div>
<div class="col-lg-3">
@*<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-6">Test Program Change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.TestProgramChangeRequired, new { disabled = "disabled" })
</div>
</div>
</div>*@
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-6">Metrology Change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.MetrologyChangeRequired, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-6">SPC Change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.SPCChangeRequired, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
<div class="col-lg-3">
@*<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-6">New Part Flow:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.NewPartFlowRequired, new { disabled = "disabled" })
</div>
</div>
</div>*@
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-6">FI Change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.FIChangeRequired, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
<div class="col-lg-2">
<div class="form-horizontal col-sm-6 col-lg-10">
<div class="form-group">
<label class="control-label col-sm-6">OI Change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.SPNChangeRequired, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
</div>
</div>
@*<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<h5 style="font-weight:600">Implementation Details</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-12">
<div class="form-group">
<label class="control-label">Implementation Details:</label>
@if (ViewBag.IsApprover == "true" && Model.CloseDate == null)
{
<div>
@Html.TextAreaFor(model => model.ImplementationDetails, 15, 30, new { id = "txtImplementationDetails", @class = "form-control", style = "font-size: 11px;width: 100%;" })
</div>
}
else
{
<div>
@Html.TextAreaFor(model => model.ImplementationDetails, 15, 30, new { id = "txtImplementationDetails", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
}
</div>
</div>
</div>
</div>*@
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<h5 style="font-weight:600">Change Impact</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label style="font-weight:bolder; font-size:small">Impact On ESH:</label>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Positive:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.ImpactOnEnvironment, 1, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Negative:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.ImpactOnEnvironment, 2, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">N/A:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.ImpactOnEnvironment, 3, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
@Html.TextAreaFor(model => model.ImpactOnEnvironmentDescription, 5, 30, new { id = "txtImpactOnEnvironmentDescription", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label style="font-weight:bolder; font-size:small">Impact On Capacity:</label>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Yes:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.ImpactOnCapacity, 1, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">No:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.ImpactOnCapacity, 0, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="col-sm-12 pull-left">If yes, what is the impact?</label>
<div class="col-sm-10">
@Html.TextAreaFor(model => model.ImpactOnCapacityDescription, 5, 30, new { id = "txtImpactOnCapacityDescription", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label style="font-weight:bolder; font-size:small">Material Consumption Change:</label>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Yes:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.MaterialConsumptionChangeRequired, 1, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">No:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.MaterialConsumptionChangeRequired, 0, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="col-sm-3">Description</label>
<div class="col-sm-10">
@Html.TextAreaFor(model => model.MaterialConsumptionChangeDescription, 5, 30, new { id = "txtMaterialConsumptionChangeDescription", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
</div>
</div>
</div>
</div>
@*<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading" >
<h5 style="font-weight:600">Description Of Change</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-6">
<div class="form-group">
<div class="col-sm-10">
@Html.TextAreaFor(model => model.DescriptionOfChange, 5, 30, new { id = "txtDescriptionOfChange", @class = "form-control", style = "font-size: 11px;width: 100%;" })
</div>
</div>
</div>
</div>
</div>*@
@*<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<h5 style="font-weight:600">Implementation</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label style="font-weight:bolder; font-size:small">How will the change be implemented?One box must be checked:</label>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Not a flow change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.NotAFlowChange, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Attach ECN/TECNs to Lots:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.AttachECN_TECNToLots, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label style="font-weight:bolder; font-size:small">SPN Changes are applied to all lots in process</label>
</div>
<div class="form-group">
<label class="control-label col-sm-3">SPN flow change at Single Step</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.SPNFlowChangeAtSingleStep, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">SPN flow change at Multiple Step:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.SPNFlowChangeAtMultipleSteps, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
</div>*@
<div class="panel panel-default" style="font-size: 10px">
@*@if (@Model.CurrentStep == 1)
{
<div class="panel-heading">
@if (ViewBag.IsApprover == "true")
{
<button class="k-textbox" data-toggle="modal" id="reAssignApprovers">
Re-Assign Approvers
</button>
}
<button class="k-textbox" data-toggle="modal" id="additionalApprovers">
Additional Approvers
</button>
</div>
@*} *@
<div class="panel-heading">
@if (ViewBag.IsApprover == "true")
{
<button class="k-textbox" data-toggle="modal" id="reAssignApprovers">
Re-Assign Approvers
</button>
<button class="k-textbox" data-toggle="modal" id="additionalApprovers">
Additional Approvers
</button>
}
else if ((ViewBag.IsOriginator == "true" || ((bool)Session[GlobalVars.IS_ADMIN] && (Request.IsAuthenticated))) && Model.CloseDate == null)
{
<button class="k-textbox" data-toggle="modal" id="additionalApprovers">
Additional Approvers
</button>
}
</div>
<div class="panel-body bg-warning">
<div class="col-sm-offset-0">
@if (Session[GlobalVars.IS_ADMIN] != null)
{
if ((bool)Session[GlobalVars.IS_ADMIN] && (Request.IsAuthenticated))
{
@(Html.Kendo().Grid<Fab2ApprovalSystem.ViewModels.ApproversListViewModel>()
.Name("ApproversList")
.Columns(columns =>
{
columns.Bound(a => a.UserID).Visible(false);
columns.Bound(a => a.ApprovalID).Visible(false);
columns.Bound(a => a.FullName);
columns.Bound(a => a.RoleName);
columns.Bound(a => a.SubRoleName);
columns.Bound(a => a.Status);
columns.Bound(a => a.AssignedDate).Format("{0:MM/dd/yy hh:mm:ss}"); ;
columns.Bound(a => a.CompletedDate).Format("{0:MM/dd/yy hh:mm:ss}"); ;
columns.Bound(a => a.Comments);
columns.Command(command => command.Custom("Re-Assign").Click("showReAssignRole")).Width("100px");
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:200px; width:100%; font-size: 10px" })
.DataSource(dataSource => dataSource
.Ajax()
//.Batch(false)
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.ApprovalID);
})
.PageSize(20)
.Read(read => read.Action("GetApproversList", "ECN", new { issueID = Model.ECNNumber, step = Model.CurrentStep, isTECN = Model.IsTECN, isEmergrncyTECN = Model.IsEmergencyTECN }))
)
.Resizable(resize => resize.Columns(true))
)
}
else
{
@(Html.Kendo().Grid<Fab2ApprovalSystem.ViewModels.ApproversListViewModel>()
.Name("ApproversList")
.Columns(columns =>
{
columns.Bound(a => a.UserID).Visible(false);
columns.Bound(a => a.ApprovalID).Visible(false);
columns.Bound(a => a.FullName);
columns.Bound(a => a.RoleName);
columns.Bound(a => a.SubRoleName);
columns.Bound(a => a.Status);
columns.Bound(a => a.AssignedDate).Format("{0:MM/dd/yy hh:mm:ss}"); ;
columns.Bound(a => a.CompletedDate).Format("{0:MM/dd/yy hh:mm:ss}"); ;
columns.Bound(a => a.Comments);
//columns.Command(command => command.Custom("Re-Assign").Click("showReAssignRole")).Width("100px");
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:200px; width:100%; font-size: 10px" })
.DataSource(dataSource => dataSource
.Ajax()
//.Batch(false)
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.ApprovalID);
})
.PageSize(20)
.Read(read => read.Action("GetApproversList", "ECN", new { issueID = Model.ECNNumber, step = Model.CurrentStep, isTECN = Model.IsTECN, isEmergrncyTECN = Model.IsEmergencyTECN }))
)
.Resizable(resize => resize.Columns(true))
)
}
}
</div>
</div>
</div>
}
</body>
<div class="modal fade" id="ApprovalComments" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Enter Approval Comments:</h4>
</div>
<div class="modal-body">
<textarea class="form-control" rows="3" id="approvalComments"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="submitApprovalComments">Confirm Approval</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="RejectComments" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Enter Reject Comments:</h4>
</div>
<div class="modal-body">
<textarea class="form-control" rows="3" id="rejectComments"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="submitRejectComments">Confirm Reject</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="RecallComments" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Enter Recall Comments:</h4>
</div>
<div class="modal-body">
<textarea class="form-control" rows="3" id="recallComments"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="submitRecallComments">Confirm Recall</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="ReAssignApproval" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Re-Assign for Approval From: <label class="bg-danger" id="ReAssignApproverFromLabel">Me</label></h4>
</div>
<div class="modal-body">
<div class="control-group">
<div class="controls">
<h4 class="modal-title" id="myModalLabel">Re-Assign for Approval to:</h4>
<div id='lstReAssignApproval'>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="ConfirmReAssignment">Confirm Re-assignment</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="AdditionalApproval" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Add New Approvers:</h4>
</div>
<div class="modal-body">
<div class="control-group">
<div class="controls">
<div id='lstAdditionalApproval'>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="additionalApproval">Confirm Additional Approver</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="UpdateDescriptionOfChangeWin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Update Description Of Change:</h4>
</div>
<div class="modal-body">
<textarea class="form-control" rows="5" id="txtDescriptionOfChangeAdd"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="ConfirmDescriptionOfChange">OK</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="UpdateReasonForChangeWin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Update Reason For Change:</h4>
</div>
<div class="modal-body">
<textarea class="form-control" rows="5" id="txtReasonForChangeAdd"></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="ConfirmReasonForChange">OK</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="ApprovalLogHistoryWin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Approval Log History</h4>
</div>
<div class="modal-body">
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.ApprovalLogHistory>()
.Name("ApprovalLogHistory")
.Columns(columns =>
{
columns.Bound(a => a.ApprovalLogID).Visible(false);
columns.Bound(a => a.FullName);
columns.Bound(a => a.SubRole);
columns.Bound(a => a.Operation);
columns.Bound(a => a.OperationTime).Format("{0:MM/dd/yy hh:mm:ss}");
columns.Bound(a => a.Comments);
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:300px; width:100%; font-size: 12px" })
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.ApprovalLogID);
})
.PageSize(50)
.Read(read => read.Action("ApprovalLogHistory_Read", "ECN", new { ecnNumber = Model.ECNNumber }))
)
)
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="timeout" tabindex="0" role="dialog" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog modal-lg" style="width:500px;">
<div class="modal-content">
<div class="modal-header" style="background-color: #fce0a3;">
<h3 class="modal-title">Page About To Timeout</h3>
</div>
<div class="modal-body" style="background-color: crimson; font-size: 20px; color:white">
You will automatically be redirected to your Home Page in 1 minute.<br />
To remain on this page please close this window or press the ESC key.
</div>
<div class="modal-footer" style="background-color: #fce0a3; ">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
@Html.Partial("_ECNCancel")
@Html.Partial("_ECNReturnToProcess")
@Html.Partial("_ECNReassignOriginator")
<script type="text/javascript">
var docType;
var ecnTypeString = '';
var enumDocumentType = {
ECN: 3,
EECN: 4,
TECNCancExp: 5
}
$(document).ready(function () {
var existingReasonForChange = $("#txtReasonForChange").val();
var existingDescriptionOfChange = $("#txtDescriptionOfChange").val();
var cancelledDoc = "false";
var expiredDoc = "false";
$("#UpdateDescriptionOfChange").hide();
$("#UpdateReasonForChange").hide();
@*if ("@Model.CloseDate" != null && "@Model.CloseDate" != '') {
// disable
$('#files').data("kendoUpload").disable();
}
else if ("@ViewBag.IsApprover" != "true" && "@ViewBag.IsOriginator" != "true") {
// disable
$('#files').data("kendoUpload").disable();
}*@
// on load ============================================
if ("@Model.CancellationInProgress" == "True")
cancelledDoc = "true";
else if ("@Model.ExpirationInProgress" == "True")
expiredDoc = "true";
if ($('#IsEmergencyTECN').is(":checked")) {
ecnTypeString = "E-TECN"
docType = 4; //document type = Emergency TECN
$("#hidOldECNType").val("E-TECN");
// CHANGES =====================================
//if ($('#hidCloseDate').val() != '') {
// $("#IsECN").prop('disabled', false);
// $("#IsTECN").prop('disabled', false);
// $("#hidOldECNType").val("E-TECN");
//}
if ("@ViewBag.CanResubmit" == "true") {
$("#IsECN").prop('disabled', false);
$("#IsTECN").prop('disabled', false);
}
//=======================================================
}
else if ($('#IsECN').is(":checked")) {
ecnTypeString = "ECN"
docType = 3; //document type = ECN
$("#hidOldECNType").val("ECN");
}
else if ($('#IsTECN').is(":checked")) {
ecnTypeString = "TECN"
docType = 3; //document type = TECN
// CHANGES =====================================
//if ($('#hidCloseDate').val() != '') {
// $("#IsECN").prop('disabled', false);
//}
if ("@ViewBag.CanResubmit" == "true") {
$("#IsECN").prop('disabled', false);
}
//========================================================
$("#hidOldECNType").val("TECN");
}
if (cancelledDoc == "true" || expiredDoc == "true") {
docType = 5; //document type = TECNCancelledExpired
}
// Events =============================================
$('#IsECN').on('change', function () {
if ($('#IsECN').is(":checked")) {
ecnTypeString = "ECN"
docType = 3; //document type = ECN/TECN
$('#txtExpirationDate').data('kendoDatePicker').value("");
$('#txtExpirationDate').data('kendoDatePicker').readonly(true);
$('#txtExtensionDate').data('kendoDatePicker').value("");
$('#txtExtensionDate').data('kendoDatePicker').readonly(true);
$('#IsTECN').prop('checked', false);
$('#IsEmergencyTECN').prop('checked', false);
$('#ReSubmitDocument').prop('disabled', false);
//$("#UpdateReasonForChange").show();
//$("#UpdateDescriptionOfChange").show();
//$('#files').data("kendoUpload").enable();
$('#CategoryID').data('kendoDropDownList').enable(true);
$('#CategoryID').data('kendoDropDownList').value(0);
}
})
$('#IsTECN').on('change', function () {
if ($('#IsTECN').is(":checked")) {
ecnTypeString = "TECN"
docType = 3; //document type = ECN/TECN
$('#txtExpirationDate').data('kendoDatePicker').value("");
$('#txtExpirationDate').data('kendoDatePicker').readonly(false);
$('#txtExtensionDate').data('kendoDatePicker').value("");
$('#txtExtensionDate').data('kendoDatePicker').readonly(true);
$('#IsECN').prop('checked', false);
$('#IsEmergencyTECN').prop('checked', false);
$('#ReSubmitDocument').prop('disabled', false);
//$("#UpdateReasonForChange").show();
//$("#UpdateDescriptionOfChange").show();
// $('#files').data("kendoUpload").enable();
$('#CategoryID').data('kendoDropDownList').enable(true);
$('#CategoryID').data('kendoDropDownList').value(0);
}
})
$('#ApprovalLogHistoryData').on('click', function () {
$("#ApprovalLogHistoryWin").modal('show');
return false;
})
$('#UpdateReasonForChange').on('click', function () {
$("#UpdateReasonForChangeWin").modal('show');
return false;
})
$('#ConfirmReasonForChange').on('click', function () {
$("#UpdateReasonForChangeWin").modal('hide');
var d = new Date();
var month = d.getMonth() + 1;
var day = d.getDate();
var output = d.getFullYear() + '/' +
(month < 10 ? '0' : '') + month + '/' +
(day < 10 ? '0' : '') + day;
$("#txtReasonForChange").val(existingReasonForChange + "\n [Reason For Change] added after Re-Submitted on : " + output + "\n " + $("#txtReasonForChangeAdd").val());
})
$('#UpdateDescriptionOfChange').on('click', function () {
$("#UpdateDescriptionOfChangeWin").modal('show');
return false;
})
$('#ConfirmDescriptionOfChange').on('click', function () {
$("#UpdateDescriptionOfChangeWin").modal('hide');
var d = new Date();
var month = d.getMonth() + 1;
var day = d.getDate();
var output = d.getFullYear() + '/' +
(month < 10 ? '0' : '') + month + '/' +
(day < 10 ? '0' : '') + day;
$("#txtDescriptionOfChange").val(existingDescriptionOfChange + "\n [Description of Change] added after Re-Submitted on : " + output + "\n " + $("#txtDescriptionOfChangeAdd").val());
})
var extensionDatepicker = $("#txtExtensionDate").data("kendoDatePicker");
var prevExtensionDate = extensionDatepicker.value();
extensionDatepicker.bind("change", function () {
if (Date.parse($('#txtExpirationDate').val()) >= Date.parse($('#txtExtensionDate').val())) {
alert('Extension has to be greater than the Expiration date');
extensionDatepicker.value(prevExtensionDate);
return false;
}
if (!confirm("Are you sure you want to extend the TECN?")) {
extensionDatepicker.value(prevExtensionDate);
return false;
}
else {
submitForApproval();
}
var value = this.value();
// alert(value); //value is the selected date in the datepicker
});
});
function AttachmentMessage() {
alert("The documents can only be viewed from Documetum");
return false;
}
function onFileUploadSuccess(e) {
var grid = $("#Attachments").data("kendoGrid");
grid.dataSource.read($('#txtECNNumber').val());
}
function checkFileType(e) {
var files = e.files;
$.each(files, function () {
if (!this.extension.toLowerCase().match(/^(.doc|.docx|.ppt|.pptx|.xls|.xlsx|.xlsm|.pdf|.gif|.jpeg|.jpg|.bmp|.png|.txt|.slddrw|.sldprt)$/)) {
alert("Only Word/PowerPoint/Excel/PDF/Image/Text files can be uploaded!")
e.preventDefault();
}
});
}
function error_handler(e) {
if (e.errors) {
var message = "Errors:\n";
$.each(e.errors, function (key, value) {
if ('errors' in value) {
$.each(value.errors, function () {
message += this + "\n";
});
}
});
alert(message);
}
}
var calculate90DaysExpiration = function () {
var start = new Date();
var end = new Date($('#txtExpirationDate').val());
var diff = new Date(end - start);
// get days
var days = diff / 1000 / 60 / 60 / 24;
//alert(days);
}
var submitForApproval = function () {
var error = '';
//var ecnTypeString = '';
if ($('#IsECN').is(':checked')) {
//ecnTypeString = "ECN"
}
else if ($('#IsTECN').is(':checked')) {
//alert('in');
var days = returnNoOfDays();
if (days > 90)
error += "TECN can only be valid for a maximum of 90 days from the date of Submission";
ecnTypeString = "TECN"
//return;
}
else if ($('#IsEmergencyTECN').is(':checked')) {
//ecnTypeString = "E-TECN"
}
if (error != '') {
alert(error);
return false;
}
$.ajax({
url: "/ECN/SubmitTECNExtension",
type: "GET",
datatype: "json",
data: {
ecnNumber: $("#txtECNNumber").val(),
documentType: docType,
ecnTypeString: ecnTypeString,
extensionDate: $('#txtExtensionDate').val()
},
success: function (data) {
if (data == 'Redirect') {
var url = '@Url.Action("EditApproval", "ECN", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtECNNumber").val());
}
else {
// TODO alert an error message
}
},
error: function (result) {
alert("Failed on Submit" + result);
}
});
}
// Save Implementation Details
$('#Save').on('click', function () {
$.ajax({
url: "/ECN/SaveAfterSubmitByApprover",
type: "GET",
datatype: "json",
data: {
ecnNumber: $("#txtECNNumber").val(),
implementationDetails: $("#txtImplementationDetails").val()
},
success: function (data) {
alert("Data Saved");
}
});
return false;
});
// PrintPDF
$('#PrintPDF').on('click', function () {
$.ajax({
url: "/ECN/SaveAfterSubmitByApprover",
type: "GET",
datatype: "json",
data: {
ecnNumber: $("#txtECNNumber").val(),
implementationDetails: $("#txtImplementationDetails").val()
},
success: function (data) {
var isETECN = "@Model.IsEmergencyTECN";
if (isETECN == "True" && $("#hidCloseDate").val() == "")
{
alert("E-TECN cannot be printed until approved.");
return;
}
var url = '@Url.Action("PrintECNPdf", "ECN", new { ecnNumber = "__id__" })';
//window.location.href = url.replace('__id__', $("#txtECNNumber").val());
url = url.replace('amp;', '');
window.open(url.replace('__id__', $("#txtECNNumber").val(), '_blank'));
}
});
return false;
})
// Approve =============================================================================================
$('#ApproveDocument').on('click', function () {
$('#submitApprovalComments').attr("disabled", false);
$.ajax({
url: "/ECN/SaveAfterSubmitByApprover",
type: "GET",
datatype: "json",
data: {
ecnNumber: $("#txtECNNumber").val(),
implementationDetails: $("#txtImplementationDetails").val()
},
success: function (data) {
$("#ApprovalComments").modal('show');
}
});
return false;
});
$('#submitApprovalComments').on('click', function () {
var urlstring = "/ECN/Approve";
var comments = document.getElementById("approvalComments").value;
if (comments != "") {
$('#submitApprovalComments').attr("disabled", true);
if ("@Model.CancellationInProgress" == "True")
urlstring = "/ECN/ApproveCancellation";
else if ("@Model.ExpirationInProgress" == "True")
urlstring = "/ECN/ApproveExpiration";
$.ajax({
url: urlstring,
type: "GET",
datatype: "json",
data: {
ecnNumber: $("#txtECNNumber").val(),
currentStep: $("#currentStep").val(),
comments: $("#approvalComments").val(),
documentType: docType,
ecnTypeString: ecnTypeString
},
success: function (data) {
$("#ApprovalComments").modal('hide');
var url = '@Url.Action("ReadOnly", "ECN", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtECNNumber").val());
},
error: function (result) {
@*$("#ApprovalComments").modal('hide');
var url = '@Url.Action("ReadOnly", "ECN", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtECNNumber").val());*@
$('#submitApprovalComments').attr("disabled", false);
alert("Server error, Please Approve the document again");
}
});
}
else {
alert("You must enter approval comments!!!")
}
});
$('#RejectDocument').on('click', function () {
// Save the document first if it was changed
$('#RejectDocument').attr("disabled", false);
$("#RejectComments").modal('show');
return false;
});
$('#RecallDocument').on('click', function () {
// Save the document first if it was changed
$('#RecallDocument').attr("disabled", false);
$("#RecallComments").modal('show');
return false;
});
$('#submitRejectComments').on('click', function () {
var comments = document.getElementById("rejectComments").value;
if (comments != "") {
$('#RejectDocument').attr("disabled", true);
//var ecnTypeString = '';
//if ($('#IsECN').is(':checked'))
// ecnTypeString = "ECN"
//else if ($('#IsTECN').is(':checked')) {
// ecnTypeString = "TECN"
//}
//else if ($('#IsEmergencyTECN').is(':checked'))
// ecnTypeString = "E-TECN"
$.ajax({
url: "/ECN/Reject",
type: "GET",
datatype: "json",
data: {
ecnNumber: $("#txtECNNumber").val(),
currentStep: $("#currentStep").val(),
comments: $("#rejectComments").val(),
docType: docType,
ecnTypeString: ecnTypeString
},
success: function (data) {
$("#RejectComments").modal('hide');
@*var url = '@Url.Action("Edit", "ECN", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtECNNumber").val());*@
var url = '@Url.Action("MyTasks", "Home")';
window.location.href = url;
},
error: function (result) {
$('#submitRejectComments').attr("disabled", false);
alert("Server error, Please Reject the document again");
}
});
}
else {
alert("You must enter rejection comments!!!")
}
});
$('#submitRecallComments').on('click', function () {
var comments = document.getElementById("recallComments").value;
if (comments != "") {
$('#RecallDocument').attr("disabled", true);
//var ecnTypeString = '';
//if ($('#IsECN').is(':checked'))
// ecnTypeString = "ECN"
//else if ($('#IsTECN').is(':checked')) {
// ecnTypeString = "TECN"
//}
//else if ($('#IsEmergencyTECN').is(':checked'))
// ecnTypeString = "E-TECN"
$.ajax({
url: "/ECN/RecallDocument",
type: "GET",
datatype: "json",
data: {
ecnNumber: $("#txtECNNumber").val(),
currentStep: $("#currentStep").val(),
comments: $("#recallComments").val(),
docType: docType,
ecnTypeString: ecnTypeString
},
success: function (data) {
$("#RecallComments").modal('hide');
@*var url = '@Url.Action("Edit", "ECN", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtECNNumber").val());*@
var url = '@Url.Action("MyTasks", "Home")';
window.location.href = url;
},
error: function (result) {
$('#submitRecallComments').attr("disabled", false);
alert("Server error, Please Recall the document again");
}
});
}
else {
alert("You must enter recall comments!!!")
}
});
function showReAssignRole(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
$('#ReAssignApproverFromLabel').text(dataItem.FullName);
var issueID = $("#txtECNNumber").val();
reAssignFromUserid = dataItem.UserID;
if (dataItem.Status.indexOf("Pending") < 0)
alert("Cannot ReAssign, because it is not in a Pending state");
else {
var searchText = ($("#txtSearch").val());
var url = "/ECN/GetAllUsersList";
var source =
{
datatype: "json",
datafields: [
{ name: 'UserID' },
{ name: 'FullName' }
],
id: 'id',
url: url,
};
var dataAdapter = new $.jqx.dataAdapter(source);
// Create a jqxListBox
$("#lstReAssignApproval").jqxListBox({
multipleextended: false, theme: "arctic", source: dataAdapter, displayMember: "FullName", valueMember: "UserID", width: 200, height: 250
});
$("#ReAssignApproval").modal('show');
return false;
//alert(dataItem.FullName);
}
}
var ReAssignApprovalByAdmin = function (userids) {
var urlString = '/ECN/ReAssignApproverByAdmin';
//if (arrayOfValues.length == 0)
// return false;
//var isRH;
//if ($('#IsRH').is(':checked'))
// isRH = 1;
//else
// isRH = 0;
//var ecnTypeString = '';
//if ($('#IsECN').is(':checked'))
// ecnTypeString = "ECN"
//else if ($('#IsTECN').is(':checked'))
// ecnTypeString = "TECN"
//else if ($('#IsEmergencyTECN').is(':checked'))
// ecnTypeString = "E-TECN"
$.ajax({
type: "Post",
url: urlString,
data: {
issueID: $("#txtECNNumber").val(),
reAssignApproverFrom: reAssignFromUserid,
reAssignApproverTo: userids,
step: $("#currentStep").val(),
docType: docType,
ecnTypeString: ecnTypeString
},
success: function (result) {
//var grid = $("#ApproversList").data("kendoGrid");
//grid.dataSource.read($('#txtECNNumber').val(), $("#currentStep").val());
var url = '@Url.Action("ReadOnly", "ECN", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtECNNumber").val());
}
});
};
//Region Additional Aprovers
$('#additionalApprovers').on('click', function () {
var searchText = ($("#txtSearch").val());
var url = "/ECN/GetAllUsersList";
var source =
{
datatype: "json",
datafields: [
{ name: 'UserID' },
{ name: 'FullName' }
],
id: 'id',
url: url,
};
var dataAdapter = new $.jqx.dataAdapter(source);
// Create a jqxListBox
$("#lstAdditionalApproval").jqxListBox({
multipleextended: true, theme: "arctic", source: dataAdapter, displayMember: "FullName", valueMember: "UserID", width: 200, height: 250
});
$("#AdditionalApproval").modal('show');
return false;
})
$('#additionalApproval').on('click', function () {
// get selected items.
var bfound = false;
var userids;
var itemsToAdd = $('#lstAdditionalApproval').jqxListBox('getSelectedItems');
if (itemsToAdd.length > 0) {
for (var i = 0; i < itemsToAdd.length; i++) {
if (itemsToAdd[i].label != undefined) {
var tempvalue = itemsToAdd[i].value;
var templabel = itemsToAdd[i].label;
if (userids == null)
userids = tempvalue;
else
userids += "~" + tempvalue;
}
};
if (userids != null) {
AssignAdditionalApproval(userids);
}
$("#AdditionalApproval").modal('hide');
return false;
}
});
var AssignAdditionalApproval = function (userids) {
//var ecnTypeString = '';
//if ($('#IsECN').is(':checked'))
// ecnTypeString = "ECN"
//else if ($('#IsTECN').is(':checked'))
// ecnTypeString = "TECN"
//else if ($('#IsEmergencyTECN').is(':checked'))
// ecnTypeString = "E-TECN"
var urlString = '/ECN/AddAdditionalApproval';
$.ajax({
type: "Post",
url: urlString,
data: {
userIDs: userids,
issueID: $("#txtECNNumber").val(),
step: $("#currentStep").val(),
docType: docType,
ecnTypeString: ecnTypeString
},
success: function (result) {
var grid = $("#ApproversList").data("kendoGrid");
grid.dataSource.read($('#txtECNNumber').val(), $("#currentStep").val());
},
error: function (result) {
alert("Failed " + result);
}
});
};
// Region Re-ASssign Approvers
$('#reAssignApprovers').on('click', function () {
// reset this variable to indicate that the current Approver of the document is the person Re-Assigning it to someone else.
reAssignFromUserid = "";
var url = "/ECN/GetAllUsersList";
var source =
{
datatype: "json",
datafields: [
{ name: 'UserID' },
{ name: 'FullName' }
],
id: 'id',
url: url,
};
var dataAdapter = new $.jqx.dataAdapter(source);
// Create a jqxListBox
$("#lstReAssignApproval").jqxListBox({
multipleextended: false, theme: "arctic", source: dataAdapter, displayMember: "FullName", valueMember: "UserID", width: 200, height: 250
});
$("#ReAssignApproval").modal('show');
return false;
})
$('#ConfirmReAssignment').on('click', function () {
// get selected items.
var bfound = false;
var userids;
var itemsToAdd = $('#lstReAssignApproval').jqxListBox('getSelectedItems');
if (itemsToAdd.length > 0) {
for (var i = 0; i < itemsToAdd.length; i++) {
if (itemsToAdd[i].label != undefined) {
var tempvalue = itemsToAdd[i].value;
var templabel = itemsToAdd[i].label;
if (userids == null)
userids = tempvalue;
else
userids += "~" + tempvalue;
}
};
//
if (userids != null) {
//alert(reAssignFromUserid);
if (reAssignFromUserid != '') {
ReAssignApprovalByAdmin(userids);
}
else {
ReAssignApproval(userids);
}
}
$("#ReAssignApproval").modal('hide');
return false;
}
});
var ReAssignApproval = function (userids) {
//var ecnTypeString = '';
//if ($('#IsECN').is(':checked'))
// ecnTypeString = "ECN"
//else if ($('#IsTECN').is(':checked'))
// ecnTypeString = "TECN"
//else if ($('#IsEmergencyTECN').is(':checked'))
// ecnTypeString = "E-TECN"
var urlString = '/ECN/ReAssignApproval';
$.ajax({
type: "Post",
url: urlString,
data: {
userIDs: userids,
issueID: $("#txtECNNumber").val(),
step: $("#currentStep").val(),
docType: docType,
ecnTypeString: ecnTypeString
},
success: function (result) {
//var grid = $("#ApproversList").data("kendoGrid");
//grid.dataSource.read($('#txtIssueID').val(), $("#currentStep").val());
var url = '@Url.Action("ReadOnly", "ECN", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtECNNumber").val());
},
error: function (result) {
alert("Failed " + result);
}
});
};
$("#DeleteDocument").on("click", function () {
var error = '';
//var ecnTypeString = '';
//if ($('#IsECN').is(':checked'))
// ecnTypeString = "ECN"
//else if ($('#IsTECN').is(':checked')) {
// ecnTypeString = "TECN"
//}
//else if ($('#IsEmergencyTECN').is(':checked')) {
// ecnTypeString = "E-TECN"
//}
if (confirm("Are you sure you want to delete this document?")) {
var urlString = '/ECN/DeleteDocument';
$.ajax({
type: "Post",
url: urlString,
data: {
ecnNumber: $("#txtECNNumber").val(),
ecnTypeString: ecnTypeString
},
success: function (result) {
var url = '@Url.Action("Index", "Home", new { tabName = "AllTasks" })';
window.location.href = url;
},
error: function (result) {
alert("Failed " + result);
}
});
}
});
$('#ReSubmitDocument').on('click', function () {
var isECN;
var expirationDate = $('#txtExpirationDate').val();
if ($('#IsECN').is(':checked'))
isECN = 1;
else
isECN = 0;
var isTECN;
if ($('#IsTECN').is(':checked'))
isTECN = 1;
else
isTECN = 0;
var isEmergencyTECN
if ($('#IsEmergencyTECN').is(':checked'))
isEmergencyTECN = 1;
else
isEmergencyTECN = 0;
var error = '';
if (isECN == 0 && isTECN == 0 && isEmergencyTECN == 0) {
error += 'You need to indicate whether the document is an ECN, TECN or an Emergency TECN \n';
}
if (isTECN && expirationDate == '') {
error += "Please enter an expiration date for this TECN ";
}
var categoryId = $("#CategoryID").data("kendoDropDownList").value();
if (categoryId < 1)
error += "Category must be specified\n";
if (error != '') {
alert("Before Re-Submitting the document..... \n" + error);
return false;
}
$.ajax({
url: "/ECN/ReSubmitDocument",
type: "GET",
datatype: "json",
data: {
ecnNumber: $("#txtECNNumber").val(),
documentType: docType,
ecnTypeString: ecnTypeString,
oldECNTypeString: $("#hidOldECNType").val(),
descriptionOfChange: $('#txtDescriptionOfChangeAdd').val(),
reasonForChange: $('#txtReasonForChangeAdd').val(),
categoryId: categoryId,
},
success: function (data) {
var arrdata = data.split('~');
var operation = (arrdata[0]);
var newECNNumber = arrdata[1];
if (operation == 'Redirect') {
var url = '@Url.Action("Edit", "ECN", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', newECNNumber);
}
else {
// TODO alert an error message
}
},
error: function (result) {
alert("Failed on Submit" + result);
}
});
return false;
});
var returnNoOfDays = function () {
//var start = new Date($('#txSubmitDate').val());
var start = new Date();
//if ($('#txtOldExtensionDate').val() != '')
//{
// start = $('#txtOldExtensionDate').val();
//}
var end = new Date($('#txtExtensionDate').val());
var diff = new Date(end - start);
// get days
var days = diff / 1000 / 60 / 60 / 24;
//alert(days);
return days
}
function DownloadAttachment(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var fileName = dataItem.FileName;
var attachmentID = dataItem.AttachmentID;
window.open('/ECN/DownloadFile?attachmentID=' + attachmentID + '&ecnNumber=' + "@Model.ECNNumber", '_blank');
}
$(window).bind("beforeunload", function () {
//return confirm("Do you really want to close?");
$.ajax({
url: "/ECN/ReleaseLockOnDocument",
type: "GET",
datatype: "json",
data: {
issueID: ("@Model.ECNNumber")
},
success: function () {
},
error: function (result) {
alert("ReleaseLockOnDocument - Failed " + result);
}
});
})
//=============================================================================================================
// the code is already in "~/Scripts/common.js", but for some reason IE 10 does not recognize the path, hence the duplication below==========================
@*var timoutWarning = 840000; // Display warning in 14 mins.
var timoutNow = 900000; // Timeout in 15 mins 1000 * 60 * 15 = 15 mins
var logoutUrl = '/Account/LogOff'; // URL to logout page.
var warningTimer;
var timeoutTimer;
// Start timers.
function StartTimers() {
warningTimer = setTimeout("IdleWarning()", timoutWarning);
timeoutTimer = setTimeout("IdleTimeout()", timoutNow);
}
// Reset timers.
function ResetTimers() {
clearTimeout(warningTimer);
clearTimeout(timeoutTimer);
StartTimers();
}
// Show idle timeout warning dialog.
function IdleWarning() {
$("#timeout").modal('show');
}
function IdleTimeout() {
//window.location = logoutUrl;
var url = '@Url.Action("MyTasks", "Home")';
window.location.href = url;
}*@
//------================================================= End of duplication
</script>