205 lines
11 KiB
Text
205 lines
11 KiB
Text
@using Kreta.Web.Helpers
|
|
@using Kreta.Resources
|
|
@using Kreta.Web.Areas.Adatszolgaltatasok.Models
|
|
@using Kreta.Web.Helpers
|
|
@using Kreta.Web.Helpers.Grid
|
|
|
|
@model SZIRAdatszolgaltatasTanuloEvVegeModel
|
|
|
|
@{
|
|
const string SZIRAdatszolgController = Constants.Controllers.SZIRAdatszolg;
|
|
const string SZIRAdatszolgApiController = Constants.ApiControllers.SZIRAdatszolgApi;
|
|
const string gridName = "TanuloEvVegeGrid";
|
|
const string searchFormName = "TanuloEvVegeSearchForm";
|
|
|
|
List<FunctionCommand> functions = new List<FunctionCommand> { };
|
|
functions.Add(new FunctionCommand { Name = CommonResource.Mentes, ClientAction = "TanuloEvVegeHelper.save" });
|
|
|
|
var grid = Html.KretaGrid<SZIRAdatszolgaltatasTanuloEvVegeGridModel>(
|
|
gridName,
|
|
getUrl: new GridApiUrl(SZIRAdatszolgApiController, "GetTanuloEvVegeGrid", new Dictionary<string, string> { }),
|
|
allowFilterable: false,
|
|
useToolBar: false,
|
|
dataBoundAdditionalFunction: "TanuloEvVegeHelper.dataBound();",
|
|
showSorszam: false
|
|
).TableHtmlAttributes(new { @class = "tableLayoutFixed" }).FunctionCommand(Html, functions);
|
|
|
|
grid.Columns(column =>
|
|
{
|
|
column.Template(@<text></text>).HeaderHtmlAttributes(new { @class = "gridheader" }).Title(@"
|
|
<div class='gridCheckBox'><input type='checkbox' id='TanuloEvVegeCheckAll' class='k-checkbox'><label class='k-checkbox-label' for='TanuloEvVegeCheckAll'></label></div>").ClientTemplate("#: ID #").Width(50);
|
|
column.Template(@<text></text>).ClientTemplate("#: TanuloNev #").Title(TanuloResource.TanuloNeve);
|
|
column.Template(@<text></text>).ClientTemplate("#: FelhelyNev #").Title(CommonResource.Feladatellatasihely);
|
|
column.Template(@<text></text>).HeaderHtmlAttributes(new { @class = "gridheader" }).Title(@"
|
|
<div class='gridCheckBox'><input type='checkbox' id='TanuloEvVegeIsSikeresTanulmanyokCheck' class='k-checkbox'><label class='k-checkbox-label' for='TanuloEvVegeIsSikeresTanulmanyokCheck'>" + SZIRAdatszolgResource.AzElozoTanevbenTanulmanyokatAzAdottEvfolyamonSikeresenTeljesítette + @"</label></div>").ClientTemplate(grid.CheckBoxColumnTemplate("IsSikeresTanulmanyok", m => m.IsSikeresTanulmanyok, Model.IsPanelEditable));
|
|
column.Template(@<text></text>).HeaderHtmlAttributes(new { @class = "gridheader" }).Title(@"
|
|
<div class='gridCheckBox'><input type='checkbox' id='TanuloEvVegeIsSikeresSzakmaiVizsgaSzak1Check' class='k-checkbox'><label class='k-checkbox-label' for='TanuloEvVegeIsSikeresSzakmaiVizsgaSzak1Check'>" + SZIRAdatszolgResource.SikeresSzakmaiVizsgatTettElso + @"</label></div>").ClientTemplate(grid.CheckBoxColumnTemplate("IsSikeresSzakmaiVizsgaSzak1", m => m.IsSikeresSzakmaiVizsgaSzak1, Model.IsPanelEditable));
|
|
column.Template(@<text></text>).HeaderHtmlAttributes(new { @class = "gridheader" }).Title(@"
|
|
<div class='gridCheckBox'><input type='checkbox' id='TanuloEvVegeIsSikeresSzakmaiVizsgaSzak2Check' class='k-checkbox'><label class='k-checkbox-label' for='TanuloEvVegeIsSikeresSzakmaiVizsgaSzak2Check'>" + SZIRAdatszolgResource.SikeresSzakmaiVizsgatTettMasodik + @"</label></div>").ClientTemplate(grid.CheckBoxColumnTemplate("IsSikeresSzakmaiVizsgaSzak2", m => m.IsSikeresSzakmaiVizsgaSzak2, Model.IsPanelEditable));
|
|
column.Template(@<text></text>).HeaderHtmlAttributes(new { @class = "gridheader" }).Title(@"
|
|
<div class='gridCheckBox'><input type='checkbox' id='TanuloEvVegeIsSikeresSzakmaiVizsgaSzak3Check' class='k-checkbox'><label class='k-checkbox-label' for='TanuloEvVegeIsSikeresSzakmaiVizsgaSzak3Check'>" + SZIRAdatszolgResource.SikeresSzakmaiVizsgatTettHarmadik + @"</label></div>").ClientTemplate(grid.CheckBoxColumnTemplate("IsSikeresSzakmaiVizsgaSzak3", m => m.IsSikeresSzakmaiVizsgaSzak3, Model.IsPanelEditable));
|
|
column.Template(@<text></text>).HeaderHtmlAttributes(new { @class = "gridheader" }).Title(@"
|
|
<div class='gridCheckBox'><input type='checkbox' id='TanuloEvVegeIsSikeresAgazatiAlapVizsgaCheck' class='k-checkbox'><label class='k-checkbox-label' for='TanuloEvVegeIsSikeresAgazatiAlapVizsgaCheck'>" + SZIRAdatszolgResource.SikeresAgazatiVizsgatTett + @"</label></div>").ClientTemplate(grid.CheckBoxColumnTemplate("IsSikeresAgazatiAlapVizsga", m => m.IsSikeresAgazatiAlapVizsga, Model.IsPanelEditable));
|
|
});
|
|
|
|
grid.Sortable(sortable => sortable.AllowUnsort(false));
|
|
}
|
|
|
|
<style>
|
|
.gridheader .k-checkbox-label {
|
|
display: inline;
|
|
}
|
|
|
|
.gridheader .k-checkbox-label::before {
|
|
top: 0;
|
|
}
|
|
|
|
.sidebar-container {
|
|
visibility: visible;
|
|
min-width: 240px;
|
|
padding: 20px;
|
|
}
|
|
|
|
.sidebar-container > div {
|
|
visibility: visible;
|
|
opacity: 1;
|
|
}
|
|
|
|
.sideSearchPanel {
|
|
height: fit-content;
|
|
}
|
|
|
|
@@media only screen and (max-width: 1920px) {
|
|
.sideSearchPanel {
|
|
min-height: 0;
|
|
}
|
|
}
|
|
</style>
|
|
|
|
<h5 style="padding: 0 20px;">@Html.Raw(SZIRAdatszolgResource.TanuloEvVegeFigyelmeztetes)</h5>
|
|
<div style="display: flex;">
|
|
<div class="sidebar-container">
|
|
@using (Html.SearchPanelSideBar(searchFormName, gridName))
|
|
{
|
|
@Html.KretaTextBoxFor(model => model.SearchModel.Nev).RenderSearchPanelSideBar()
|
|
@Html.KretaCheckBoxFor(model => model.SearchModel.IsVegzos).RenderSearchPanelSideBar()
|
|
@Html.KretaMultiSelectFor(model => model.SearchModel.EvfolyamIds, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetEvfolyamTipusListForPrevTanev" }), "Text", "Value").AutoBind(true).RenderSearchPanelSideBar()
|
|
@Html.KretaMultiSelectFor(model => model.SearchModel.OsztalyIds, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetOsztalyokKollegiumNelkulForPrevTanev" }), "Text", "Value").AutoBind(true).RenderSearchPanelSideBar()
|
|
@Html.KretaMultiSelectFor(model => model.SearchModel.FeladatEllatasiHelyIds, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetFeladatellatasiHelyekKollegiumNelkulForPrevTanev" }), "Text", "Value").AutoBind(true).RenderSearchPanelSideBar()
|
|
@Html.KretaMultiSelectFor(model => model.SearchModel.KepzesTipusaIds, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetTanterviJellegListForPrevTanev" }), "Text", "Value").AutoBind(true).RenderSearchPanelSideBar()
|
|
}
|
|
</div>
|
|
<div style="padding: 15px;">
|
|
@(grid)
|
|
</div>
|
|
</div>
|
|
|
|
<div style="display: flex; flex-direction: column; padding: 10px 20px; gap: 5px;">
|
|
<div id="TanuloEvVegeFileDownload" style="cursor: pointer;">@Html.KretaIcon("fa-file-excel-o", new Dictionary<string, object> { { "style", "font-size: 22px; color: #207446;" } }) @SZIRAdatszolgResource.EllenorzoTablazat</div>
|
|
<a style="text-decoration: none;" href="https://tudasbazis.ekreta.hu/download/attachments/2424949/TANULO_EV_VEGE_segedlet_v1.0.pdf?api=v2" rel="noopener noreferrer" target="_blank">@Html.KretaIcon("fa-globe", new Dictionary<string, object> { { "style", "font-size: 22px; color: #406A7C;" } }) @SZIRAdatszolgResource.Segedlet</a>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
var TanuloEvVegeHelper = (function () {
|
|
var tanuloEvVegeHelper = function () { };
|
|
|
|
var gridName = "@gridName";
|
|
var searchFormName = "@searchFormName";
|
|
var saveUrl = "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = SZIRAdatszolgApiController, action = "SaveTanuloEvVegeGrid" })";
|
|
|
|
tanuloEvVegeHelper.dataBound = function () {
|
|
SZIRHelper.GridDataSourceRowsBound(gridName, CommonUtils.parseBool('@Model.IsPanelEditable'));
|
|
}
|
|
|
|
tanuloEvVegeHelper.save = function () {
|
|
var rows = KretaGridHelper.getAllRows(gridName);
|
|
|
|
if (rows && rows.length) {
|
|
|
|
var data = rows.map(i => ({
|
|
TanuloId: i.TanuloId,
|
|
FelhelyId: i.FelhelyId,
|
|
IsSikeresTanulmanyok: i.ki_IsSikeresTanulmanyok,
|
|
IsSikeresSzakmaiVizsgaSzak1: i.ki_IsSikeresSzakmaiVizsgaSzak1,
|
|
IsSikeresSzakmaiVizsgaSzak2: i.ki_IsSikeresSzakmaiVizsgaSzak2,
|
|
IsSikeresSzakmaiVizsgaSzak3: i.ki_IsSikeresSzakmaiVizsgaSzak3,
|
|
IsSikeresAgazatiAlapVizsga: i.ki_IsSikeresAgazatiAlapVizsga
|
|
}));
|
|
|
|
AjaxHelper.DoPost(saveUrl, data, success);
|
|
}
|
|
}
|
|
|
|
tanuloEvVegeHelper.check = function (checked, field) {
|
|
var allNodes = [];
|
|
|
|
KretaGridHelper.getAllRows(gridName).forEach(val => {
|
|
allNodes.push(document.querySelector(`tr[data-uid="${val.uid}"] [data-rowinputname='${field}']`));
|
|
});
|
|
|
|
if (allNodes.length) {
|
|
allNodes.forEach(n => n.checked = checked);
|
|
}
|
|
}
|
|
|
|
tanuloEvVegeHelper.checkAll = function (checked) {
|
|
var allNodes = [];
|
|
|
|
KretaGridHelper.getAllRows(gridName).forEach(val => {
|
|
var nodes = [...document.querySelectorAll(`tr[data-uid="${val.uid}"] input`)];
|
|
|
|
allNodes = allNodes.concat(nodes)
|
|
});
|
|
|
|
if (allNodes.length) {
|
|
allNodes.forEach(n => n.checked = checked);
|
|
}
|
|
}
|
|
|
|
function success() {
|
|
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
|
|
|
KretaWindowHelper.successFeedBackWindow();
|
|
}
|
|
|
|
return tanuloEvVegeHelper;
|
|
})();
|
|
|
|
$("#TanuloEvVegeFileDownload").click(function () {
|
|
var url = "@Url.Action("TanuloEvVege", SZIRAdatszolgController, new { area = Constants.Areas.Adatszolgaltatasok })";
|
|
|
|
AjaxHelper.DownloadFile(url);
|
|
})
|
|
|
|
$("#TanuloEvVegeCheckAll").click(function () {
|
|
TanuloEvVegeHelper.checkAll(this.checked);
|
|
});
|
|
|
|
$("#TanuloEvVegeIsSikeresTanulmanyokCheck").click(function () {
|
|
TanuloEvVegeHelper.check(this.checked, "IsSikeresTanulmanyok");
|
|
});
|
|
|
|
$("#TanuloEvVegeIsSikeresErettsegiCheck").click(function () {
|
|
TanuloEvVegeHelper.check(this.checked, "IsSikeresErettsegi");
|
|
});
|
|
|
|
$("#TanuloEvVegeIsSikeresSzakmaiVizsgaCheck").click(function () {
|
|
TanuloEvVegeHelper.check(this.checked, "IsSikeresSzakmaiVizsga");
|
|
});
|
|
|
|
$("#TanuloEvVegeIsSikeresSzakmaiVizsgaSzak1Check").click(function () {
|
|
TanuloEvVegeHelper.check(this.checked, "IsSikeresSzakmaiVizsgaSzak1");
|
|
});
|
|
|
|
$("#TanuloEvVegeIsSikeresSzakmaiVizsgaSzak2Check").click(function () {
|
|
TanuloEvVegeHelper.check(this.checked, "IsSikeresSzakmaiVizsgaSzak2");
|
|
});
|
|
|
|
$("#TanuloEvVegeIsSikeresSzakmaiVizsgaSzak3Check").click(function () {
|
|
TanuloEvVegeHelper.check(this.checked, "IsSikeresSzakmaiVizsgaSzak3");
|
|
});
|
|
|
|
$("#TanuloEvVegeIsSikeresAgazatiAlapVizsgaCheck").click(function () {
|
|
TanuloEvVegeHelper.check(this.checked, "IsSikeresAgazatiAlapVizsga");
|
|
});
|
|
</script>
|