if (typeof (Avanade) == "undefined") { Avanade = { __namespace: true }; }
if (typeof (Avanade.Hlv) == "undefined") { Avanade.Hlv = { __namespace: true }; }
if (typeof (Avanade.Hlv.PortalAgenti) == "undefined") { Avanade.Hlv.PortalAgenti = { __namespace: true }; }
const hlvConst = {
colors: {
red: "#C31622 !important",
green: "#00818F !important",
purple: "#8861A9 !important",
black: "#000 !important",
}
};
$(document).ready(function () {
$("#richiesta-lavorazione-body").hide();
$(".ricerca-ticket").hide();
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(window.location.pathname)) {
if (window.location.pathname.replace("/", "").trim().toLocaleLowerCase().indexOf("signin") > -1 ||
window.location.pathname.replace("/", "").trim().toLocaleLowerCase().indexOf("login") > -1) {
var form =
'
Dettaglio Richiesta -
' + '' + ticketNumber + '' + ' Stato: ' + '' + status + '' + '');
$('.modal-form.in .modal-content .modal-body iframe').contents().find("tr:lt(2)").hide()
//MODALE CREA COMMENTO DA CASI APERTI
//$(".modal.fade.modal-form.modal-form-insert.in iframe").contents().find("td:lt(6)").hide()
//$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype1id_name").parent().parent().parent().hide();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype2id").val() == "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype2id_name").parent().parent().parent().hide();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype3id").val() == "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype3id_name").parent().parent().parent().hide();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype4id").val() == "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype4id_name").parent().parent().parent().hide();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype5id").val() == "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype5id_name").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#customerid_name").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_nodeid_name").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_subnodeid_name").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#caseorigincode").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_externalcasetypology").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_customerontheintermediaryspremises").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtamountrequired").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtmontescontibalance").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtreasonforrequest").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_amountrequired").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_montescontibalance").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_reasonforrequest").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcamontescontibalance").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_amountrequired").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcaamountrequired").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcareasonforrequest").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_montescontibalance").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_reasonforrequest").parent().parent().parent().hide();
var lastReqId = getLatReqTypeIdFromInputs();
var lastReqType = Avanade.Hlv.PortalAgenti.Common.getParentReqTypology(lastReqId);
if (lastReqType != null && lastReqType.length > 0) {
var particularCase = !Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(lastReqType[0].hlv_externalcasetypology) ? parseInt(lastReqType[0].hlv_externalcasetypology) : -1;
var severityValue = lastReqType[0].hlv_severity_value;
var severityLabel = lastReqType[0].hlv_severity_name;
var serviceId = lastReqType[0].hlv_service_id;
var serviceLabel = lastReqType[0].hlv_service_name;
var customerontheintermediaryspremises = lastReqType[0].hlv_customerontheintermediaryspremises;
switch (particularCase) {
case 855600015://Sblocco Quietanzamneto
break;
case 855600014://Montesconti RCA
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtamountrequired").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtamountrequired").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtmontescontibalance").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtmontescontibalance").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtreasonforrequest").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtreasonforrequest").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_amountrequired").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_amountrequired").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_montescontibalance").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_montescontibalance").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_reasonforrequest").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_reasonforrequest").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcamontescontibalance").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcamontescontibalance").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcaamountrequired").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcaamountrequired").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcareasonforrequest").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcareasonforrequest").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_amountrequired").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_amountrequired").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_montescontibalance").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_montescontibalance").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_reasonforrequest").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_reasonforrequest").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt").is(":checked"))
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca").is(":checked"))
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi").is(":checked"))
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi").is(":checked"))
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi").parent().parent().parent().show();
break;
}
}
}
$(".modal-form.in .modal-content .modal-body iframe").contents().find(".modal.fade").on("shown.bs.modal", function () {
alert("ciao")
})
})
})
$("#optionset-nodo").hide();
$("#optionset-sottonodo").hide();
if ($("#roles :input").val() == "PI - Direzione") {
var companies = Avanade.Hlv.PortalAgenti.Common.getCompanies();
if (companies != null) {
companies.forEach(function (elem) {
companyList.push({
id: elem.companyid,
name: elem.companyname,
type: "company",
value: "1"
})
})
}
}
else if ($("#roles :input").val() == "PI - Insurance Corner" || $("#roles :input").val() == "PI - SubAgente" || $("#roles :input").val() == "PI - Coll – SottoNodo Broker") {
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(subag1.id) && subag1.id != "/") {
var ag1Res = Avanade.Hlv.PortalAgenti.Common.getCompany(subag1.id);
if (ag1Res != null) {
ag1Res.forEach(function (elem) {
companyList.push({
id: elem.companyid,
name: elem.companyname,
type: "company",
value: "1"
})
})
}
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(subag2.id) && subag2.id != "/") {
var ag2Res = Avanade.Hlv.PortalAgenti.Common.getCompany(subag2.id);
if (ag2Res != null) {
ag2Res.forEach(function (elem) {
companyList.push({
id: elem.companyid,
name: elem.companyname,
type: "company",
value: "2"
})
})
}
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(subag3.id) && subag3.id != "/") {
var ag3Res = Avanade.Hlv.PortalAgenti.Common.getCompany(subag3.id);
if (ag3Res != null) {
ag3Res.forEach(function (elem) {
companyList.push({
id: elem.companyid,
name: elem.companyname,
type: "company",
value: "3"
})
})
}
}
}
else {
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(ag1.id) && ag1.id != "/") {
var ag1Res = Avanade.Hlv.PortalAgenti.Common.getCompany(ag1.id);
if (ag1Res != null) {
ag1Res.forEach(function (elem) {
companyList.push({
id: elem.companyid,
name: elem.companyname,
type: "company",
value: "1"
})
})
}
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(ag2.id) && ag2.id != "/") {
var ag2Res = Avanade.Hlv.PortalAgenti.Common.getCompany(ag2.id);
if (ag2Res != null) {
ag2Res.forEach(function (elem) {
companyList.push({
id: elem.companyid,
name: elem.companyname,
type: "company",
value: "2"
})
})
}
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(ag3.id) && ag3.id != "/") {
var ag3Res = Avanade.Hlv.PortalAgenti.Common.getCompany(ag3.id);
if (ag3Res != null) {
ag3Res.forEach(function (elem) {
companyList.push({
id: elem.companyid,
name: elem.companyname,
type: "company",
value: "3"
})
})
}
}
}
companyList.forEach(function (c) {
var blRes = Avanade.Hlv.PortalAgenti.Common.getBusinessLine(c.id);
if (blRes != null && blRes.length > 0) {
blRes.forEach(function (b) {
var position = blList.find(function (row) { return row == b.hlv_businessline_value })
if (!position)
blList.push(parseInt(b.hlv_businessline_value));
})
}
})
var row1count = 0;
var row2count = 0;
var classRow1 = "";
var classRow2 = "";
blListToCheck1.forEach(function (b) {
if (blList.includes(b)) {
$("#bl_" + b).show();
row1count++;
}
})
blListToCheck2.forEach(function (b) {
if (blList.includes(b)) {
$("#bl_" + b).show();
row2count++;
}
})
if (row1count > 0) {
classRow1 = "col-md-" + (12 / row1count);
blListToCheck1.forEach(function (b) {
$("#bl_" + b).removeClass("col-md-4").addClass(classRow1);
})
}
if (row2count >= 0) {
classRow2 = "col-md-" + (12 / (row2count + 1));
blListToCheck2.forEach(function (b) {
$("#bl_" + b).removeClass("col-md-4").addClass(classRow2);
})
}
};
self.showNodeOptions = function () {
var userObj = Avanade.Hlv.PortalAgenti.Common.getUserAgencies();
var userId = userObj != null ? userObj.userid : null;
if (userId == null) {
return;
}
$('.input-group.entitylist-filter-option-text input[name="0"]').val("");
$('.input-group.entitylist-filter-option-text input[name="1"]').val(userId);
$('.input-group.entitylist-filter-option-text input[name="2"]').val("");
$('.input-group.entitylist-filter-option-text input[name="3"]').val("aaa");
$('.input-group.entitylist-filter-option-text input[name="4"]').val("");
// $('.entitylist-filter-option .checkbox input[name="3"]').prop('checked', true)
// $('.entitylist-filter-option .checkbox input[name="5"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="5"]').val("");
$("#optionset-nodo").show();
$("#optionset-sottonodo").hide();
$("#subNodeRequestDescription").hide();
$("#nodeRequestDescription").show();
$("#personalRequestDescription").hide();
$("#ticket-filter-option-nodo").val(0);
$("#ticket-filter-option-sottonodo").val(0);
$(".btn.btn-default.btn-entitylist-filter-submit").click();
};
self.showSubNodeOptions = function () {
var userObj = Avanade.Hlv.PortalAgenti.Common.getUserAgencies();
var userId = userObj != null ? userObj.userid : null;
if (userId == null) {
return;
}
var firstSubNode = $($("#ticket-filter-option-sottonodo option")[1]).attr('value')
$('.input-group.entitylist-filter-option-text input[name="0"]').val("");
$('.input-group.entitylist-filter-option-text input[name="1"]').val(userId);
// $('.entitylist-filter-option .checkbox input[name="3"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="3"]').val("");
if ($("#roles :input").val() == "PI - Agente" ||
$("#roles :input").val() == "PI - Insurance Corner") {
//$('.entitylist-filter-option .checkbox input[name="5"]').prop('checked', true)
$('.input-group.entitylist-filter-option-text input[name="5"]').val("aaa");
}
else {
$('.input-group.entitylist-filter-option-text input[name="2"]').val(firstSubNode);
}
$("#optionset-nodo").hide();
$("#optionset-sottonodo").show();
$("#subNodeRequestDescription").show();
$("#nodeRequestDescription").hide();
$("#personalRequestDescription").hide();
$("#ticket-filter-option-nodo").val(0);
$("#ticket-filter-option-sottonodo").val(firstSubNode);
$(".btn.btn-default.btn-entitylist-filter-submit").click();
};
self.goToArticle = function (objArray) {
var titlekb = $("#carousel-kb .carousel-item.active .sub-title").text().replace(/(\r\n|\n|\r)/gm, "").trim();
if (titlekb != "") {
window.location = "/articolidisupporto?titlekb=" + titlekb;
}
};
self.personalCasesFilter = function () {
var userObj = Avanade.Hlv.PortalAgenti.Common.getUserAgencies();
var userId = userObj != null ? userObj.userid : null;
if (userId == null) {
return;
}
$("#optionset-nodo").hide();
$("#optionset-sottonodo").hide();
$("#subNodeRequestDescription").hide();
$("#nodeRequestDescription").hide();
$("#personalRequestDescription").show();
$("#ticket-filter-option-nodo").val(0);
$("#ticket-filter-option-sottonodo").val(0);
$('.input-group.entitylist-filter-option-text input[name="0"]').val(userId);
$('.input-group.entitylist-filter-option-text input[name="1"]').val("");
$('.input-group.entitylist-filter-option-text input[name="2"]').val("");
//$('.entitylist-filter-option .checkbox input[name="3"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="3"]').val("");
//$('.entitylist-filter-option .checkbox input[name="5"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="5"]').val("");
$(".btn.btn-default.btn-entitylist-filter-submit").click();
};
self.nodoCasesFilter = function () {
//var userObj = Avanade.Hlv.PortalAgenti.Common.getUserAgencies();
var nodo = $("#ticket-filter-option-nodo").val();
if (nodo == null || nodo == "0") {
return;
}
$('.input-group.entitylist-filter-option-text input[name="0"]').val("");
$('.input-group.entitylist-filter-option-text input[name="1"]').val(nodo);
$('.input-group.entitylist-filter-option-text input[name="2"]').val("");
//$('.entitylist-filter-option .checkbox input[name="3"]').prop('checked', true)
$('.input-group.entitylist-filter-option-text input[name="3"]').val("aaa");
//$('.entitylist-filter-option .checkbox input[name="5"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="5"]').val("");
$(".btn.btn-default.btn-entitylist-filter-submit").click();
};
self.subNodoCasesFilter = function () {
//var userObj = Avanade.Hlv.PortalAgenti.Common.getUserAgencies();
var sottonodo = $("#ticket-filter-option-sottonodo").val();
if (sottonodo == null) {
return;
}
$('.input-group.entitylist-filter-option-text input[name="0"]').val("");
$('.input-group.entitylist-filter-option-text input[name="1"]').val("");
$('.input-group.entitylist-filter-option-text input[name="2"]').val(sottonodo);
//$('.entitylist-filter-option .checkbox input[name="3"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="3"]').val("");
if ($("#roles :input").val() == "PI - Agente" ||
$("#roles :input").val() == "PI - Insurance Corner") {
//$('.entitylist-filter-option .checkbox input[name="5"]').prop('checked', true)
$('.input-group.entitylist-filter-option-text input[name="5"]').val("aaa");
}
else {
$('.input-group.entitylist-filter-option-text input[name="2"]').val(sottonodo);
}
$(".btn.btn-default.btn-entitylist-filter-submit").click();
};
var getLatReqTypeIdFromInputs = function () {
var resid = "";
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype5id").val())) {
return $('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype5id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype4id").val())) {
return $('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype4id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype3id").val())) {
return $('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype3id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype2id").val())) {
return $('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype2id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype1id").val())) {
return $('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype1id").val()
}
};
};
Avanade.Hlv.PortalAgenti.News = new function () {
const self = this;
self.init = function () {
$("#modal-dettaglio-news").on("show.bs.modal", function () {
})
};
self.showModal = function (index) {
var title = $("#news-title-" + index).html();
var desc = $("#news-desc-" + index).html();
$("#modal-dettaglio-news #modal-title").html(title);
$("#modal-dettaglio-news #modalContent-news").html(desc);
$("#modal-dettaglio-news").modal("show");
};
};
Avanade.Hlv.PortalAgenti.VisualizzaRichieste = new function () {
const self = this;
var isFirstLoad = true;
var countFirstLoad = 0;
self.init = function () {
$(".carousel-item:first-child").addClass("active");
$(".carousel-indicators li:first-child").addClass("active");
$(".entitylist").on("loaded", function () {
$("#richiesteBody-ticket-section td[data-attribute='ticketnumber'] a").addClass("customLinkVoice");
$("#richiesteBody-ticket-section tr td:last-child").hide();
countFirstLoad++;
if (isFirstLoad && countFirstLoad == 3) {
$("#personalFilter").click();
isFirstLoad = false;
}
})
$("#risultatiRicerca .entitylist").on("loaded", function () {
// var countRecAttr = $('#SearchCountTextnull').attr('aria-label');
// if (countRecAttr == null){
// return;
// }
// var countRec = $('#SearchCountTextnull').attr('aria-label').split(' ')[0];
// if (isNaN(countRec)) {
// countRec = 0;
// }
// $('#section-results-countRecords').text(countRec);
})
$(".modal.fade").on("show.bs.modal", function () {
$(".modal.fade").css("opacity", 1);
$(".modal-dialog").css({ "top": "40px", "max-width": "1000px", "width": "1000px" });
$(".modal-content").css({ "border-radius": 0 })
})
$(".modal.fade").on("shown.bs.modal", function () {
$(".modal-form.in .modal-content .modal-body iframe").on("load", function () {
var ticketNumber = $(".modal-form.in .modal-content .modal-body iframe").contents().find("#ticketnumber")[0].value;
$(".modal-form.in .modal-header h4").html("");
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(ticketNumber)) {
var status = $(".modal-form.in .modal-content .modal-body iframe").contents().find("#statuscode")[0].innerText;
$(".modal-form.in .modal-header").css({ "display": "block", "border-bottom": "none" })
$(".modal-form.in .modal-header h4").html('
Dettaglio Richiesta -
' + '' + ticketNumber + '' + ' Stato: ' + '' + status + '' + '');
$('.modal-form.in .modal-content .modal-body iframe').contents().find("tr:lt(2)").hide();
//$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype1id_name").parent().parent().parent().hide();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype2id").val() == "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype2id_name").parent().parent().parent().hide();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype3id").val() == "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype3id_name").parent().parent().parent().hide();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype4id").val() == "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype4id_name").parent().parent().parent().hide();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype5id").val() == "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype5id_name").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#customerid_name").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_nodeid_name").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_subnodeid_name").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#caseorigincode").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_externalcasetypology").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_customerontheintermediaryspremises").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtamountrequired").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtmontescontibalance").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtreasonforrequest").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_amountrequired").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_montescontibalance").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_reasonforrequest").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcamontescontibalance").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_amountrequired").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcaamountrequired").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcareasonforrequest").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_montescontibalance").parent().parent().parent().hide();
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_reasonforrequest").parent().parent().parent().hide();
var lastReqId = getLatReqTypeIdFromInputs();
var lastReqType = Avanade.Hlv.PortalAgenti.Common.getParentReqTypology(lastReqId);
if (lastReqType != null && lastReqType.length > 0) {
var particularCase = !Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(lastReqType[0].hlv_externalcasetypology) ? parseInt(lastReqType[0].hlv_externalcasetypology) : -1;
var severityValue = lastReqType[0].hlv_severity_value;
var severityLabel = lastReqType[0].hlv_severity_name;
var serviceId = lastReqType[0].hlv_service_id;
var serviceLabel = lastReqType[0].hlv_service_name;
var customerontheintermediaryspremises = lastReqType[0].hlv_customerontheintermediaryspremises;
switch (particularCase) {
case 855600015://Sblocco Quietanzamneto
break;
case 855600014://Montesconti RCA
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtamountrequired").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtamountrequired").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtmontescontibalance").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtmontescontibalance").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtreasonforrequest").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvtreasonforrequest").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_amountrequired").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_amountrequired").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_montescontibalance").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_montescontibalance").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_reasonforrequest").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi_reasonforrequest").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcamontescontibalance").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcamontescontibalance").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcaamountrequired").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcaamountrequired").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcareasonforrequest").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rcareasonforrequest").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_amountrequired").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_amountrequired").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_montescontibalance").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_montescontibalance").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_reasonforrequest").val() != "")
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi_reasonforrequest").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt").is(":checked"))
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca").is(":checked"))
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi").is(":checked"))
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_rca_svi").parent().parent().parent().show();
if ($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi").is(":checked"))
$('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_cvt_svi").parent().parent().parent().show();
break;
}
}
}
})
})
$('#richiesteBody-ticket-section-results [name="0"]').val("");
$('#richiesteBody-ticket-section-results [name="1"]').val("");
$('#richiesteBody-ticket-section-results [name="2"]').prop('type', 'text');
$('#richiesteBody-ticket-section-results [name="2"]').val("");
$('#richiesteBody-ticket-section-results [name="3"]').prop('type', 'text');
$('#richiesteBody-ticket-section-results [name="3"]').val("");
$('#richiesteBody-ticket-section-results [name="4"]').val("");
$('#richiesteBody-ticket-section-results [name="5"]').val("");
$('#richiesteBody-ticket-section-results [name="6"]').val("");
$("#optionset-nodo").hide();
$("#optionset-sottonodo").hide();
};
self.closeModal = function () {
$("#modal-dettaglio-richiesta").modal("hide");
};
self.chiudiRicercaTicket = function () {
$(".ricerca-ticket").hide()
};
self.openModalDettaglioRichiesteLavorazione = function () {
$("#modal-title").text("Richieste in lavorazione");
$("#openPersonalCases").hide();
$("#closedPersonalCases").hide();
$("#openNodeCases").hide();
$("#closedNodeCases").hide();
$("#openSubNodeCases").hide();
$("#closedSubNodeCases").hide();
$("#inProgressPersonalCases").show();
$("#inProgressNodeCases").show();
$("#inProgressSubNodeCases").show();
$("#totale-title").text("Totale richieste in lavorazione");
$("#totalOpenRecords").hide();
$("#totalClosedRecords").hide();
$("#totalRecordInProgress").show();
$("#modal-dettaglio-count-richieste").modal("show");
};
self.openModalDettaglioRichiesteAperte = function () {
$("#modal-title").text("Richieste aperte");
$("#closedPersonalCases").hide();
$("#inProgressPersonalCases").hide();
$("#inProgressNodeCases").hide();
$("#closedNodeCases").hide();
$("#inProgressSubNodeCases").hide();
$("#closedSubNodeCases").hide();
$("#openPersonalCases").show();
$("#openNodeCases").show();
$("#openSubNodeCases").show();
$("#totale-title").text("Totale richieste aperte");
$("#totalOpenRecords").show();
$("#totalClosedRecords").hide();
$("#totalRecordInProgress").hide();
$("#modal-dettaglio-count-richieste").modal("show");
};
self.openModalDettaglioRichiesteChiuse = function () {
$("#modal-title").text("Richieste chiuse");
$("#openPersonalCases").hide();
$("#inProgressPersonalCases").hide();
$("#inProgressNodeCases").hide();
$("#openNodeCases").hide();
$("#inProgressSubNodeCases").hide();
$("#openSubNodeCases").hide();
$("#closedPersonalCases").show();
$("#closedNodeCases").show();
$("#closedSubNodeCases").show();
$("#totale-title").text("Totale richieste chiuse");
$("#totalOpenRecords").hide();
$("#totalClosedRecords").show();
$("#totalRecordInProgress").hide();
$("#modal-dettaglio-count-richieste").modal("show");
};
self.showSearchSection = function () {
$(".entitylist").on("loaded", function () {
$(".customLinkVoice").css("color", hlvConst.colors.green)
$("#customLinkVoiceHrefSearchResults").css("color", hlvConst.colors.green)
})
$(".changingFont").css("color", hlvConst.colors.green)
$(".sort-enabled a").addClass("sort-green");
$(".sort-enabled a").removeClass("sort-red");
$(".sort-enabled a").removeClass("sort-purple");
$(".customLinkVoice").css("color", hlvConst.colors.green)
$(".ticketFilter-option").removeClass("ticketFilter-selected");
$(".ticketFilter-option-cerca").addClass("ticketFilter-selected");
$('#richiesteBody-ticket-section-results [name="0"]').val("");
$('#richiesteBody-ticket-section-results [name="1"]').val("");
$('#richiesteBody-ticket-section-results [name="2"]').val("");
$('#richiesteBody-ticket-section-results [name="3"]').val("");
$('#richiesteBody-ticket-section-results [name="4"]').val("");
$('#richiesteBody-ticket-section-results [name="5"]').val("");
$('#richiesteBody-ticket-section-results [name="6"]').val("");
$("#richiesteBody-ticket-section-general").hide();
$("#subNodeRequestDescription").hide();
$("#nodeRequestDescription").hide();
$("#personalRequestDescription").hide();
$("#richiesteBody-ticket-section-results").show();
self.filtersReset();
};
self.apriRichiestaLavorazione = function () {
$("#richiesteBody-ticket-section").hide()
$("#richiesta-lavorazione-body").show()
};
self.tornaIndietroRichiestaLavorazione = function () {
$("#richiesta-lavorazione-body").hide();
$("#richiesteBody-ticket-section").show()
};
self.apriRicercaTicket = function () {
$(".changingFont").css("color", hlvConst.colors.green);
$(".sort-enabled a").addClass("sort-green");
$(".sort-enabled a").removeClass("sort-red");
$(".sort-enabled a").removeClass("sort-purple");
$(".customLinkVoice").css("color", hlvConst.colors.green);
$(".ricerca-ticket").show();
};
self.searchTab = function () {
var inputText = $(".esegui-ricerca input").val();
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(inputText)) {
inputText = "*" + inputText;
}
$(".input-group.pull-left.view-search.entitylist-search input").val(inputText);
$(".input-group.pull-left.view-search.entitylist-search button").click();
};
self.filtersReset = function () {
$(".esegui-ricerca input").val("");
self.searchTab();
$("#stato_checkbox_select select").val("");
$("#lavoratoda-select select").val("");
$("#incaricoa-select select").val("");
$("#codicesottonodo-select select").val("");
$("input[id='date-filter-custom-from'], input[id='date-filter-custom-to']").val("")
$('#richiesteBody-ticket-section-results [name="2"]').val("");
$('#richiesteBody-ticket-section-results [name="3"]').val("");
self.applyFilters();
};
self.applyFilters = function () {
var stato = $("#stato_checkbox_select select").val();
var lavoratoDa = $("#lavoratoda-select select").val();
var inCaricoa = $("#incaricoa-select select").val();
var codSottonodo = $("#codicesottonodo-select select").val();
$(".input-group.entitylist-filter-option-text #dropdown_0").val(stato);
if (Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(lavoratoDa) || lavoratoDa == "0") {
lavoratoDa = "";
}
$(".input-group.entitylist-filter-option-text #5").val(lavoratoDa);
if (Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(inCaricoa) || inCaricoa == "0") {
inCaricoa = "";
}
if ($("#roles :input").val() == "PI - Direzione") {
var userObj = Avanade.Hlv.PortalAgenti.Common.getUserAgencies();
var userId = userObj != null ? userObj.userid : null;
inCaricoa = userId;
}
$(".input-group.entitylist-filter-option-text #6").val(inCaricoa);
if (Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(codSottonodo) || codSottonodo == "0") {
codSottonodo = "";
}
$("#richiesteBody-ticket-section-results .input-group.entitylist-filter-option-text #4").val(codSottonodo);
var dal = $("#date-filter-custom-from").val();
var al = $("#date-filter-custom-to").val();
if (Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(al)) {
al = $("input[id='date-filter-custom-to']").val("")
$('#richiesteBody-ticket-section-results [name="3"]').val("");
}
else {
$('#richiesteBody-ticket-section-results [name="3"]').val(moment(al).format("MM/DD/YYYY"));
}
if (Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(dal)) {
dal = $("input[id='date-filter-custom-from']").val("")
$('#richiesteBody-ticket-section-results [name="2"]').val("");
}
else {
$('#richiesteBody-ticket-section-results [name="2"]').val(moment(dal).format("MM/DD/YYYY"));
}
$('#richiesteBody-ticket-section-results [name="1"]').val("");
$(".btn.btn-default.btn-entitylist-filter-submit").click();
};
self.hideTicketData = function () {
if (!$(".dati-richiesta-lavorazione").is(":hidden")) {
$(".dati-richiesta-bar svg").attr('width', '24.773').attr('height', '15.149').attr('viewBox', '0 0 30.773 21.149');
$(".dati-richiesta-bar svg path").attr('transform', 'translate(38.655 32.4), rotate(180)');
$(".dati-richiesta-lavorazione").hide()
}
else if ($(".dati-richiesta-lavorazione").is(":hidden")) {
$(".dati-richiesta-bar svg").attr('width', '15.149').attr('height', '24.773').attr('viewBox', '0 0 21.149 30.773');
$(".dati-richiesta-bar svg path").attr('transform', 'translate(32.4 -7.882) rotate(90)');
$(".dati-richiesta-lavorazione").show()
}
};
self.hideInteraction = function () {
if (!$(".richiesta-lavorazione-interazione").is(":hidden")) {
$(".interazione-bar svg").attr('width', '24.773').attr('height', '15.149').attr('viewBox', '0 0 30.773 21.149');
$(".interazione-bar svg path").attr('transform', 'translate(38.655 32.4), rotate(180)');
$(".richiesta-lavorazione-interazione").hide()
}
else if ($(".richiesta-lavorazione-interazione").is(":hidden")) {
$(".interazione-bar svg").attr('width', '15.149').attr('height', '24.773').attr('viewBox', '0 0 21.149 30.773');
$(".interazione-bar svg path").attr('transform', 'translate(32.4 -7.882) rotate(90)');
$(".richiesta-lavorazione-interazione").show()
}
};
self.personalCasesFilter = function () {
var userObj = Avanade.Hlv.PortalAgenti.Common.getUserAgencies();
var userId = userObj != null ? userObj.userid : null;
if (userId == null) {
return;
}
$("#optionset-nodo").hide();
$("#optionset-sottonodo").hide();
$("#subNodeRequestDescription").hide();
$("#nodeRequestDescription").hide();
$("#personalRequestDescription").show();
$("#ticket-filter-option-nodo").val(0);
$("#ticket-filter-option-sottonodo").val(0);
$('[name="0"]').val("");
$('#richiesteBody-ticket-section-general [name="0"]').val(userId);
//$('.entitylist-filter-option .checkbox input[name="3"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="3"]').val("");
//$('.entitylist-filter-option .checkbox input[name="5"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="5"]').val("");
$('[name="1"]').val("");
$('[name="2"]').val("");
$('[name="3"]').val("");
$('[name="4"]').val("");
$('[name="5"]').val("");
$('[name="6"]').val("");
$(".btn.btn-default.btn-entitylist-filter-submit").click();
};
self.nodoCasesFilter = function () {
//var userObj = Avanade.Hlv.PortalAgenti.Common.getUserAgencies();
var nodo = $("#ticket-filter-option-nodo").val();
if (nodo == null || nodo == "0") {
return;
}
$('.input-group.entitylist-filter-option-text input[name="0"]').val("");
$('.input-group.entitylist-filter-option-text input[name="1"]').val(nodo);
$('.input-group.entitylist-filter-option-text input[name="2"]').val("");
//$('.entitylist-filter-option .checkbox input[name="3"]').prop('checked', true)
$('.input-group.entitylist-filter-option-text input[name="3"]').val("aaa");
//$('.entitylist-filter-option .checkbox input[name="5"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="5"]').val("");
$(".btn.btn-default.btn-entitylist-filter-submit").click();
};
self.subNodoCasesFilter = function () {
//var userObj = Avanade.Hlv.PortalAgenti.Common.getUserAgencies();
var sottonodo = $("#ticket-filter-option-sottonodo").val();
if (sottonodo == null) {
return;
}
$('[name="0"]').val("");
if ($("#roles :input").val() == "PI - Agente" ||
$("#roles :input").val() == "PI - Insurance Corner") {
//$('.entitylist-filter-option .checkbox input[name="5"]').prop('checked', true)
$('.input-group.entitylist-filter-option-text input[name="5"]').val("aaa");
}
else {
$('#richiesteBody-ticket-section-general [name="2"]').val(sottonodo);
$('.input-group.entitylist-filter-option-text input[name="5"]').val("");
}
//$('.entitylist-filter-option .checkbox input[name="3"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="3"]').val("");
$('[name="1"]').val("");
$('[name="3"]').val("");
$('[name="4"]').val("");
$('[name="5"]').val("");
$('[name="6"]').val("");
$(".btn.btn-default.btn-entitylist-filter-submit").click();
};
self.showNodeOptions = function () {
var userObj = Avanade.Hlv.PortalAgenti.Common.getUserAgencies();
var userId = userObj != null ? userObj.userid : null;
if (userId == null) {
return;
}
$('[name="0"]').val("");
$('[name="1"]').val(userId);
$('[name="2"]').val("");
$('[name="3"]').val("");
$('[name="4"]').val("");
$('[name="5"]').val("");
$('[name="6"]').val("");
//$('.entitylist-filter-option .checkbox input[name="3"]').prop('checked', true)
$('.input-group.entitylist-filter-option-text input[name="3"]').val("aaa");
$("#optionset-nodo").show();
$("#optionset-sottonodo").hide();
$("#subNodeRequestDescription").hide();
$("#nodeRequestDescription").show();
$("#personalRequestDescription").hide();
$("#ticket-filter-option-nodo").val(0);
$("#ticket-filter-option-sottonodo").val(0);
$(".btn.btn-default.btn-entitylist-filter-submit").click();
};
self.showSubNodeOptions = function () {
var userObj = Avanade.Hlv.PortalAgenti.Common.getUserAgencies();
var userId = userObj != null ? userObj.userid : null;
if (userId == null) {
return;
}
var firstSubNode = $($("#ticket-filter-option-sottonodo option")[1]).attr('value')
$('[name="0"]').val("");
$('[name="1"]').val(userId);
$('[name="2"]').val(firstSubNode);
$('[name="3"]').val("");
$('[name="4"]').val("");
$('[name="5"]').val("");
$('[name="6"]').val("");
$("#optionset-nodo").hide();
$("#optionset-sottonodo").show();
$("#subNodeRequestDescription").show();
$("#nodeRequestDescription").hide();
$("#personalRequestDescription").hide();
//$('.entitylist-filter-option .checkbox input[name="3"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="3"]').val("");
//$('.entitylist-filter-option .checkbox input[name="5"]').prop('checked', false)
$('.input-group.entitylist-filter-option-text input[name="5"]').val("ss");
$("#ticket-filter-option-nodo").val(0);
$("#ticket-filter-option-sottonodo").val(firstSubNode);
$(".btn.btn-default.btn-entitylist-filter-submit").click();
};
var getLatReqTypeIdFromInputs = function () {
var resid = "";
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype5id").val())) {
return $('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype5id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype4id").val())) {
return $('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype4id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype3id").val())) {
return $('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype3id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype2id").val())) {
return $('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype2id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype1id").val())) {
return $('.modal-form.in .modal-content .modal-body iframe').contents().find("#hlv_requesttype1id").val()
}
}
};
Avanade.Hlv.PortalAgenti.VisualizzaRichieste.Lavorazione = new function () {
const self = this;
self.init = function () {
var id = $("#incident-regarding-id").val();
var title = $("#incident-regarding-title").val();
var field = "#regardingobject";
$(field + "id").val(id);
$(field + "id_entityname").val("incident");
$(field + "id_name").val(title);
var cell = $(field + "id_name").parent().parent().parent();
cell.hide();
field = "#subject";
var op = $("#currentuserfullname").val();
var tn = "Interazione";
var subject = tn + " - " + op;
$(field).val(subject);
cell = $(field).parent().parent().parent();
cell.hide();
field = "#hlv_author";
var idAuthor = $("#currentuserid").val();
$(field).val(idAuthor);
cell = $(field).parent().parent().parent();
cell.hide();
$('.dati-richiesta-lavorazione .form-readonly.entity-form').find("tr:lt(2)").hide();
$('.dati-richiesta-lavorazione')
if ($(".dati-richiesta-lavorazione #hlv_requesttype2id").val() == "")
$(".dati-richiesta-lavorazione #hlv_requesttype2id_name").parent().parent().parent().hide();
if ($(".dati-richiesta-lavorazione #hlv_requesttype3id").val() == "")
$(".dati-richiesta-lavorazione #hlv_requesttype3id_name").parent().parent().parent().hide();
if ($(".dati-richiesta-lavorazione #hlv_requesttype4id").val() == "")
$(".dati-richiesta-lavorazione #hlv_requesttype4id_name").parent().parent().parent().hide();
if ($(".dati-richiesta-lavorazione #hlv_requesttype5id").val() == "")
$(".dati-richiesta-lavorazione #hlv_requesttype5id_name").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #customerid_name").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_nodeid_name").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_subnodeid_name").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #caseorigincode").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_externalcasetypology").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_customerontheintermediaryspremises").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_cvt").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_cvtamountrequired").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_cvtmontescontibalance").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_cvtreasonforrequest").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_cvt_svi_amountrequired").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_cvt_svi_montescontibalance").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_cvt_svi_reasonforrequest").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_cvt_svi").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_rca").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_rcamontescontibalance").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_rca_svi_amountrequired").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_rca_svi").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_rcaamountrequired").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_rcareasonforrequest").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_rca_svi_montescontibalance").parent().parent().parent().hide();
$(".dati-richiesta-lavorazione #hlv_rca_svi_reasonforrequest").parent().parent().parent().hide();
var lastReqId2 = getLatReqTypeIdFromInputsInPage();
var lastReqType2 = Avanade.Hlv.PortalAgenti.Common.getParentReqTypology(lastReqId2);
if (lastReqType2 != null && lastReqType2.length > 0) {
var particularCase = !Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty(lastReqType2[0].hlv_externalcasetypology) ? parseInt(lastReqType2[0].hlv_externalcasetypology) : -1;
var severityValue = lastReqType2[0].hlv_severity_value;
var severityLabel = lastReqType2[0].hlv_severity_name;
var serviceId = lastReqType2[0].hlv_service_id;
var serviceLabel = lastReqType2[0].hlv_service_name;
var customerontheintermediaryspremises = lastReqType2[0].hlv_customerontheintermediaryspremises;
switch (particularCase) {
case 855600015://Sblocco Quietanzamneto
break;
case 855600014://Montesconti RCA
if ($(".dati-richiesta-lavorazione #hlv_cvtamountrequired").val() != "")
$(".dati-richiesta-lavorazione #hlv_cvtamountrequired").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_cvtmontescontibalance").val() != "")
$(".dati-richiesta-lavorazione #hlv_cvtmontescontibalance").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_cvtreasonforrequest").val() != "")
$(".dati-richiesta-lavorazione #hlv_cvtreasonforrequest").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_cvt_svi_amountrequired").val() != "")
$(".dati-richiesta-lavorazione #hlv_cvt_svi_amountrequired").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_cvt_svi_montescontibalance").val() != "")
$(".dati-richiesta-lavorazione #hlv_cvt_svi_montescontibalance").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_cvt_svi_reasonforrequest").val() != "")
$(".dati-richiesta-lavorazione #hlv_cvt_svi_reasonforrequest").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_rcamontescontibalance").val() != "")
$(".dati-richiesta-lavorazione #hlv_rcamontescontibalance").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_rcaamountrequired").val() != "")
$(".dati-richiesta-lavorazione #hlv_rcaamountrequired").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_rcareasonforrequest").val() != "")
$(".dati-richiesta-lavorazione #hlv_rcareasonforrequest").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_rca_svi_amountrequired").val() != "")
$(".dati-richiesta-lavorazione #hlv_rca_svi_amountrequired").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_rca_svi_montescontibalance").val() != "")
$(".dati-richiesta-lavorazione #hlv_rca_svi_montescontibalance").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_rca_svi_reasonforrequest").val() != "")
$(".dati-richiesta-lavorazione #hlv_rca_svi_reasonforrequest").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_cvt").is(":checked"))
$(".dati-richiesta-lavorazione #hlv_cvt").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_rca").is(":checked"))
$(".dati-richiesta-lavorazione #hlv_rca").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_rca_svi").is(":checked"))
$(".dati-richiesta-lavorazione #hlv_rca_svi").parent().parent().parent().show();
if ($(".dati-richiesta-lavorazione #hlv_cvt_svi").is(":checked"))
$(".dati-richiesta-lavorazione #hlv_cvt_svi").parent().parent().parent().show();
break;
}
}
setDragAndDrop();
}
var getLatReqTypeIdFromInputsInPage = function () {
var resid = "";
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($(".dati-richiesta-lavorazione #hlv_requesttype5id").val())) {
return $(".dati-richiesta-lavorazione #hlv_requesttype5id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($(".dati-richiesta-lavorazione #hlv_requesttype4id").val())) {
return $(".dati-richiesta-lavorazione #hlv_requesttype4id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($(".dati-richiesta-lavorazione #hlv_requesttype3id").val())) {
return $(".dati-richiesta-lavorazione #hlv_requesttype3id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($(".dati-richiesta-lavorazione #hlv_requesttype2id").val())) {
return $(".dati-richiesta-lavorazione #hlv_requesttype2id").val()
}
if (!Avanade.Hlv.PortalAgenti.Common.isStringNullOrEmpty($(".dati-richiesta-lavorazione #hlv_requesttype1id").val())) {
return $(".dati-richiesta-lavorazione #hlv_requesttype1id").val()
}
}
var getDataTransfer = function () {
try {
return new DataTransfer();
} catch (e) {
return null;
}
};
var setDragAndDrop = function () {
var inputFile = $("input[type='file']");
var parentInputFile = inputFile.parent();
inputFile.addClass("uxc-m-multi-file-upload__input uxc-js-m-multi-file-upload__input");
parentInputFile.append("