Added manager view for setting OOO status for employees. The OOO status for the employees will reflect on the training report as well.
This commit is contained in:
parent
0dd3d4ec2a
commit
adad38b849
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -123,6 +123,7 @@ namespace Fab2ApprovalSystem.Controllers
|
|||||||
Session[GlobalVars.SESSION_USERID] = user.UserID;
|
Session[GlobalVars.SESSION_USERID] = user.UserID;
|
||||||
Session[GlobalVars.SESSION_USERNAME] = user.FullName;
|
Session[GlobalVars.SESSION_USERNAME] = user.FullName;
|
||||||
Session[GlobalVars.IS_ADMIN] = user.IsAdmin;
|
Session[GlobalVars.IS_ADMIN] = user.IsAdmin;
|
||||||
|
Session[GlobalVars.IS_MANAGER] = user.IsManager;
|
||||||
Session[GlobalVars.OOO] = user.OOO;
|
Session[GlobalVars.OOO] = user.OOO;
|
||||||
Session[GlobalVars.CAN_CREATE_PARTS_REQUEST] = user.IsAdmin || PartsRequestController.CanCreatePartsRequest(user.UserID);
|
Session[GlobalVars.CAN_CREATE_PARTS_REQUEST] = user.IsAdmin || PartsRequestController.CanCreatePartsRequest(user.UserID);
|
||||||
|
|
||||||
|
37
Fab2ApprovalSystem/Controllers/ManagerController.cs
Normal file
37
Fab2ApprovalSystem/Controllers/ManagerController.cs
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.Mvc;
|
||||||
|
using Fab2ApprovalSystem.DMO;
|
||||||
|
using Fab2ApprovalSystem.Misc;
|
||||||
|
|
||||||
|
namespace Fab2ApprovalSystem.Controllers
|
||||||
|
{
|
||||||
|
[Authorize]
|
||||||
|
[SessionExpireFilter]
|
||||||
|
public class ManagerController : Controller
|
||||||
|
{
|
||||||
|
UserAccountDMO userDMO = new UserAccountDMO();
|
||||||
|
AdminDMO adminDMO = new AdminDMO();
|
||||||
|
TrainingDMO trainingDMO = new TrainingDMO();
|
||||||
|
LotDispositionDMO ldDMO = new LotDispositionDMO();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public ActionResult Index()
|
||||||
|
{
|
||||||
|
|
||||||
|
if ((bool)Session[GlobalVars.IS_MANAGER])
|
||||||
|
{
|
||||||
|
var model = userDMO.GetAllUsers();
|
||||||
|
ViewBag.AllActiveUsers = userDMO.GetAllActiveUsers();
|
||||||
|
return View(model);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return Content("Not Autthorized");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -737,7 +737,7 @@ namespace Fab2ApprovalSystem.Controllers
|
|||||||
emailBody += "<tr><td>" + assignment.FullName + "</td><td>" + DateAssigned + "</td>";
|
emailBody += "<tr><td>" + assignment.FullName + "</td><td>" + DateAssigned + "</td>";
|
||||||
|
|
||||||
if (userDMO.GetUserByID(assignment.UserID).OOO)
|
if (userDMO.GetUserByID(assignment.UserID).OOO)
|
||||||
emailBody += "<td>X</td>";
|
emailBody += "<td style=\"text-align:center;\">X</td>";
|
||||||
else
|
else
|
||||||
emailBody += "<td></td>";
|
emailBody += "<td></td>";
|
||||||
|
|
||||||
|
@ -100,6 +100,7 @@
|
|||||||
<Compile Include="Controllers\ChangeControlController.cs" />
|
<Compile Include="Controllers\ChangeControlController.cs" />
|
||||||
<Compile Include="Controllers\CorrectiveActionController.cs" />
|
<Compile Include="Controllers\CorrectiveActionController.cs" />
|
||||||
<Compile Include="Controllers\ECNController.cs" />
|
<Compile Include="Controllers\ECNController.cs" />
|
||||||
|
<Compile Include="Controllers\ManagerController.cs" />
|
||||||
<Compile Include="Controllers\PartsRequestController.cs" />
|
<Compile Include="Controllers\PartsRequestController.cs" />
|
||||||
<Compile Include="Controllers\ReportsController.cs" />
|
<Compile Include="Controllers\ReportsController.cs" />
|
||||||
<Compile Include="Controllers\HomeController.cs" />
|
<Compile Include="Controllers\HomeController.cs" />
|
||||||
@ -1847,6 +1848,8 @@
|
|||||||
<Content Include="Views\Admin\JobSchedulerConfiguration.cshtml" />
|
<Content Include="Views\Admin\JobSchedulerConfiguration.cshtml" />
|
||||||
<Content Include="Views\Admin\TrainingReportConfig.cshtml" />
|
<Content Include="Views\Admin\TrainingReportConfig.cshtml" />
|
||||||
<Content Include="Views\Admin\TECNNotificationConfig.cshtml" />
|
<Content Include="Views\Admin\TECNNotificationConfig.cshtml" />
|
||||||
|
<Content Include="Views\Manager\Index.cshtml" />
|
||||||
|
<Content Include="Views\Manager\_ManagerLayout.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="App_Data\" />
|
<Folder Include="App_Data\" />
|
||||||
|
@ -14,6 +14,7 @@ namespace Fab2ApprovalSystem.Misc
|
|||||||
public const string SESSION_USERID = "UserID";
|
public const string SESSION_USERID = "UserID";
|
||||||
public const string ECN_VIEW_OPTION = "ECN_ViewOption";
|
public const string ECN_VIEW_OPTION = "ECN_ViewOption";
|
||||||
public const string IS_ADMIN = "IsAdmin";
|
public const string IS_ADMIN = "IsAdmin";
|
||||||
|
public const string IS_MANAGER = "IsManager";
|
||||||
public const string OOO = "OOO";
|
public const string OOO = "OOO";
|
||||||
public const string SUCCESS = "Success";
|
public const string SUCCESS = "Success";
|
||||||
public const string CAN_CREATE_PARTS_REQUEST = "CanCreatePartsRequest";
|
public const string CAN_CREATE_PARTS_REQUEST = "CanCreatePartsRequest";
|
||||||
|
@ -23,6 +23,7 @@ namespace Fab2ApprovalSystem.Models
|
|||||||
public string FullName { get; set; }
|
public string FullName { get; set; }
|
||||||
|
|
||||||
public bool IsAdmin { get; set; }
|
public bool IsAdmin { get; set; }
|
||||||
|
public bool IsManager { get; set; }
|
||||||
public bool IsActive { get; set; }
|
public bool IsActive { get; set; }
|
||||||
public DateTime? LastLogin { get; set; }
|
public DateTime? LastLogin { get; set; }
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
columns.Bound(l => l.IsActive);
|
columns.Bound(l => l.IsActive);
|
||||||
//columns.Template(@<text></text>).ClientTemplate("<input type='checkbox' #= IsActive ? checked='checked':'' # class='chkbx' />");
|
//columns.Template(@<text></text>).ClientTemplate("<input type='checkbox' #= IsActive ? checked='checked':'' # class='chkbx' />");
|
||||||
columns.Bound(l => l.IsAdmin);
|
columns.Bound(l => l.IsAdmin);
|
||||||
|
columns.Bound(l => l.IsManager);
|
||||||
|
|
||||||
columns.Bound(l => l.LastLogin).Format("{0:MM/dd/yy hh:mm:ss}");
|
columns.Bound(l => l.LastLogin).Format("{0:MM/dd/yy hh:mm:ss}");
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@
|
|||||||
model.Id(p => p.ID);
|
model.Id(p => p.ID);
|
||||||
})
|
})
|
||||||
.PageSize(50)
|
.PageSize(50)
|
||||||
.Read(read => read.Action("Attach_Read", "CorrectiveAction", new { caNO = Model.CANo }))
|
.Read(read => read.Action("Attachment_Read", "CorrectiveAction", new { caNO = Model.CANo }))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
</div>
|
</div>
|
||||||
|
@ -305,20 +305,6 @@
|
|||||||
</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">
|
|
||||||
<input type="checkbox" name="AddDelegate" id="AddDelegate" value="false" onclick="toggleDelegate()" />
|
|
||||||
<label for="AddDelegate">Add Delegate?</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<div class="row hideControl" id="DelegateLabel">
|
<div class="row hideControl" id="DelegateLabel">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
@ -513,15 +499,8 @@
|
|||||||
$('#SaveOOOInfo').on('click', function () {
|
$('#SaveOOOInfo').on('click', function () {
|
||||||
var tab = $('#currentTab').val();
|
var tab = $('#currentTab').val();
|
||||||
var bfound = false;
|
var bfound = false;
|
||||||
var delegate = "";
|
|
||||||
|
|
||||||
var checkbox = $('#AddDelegate').is(":checked");
|
if (userid == $("#DelegateTo").data("kendoDropDownList").value()) {
|
||||||
|
|
||||||
if (checkbox === true) {
|
|
||||||
delegate = $("#DelegateTo").data("kendoDropDownList").value();
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
@ -603,15 +582,6 @@
|
|||||||
//grid.removeRow($(element));
|
//grid.removeRow($(element));
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleDelegate() {
|
|
||||||
var control = document.getElementById("DelegateControl");
|
|
||||||
var label = document.getElementById("DelegateLabel");
|
|
||||||
|
|
||||||
control.classList.toggle("hideControl");
|
|
||||||
label.classList.toggle("hideControl");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function showReAssignRole(_pendingApprovers, _closeDate, _issueID, _docType, _submitDate) {
|
function showReAssignRole(_pendingApprovers, _closeDate, _issueID, _docType, _submitDate) {
|
||||||
//alert(_closeDate);;
|
//alert(_closeDate);;
|
||||||
//alert(_pendingApprovers);
|
//alert(_pendingApprovers);
|
||||||
|
@ -148,7 +148,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
@ -217,12 +216,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@*<div class="col-sm-6">
|
@*<div class="col-sm-6">
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="test"/>
|
<input type="text" id="test"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>*@
|
</div>*@
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
@ -313,7 +312,6 @@
|
|||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
$('#SaveOOOInfo').on('click', function () {
|
$('#SaveOOOInfo').on('click', function () {
|
||||||
var tab = $('#currentTab').val();
|
var tab = $('#currentTab').val();
|
||||||
var bfound = false;
|
var bfound = false;
|
||||||
|
594
Fab2ApprovalSystem/Views/Manager/Index.cshtml
Normal file
594
Fab2ApprovalSystem/Views/Manager/Index.cshtml
Normal file
@ -0,0 +1,594 @@
|
|||||||
|
@model IEnumerable<Fab2ApprovalSystem.Models.LoginModel>
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewBag.Title = "Index";
|
||||||
|
}
|
||||||
|
|
||||||
|
@{
|
||||||
|
Layout = "_ManagerLayout.cshtml";
|
||||||
|
}
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/Content/kendo/kendo.blueopal.min.css" />
|
||||||
|
<link rel="stylesheet" href="~/Content/kendogridcustom.css" />
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.k-grid-edit-row input {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.k-grid .k-grid-header .k-header .k-link {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.k-grid .k-grid-header .k-header {
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.k-grid .k-edit-cell input {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hiddenDelegate {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*InLine Edit Mode*/
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div id="userListdiv" class="k-content">
|
||||||
|
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.LoginModel>()
|
||||||
|
.Name("userList")
|
||||||
|
.Columns(columns =>
|
||||||
|
{
|
||||||
|
columns.Bound(l => l.UserID).Visible(false);
|
||||||
|
columns.Bound(l => l.FirstName);
|
||||||
|
columns.Bound(l => l.LastName);
|
||||||
|
columns.Bound(l => l.Email);
|
||||||
|
columns.Bound(l => l.IsActive);
|
||||||
|
//columns.Template(@<text></text>).ClientTemplate("<input type='checkbox' #= IsActive ? checked='checked':'' # class='chkbx' />");
|
||||||
|
|
||||||
|
columns.Bound(l => l.LastLogin).Format("{0:MM/dd/yy hh:mm:ss}");
|
||||||
|
|
||||||
|
// columns.Command(command => { command.Edit(); command.Destroy(); }).Width("200px");
|
||||||
|
|
||||||
|
|
||||||
|
columns.Bound(l => l.OOO);
|
||||||
|
columns.Bound(l => l.OOOStartDate).Format("{0:MM/dd/yy hh:mm:ss}").Width("150px");
|
||||||
|
columns.Bound(l => l.OOOExpirationDate).Format("{0:MM/dd/yy hh:mm:ss}").Width("150px");
|
||||||
|
columns.Bound(l => l.DelegatedTo).Visible(false);
|
||||||
|
columns.Bound(l => l.DelegatedToFullName);
|
||||||
|
columns.Bound(p => p.OOOStatusWithUserID).ClientTemplate("#=buildButtons(OOOStatusWithUserID)#").Width(120);
|
||||||
|
//columns.Template(p => { }).HeaderTemplate("").ClientTemplate(@"
|
||||||
|
//<input type='button' value='Approval Groups' class='btn btn-primary btn-xs' onclick='ShowApprovalGroup(" + l => + ")'/>");
|
||||||
|
})
|
||||||
|
.HtmlAttributes(new { style = "height: 500px;" })
|
||||||
|
.Scrollable()
|
||||||
|
.Resizable(resize => resize.Columns(true))
|
||||||
|
.Groupable()
|
||||||
|
.Sortable()
|
||||||
|
.Filterable()
|
||||||
|
.Pageable(pageable => pageable
|
||||||
|
.Refresh(true)
|
||||||
|
.PageSizes(true)
|
||||||
|
.ButtonCount(5))
|
||||||
|
.DataSource(dataSource => dataSource
|
||||||
|
|
||||||
|
.Ajax().ServerOperation(false)
|
||||||
|
.Events(events => events.Error("error_handler"))
|
||||||
|
.Model(model =>
|
||||||
|
{
|
||||||
|
model.Id(l => l.UserID);
|
||||||
|
model.Field(p => p.UserID).Editable(false);
|
||||||
|
model.Field(l => l.LastLogin).Editable(false);
|
||||||
|
model.Field(l => l.OOO).Editable(false);
|
||||||
|
model.Field(l => l.OOOStartDate).Editable(false);
|
||||||
|
model.Field(l => l.OOOExpirationDate).Editable(false);
|
||||||
|
model.Field(l => l.DelegatedToFullName).Editable(false);
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
.PageSize(50)
|
||||||
|
.Read(read => read.Action("GetGridUserList", "Admin"))
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
)
|
||||||
|
@*@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.LoginModel>()
|
||||||
|
.Name("Grid")
|
||||||
|
.Columns(columns =>
|
||||||
|
{
|
||||||
|
columns.Bound(l => l.UserID).Visible(false);
|
||||||
|
columns.Bound(l => l.LoginID);
|
||||||
|
columns.Bound(l => l.FirstName);
|
||||||
|
columns.Bound(l => l.LastName);
|
||||||
|
columns.Bound(l => l.IsAdmin);
|
||||||
|
columns.Bound(l => l.LastLogin).Format("{0:MM/dd/yy hh:mm:ss}");
|
||||||
|
columns.Bound(l => l.OOO);
|
||||||
|
columns.Bound(l => l.OOOStartDate).Format("{0:MM/dd/yy hh:mm:ss}").Width("150px");
|
||||||
|
columns.Bound(l => l.OOOExpirationDate).Format("{0:MM/dd/yy hh:mm:ss}").Width("150px");
|
||||||
|
columns.Bound(l => l.DelegatedTo).Visible(false);
|
||||||
|
columns.Bound(l => l.DelegatedToFullName);
|
||||||
|
columns.Bound(p => p.OOOStatusWithUserID).ClientTemplate("#=buildButtons(OOOStatusWithUserID)#").Width(120);
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
.ToolBar(toolbar =>
|
||||||
|
{
|
||||||
|
toolbar.Create();
|
||||||
|
toolbar.Save();
|
||||||
|
})
|
||||||
|
.Editable(editable => editable.Mode(GridEditMode.InCell))
|
||||||
|
.Pageable()
|
||||||
|
.Navigatable()
|
||||||
|
.Sortable()
|
||||||
|
.Scrollable()
|
||||||
|
.DataSource(dataSource => dataSource
|
||||||
|
.Ajax()
|
||||||
|
.Batch(true)
|
||||||
|
.PageSize(20)
|
||||||
|
.ServerOperation(false)
|
||||||
|
//.Events(events => events.Error("error_handler"))
|
||||||
|
.Model(model => model.Id(p => p.UserID))
|
||||||
|
.Read(read => read.Action("GetGridUserList", "Admin"))
|
||||||
|
.Create(update => update.Action("InsertUser", "Admin"))
|
||||||
|
.Update(update => update.Action("BatchUpdateUser", "Admin"))
|
||||||
|
.Destroy(destroy => destroy.Action("DeleteUser", "Admin"))
|
||||||
|
)
|
||||||
|
)*@
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal fade" id="OOODialog" 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">×</button>
|
||||||
|
@*<h4 class="modal-title" id="myModalLabel">Out Of Office for user:</h4>*@
|
||||||
|
<label style="color: #36940a; font-weight: bold; font-size: 16px; " id="currentUser"></label>
|
||||||
|
</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 hiddenDelegate" id="delegateControl">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="controls">
|
||||||
|
<div class="controls">
|
||||||
|
@(Html.Kendo().DropDownList()
|
||||||
|
.Name("DelegateTo")
|
||||||
|
.HtmlAttributes(new { style = "width: 250px" })
|
||||||
|
.DataTextField("FullName")
|
||||||
|
.DataValueField("UserID")
|
||||||
|
.DataSource(source =>
|
||||||
|
{
|
||||||
|
source.Read(read =>
|
||||||
|
{
|
||||||
|
read.Action("GetAllUserList", "Admin");
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="controls">
|
||||||
|
<label for="CurrentUser">Start Date:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="controls">
|
||||||
|
<div class="controls">
|
||||||
|
<label for="CurrentUser">End Date:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="controls">
|
||||||
|
@(Html.Kendo().DatePicker()
|
||||||
|
.Name("txtStartDate")
|
||||||
|
//.Value()
|
||||||
|
)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="controls">
|
||||||
|
@(Html.Kendo().DatePicker()
|
||||||
|
.Name("txtEndDate")
|
||||||
|
//.Value()
|
||||||
|
)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</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="SaveOOOInfo">Save</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function toggleDelegate() {
|
||||||
|
document.getElementById("delegateControl").classList.toggle("hiddenDelegate");
|
||||||
|
document.getElementById("delegateLabel").classList.toggle("hiddenDelegate");
|
||||||
|
}
|
||||||
|
|
||||||
|
function error_handler(e) {
|
||||||
|
alert("Error during the operation");
|
||||||
|
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 userid = "";
|
||||||
|
function onEdit(e) {
|
||||||
|
|
||||||
|
$(e.container).find("td:last").html("<a href='javascript: void(0)' class='abutton update' onclick='updateRow()' title='button update'>button update</a> " +
|
||||||
|
"<a href='javascript: void(0)' class='abutton cancel' onclick='cancelRow()' title='button cancel'>button cancel</a>");
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancelRow() {
|
||||||
|
grid = $("#userList").data("kendoGrid");
|
||||||
|
grid.cancelRow();
|
||||||
|
}
|
||||||
|
|
||||||
|
function editRow(element) {
|
||||||
|
grid = $("#userList").data("kendoGrid");
|
||||||
|
grid.editRow($(element).closest("tr"));
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateRow() {
|
||||||
|
grid = $("#userList").data("kendoGrid");
|
||||||
|
grid.saveRow();
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteRow(element, userId) {
|
||||||
|
grid = $("#userList").data("kendoGrid");
|
||||||
|
|
||||||
|
console.log(userId);
|
||||||
|
|
||||||
|
$("#DeletedUserIDHidden").val(userId);
|
||||||
|
$("#SubRoleListReAssign").data("kendoGrid").dataSource.read();
|
||||||
|
$("#ReAssignApprovalGroups").modal('show');
|
||||||
|
//var ds = grid.dataSource;
|
||||||
|
//var dataItem = grid.dataItem($(element.target).closest("tr"));
|
||||||
|
//var rowViewIndex = $(element).closest("tr").index();
|
||||||
|
//var index = ((ds.page() - 1) * ds.pageSize()) + rowViewIndex;
|
||||||
|
|
||||||
|
//var myRowData = $("#userList").data().kendoGrid.dataSource.at(index);
|
||||||
|
//console.log(myRowData);
|
||||||
|
|
||||||
|
//grid.data.
|
||||||
|
|
||||||
|
//grid.removeRow($(element).closest("tr"));
|
||||||
|
}
|
||||||
|
|
||||||
|
function createRow() {
|
||||||
|
grid = $("#userList").data("kendoGrid");
|
||||||
|
grid.addRow();
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildButtons(oooStatusWithUserID) {
|
||||||
|
|
||||||
|
var uid = oooStatusWithUserID.split('~')[0];
|
||||||
|
var oooStatus = oooStatusWithUserID.split('~')[1];
|
||||||
|
var userName = oooStatusWithUserID.split('~')[2];
|
||||||
|
|
||||||
|
var template = "";
|
||||||
|
if (oooStatus == '0') {
|
||||||
|
|
||||||
|
template = "<input type='button' value='Set OOO ' class='btn btn-primary btn-xs' id='" + uid + "-" + userName + "'" + "onclick='SetOOOStatus(this)'/>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
template = "<input type='button' value='Expire OOO' class='btn btn-warning btn-xs' id='" + uid + "-" + userName + "'" + "onclick='Expire(this)'/>";
|
||||||
|
}
|
||||||
|
|
||||||
|
return template;
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildShowGroupsButton(UserID) {
|
||||||
|
|
||||||
|
var uid = oooStatusWithUserID.split('~')[0];
|
||||||
|
|
||||||
|
|
||||||
|
var template = "";
|
||||||
|
template = "<input type='button' value='Edit Approval Groups ' class='btn btn-primary btn-xs' id='" + UserID + "' " + "onclick='ShowApprovalGroup(this)'/>";
|
||||||
|
|
||||||
|
return template;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function SetOOOStatus(e) {
|
||||||
|
$("#txtStartDate").val('');
|
||||||
|
$("#txtEndDate").val('');
|
||||||
|
|
||||||
|
|
||||||
|
id = e.id;
|
||||||
|
userid = id.split('-')[0];
|
||||||
|
var userName = id.split('-')[1];
|
||||||
|
$('#currentUser').text("Out Of Office for user: " + userName);
|
||||||
|
$("#OOODialog").modal('show');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$('#SaveOOOInfo').on('click', function () {
|
||||||
|
var bfound = false;
|
||||||
|
//var currentDate = new Date();
|
||||||
|
var delegate = "";
|
||||||
|
var isChecked = $("#AssignDelegate").is(":checked");
|
||||||
|
|
||||||
|
console.log(isChecked);
|
||||||
|
|
||||||
|
if (isChecked === true)
|
||||||
|
delegate = $("#DelegateTo").data("kendoDropDownList").value();
|
||||||
|
|
||||||
|
else
|
||||||
|
delegate = "0";
|
||||||
|
|
||||||
|
console.log(delegate);
|
||||||
|
|
||||||
|
|
||||||
|
if (userid == delegate)
|
||||||
|
{
|
||||||
|
alert('The OOO person cannot be same as the delegate to person');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var fullDate = new Date()
|
||||||
|
|
||||||
|
//convert month to 2 digits
|
||||||
|
var twoDigitMonth = ((fullDate.getMonth().length + 1) === 1) ? (fullDate.getMonth() + 1) : '0' + (fullDate.getMonth() + 1);
|
||||||
|
|
||||||
|
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');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var stDateEntered = $("#txtStartDate").val();
|
||||||
|
var arrStDate = stDateEntered.split('/');
|
||||||
|
var stDate = new Date(arrStDate[2], arrStDate[0] - 1, arrStDate[1]);
|
||||||
|
|
||||||
|
var endDateEntered = $("#txtEndDate").val();
|
||||||
|
var arrEndDate = endDateEntered.split('/');
|
||||||
|
var endDate = new Date(arrEndDate[2], arrEndDate[0] - 1, arrEndDate[1]);
|
||||||
|
|
||||||
|
|
||||||
|
if (stDate < currentDate) {
|
||||||
|
alert("Start Date should be greater than the or equal to Current Date ");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (endDate <= stDate) {
|
||||||
|
|
||||||
|
alert("The End Date should be greater than the Start Date ");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#OOODialog").modal('hide');
|
||||||
|
|
||||||
|
var urlString = '/Admin/EnableOOOStatus';
|
||||||
|
$.ajax({
|
||||||
|
type: "Post",
|
||||||
|
url: urlString,
|
||||||
|
data: {
|
||||||
|
oooUserID: userid,
|
||||||
|
delegatedTo: delegate,
|
||||||
|
startDate: $("#txtStartDate").val(),
|
||||||
|
endDate: $("#txtEndDate").val(),
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
if (result == "3") {
|
||||||
|
alert('The user which you selected for Delegation is already a delegator for another user\n Please select a different user for Delgation')
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var grid = $("#userList").data("kendoGrid");
|
||||||
|
grid.dataSource.read();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (result) {
|
||||||
|
alert("Failed " + result);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
function Expire(e) {
|
||||||
|
id = e.id;
|
||||||
|
userid = id.split('-')[0];
|
||||||
|
var userName = id.split('-')[1];
|
||||||
|
|
||||||
|
if (confirm('Are you sure you want to expire the OOO setting for user: ' + userName))
|
||||||
|
{
|
||||||
|
var urlString = '/Admin/ExpireOOOStatus';
|
||||||
|
$.ajax({
|
||||||
|
type: "Post",
|
||||||
|
url: urlString,
|
||||||
|
data: {
|
||||||
|
oooUserID: userid
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
var grid = $("#userList").data("kendoGrid");
|
||||||
|
grid.dataSource.read();
|
||||||
|
},
|
||||||
|
error: function (result) {
|
||||||
|
alert("Failed " + result);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function ShowApprovalGroup(UserId) {
|
||||||
|
|
||||||
|
$("#UserIDHidden").val(UserId);
|
||||||
|
$("#SubRoleList").data("kendoGrid").dataSource.read();
|
||||||
|
$("#UserApprovalGroupsDialog").modal('show');
|
||||||
|
}
|
||||||
|
function ShowApprovalGroupReAssign(UserId) {
|
||||||
|
|
||||||
|
$("#DeletedUserIDHidden").val(UserId);
|
||||||
|
$("#SubRoleListReAssign").data("kendoGrid").dataSource.read();
|
||||||
|
$("#UserApprovalGroupsDialog").modal('show');
|
||||||
|
}
|
||||||
|
function GetUserID() {
|
||||||
|
var userId = $("#UserIDHidden").val();
|
||||||
|
return { userId : userId};
|
||||||
|
}
|
||||||
|
function GetDeletedUserID()
|
||||||
|
{
|
||||||
|
var userId = $("#DeletedUserIDHidden").val();
|
||||||
|
return { userId: userId };
|
||||||
|
}
|
||||||
|
function ShowUserTasks(UserId) {
|
||||||
|
$("#TaskUserIDHidden").val(UserId);
|
||||||
|
$("#UserTaskList").data("kendoGrid").dataSource.read();
|
||||||
|
$("#UserAssignedTasksDialog").modal('show');
|
||||||
|
}
|
||||||
|
function GetTaskListUserID() {
|
||||||
|
var userId = $("#TaskUserIDHidden").val();
|
||||||
|
return { userId: userId };
|
||||||
|
}
|
||||||
|
function ShowRoleUserSelector(SubRoleID) {
|
||||||
|
var userBeingDeleted = $("#DeletedUserIDHidden").val()
|
||||||
|
$("#hiddenRoleId").val(SubRoleID);
|
||||||
|
$("#RoleReAssignPromptDeletedUserHidden").val(userBeingDeleted)
|
||||||
|
$("#RoleReAssignPrompt").modal('show');
|
||||||
|
}
|
||||||
|
function SubmitRoleAssignment() {
|
||||||
|
var userToAssign = $("#selectedUserToReassign").data("kendoDropDownList").value();
|
||||||
|
var roleToAssign = $("#hiddenRoleId").val();
|
||||||
|
var userBeingDeleted = $("#RoleReAssignPromptDeletedUserHidden").val();
|
||||||
|
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/Admin/ReplaceUserRoles",
|
||||||
|
type: "POST",
|
||||||
|
datatype: "json",
|
||||||
|
data: {
|
||||||
|
subRole: roleToAssign,
|
||||||
|
users: userToAssign
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
alert(data);
|
||||||
|
DeleteUserFromRole(roleToAssign, userBeingDeleted);
|
||||||
|
$("#RoleReAssignPrompt").modal('hide');
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function (result) {
|
||||||
|
alert("Failed " + result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
function DeleteUserFromRole(subRoleId, userId) {
|
||||||
|
$.ajax({
|
||||||
|
url: "/Admin/DeleteUserRoles",
|
||||||
|
type: "POST",
|
||||||
|
datatype: "json",
|
||||||
|
data: {
|
||||||
|
subRole: subRoleId,
|
||||||
|
users: userId
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
$("#SubRoleListReAssign").data("kendoGrid").dataSource.read();
|
||||||
|
return;
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function (result) {
|
||||||
|
alert("Failed " + result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function InactivateUser() {
|
||||||
|
if (confirm("Are you sure you wish to de-activate this user?")) {
|
||||||
|
var userId = $("#DeletedUserIDHidden").val();
|
||||||
|
$.ajax({
|
||||||
|
url: "/Admin/DeleteUser",
|
||||||
|
type: "POST",
|
||||||
|
datatype: "json",
|
||||||
|
data: {
|
||||||
|
userId: userId
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
alert(data);
|
||||||
|
$("#ReAssignApprovalGroups").modal('hide');
|
||||||
|
$("#userList").data("kendoGrid").dataSource.read();
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function (result) {
|
||||||
|
alert("Failed " + result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
65
Fab2ApprovalSystem/Views/Manager/_ManagerLayout.cshtml
Normal file
65
Fab2ApprovalSystem/Views/Manager/_ManagerLayout.cshtml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<title>@ViewBag.Title - Mesa Approval</title>
|
||||||
|
@Styles.Render("~/Content/kendo/css")
|
||||||
|
@Styles.Render("~/Content/css")
|
||||||
|
@*@Styles.Render("~/Content/jqw/css")*@
|
||||||
|
|
||||||
|
|
||||||
|
@Scripts.Render("~/bundles/modernizr")
|
||||||
|
@Scripts.Render("~/bundles/jquery")
|
||||||
|
@Scripts.Render("~/bundles/kendo")
|
||||||
|
|
||||||
|
|
||||||
|
@*<script src="~/Scripts/bootstrap.js"></script>
|
||||||
|
<script src="~/Scripts/respond.js"></script>*@
|
||||||
|
@Scripts.Render("~/bundles/bootstrap")
|
||||||
|
@*@Scripts.Render("~/Content/jqw/jq")*@
|
||||||
|
<script src="~/Scripts/excel-bootstrap-table-filter-bundle.js"></script>
|
||||||
|
<script src="~/Scripts/moment.js"></script>
|
||||||
|
<link rel="stylesheet" href="~/Content/excel-bootstrap-table-filter-style.css" />
|
||||||
|
</head>
|
||||||
|
<body class="navbar-inner">
|
||||||
|
<div class=" navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div >
|
||||||
|
<div class="navbar-header">
|
||||||
|
@if (Request.IsAuthenticated) {
|
||||||
|
@*@Html.ActionLink("Home", "Index", "Home", new { tabName = "MyTasks" }, new { @class = "navbar-brand" })*@
|
||||||
|
@Html.ActionLink("Home", "MyTasks", "Home", null, new { @class = "navbar-brand" })
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="navbar-collapse collapse">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
@if ((bool)@Session[GlobalVars.IS_ADMIN])
|
||||||
|
{
|
||||||
|
<li>@Html.ActionLink("Admin", "Index", "Admin")</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
@Html.Partial("_LoginPartial")
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@(Html.Kendo().Menu()
|
||||||
|
.Name("menu")
|
||||||
|
.HtmlAttributes(new { style = "width:100%; font-size: 12px" })
|
||||||
|
.Items(menu =>
|
||||||
|
{
|
||||||
|
menu.Add().Text("Manage Users").Action("Index", "Manager");
|
||||||
|
}))
|
||||||
|
<div>
|
||||||
|
@RenderBody()
|
||||||
|
@*<hr />*@
|
||||||
|
<footer >
|
||||||
|
<p>© @DateTime.Now.Year - Infineon Technologies</p>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@RenderSection("scripts", required: false)
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
x
Reference in New Issue
Block a user