initial add
This commit is contained in:
106
Fab2ApprovalSystem/Views/ChangeControl/_CCReassignOwner.cshtml
Normal file
106
Fab2ApprovalSystem/Views/ChangeControl/_CCReassignOwner.cshtml
Normal file
@ -0,0 +1,106 @@
|
||||
<div class="modal fade" id="ReAssignOwner" 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">Re-Assign Owner From: <label class="bg-danger" id="ReAssignOwnerFromLabel">Me</label></h4>
|
||||
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="control-group">
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
<h4 class="modal-title" id="myModalLabel">Re-Assign Owner to:</h4>
|
||||
<div id='lstReAssignOwner'>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<h4 class="modal-title">Comments (Required):</h4>
|
||||
<textarea class="form-control" rows="5" id="comments" style="resize: none;"></textarea>
|
||||
</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="ConfirmOwnerReAssignment">Confirm Re-assignment</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#lnkReassignOwner").click(function (e) {
|
||||
|
||||
$("#ReAssignOwnerFromLabel").text($("#txtOwner").val());
|
||||
$("#comments").val("");
|
||||
|
||||
var dataAdapter = new $.jqx.dataAdapter({
|
||||
datatype: "json",
|
||||
datafields: [
|
||||
{ name: "UserID" },
|
||||
{ name: "FullName" }
|
||||
],
|
||||
id: 'id',
|
||||
url: "/ChangeControl/GetAllUsersList",
|
||||
});
|
||||
|
||||
$("#lstReAssignOwner").jqxListBox({
|
||||
multipleextended: false,
|
||||
theme: "arctic",
|
||||
source: dataAdapter,
|
||||
displayMember: "FullName",
|
||||
valueMember: "UserID",
|
||||
width: 200,
|
||||
height: 200
|
||||
});
|
||||
|
||||
$("#ReAssignOwner").modal('show');
|
||||
});
|
||||
|
||||
$('#ConfirmOwnerReAssignment').on('click', function () {
|
||||
|
||||
if ($('#lstReAssignOwner').jqxListBox('getSelectedItem') == null) {
|
||||
alert("You must select a new owner");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($("#comments").val() == "") {
|
||||
alert("Comments are required");
|
||||
return;
|
||||
}
|
||||
|
||||
$('#ConfirmOwnerReAssignment').attr("disabled", true);
|
||||
|
||||
$.ajax({
|
||||
url: "/ChangeControl/ReAssignOwnerByAdmin",
|
||||
type: "POST",
|
||||
datatype: "json",
|
||||
data: {
|
||||
planNumber: $("#txtPlanNumber").val(),
|
||||
comments: $("#comments").val(),
|
||||
newOwnerId: $("#lstReAssignOwner").jqxListBox("getSelectedItem").value,
|
||||
},
|
||||
success: function (data) {
|
||||
|
||||
$("#ReAssignOwner").modal('hide');
|
||||
|
||||
var pn = $("#txtPlanNumber").val().replace(/[^0-9]/g, '');
|
||||
|
||||
var url = '@Url.Action("Edit", "ChangeControl", new { issueID = "__id__" })';
|
||||
url = url.replace('amp;', '');
|
||||
window.location.href = url.replace('__id__', pn);
|
||||
|
||||
},
|
||||
error: function (result) {
|
||||
$('#ConfirmOwnerReAssignment').attr("disabled", false);
|
||||
alert("Server error while changing owner");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user