EnVisageOnline/Beta/Source/EnVisage/Views/Team/Index.cshtml

124 lines
3.7 KiB
Plaintext

@using EnVisage.Code.HtmlHelpers
@using Microsoft.AspNet.Identity
@using EnVisage.Code
@{
ViewBag.Title = "Teams";
}
@section scripts
{
<script type="text/javascript">
var ctr = 0;
var CompanyesArr = new Array();
init.push(function () {
$('#teams').dataTable({
"bProcessing": true,
"bServerSide": true,
"bAutoWidth" : false,
"sAjaxSource": document.URL,
"sServerMethod": "POST",
"aoColumns": [
{ "mDataProp": "Name" },
{ "mDataProp": "Comany" },
{ "mDataProp": "Users" },
{
"mData": function (data, type, full) {
if(data.CostCenterNumber != "")
return data.CostCenter + " (" + data.CostCenterNumber + ")";
else
return data.CostCenter;
}
},
{ "mDataProp": "GLAccount" },
{ "mDataProp": "ReportTo" },
{
"mData": function (data, type, full) {
@if (Html.CheckSecurityObjectPermission(Areas.Views, AccessLevel.Write))
{
<text>
ctr++;
var text = '<a id="btnEdit' + ctr + '" onclick="return CheckLock(this.id, \'Clients\', \'_rplcmnt_\')" data-toggle="popover" data-placement="left" ' + 'class="btn btn-sm btn-primary popover-warning popover-dark" href="@Url.Action("Edit", "Team", new {@id = "_rplcmnt_"})"><i class="fa fa-edit"></i> Edit</a> ' +
'<a id="btnDelete' + ctr + '" onclick="return CheckLock(this.id, \'Clients\', \'_rplcmnt_\')" data-toggle="popover" data-placement="left" ' + 'class="btn btn-sm btn-danger popover-warning popover-dark ';
//if (data.IsResourcesAttached)
// text += 'disabled';
text += '" href="@Url.Action("Delete", "Team", new {@id = "_rplcmnt_"})"' + ' ><i class="fa fa-trash-o"></i> Delete</a>';
return text.replace(/_rplcmnt_/g, data.Id);
</text>
}
else
{
<text>
return "";
</text>
}
}
}],
}).columnFilter({
"aoColumns": [
{ "type": "null" },
{ "type": "null" },
{ "type": "select" }
]
});
@if (Html.CheckSecurityObjectPermission(Areas.Views, AccessLevel.Write))
{
<text>
$('#teams_wrapper .table-caption').html('<a class="btn btn-primary" href="@Url.Action("Edit", "Team")"><i class="fa fa-plus"></i> Add Team</a>');
</text>
}
$('#teams_wrapper .dataTables_filter input').attr('placeholder', 'Search...');
$('#teams_wrapper .dataTables_processing').addClass("table-caption");
$('#teams_wrapper .dataTables_processing').html('<span class="h3"><img class="valign-middle" src="../Content/images/loadFA.gif"/></span>');
});
/*$(document).ready(function () {
setTimeout(function () {
$('.DT-lf-right>div:first').after('<div class="DT-search" style="vertical-align: middle"><div id="teams_filter" class="dataTables_filter"></div></div>');
$('#teams_filter').append($('span.filter_select'));
$('span.filter_select select').width(128);
$('span.filter_select select').height(28);
}, 500);
});*/
</script>
}
<div class="table-light table-responsive">
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="teams">
<thead>
<tr>
<th>
Name
</th>
<th>
Company
</th>
<th>
Users
</th>
<th>
Cost Center
</th>
<th>
GL Account
</th>
<th>
Report to
</th>
<th>
</th>
</tr>
</thead>
<tfoot style="display: none;">
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</tfoot>
</table>
</div>