712 lines
34 KiB
Text
712 lines
34 KiB
Text
@using Kreta.Web.Areas.Adminisztracio.Models;
|
|
@using Kreta.Web.Security;
|
|
|
|
@model ElerhetosegekModel
|
|
|
|
@{
|
|
var formName = "ElerhetosegekModositasForm";
|
|
|
|
var emailComboBoxName = "EmailTipusCmb_";
|
|
var emailCimTextBoxName = "EmailCimTxt_";
|
|
var emailAlapertelmezettRadioName = "EmailCimRdo_";
|
|
var emailDeleteButtonName = "DeleteEmailBtn_";
|
|
var emailAlapertelmezettRadioGroupName = "AlapertelmezettEmailGroup";
|
|
var emailAlapertelmezettRadioChangeEventName = "ElerhetosegekModositasHelper.setEmailDeleteButtonVisibility();";
|
|
var emailDeleteEventName = "ElerhetosegekModositasHelper.deleteEmail(this);";
|
|
|
|
var telefonComboBoxName = "TelefonTipusCmb_";
|
|
var telefonszamTextBoxName = "TelefonszamTxt_";
|
|
var telefonAlapertelmezettRadioName = "TelefonRdo_";
|
|
var telefonDeleteButtonName = "DeleteTelefonBtn_";
|
|
var telefonAlapertelmezettRadioGroupName = "AlapertelmezettTelefonGroup";
|
|
var telefonAlapertelmezettRadioChangeEventName = "ElerhetosegekModositasHelper.setTelefonDeleteButtonVisibility();";
|
|
var telefonDeleteEventName = "ElerhetosegekModositasHelper.deleteTelefon(this);";
|
|
|
|
var ujEmailButtonName = "UjEmailBtn";
|
|
var ujTelefonButtonName = "UjTelefonBtn";
|
|
|
|
var new_dataStatus = (int)Kreta.Enums.ManualEnums.ElerhetosegStatusEnum.New;
|
|
var saved_dataStatus = (int)Kreta.Enums.ManualEnums.ElerhetosegStatusEnum.Saved;
|
|
var deleted_dataStatus = (int)Kreta.Enums.ManualEnums.ElerhetosegStatusEnum.Deleted;
|
|
}
|
|
|
|
<style>
|
|
.kretaLabelTooltipText {
|
|
min-width: 400px;
|
|
}
|
|
|
|
.deleteIcon {
|
|
font-size: 22px;
|
|
margin: 10px auto;
|
|
}
|
|
|
|
.buttonContainer {
|
|
display: block;
|
|
text-align: left;
|
|
}
|
|
|
|
.buttonColPadding {
|
|
padding: 0;
|
|
}
|
|
|
|
.containerPaddingLeftZero {
|
|
padding-left: 0;
|
|
}
|
|
|
|
.newButtonPadding {
|
|
padding: 8px 2px;
|
|
}
|
|
|
|
.saveButton {
|
|
background-color: #54a5d1;
|
|
}
|
|
</style>
|
|
|
|
<script type="text/javascript">
|
|
var ElerhetosegekModositasHelper = (function () {
|
|
var elerhetosegekModositasHelper = function () { };
|
|
|
|
var url = {
|
|
Save: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ProfilApi", action = "SaveElerhetosegek" })"
|
|
};
|
|
|
|
var formName = "@formName";
|
|
|
|
var ujEmailCounter = 1;
|
|
var ujTelefonCounter = 1;
|
|
|
|
elerhetosegekModositasHelper.saveConfirmWindow = function () {
|
|
KretaWindowHelper.confirmWindow("@(CommonResource.Kerdes)", "@(CommonResource.BiztosanMenteniSzeretneAModositasokat)", save);
|
|
}
|
|
|
|
function save () {
|
|
var emailDatas = [];
|
|
var emailRows = $("#EmailTable > div[data-status].row");
|
|
if (emailRows.length > 0) {
|
|
emailRows.each(function (index, value) {
|
|
var row = $(value);
|
|
var tipus = row.data("email-type");
|
|
var alapertelmezett = tipus !== @((int)Kreta.Enums.EmailTipusEnum.PublikusEmailcim) ? row.find("input[id^='@emailAlapertelmezettRadioName']")[0].checked : false;
|
|
emailDatas[index] = {
|
|
Id: row.data("email-id"),
|
|
TextBoxId: row.data("textbox-id"),
|
|
ComboBoxId: row.data("combobox-id"),
|
|
Tipus: tipus,
|
|
Status: row.data("status"),
|
|
Alapertelmezett: alapertelmezett,
|
|
EmailCim_Input: row.find("input[id^='@emailCimTextBoxName']").val()
|
|
}
|
|
});
|
|
}
|
|
|
|
var telefonDatas = [];
|
|
var telefonRows = $("#TelefonTable > div[data-status].row");
|
|
if (telefonRows.length > 0) {
|
|
telefonRows.each(function (index, value) {
|
|
var row = $(value);
|
|
var tipus = row.data("telefon-type");
|
|
var alapertelmezett = tipus !== @((int)Kreta.Enums.TelefonTipusEnum.PublikusTelefonszam) ? row.find("input[id^='@telefonAlapertelmezettRadioName']")[0].checked : false;
|
|
telefonDatas[index] = {
|
|
Id: row.data("telefon-id"),
|
|
TextBoxId: row.data("textbox-id"),
|
|
ComboBoxId: row.data("combobox-id"),
|
|
Tipus: tipus,
|
|
Status: row.data("status"),
|
|
Alapertelmezett: alapertelmezett,
|
|
Telefonszam: row.find("input[id^='@telefonszamTextBoxName']").val()
|
|
}
|
|
});
|
|
}
|
|
|
|
if (emailDatas.length > 0 || telefonDatas.length > 0) {
|
|
var elerhetosegek = {
|
|
Email: emailDatas,
|
|
Telefon: telefonDatas
|
|
};
|
|
AjaxHelper.DoValidationPost(url.Save, formName, elerhetosegek, setElerhetosegStatuses);
|
|
}
|
|
}
|
|
|
|
function setElerhetosegStatuses(newElerhetosegDbDatas) {
|
|
var emailRows = $("#EmailTable > div[data-status].row");
|
|
emailRows.each(function (index, value) {
|
|
var row = $(value);
|
|
var status = row.data("status");
|
|
if (status === @(new_dataStatus)) {
|
|
var textBoxId = row.data("textbox-id");
|
|
var newElerhetosegDbData = newElerhetosegDbDatas.Email.find(e => e.TextBoxId === textBoxId);
|
|
row.data("email-id", newElerhetosegDbData.Id);
|
|
row.data("status", @(saved_dataStatus));
|
|
|
|
var newIdCounter = textBoxId.split('_')[1];
|
|
var comboBox = KretaComboBoxHelper.getKendoComboBoxData("@emailComboBoxName" + newIdCounter);
|
|
var emailTipusText = comboBox.text();
|
|
var emailTipusValue = comboBox.value();
|
|
var emailLabel = emailTipusText + " e-mail cím";
|
|
var emailCimTextBoxName = "@emailCimTextBoxName" + newIdCounter;
|
|
var emailCim = $("#" + textBoxId).val();
|
|
|
|
var labelDivClass = "col-xs-12 col-sm-12 col-md-6 containerPaddingLeftZero";
|
|
var label = $("<label></label>")
|
|
.addClass("windowInputLabel")
|
|
.attr("for", emailCimTextBoxName)
|
|
.append(emailLabel);
|
|
if (emailTipusValue === "@((int)Kreta.Enums.EmailTipusEnum.PublikusEmailcim)") {
|
|
label.append(" ");
|
|
label.append(
|
|
$("<img/>")
|
|
.addClass("kretaLabelTooltipImg")
|
|
);
|
|
label.append(
|
|
$("<span></span>")
|
|
.addClass("kretaLabelTooltipText")
|
|
.append("@AdminisztracioResource.PublikusEmailToolTip")
|
|
);
|
|
|
|
labelDivClass += " kretaLabelTooltip";
|
|
}
|
|
|
|
var textBox = $("<input/>")
|
|
.addClass("k-textbox")
|
|
.attr("data-labelmsg", emailLabel)
|
|
.attr("id", emailCimTextBoxName)
|
|
.attr("name", emailCimTextBoxName)
|
|
.attr("type", "text")
|
|
.attr("value", emailCim)
|
|
.attr("maxlength", @Kreta.Core.Constants.General.EmailMaximumKarakterekSzama);
|
|
|
|
var replaceDiv = $("<div></div>")
|
|
.addClass("col-sm-10 containerPaddingLeftZero")
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass(labelDivClass)
|
|
.append(label)
|
|
)
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-xs-12 col-sm-12 col-md-6 containerPaddingLeftZero")
|
|
.append(textBox)
|
|
);
|
|
|
|
row.find("div.col-sm-10").replaceWith(replaceDiv);
|
|
}
|
|
else if (status === @(deleted_dataStatus)) {
|
|
row.removeData("email-id");
|
|
}
|
|
});
|
|
|
|
var telefonRows = $("#TelefonTable > div[data-status].row");
|
|
telefonRows.each(function (index, value) {
|
|
var row = $(value);
|
|
var status = row.data("status");
|
|
if (status === @(new_dataStatus)) {
|
|
var textBoxId = row.data("textbox-id");
|
|
var newElerhetosegDbData = newElerhetosegDbDatas.Telefon.find(e => e.TextBoxId === textBoxId);
|
|
row.data("telefon-id", newElerhetosegDbData.Id);
|
|
row.data("status", (@saved_dataStatus));
|
|
|
|
var newIdCounter = textBoxId.split('_')[1];
|
|
var comboBox = KretaComboBoxHelper.getKendoComboBoxData("@telefonComboBoxName" + newIdCounter);
|
|
var telefonTipusText = comboBox.text();
|
|
var telefonTipusValue = comboBox.value();
|
|
var telefonLabel = telefonTipusText + " telefonszám";
|
|
var telefonszamTextBoxName = "@telefonszamTextBoxName" + newIdCounter;
|
|
var telefonszam = $("#" + textBoxId).val();
|
|
|
|
var labelDivClass = "col-xs-12 col-sm-12 col-md-6 containerPaddingLeftZero";
|
|
var label = $("<label></label>")
|
|
.addClass("windowInputLabel")
|
|
.attr("for", telefonszamTextBoxName)
|
|
.append(telefonLabel);
|
|
if (telefonTipusValue === "@((int)Kreta.Enums.TelefonTipusEnum.PublikusTelefonszam)") {
|
|
label.append(" ");
|
|
label.append(
|
|
$("<img/>")
|
|
.addClass("kretaLabelTooltipImg")
|
|
);
|
|
label.append(
|
|
$("<span></span>")
|
|
.addClass("kretaLabelTooltipText")
|
|
.append("@AdminisztracioResource.PublikusTelefonszamTooltip")
|
|
);
|
|
|
|
labelDivClass += " kretaLabelTooltip";
|
|
}
|
|
|
|
var textBox = $("<input/>")
|
|
.addClass("k-textbox")
|
|
.attr("data-labelmsg", telefonLabel)
|
|
.attr("id", telefonszamTextBoxName)
|
|
.attr("name", telefonszamTextBoxName)
|
|
.attr("type", "text")
|
|
.attr("value", telefonszam);
|
|
|
|
var replaceDiv = $("<div></div>")
|
|
.addClass("col-sm-10 containerPaddingLeftZero")
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass(labelDivClass)
|
|
.append(label)
|
|
)
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-xs-12 col-sm-12 col-md-6 containerPaddingLeftZero")
|
|
.append(textBox)
|
|
);
|
|
|
|
row.find("div.col-sm-10").replaceWith(replaceDiv);
|
|
}
|
|
else if (status === @(deleted_dataStatus)) {
|
|
row.removeData("telefon-id");
|
|
}
|
|
});
|
|
|
|
KretaWindowHelper.successFeedBackWindow();
|
|
}
|
|
|
|
elerhetosegekModositasHelper.setEmailDeleteButtonVisibility = function () {
|
|
$("input[id^='@emailAlapertelmezettRadioName']").each(function () {
|
|
var checked = this.checked;
|
|
var emailId = this.id.split('_')[1];
|
|
var deleteEmailButtonByIdSelector = "#" + "@emailDeleteButtonName" + emailId;
|
|
var deleteEmailButtonById = $(deleteEmailButtonByIdSelector);
|
|
|
|
if (checked) {
|
|
deleteEmailButtonById.hide();
|
|
}
|
|
else {
|
|
deleteEmailButtonById.show();
|
|
}
|
|
});
|
|
}
|
|
|
|
elerhetosegekModositasHelper.addNewEmail = function () {
|
|
var ujEmailId = "new" + ujEmailCounter;
|
|
var ujEmailComboBoxName = "@emailComboBoxName" + ujEmailId;
|
|
var ujEmailCimTextBoxName = "@emailCimTextBoxName" + ujEmailId;
|
|
var ujEmailAlapertelmezettRadioName = "@emailAlapertelmezettRadioName" + ujEmailId + "_";
|
|
var ujEmailDeleteButtonName = "@emailDeleteButtonName" + ujEmailId;
|
|
|
|
var cmb = $("<span></span>")
|
|
.addClass("k-widget k-combobox k-header")
|
|
.attr("style", "")
|
|
.append(
|
|
$("<span></span>")
|
|
.addClass("k-dropdown-wrap k-state-default k-state-hover")
|
|
.attr("tabindex", -1)
|
|
.attr("unselectable", "on")
|
|
.append(
|
|
$("<input/>")
|
|
.addClass("k-input")
|
|
.attr("name", ujEmailComboBoxName + "_input")
|
|
.attr("type", "text")
|
|
.attr("autocomplete", "off")
|
|
.attr("title", "")
|
|
.attr("role", "combobox")
|
|
.attr("aria-expanded", false)
|
|
.attr("tabindex", 0)
|
|
.attr("style", "width: 100%;")
|
|
.attr("aria-disabled", false)
|
|
.attr("aria-autocomplete", "list")
|
|
.attr("aria-owns", ujEmailComboBoxName + "_listbox")
|
|
.attr("aria-busy", false)
|
|
.attr("aria-activedescendant", "c195d3bf-857f-48f7-ac43-3f820877a4a5")
|
|
)
|
|
.append(
|
|
$("<span></span>")
|
|
.addClass("k-select")
|
|
.attr("tabindex", -1)
|
|
.attr("unselectable", "on")
|
|
.append(
|
|
$("<span></span>")
|
|
.addClass("k-icon k-i-arrow-s")
|
|
.attr("unselectable", "on")
|
|
.attr("role", "button")
|
|
.attr("tabindex", -1)
|
|
.attr("aria-controls", ujEmailComboBoxName + "_listbox")
|
|
.text("select")
|
|
)
|
|
|
|
)
|
|
)
|
|
.append(
|
|
$("<input/>")
|
|
.addClass("valid")
|
|
.attr("data-msg-unknownvalue", "Ismeretlen érték")
|
|
.attr("id", ujEmailComboBoxName)
|
|
.attr("name", ujEmailComboBoxName)
|
|
.attr("type", "text")
|
|
.attr("data-role", "combobox")
|
|
.attr("style", "display: none;")
|
|
.attr("aria-disabled", false)
|
|
);
|
|
|
|
var cmbScript = $("<script>")
|
|
.text('jQuery(function(){jQuery("' + '#' + ujEmailComboBoxName + '").kendoComboBox({"open":KretaComboBoxHelper.onOpenDropdown,"dataBound":KretaComboBoxHelper.onDataBound,"change":function(e){ KretaComboBoxHelper.onChange(e); ElerhetosegekModositasHelper.emailTipusComboBoxOnChange(e); },"dataSource":{"transport":{"read":{"url":"/api/ComboBoxHelperApi/GetEmailTipusList?forProfilElerhetosegek=True\u0026isTanulo=' + @Json.Encode(ClaimData.IsTanuloOrGondviselo) + '"}},"serverFiltering":true,"filter":[]},"dataTextField":"Text","dataValueField":"Value"});});');
|
|
|
|
var txt = $("<input/>")
|
|
.addClass("k-textbox")
|
|
.attr("type", "text")
|
|
.attr("id", ujEmailCimTextBoxName)
|
|
.attr("name", ujEmailCimTextBoxName)
|
|
.attr("maxlength", @Kreta.Core.Constants.General.EmailMaximumKarakterekSzama);
|
|
|
|
var rdo = $("<input/>")
|
|
.addClass("k-radio k-radio")
|
|
.attr("id", ujEmailAlapertelmezettRadioName)
|
|
.attr("name", "@emailAlapertelmezettRadioGroupName")
|
|
.attr("onchange", "@emailAlapertelmezettRadioChangeEventName")
|
|
.attr("type", "radio")
|
|
.attr("value", "");
|
|
|
|
var rdoLabel = $("<label></label>")
|
|
.addClass("k-radio-label")
|
|
.attr("for", ujEmailAlapertelmezettRadioName)
|
|
.attr("title", "Alapértelmezett");
|
|
|
|
var button = $("<a></a>")
|
|
.addClass("buttonContainer")
|
|
.attr("title", "Törlés")
|
|
.attr("href", "javascript:void(0)")
|
|
.attr("onclick", "@emailDeleteEventName")
|
|
.attr("id", ujEmailDeleteButtonName)
|
|
.append(
|
|
$("<i/>")
|
|
.addClass("fa fa-trash deleteIcon")
|
|
.attr("aria-hidden", "true")
|
|
);
|
|
|
|
var newRow = $("<div></div>")
|
|
.addClass("row")
|
|
.attr("data-status", @(new_dataStatus))
|
|
.attr("data-textbox-id", ujEmailCimTextBoxName)
|
|
.attr("data-combobox-id", ujEmailComboBoxName)
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-sm-10 containerPaddingLeftZero")
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-xs-12 col-sm-12 col-md-6 containerPaddingLeftZero")
|
|
.append(cmb)
|
|
.append(cmbScript)
|
|
)
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-xs-12 col-sm-12 col-md-6 containerPaddingLeftZero")
|
|
.append(txt)
|
|
)
|
|
)
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-sm-1")
|
|
.append(
|
|
$("<div></div>")
|
|
.append(rdo)
|
|
.append(rdoLabel)
|
|
)
|
|
)
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-sm-1 buttonColPadding")
|
|
.append(button)
|
|
);
|
|
|
|
$("#EmailTable > .row").last().after(newRow);
|
|
++ujEmailCounter;
|
|
}
|
|
|
|
elerhetosegekModositasHelper.emailTipusComboBoxOnChange = function (e) {
|
|
var comboBoxId = e.sender.element[0].id;
|
|
var comboBoxValue = KretaComboBoxHelper.getKendoValue(comboBoxId);
|
|
|
|
var row = $("#" + comboBoxId).closest(".row");
|
|
row.data("email-type", comboBoxValue);
|
|
|
|
var newIdCounter = comboBoxId.split('_')[1];
|
|
var alapertelmezettRdoClosestDiv = $("#" + "@emailAlapertelmezettRadioName" + newIdCounter + "_").closest("div");
|
|
if (comboBoxValue === "@((int)Kreta.Enums.EmailTipusEnum.PublikusEmailcim)") {
|
|
alapertelmezettRdoClosestDiv.hide();
|
|
}
|
|
else {
|
|
alapertelmezettRdoClosestDiv.show();
|
|
}
|
|
}
|
|
|
|
elerhetosegekModositasHelper.deleteEmail = function (e) {
|
|
KretaWindowHelper.confirmWindow("@(CommonResource.Kerdes)", "@(CommonResource.BiztosanTorli)", deleteRow, e);
|
|
}
|
|
|
|
elerhetosegekModositasHelper.setTelefonDeleteButtonVisibility = function () {
|
|
$("input[id^='@telefonAlapertelmezettRadioName']").each(function () {
|
|
var checked = this.checked;
|
|
var telefonId = this.id.split('_')[1];
|
|
var deleteTelefonszamButtonByIdSelector = "#" + "@telefonDeleteButtonName" + telefonId;
|
|
var deleteTelefonszamButtonById = $(deleteTelefonszamButtonByIdSelector);
|
|
|
|
if (checked) {
|
|
deleteTelefonszamButtonById.hide();
|
|
}
|
|
else {
|
|
deleteTelefonszamButtonById.show();
|
|
}
|
|
});
|
|
}
|
|
|
|
elerhetosegekModositasHelper.addNewTelefon = function () {
|
|
var ujTelefonId = "new" + ujTelefonCounter;
|
|
var ujTelefonComboBoxName = "@telefonComboBoxName" + ujTelefonId;
|
|
var ujTelefonszamTextBoxName = "@telefonszamTextBoxName" + ujTelefonId;
|
|
var ujTelefonAlapertelmezettRadioName = "@telefonAlapertelmezettRadioName" + ujTelefonId + "_";
|
|
var ujTelefonDeleteButtonName = "@telefonDeleteButtonName" + ujTelefonId;
|
|
|
|
var cmb = $("<span></span>")
|
|
.addClass("k-widget k-combobox k-header")
|
|
.attr("style", "")
|
|
.append(
|
|
$("<span></span>")
|
|
.addClass("k-dropdown-wrap k-state-default k-state-hover")
|
|
.attr("tabindex", -1)
|
|
.attr("unselectable", "on")
|
|
.append(
|
|
$("<input/>")
|
|
.addClass("k-input")
|
|
.attr("name", ujTelefonComboBoxName + "_input")
|
|
.attr("type", "text")
|
|
.attr("autocomplete", "off")
|
|
.attr("title", "")
|
|
.attr("role", "combobox")
|
|
.attr("aria-expanded", false)
|
|
.attr("tabindex", 0)
|
|
.attr("style", "width: 100%;")
|
|
.attr("aria-disabled", false)
|
|
.attr("aria-autocomplete", "list")
|
|
.attr("aria-owns", ujTelefonComboBoxName + "_listbox")
|
|
.attr("aria-busy", false)
|
|
.attr("aria-activedescendant", "c195d3bf-857f-48f7-ac43-3f820877a4a5")
|
|
)
|
|
.append(
|
|
$("<span></span>")
|
|
.addClass("k-select")
|
|
.attr("tabindex", -1)
|
|
.attr("unselectable", "on")
|
|
.append(
|
|
$("<span></span>")
|
|
.addClass("k-icon k-i-arrow-s")
|
|
.attr("unselectable", "on")
|
|
.attr("role", "button")
|
|
.attr("tabindex", -1)
|
|
.attr("aria-controls", ujTelefonComboBoxName + "_listbox")
|
|
.text("select")
|
|
)
|
|
|
|
)
|
|
)
|
|
.append(
|
|
$("<input/>")
|
|
.addClass("valid")
|
|
.attr("data-msg-unknownvalue", "Ismeretlen érték")
|
|
.attr("id", ujTelefonComboBoxName)
|
|
.attr("name", ujTelefonComboBoxName)
|
|
.attr("type", "text")
|
|
.attr("data-role", "combobox")
|
|
.attr("style", "display: none;")
|
|
.attr("aria-disabled", false)
|
|
);
|
|
|
|
var cmbScript = $("<script>")
|
|
.text('jQuery(function(){jQuery("' + '#' + ujTelefonComboBoxName + '").kendoComboBox({"open":KretaComboBoxHelper.onOpenDropdown,"dataBound":KretaComboBoxHelper.onDataBound,"change":function(e){ KretaComboBoxHelper.onChange(e); ElerhetosegekModositasHelper.telefonTipusComboBoxOnChange(e); },"dataSource":{"transport":{"read":{"url":"/api/ComboBoxHelperApi/GetTelefonTipusList?forProfilElerhetosegek=True\u0026isTanulo=' + @Json.Encode(ClaimData.IsTanuloOrGondviselo) + '"}},"serverFiltering":true,"filter":[]},"dataTextField":"Text","dataValueField":"Value"});});');
|
|
|
|
var txt = $("<input/>")
|
|
.addClass("k-textbox")
|
|
.attr("type", "text")
|
|
.attr("id", ujTelefonszamTextBoxName)
|
|
.attr("name", ujTelefonszamTextBoxName);
|
|
|
|
var rdo = $("<input/>")
|
|
.addClass("k-radio k-radio")
|
|
.attr("id", ujTelefonAlapertelmezettRadioName)
|
|
.attr("name", "@telefonAlapertelmezettRadioGroupName")
|
|
.attr("onchange", "@telefonAlapertelmezettRadioChangeEventName")
|
|
.attr("type", "radio")
|
|
.attr("value", "");
|
|
|
|
var rdoLabel = $("<label></label>")
|
|
.addClass("k-radio-label")
|
|
.attr("for", ujTelefonAlapertelmezettRadioName)
|
|
.attr("title", "Alapértelmezett");
|
|
|
|
var button = $("<a></a>")
|
|
.addClass("buttonContainer")
|
|
.attr("title", "Törlés")
|
|
.attr("href", "javascript:void(0)")
|
|
.attr("onclick", "@telefonDeleteEventName")
|
|
.attr("id", ujTelefonDeleteButtonName)
|
|
.append(
|
|
$("<i/>")
|
|
.addClass("fa fa-trash deleteIcon")
|
|
.attr("aria-hidden", "true")
|
|
);
|
|
|
|
var newRow = $("<div></div>")
|
|
.addClass("row")
|
|
.attr("data-status", @(new_dataStatus))
|
|
.attr("data-textbox-id", ujTelefonszamTextBoxName)
|
|
.attr("data-combobox-id", ujTelefonComboBoxName)
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-sm-10 containerPaddingLeftZero")
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-xs-12 col-sm-12 col-md-6 containerPaddingLeftZero")
|
|
.append(cmb)
|
|
.append(cmbScript)
|
|
)
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-xs-12 col-sm-12 col-md-6 containerPaddingLeftZero")
|
|
.append(txt)
|
|
)
|
|
)
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-sm-1")
|
|
.append(
|
|
$("<div></div>")
|
|
.append(rdo)
|
|
.append(rdoLabel)
|
|
)
|
|
)
|
|
.append(
|
|
$("<div></div>")
|
|
.addClass("col-sm-1 buttonColPadding")
|
|
.append(button)
|
|
);
|
|
|
|
$("#TelefonTable > .row").last().after(newRow);
|
|
++ujTelefonCounter;
|
|
}
|
|
|
|
elerhetosegekModositasHelper.telefonTipusComboBoxOnChange = function (e) {
|
|
var comboBoxId = e.sender.element[0].id;
|
|
var comboBoxValue = KretaComboBoxHelper.getKendoValue(comboBoxId);
|
|
|
|
var row = $("#" + comboBoxId).closest(".row");
|
|
row.data("telefon-type", comboBoxValue);
|
|
|
|
var newIdCounter = comboBoxId.split('_')[1];
|
|
var alapertelmezettRdoClosestDiv = $("#" + "@telefonAlapertelmezettRadioName" + newIdCounter + "_").closest("div");
|
|
if (comboBoxValue === "@((int)Kreta.Enums.TelefonTipusEnum.PublikusTelefonszam)") {
|
|
alapertelmezettRdoClosestDiv.hide();
|
|
}
|
|
else {
|
|
alapertelmezettRdoClosestDiv.show();
|
|
}
|
|
}
|
|
|
|
elerhetosegekModositasHelper.deleteTelefon = function (e) {
|
|
KretaWindowHelper.confirmWindow("@(CommonResource.Kerdes)", "@(CommonResource.BiztosanTorli)", deleteRow, e);
|
|
}
|
|
|
|
function deleteRow (e) {
|
|
var row = $(e).closest("div").parent();
|
|
$(row).data("status", @(deleted_dataStatus));
|
|
row.hide();
|
|
}
|
|
|
|
elerhetosegekModositasHelper.setAlapertelmezettLabelTitle = function () {
|
|
$("#ElerhetosegekModositasForm").find("label.k-radio-label").attr("title", "Alapértelmezett");
|
|
}
|
|
|
|
return elerhetosegekModositasHelper;
|
|
})();
|
|
</script>
|
|
|
|
@using (Html.KretaForm(formName))
|
|
{
|
|
@Html.KretaValidationSummary()
|
|
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-sm-6" id="EmailTable">
|
|
<div class="row">
|
|
<h4>@AdminisztracioResource.Email</h4>
|
|
</div>
|
|
<div class="row">
|
|
<div class="kendo-gridFunctionKommand">
|
|
@Html.KretaButton(ujEmailButtonName, CommonResource.Uj.ToUpper(), clickEventName: "ElerhetosegekModositasHelper.addNewEmail", htmlAttributes: new Dictionary<string, object> { { "class", "newButtonPadding" } })
|
|
</div>
|
|
</div>
|
|
@foreach (var email in Model.Email)
|
|
{
|
|
var tooltipResource = email.IsPublic ? AdminisztracioResource.PublikusEmailToolTip : string.Empty;
|
|
var textBoxId = emailCimTextBoxName + email.Id;
|
|
<div class="row" data-email-type="@email.Tipus" data-status="@saved_dataStatus" data-email-id="@email.Id" data-textbox-id="@textBoxId">
|
|
<div class="col-sm-10 containerPaddingLeftZero">
|
|
@Html.KretaTextBox(textBoxId, htmlAttributes: new Dictionary<string, object> { { "data-labelmsg", email.Label }, { "maxlength", Kreta.Core.Constants.General.EmailMaximumKarakterekSzama } }).Value(email.EmailCim_Input).RenderWithName(tooltipResource: tooltipResource, customClass: "containerPaddingLeftZero")
|
|
</div>
|
|
<div class="col-sm-1">
|
|
@if (!email.IsPublic)
|
|
{
|
|
@Html.KretaRadioButton(emailAlapertelmezettRadioName + email.Id, string.Empty, email.Alapertelmezett, htmlAttributes: new Dictionary<string, object> { { "name", emailAlapertelmezettRadioGroupName }, { "onchange", emailAlapertelmezettRadioChangeEventName } })
|
|
}
|
|
</div>
|
|
<div class="col-sm-1 buttonColPadding">
|
|
<a class="buttonContainer" title="Törlés" href="javascript:void(0)" onclick="@emailDeleteEventName" id="@(emailDeleteButtonName + email.Id)">
|
|
<i class="fa fa-trash deleteIcon" aria-hidden="true"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="col-sm-6" id="TelefonTable">
|
|
<div class="row">
|
|
<h4>@AdminisztracioResource.Telefonszam</h4>
|
|
</div>
|
|
<div class="row">
|
|
<div class="kendo-gridFunctionKommand">
|
|
@Html.KretaButton(ujTelefonButtonName, CommonResource.Uj.ToUpper(), clickEventName: "ElerhetosegekModositasHelper.addNewTelefon", htmlAttributes: new Dictionary<string, object> { { "class", "newButtonPadding" } })
|
|
</div>
|
|
</div>
|
|
@foreach (var telefon in Model.Telefon)
|
|
{
|
|
var tooltipResource = telefon.IsPublic ? AdminisztracioResource.PublikusTelefonszamTooltip : string.Empty;
|
|
var textBoxId = telefonszamTextBoxName + telefon.Id;
|
|
<div class="row" data-telefon-type="@telefon.Tipus" data-status="@saved_dataStatus" data-telefon-id="@telefon.Id" data-textbox-id="@textBoxId">
|
|
<div class="col-sm-10 containerPaddingLeftZero">
|
|
@Html.KretaTextBox(textBoxId, htmlAttributes: new Dictionary<string, object> { { "data-labelmsg", telefon.Label } }).Value(telefon.Telefonszam).RenderWithName(tooltipResource: tooltipResource, customClass: "containerPaddingLeftZero")
|
|
</div>
|
|
<div class="col-sm-1">
|
|
@if (!telefon.IsPublic)
|
|
{
|
|
@Html.KretaRadioButton(telefonAlapertelmezettRadioName + telefon.Id, string.Empty, telefon.Alapertelmezett, htmlAttributes: new Dictionary<string, object> { { "name", telefonAlapertelmezettRadioGroupName }, { "onchange", telefonAlapertelmezettRadioChangeEventName } })
|
|
}
|
|
</div>
|
|
<div class="col-sm-1 buttonColPadding">
|
|
<a class="buttonContainer" title="Törlés" href="javascript:void(0)" onclick="@telefonDeleteEventName" id="@(telefonDeleteButtonName + telefon.Id)">
|
|
<i class="fa fa-trash deleteIcon" aria-hidden="true"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
<div style="margin-top: 20px"></div>
|
|
@if (!ClaimData.IsTanuloOrGondviselo)
|
|
{
|
|
<div class="row">
|
|
@AdminisztracioResource.FigyelemAMezokKitoltesevelHozzajarulAhhozHogyAzInformacioNyilvanossaValjonAKretaRendszerFelhasznaloiReszereABeirtPublikusEmailCimEstelefonszamMegjelenikAzElektronikusEllenorzokonyvbenASzulokEsDiakokReszere
|
|
</div>
|
|
}
|
|
<div class="row">
|
|
@Html.KretaButton("ElerhetosegekModositasSaveBtn", CommonResource.Mentes, clickEventName: "ElerhetosegekModositasHelper.saveConfirmWindow", htmlAttributes: new Dictionary<string, object> { { "class", "saveButton" } })
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
ElerhetosegekModositasHelper.setEmailDeleteButtonVisibility();
|
|
ElerhetosegekModositasHelper.setTelefonDeleteButtonVisibility();
|
|
ElerhetosegekModositasHelper.setAlapertelmezettLabelTitle();
|
|
});
|
|
</script>
|