Created
June 26, 2020 10:13
-
-
Save adrianferr/552ee7d9d6caf965be52a82c8fd4ce4f to your computer and use it in GitHub Desktop.
altaNodo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tipoNodo; | |
var catalanModificado=false; | |
var origenFormularioLinkParameter; | |
var parametroOriginal; | |
var nuevoParametro; | |
var listaParametros; | |
var listaSinOriginal; | |
var listaIntermediaSinAmpInicial; | |
var listaIntermediaSinDobleAmp; | |
var linkParametersInicial; | |
var linkParameters; | |
var listaSinAmpErroneos; | |
var identificadorPerfilado; | |
var linksTabla; | |
var idBoton; | |
var listaTabla; | |
var tPalera; | |
var numFila; | |
var tablaAUsar; | |
var nTrGlobal; | |
/*Bloqueo de la pantalla principal para mostrar ventanas modales*/ | |
jQuery.fn.doBloquer = function() { | |
$(this).css({ | |
'position' : 'fixed', | |
'width' : '100%', | |
'height' : '100%', | |
'left' : '0px', | |
'top' : '0px', | |
'background-color' : '#000', | |
'opacity' : 0.5, | |
'z-index' : '999' | |
}); | |
$(this).fadeIn(500); | |
}; | |
/** | |
* Muestra la ventana modal de alta parametro | |
*/ | |
jQuery.fn.doModalAlta = function() { | |
$(this).css({ | |
'width' : '25%' | |
}); | |
$(this).css({ | |
'position' : 'fixed', | |
'left' : '650px', | |
'top' : '50px', | |
'z-index' : '1500' | |
}); | |
$(this).fadeIn(500); | |
}; | |
/** | |
* Abre la ventana modal de altaParameter | |
*/ | |
function abrirModalAltaParameter() { | |
$("#bloquer").doBloquer(); | |
$("#divAltaParametro").doModalAlta(); | |
} | |
/** | |
* Cierra la venta modal de altaParameter y desbloquea la pantalla principal | |
*/ | |
function cerrarModalAltaParameter() { | |
$("#divAltaParametro").css('display', 'none'); | |
document.body.style.cursor = "default"; | |
} | |
/** | |
* Cierra modal AltaParameter con la X de arriba-derecha | |
*/ | |
$("#btn-cerrarAltaLinkParameter").click(function(event){ | |
cerrarModalAltaParameter(); | |
}); | |
/** | |
* Cierra modal AltaParameter con boton volver | |
*/ | |
$("#volverBtnAltaParameter").on('click', function(event) { | |
event.preventDefault(); | |
cerrarModalAltaParameter(); | |
}); | |
function anadirRow(nombreLinkP, valor, identificadorPerfilado){ | |
var aplicacionAux = identificadorPerfilado.split("_")[0]; | |
var codigoPerfilAux = identificadorPerfilado.split("_")[1]; | |
var codigoIdiomaAux = identificadorPerfilado.split("_")[2];; | |
var nombreTabla = "tablaParameters_"+identificadorPerfilado; | |
tablaAUsar=$('#'+nombreTabla).dataTable(); | |
$('#tablaParameters_'+identificadorPerfilado).dataTable().fnAddData({id:'1', aplicacion:aplicacionAux, perfil:codigoPerfilAux, idioma:codigoIdiomaAux, nombre:nombreLinkP, valor:valor}); | |
} | |
function borrarRow(identificadorPerfilado, nTr){ | |
var nombreTabla = "tablaParameters_"+identificadorPerfilado; | |
tablaAUsar=$('#'+nombreTabla).dataTable(); | |
tablaAUsar.fnDeleteRow(nTr); | |
tablaAUsar.fnDraw(); | |
} | |
function modificarRowTablaDesdeEditar(identificadorPerfilado, nTrGlobal, nombreNuevo, valorNuevo){ | |
var aplicacionAuxM = identificadorPerfilado.split("_")[0]; | |
var codigoPerfilAuxM = identificadorPerfilado.split("_")[1]; | |
var codigoIdiomaAuxM = identificadorPerfilado.split("_")[2]; | |
//$('#tablaParameters_'+identificadorPerfilado).dataTable().fnUpdate({id:'1', aplicacion:aplicacionAuxM, perfil:codigoPerfilAuxM, idioma:codigoIdiomaAuxM, nombre:nombreNuevo, valor:valorNuevo, data:'8'}, nTrGlobal); | |
//$('#tablaParameters_'+identificadorPerfilado).dataTable().fnUpdate(1, aplicacionAuxM, codigoPerfilAuxM, codigoIdiomaAuxM, nombreNuevo, valorNuevo, nTrGlobal); | |
//$('#tablaParameters_'+identificadorPerfilado).dataTable().fnUpdate(['id:'+'1', 'aplicacion:'+aplicacionAuxM, 'perfil:'+codigoPerfilAuxM, 'idioma:'+codigoIdiomaAuxM, 'nombre:'+nombreNuevo, 'valor:'+valorNuevo, 'data:'+'8'], nTrGlobal); | |
//$('#tablaParameters_'+identificadorPerfilado).dataTable().fnUpdate(['1', aplicacionAuxM, codigoPerfilAuxM, codigoIdiomaAuxM, nombreNuevo, valorNuevo, 8], nTrGlobal); | |
} | |
function altaNodoAjax(textoAlertaLink){ | |
var idFaq = $('#idFaq').val(); | |
var checkedNodo=""; | |
if($('#siVerificado').length>0){ | |
if(document.getElementById('siVerificado').checked){ | |
checkedNodo="S"; | |
}else{ | |
checkedNodo="N"; | |
} | |
} | |
var jsonForm = $('#altaNodoForm').serialize(); | |
jsonForm += "&idFaq="+idFaq; | |
if(checkedNodo!==""){ | |
jsonForm += "&verificadoCatalanNoHidden=" + checkedNodo; | |
} | |
jsonForm += "&catalanModificado=" + catalanModificado; | |
$.ajax({ | |
url : "/adminFaq/altaNodo"+ "?idAplicacionEnUso=" + $("#idAplicacionMenu").val(), | |
type: 'GET', | |
cache: false, | |
async: false, | |
headers:{ | |
'Content-Type': "application/x-www-form-urlencoded; charset=UTF-8" | |
}, | |
data : jsonForm, | |
success : function(data) { | |
if (textoAlertaLink!=="") { | |
modalAlertListado(true,Globalize.localize('guiada.nodo.actualizado')+textoAlertaLink); | |
}else{ | |
modalAlertError(true,Globalize.localize('guiada.nodo.actualizado')); | |
} | |
cerrarModalAltaNodo(); | |
if (origenEdit==="ATRIBUTOS") { | |
var idNode= $("#idNode").val(); | |
$('#divGuiadasFAQ').html(data); | |
$('#divGuiadasFAQ').show(); | |
loadDetalleGuiada(idNode); | |
} else{ | |
$('#divGuiadasFAQ').html(data); | |
$('#divGuiadasFAQ').show(); | |
} | |
}, | |
error : function(error) { | |
modalAlertError(false,JSON.stringify(error)); | |
}, | |
}); | |
} | |
//Comprueba si existe un nodo dada un IdNode. Necesario hacer comprobaciones para los nodos -2,-3,-4 | |
function existeNodo(idNodo) { | |
var jsonForm = $('#altaNodoForm').serialize(); | |
var idFaq = $('#idFaq').val(); | |
var resultado; | |
jsonForm += "&idFaq="+idFaq+"&idNodoVal="+idNodo; | |
$.ajax({ | |
url : "/adminFaq/existeNodo", | |
type: 'GET', | |
cache: false, | |
async: false, | |
headers:{ | |
'Content-Type': "application/x-www-form-urlencoded; charset=UTF-8" | |
}, | |
data : jsonForm, | |
success : function(data) { | |
if (data.resultado==="KO"){ | |
resultado = false; | |
}else{ | |
resultado = true; | |
} | |
}, | |
error : function(error) { | |
modalAlertError(false,JSON.stringify(error)); | |
resultado = false; | |
return false; | |
}, | |
}); | |
return resultado; | |
} | |
//Comprueba si existe otro nodo con el mismo link | |
function existeLink(idNodo) { | |
var jsonForm = $('#altaNodoForm').serialize(); | |
var idFaq = $('#idFaq').val(); | |
var resultado; | |
jsonForm += "&idFaq=" + idFaq + "&idNodoVal=" + idNodo; | |
$.ajax({ | |
url : "/adminFaq/existeLinkNodo", | |
type : 'GET', | |
cache : false, | |
async : false, | |
headers : { | |
'Content-Type' : "application/x-www-form-urlencoded; charset=UTF-8" | |
}, | |
data : jsonForm, | |
success : function(data) { | |
if (data.resultado === "KO"){ | |
resultado = data.mensaje; | |
}else{ | |
resultado = ""; | |
} | |
}, | |
error : function(error) { | |
modalAlertError(false, JSON.stringify(error)); | |
resultado = ""; | |
}, | |
}); | |
return resultado; | |
} | |
function altaNodo(textoAlertaLink){ | |
var idNode= $("#idNode").val(); | |
if(catalanModificado && idNode>=0){ | |
modalConfirm(2500, Globalize.localize('adminFaq.mensaje.verificarIdiomas.confirmacion'), function() {altaNodoAjax(textoAlertaLink)} ); | |
}else{ | |
altaNodoAjax(textoAlertaLink); | |
} | |
} | |
function decodeHtml(html) { | |
var txt = document.createElement("textarea"); | |
txt.innerHTML = html; | |
return txt.value; | |
} | |
function seleccionarCustomizacion(idAplicacion, perfil, codigoIdioma){ | |
$("#aplicacionSelect").val(idAplicacion).trigger("change"); | |
$("#pefilSelect").val(idAplicacion + "_" + perfil).trigger("change"); | |
$("[id^='idiomaTab_" + idAplicacion + "_" +perfil + "_" + codigoIdioma+"']").trigger("click"); | |
} | |
/** | |
* Cierra la venta modal y desbloquea la pantalla principal | |
*/ | |
function cerrarModalAltaNodo() { | |
$("#bloquer").css('display', 'none'); | |
$("#modalAltaNodo").css('display', 'none'); | |
document.body.style.cursor = "default"; | |
} | |
function esNumerico(pulsada,permitidos){ | |
if($.inArray(pulsada,permitidos) >=0 ){ | |
return true; | |
} | |
if(pulsada >= 48 && pulsada <= 57){ | |
return true; | |
} | |
if(pulsada >= 96 && pulsada <= 105){ | |
return true; | |
} | |
return false; | |
} | |
$(document).ready(function() { | |
//crear tabla parametros | |
var aoColumns = [ | |
{'mData' : 'aplicacion', "bSearchable": false, 'bSortable': false, "bVisible":false}, | |
{'mData' : 'perfil',"bSearchable": false, 'bSortable': false, "bVisible":false}, | |
{'mData' : 'idioma',"bSearchable": false, 'bSortable': false, "bVisible":false}, | |
{'mData' : 'nombre'}, | |
{'mData' : 'valor'}, | |
{'mData' : null, sDefaultContent:'<i class="icono-editar"></i><i class="icono-borrar"></i>', 'bSortable':false, "bSearchable": false} | |
]; | |
var oLanguage = { | |
'sLengthMenu' : Globalize.localize('table.sLengthMenu'), | |
'sInfo' : Globalize.localize('table.sInfoSummary'), | |
'sInfoEmpty' : Globalize.localize('table.sInfoEmpty'), | |
'sInfoFiltered' : Globalize.localize('table.sInfoFiltered'), | |
'sZeroRecords' : Globalize.localize('table.sZeroRecords'), | |
'sSearch': Globalize.localize('table.sSearch') | |
}; | |
var oInit = { | |
"sDom" : "<'datatables-action-box'<'col-md-2'><'col-md-12'f>r>t<'datatables-action-box'<'span6'i><'span6'>>", | |
"bPaginate" : false, | |
"bScrollCollapse" : true, | |
"sScrollY" : "200px", | |
"bFilter" : true, | |
"bLengthChange" : false, | |
"bAutoWidth": false, | |
"bInfo" : true, | |
"aoColumns" : aoColumns, | |
"oLanguage" : oLanguage | |
}; | |
//Se crean tantas tablas como selectores haya | |
$('[id^="tablaParameters_"]').each(function(){ | |
$(this).dataTable(oInit); | |
}); | |
$("[id*=buttonAltaLinkParameter_]").on('click', function(){ | |
//recuperamos elementos de la customizacion | |
idBoton = $(this).attr("id"); | |
identificadorPerfilado = idBoton.replace("buttonAltaLinkParameter_", ""); | |
//recojo lista de parametros original de la tabla desde la variable oculta | |
var nombreDinamico="listaParametrosTabla_"+identificadorPerfilado; | |
linksTabla=$('#'+nombreDinamico).val(); | |
abrirModalAltaParameter(); | |
origenFormularioLinkParameter = $('#origenFormularioLinkParameter').val("nuevo"); | |
$('#tituloAltaLinkParameter').text("Nuevo parámetro"); | |
$('input#nombreParametro').val(""); | |
$('input#valorParametro').val(""); | |
$('#valorParametroComboDiv').hide(); | |
$('#valorParametroDiv').show(); | |
document.getElementById('checkValorContexto').checked=false; | |
$('#checkValorContexto').change(function (){ | |
if($('#checkValorContexto').is(':checked')) { | |
$('#valorParametroDiv').hide(); | |
$('#valorParametroComboDiv').val(""); | |
$('#valorParametroComboDiv').show(); | |
}else{ | |
$('#valorParametroComboDiv').hide(); | |
$('input#valorParametro').val(""); | |
$('#valorParametroDiv').show(); | |
} | |
}); | |
}); | |
$("[id^='tablaParameters_'] tbody td .icono-editar").on('click', function(){ | |
var nTr = $(this).parents('tr')[0]; | |
nTrGlobal=nTr; | |
var idTabla = $(this).parent().parent().parent().parent().attr("id"); | |
identificadorPerfilado = idTabla.replace("tablaParameters_", ""); | |
var nombreTabla = "tablaParameters_"+identificadorPerfilado; | |
tablaAUsar=$('#'+nombreTabla).dataTable(); | |
var app = tablaAUsar.fnGetData(nTr,0); | |
var perf = tablaAUsar.fnGetData(nTr,1); | |
var idiom = tablaAUsar.fnGetData(nTr,2); | |
var nombre = tablaAUsar.fnGetData(nTr,3); | |
var valor = tablaAUsar.fnGetData(nTr,4); | |
//abrir pop-up | |
abrirModalAltaParameter(); | |
origenFormularioLinkParameter = $('#origenFormularioLinkParameter').val("editar"); | |
//relleno parametroOriginal de entrada al formulario | |
parametroOriginal=nombre+"="+valor; | |
//recojo lista de parametros original de la tabla desde la variable oculta | |
var nombreDinamico= "listaParametrosTabla_"+identificadorPerfilado; | |
linksTabla = $('#'+nombreDinamico).val(); | |
$('#tituloAltaLinkParameter').text("Editar parámetro"); | |
$('input#nombreParametro').val(""); | |
$('input#valorParametro').val(""); | |
if(valor.indexOf("${") == 0){ | |
$('input#nombreParametro').val(nombre); | |
$('#valorParametroDiv').hide(); | |
$('#valorParametroComboDiv').show(); | |
$('#comboParametroCombo').val(valor); | |
$("#checkValorContexto").prop("checked", true); | |
}else{ | |
$('input#nombreParametro').val(nombre); | |
$('input#valorParametro').val(valor); | |
$('#valorParametroComboDiv').hide(); | |
$('#valorParametroDiv').show(); | |
$("#checkValorContexto").prop("checked", false); | |
} | |
//$('#tablaPalera').dataTable().fnUpdate([1, app, perf, idiom, nombre, valor, 7], nTr); | |
//$('#tablaPalera').dataTable().fnUpdate([1, 1, 1, 1, 1, 1], nTr); | |
//error dado: datatables warning (table id = 'tableParameters_1_DEFAULT_es'): requested unknown parameter 'id' from the datasource for row2 | |
}); | |
$("[id^='tablaParameters_'] tbody td .icono-borrar").on('click', function(){ | |
var nTr = $(this).parents('tr')[0]; | |
numFila= nTr._DT_RowIndex; | |
var idTabla = $(this).parent().parent().parent().parent().attr("id"); | |
identificadorPerfilado = idTabla.replace("tablaParameters_", ""); | |
var nombreTabla = "tablaParameters_"+identificadorPerfilado; | |
tablaAUsar=$('#'+nombreTabla).dataTable(); | |
var app = tablaAUsar.fnGetData(nTr,0); | |
var perf = tablaAUsar.fnGetData(nTr,1); | |
var idiom = tablaAUsar.fnGetData(nTr,2); | |
var nombre = tablaAUsar.fnGetData(nTr,3); | |
var valor = tablaAUsar.fnGetData(nTr,4); | |
//recojo idFaq, nodeId y elementos que conforman el idGlobal | |
var idFaq= $("#idFaq").val(); | |
var nodeId= $("#idNode").val(); | |
//recojo lista de parametros original de la tabla desde la variable oculta | |
var nombreDinamico= "listaParametrosTabla_"+identificadorPerfilado; | |
listaParametros = $('#'+nombreDinamico).val(); | |
//alert("Elementos. Nombre: "+nombre+". Valor: "+valor+". Global: "+global+". id: "+id+". numFila: "+numFila+". ListaParametros: "+listaParametros); | |
var aplicacion = identificadorPerfilado.split("_")[0]; | |
var codigoPerfil = identificadorPerfilado.split("_")[1]; | |
var codigoIdioma = identificadorPerfilado.split("_")[2]; | |
//si es un edit sustituyo el original por el nuevo | |
//origen = $("#origenFormularioLinkParameter").val(); | |
//parametro a borrar | |
parametroOriginal=nombre+"="+valor; | |
//recorro la lista de parametros, localizo el original, y lo cambio por el nuevo, conformando la lista final | |
listaSinOriginal=listaParametros.replace(parametroOriginal, ""); | |
//elimino posible & inicial, y posible doble && | |
var amp="&"; | |
if(listaSinOriginal.indexOf("&") == 0){ | |
listaIntermediaSinAmpInicial=listaSinOriginal.substr(1); | |
listaIntermediaSinDobleAmp = listaIntermediaSinAmpInicial.replace(/&&/g,"&"); | |
if( listaIntermediaSinDobleAmp.lastIndexOf(amp) == (listaIntermediaSinDobleAmp.length - amp.length) && listaIntermediaSinDobleAmp.lastIndexOf(amp) >= 0){ | |
listaSinAmpErroneos=listaIntermediaSinDobleAmp.substr(0, listaIntermediaSinDobleAmp.length - 1); | |
}else{ | |
listaSinAmpErroneos=listaIntermediaSinDobleAmp; | |
} | |
linkParametersInicial=listaSinAmpErroneos; | |
}else{ | |
listaIntermediaSinDobleAmp = listaSinOriginal.replace(/&&/g,"&"); | |
if( listaIntermediaSinDobleAmp.lastIndexOf(amp) == (listaIntermediaSinDobleAmp.length - amp.length) && listaIntermediaSinDobleAmp.lastIndexOf(amp) >= 0){ | |
listaSinAmpErroneos=listaIntermediaSinDobleAmp.substr(0, listaIntermediaSinDobleAmp.length - 1); | |
}else{ | |
listaSinAmpErroneos=listaIntermediaSinDobleAmp; | |
} | |
linkParametersInicial=listaSinAmpErroneos; | |
} | |
//modifico linkParameters para eliminar problemas | |
linkParameters = encodeURIComponent(linkParametersInicial); | |
//ajax | |
var jsonForm = ""; | |
jsonForm += "&idFaq="+idFaq; | |
jsonForm += "&nodeId="+nodeId ; | |
jsonForm += "&aplicacion="+aplicacion; | |
jsonForm += "&codigoPerfil="+codigoPerfil; | |
jsonForm += "&codigoIdioma="+codigoIdioma; | |
jsonForm += "&linkParameters="+linkParameters; | |
$.ajax({ | |
url : "/adminFaq/cambioLinkParameter"+"?idAplicacionEnUso="+$("#idAplicacionMenu").val(), | |
type: 'GET', | |
cache: false, | |
async: false, | |
headers:{'Content-Type': "application/x-www-form-urlencoded; charset=UTF-8"}, | |
data : jsonForm, | |
success : function(data) { | |
if (data.mensaje==="OK"){ | |
modalAlertListado(true,Globalize.localize('label.faqGuiada.parametrosActualizado')); | |
//actualizo el valor de la variable oculta | |
$('#'+nombreDinamico).val(linkParametersInicial); | |
borrarRow(identificadorPerfilado, nTr); | |
}else{ | |
modalAlertError(true,Globalize.localize('label.faqGuiada.parametrosNoActualizado')); | |
cerrarModalAltaParameter(); | |
} | |
}, | |
error : function(error) { | |
modalAlertError(false,JSON.stringify(error)); | |
resultado = false; | |
return false; | |
}, | |
error : function(error) { | |
modalAlertError(false,JSON.stringify(error)); | |
}, | |
}); | |
}); | |
$("#guardarBtnAltaParameter").on('click', function(event){ | |
var validarParametros=true; | |
//recojo idFaq, nodeId y elementos que conforman el idGlobal | |
var idFaq= $("#idFaq").val(); | |
var nodeId= $("#idNode").val(); | |
var aplicacion = identificadorPerfilado.split("_")[0]; | |
var codigoPerfil = identificadorPerfilado.split("_")[1]; | |
var codigoIdioma = identificadorPerfilado.split("_")[2]; | |
//recojo los valores y las conformo en string | |
var nombreLinkP=$('input#nombreParametro').val(); | |
var valorLinkP=$('input#valorParametro').val(); | |
var valorComboLinkP=$('#comboParametroCombo').val(); | |
var valor; | |
//valido que no sea vacio | |
if((valorLinkP==="") && (valorComboLinkP==="") ){ | |
validarParametros=false; | |
} | |
if(valorComboLinkP ===""){ | |
valor=valorLinkP; | |
nuevoParametro=nombreLinkP+"="+valorLinkP; | |
}else{ | |
valor=valorComboLinkP; | |
nuevoParametro=nombreLinkP+"="+valorComboLinkP; | |
} | |
var nombreDinamico= "listaParametrosTabla_"+identificadorPerfilado; | |
//si es un edit sustituyo el original por el nuevo | |
origen = $("#origenFormularioLinkParameter").val(); | |
var amp="&"; | |
if(origen=== "editar"){ | |
//recojo la lista de parametros inicial de la tabla | |
listaParametros = linksTabla; | |
//recorro la lista de parametros, localizo el original, y lo cambio por el nuevo, conformando la lista final | |
listaSinOriginal=listaParametros.replace(parametroOriginal, ""); | |
//elimino posible & inicial, y posible doble && | |
if(listaSinOriginal.indexOf("&") == 0){ | |
listaIntermediaSinAmpInicial=listaSinOriginal.substr(1); | |
listaIntermediaSinDobleAmp = listaIntermediaSinAmpInicial.replace(/&&/g,"&"); | |
if( listaIntermediaSinDobleAmp.lastIndexOf(amp) == (listaIntermediaSinDobleAmp.length - amp.length) && listaIntermediaSinDobleAmp.lastIndexOf(amp) >= 0){ | |
listaSinAmpErroneos=listaIntermediaSinDobleAmp.substr(0, listaIntermediaSinDobleAmp.length - 1); | |
}else{ | |
listaSinAmpErroneos=listaIntermediaSinDobleAmp; | |
} | |
linkParametersInicial=listaSinAmpErroneos+"&"+nuevoParametro; | |
}else{ | |
listaIntermediaSinDobleAmp = listaSinOriginal.replace(/&&/g,"&"); | |
if( listaIntermediaSinDobleAmp.lastIndexOf(amp) == (listaIntermediaSinDobleAmp.length - amp.length) && listaIntermediaSinDobleAmp.lastIndexOf(amp) >= 0){ | |
listaSinAmpErroneos=listaIntermediaSinDobleAmp.substr(0, listaIntermediaSinDobleAmp.length - 1); | |
}else{ | |
listaSinAmpErroneos=listaIntermediaSinDobleAmp; | |
} | |
linkParametersInicial = listaSinAmpErroneos+"&"+nuevoParametro; | |
} | |
} | |
if(origen=== "nuevo"){ | |
//recojo la lista de parametros inicial de la tabla | |
listaParametros=linksTabla; | |
//sumo el nuevo a los anteriores, conformando la lista final | |
if(listaParametros===""){ | |
linkParametersInicial = nuevoParametro; | |
}else{ | |
linkParametersInicial = listaParametros+"&"+nuevoParametro; | |
} | |
} | |
//modifico linkParameters para eliminar problemas | |
linkParameters = encodeURIComponent(linkParametersInicial); | |
//ajax | |
var jsonForm = ""; | |
jsonForm += "&idFaq="+idFaq; | |
jsonForm += "&nodeId="+nodeId ; | |
jsonForm += "&aplicacion="+aplicacion; | |
jsonForm += "&codigoPerfil="+codigoPerfil; | |
jsonForm += "&codigoIdioma="+codigoIdioma; | |
jsonForm += "&linkParameters="+linkParameters; | |
if(origen=== "nuevo"){ | |
anadirRow(nombreLinkP, valor, identificadorPerfilado); | |
} | |
if(origen=== "editar"){ | |
borrarRow(identificadorPerfilado, nTrGlobal); | |
anadirRow(nombreLinkP, valor, identificadorPerfilado); | |
} | |
// if(validarParametros){ | |
// $.ajax({ | |
// url : "/adminFaq/cambioLinkParameter"+"?idAplicacionEnUso="+$("#idAplicacionMenu").val(), | |
// type: 'GET', | |
// cache: false, | |
// async: false, | |
// headers:{'Content-Type': "application/x-www-form-urlencoded; charset=UTF-8"}, | |
// data : jsonForm, | |
// success : function(data) { | |
// if (data.mensaje==="OK"){ | |
// modalAlertListado(true,Globalize.localize('label.faqGuiada.parametrosActualizado')); | |
// }else{ | |
// modalAlertError(true,Globalize.localize('label.faqGuiada.parametrosNoActualizado')); | |
// } | |
// cerrarModalAltaParameter(); | |
// $('#'+nombreDinamico).val(linkParametersInicial); | |
// if(origen=== "nuevo"){ | |
// anadirRow(nombreLinkP, valor, identificadorPerfilado); | |
// } | |
// if(origen=== "editar"){ | |
// //modificarRowTablaDesdeEditar(identificadorPerfilado, nTrGlobal, nombreLinkP, valor); | |
// //modificarRowTablaDesdeEditar(identificadorPerfilado); | |
// borrarRow(identificadorPerfilado, nTrGlobal); | |
// anadirRow(nombreLinkP, valor, identificadorPerfilado); | |
// } | |
// }, | |
// error : function(error) { | |
// modalAlertError(false,JSON.stringify(error)); | |
// resultado = false; | |
// return false; | |
// }, | |
// error : function(error) { | |
// modalAlertError(false,JSON.stringify(error)); | |
// }, | |
// }); | |
// }else{ | |
// modalAlertError(true,Globalize.localize('label.faqGuiada.parametroVacio')); | |
// } | |
}); | |
// $('[id*=_buttonAltaLinkParameter]').each(function(){ | |
// var buttonCustomAltaLinkParameter = $(this); | |
// var buttonPlaceholderLinkParameter = $(this.dataTables_alta_linkParameter); | |
// buttonPlaceholderLinkParameter.html(buttonCustomAltaLinkParameter); | |
// }); | |
$( ".aplicacionesCustomizables #aplicacionSelect" ).change(function(){ | |
var idAplicacion = $(this).val(); | |
var active =!$(this).parent().parent().parent().find("[id^='aplicacionContentDiv_"+idAplicacion + "']").hasClass("hidden"); | |
if(!active){ | |
$(this).parent().parent().parent().find( "[id^='aplicacionContentDiv']" ).addClass("hidden"); | |
$(this).parent().parent().parent().find( "[id='aplicacionContentDiv_" + idAplicacion + "']" ).removeClass("hidden"); | |
} | |
}); | |
$( ".perfilesCustomizables #pefilSelect" ).change(function(){ | |
var idAplicacion = $(this).val().split("_")[0]; | |
var perfil = $(this).val().split("_")[1]; | |
var active =!$(this).parent().parent().parent().find("[id^='perfilContentDiv_" + idAplicacion + "_" + perfil + "']").hasClass("hidden"); | |
if(!active){ | |
$(this).parent().parent().parent().find( "[id^='perfilContentDiv']" ).addClass("hidden"); | |
$(this).parent().parent().parent().find( "[id='perfilContentDiv_" + idAplicacion + "_" + perfil + "']" ).removeClass("hidden"); | |
} | |
}); | |
$( ".parametro-lista-idiomas [id^='idiomaTab']" ).click(function(){ | |
var active = $(this).hasClass("activeIdiomaTab"); | |
if(!active){ | |
var id = $(this).attr("id"); | |
var idAplicacion = id.split("_")[1]; | |
var perfil = id.split("_")[2]; | |
var codigoIdioma = id.split("_")[3]; | |
$(this).parent().parent().parent().find( "[id^='perfilContentDiv_" + idAplicacion + "_" + perfil + "'] [id^='idiomaTab']" ).removeClass("activeIdiomaTab"); | |
$(this).parent().parent().parent().find( "[id^='perfilContentDiv_" + idAplicacion + "_" + perfil + "'] [id='idiomaTab_" + idAplicacion + "_" + perfil + "_" + codigoIdioma + "']" ).addClass("activeIdiomaTab"); | |
$(this).parent().parent().parent().find( "[id^='perfilContentDiv_" + idAplicacion + "_" + perfil + "'] [id^='idiomaContentDiv']" ).addClass("hidden"); | |
$(this).parent().parent().parent().find( "[id^='perfilContentDiv_" + idAplicacion + "_" + perfil + "'] [id^='idiomaContentDiv_" + idAplicacion + "_" + perfil + "_" + codigoIdioma + "']" ).removeClass("hidden"); | |
} | |
}); | |
$('#altaNodoForm input').each(function(){ | |
if($(this).attr("id") && $(this).attr("id").match(/^\w+_\w+_\w{2}$/) && !$(this).attr("id").match(/_\es$/)){ | |
$(this).on('change', function() { | |
catalanModificado=true; | |
$('#siVerificado').attr('checked', false); | |
$('#labelVerificado').css('color', 'red'); | |
}); | |
} | |
}); | |
$(':checkbox[readonly=readonly]').click(function(){ | |
$('#siVerificado').focus(); | |
$('#labelVerificado').css('color', 'red'); | |
$('#verificadoError').show(); | |
return false; | |
}); | |
if($('#siVerificado').length>0){ | |
var verificadoCatalan = $('#verificadoCatalan').val(); | |
if(verificadoCatalan === "S"){ | |
$('#siVerificado').attr('checked', true); | |
$('#labelVerificado').css('color', 'rgb(51, 51, 51)'); | |
}else{ | |
$('#siVerificado').attr('checked', false); | |
$('#labelVerificado').css('color', 'red'); | |
} | |
} | |
$("#cerrarAltaNodo").on('click', function(event) { | |
event.preventDefault(); | |
cerrarModalAltaNodo(); | |
}); | |
$("#volverBtnAltaNodo").on('click', function(event) { | |
event.preventDefault(); | |
cerrarModalAltaNodo(); | |
}); | |
$('input[id^="phone_"]').each(function(){ | |
$(this).keydown(function(event) { | |
// teclas especiales backspace, tabulador, return, desplazamiento(izq. y drch.), suprimir | |
var permitidos = [8,9,13,37,39,46]; | |
if(!esNumerico(event.which,permitidos)) | |
event.preventDefault(); | |
}); | |
}); | |
$('input#delay').keydown(function(event) { | |
// teclas especiales backspace, tabulador, return, desplazamiento(izq. y drch.), suprimir | |
var permitidos = [8,9,13,37,39,46]; | |
if(!esNumerico(event.which,permitidos)) | |
event.preventDefault(); | |
}); | |
$("#guardarBtnAltaNodo").on('click', function() { | |
$('#altaNodoForm textarea').each(function(){ | |
if($(this).attr("id") && $(this).attr("id").match(/^\w+_\w+_\w{2}$/) && !$(this).attr("id").match(/_\es$/) && decodeHtml($(this).val())!== $(this).attr("data-original")){ | |
catalanModificado=true; | |
$('#siVerificado').attr('checked', false); | |
} | |
}); | |
var validate= true; | |
var idNode= $("#idNode").val(); | |
var textoAlertaLink=""; | |
if (($('#idTipo').val() === "SALIDA")){ | |
textoAlertaLink=existeLink(idNode); | |
} | |
if (($('#tipoNodo').val() === "SALIDA")&&($("#subtipoNodo").val())==="Directo"){ | |
var en4=existeNodo(-4); | |
var en3=existeNodo(-3); | |
var en2=existeNodo(-2); | |
if ($('#feedback').val()==="1"){ | |
$('#nombreNodeEs').val("Nodo Salida Directo con Feedback"); | |
}else{ | |
if ($('#utilidad').val()==="1") { | |
$('#nombreNodeEs').val("Nodo Salida Directo sin Feedback Útil"); | |
}else{ | |
$('#nombreNodeEs').val("Nodo Salida Directo sin Feedback No Útil"); | |
} | |
} | |
if ($('#feedback').val()==="1" && en3){ | |
modalAlertError(false,"Ya existe un nodo salida directo con feedback"); | |
return; | |
} | |
if (( $('#feedback').val()==="0" && en2 && $('#utilidad').val()==="1" ) || ( $('#feedback').val()==="0" && en4 && $('#utilidad').val()==="0") ){ | |
if($('#utilidad').val()==="1"){ | |
modalAlertError(false,"Ya existe un nodo salida directo sin feedback y útil"); | |
} | |
if($('#utilidad').val()==="0"){ | |
modalAlertError(false,"Ya existe un nodo salida directo sin feedback y NO útil"); | |
} | |
return; | |
} | |
} | |
if ($("#tipoNodo").val()==="FEEDBACK") { | |
if($('#nodeText_DEFAULT_es').length){ | |
$('#nodeText_DEFAULT_es').val("¿Te han sido útiles los pasos que has seguido?"); | |
} | |
if($('#nodeText_DEFAULT_ca').length){ | |
$('#nodeText_DEFAULT_ca').val("T'han estat útils els passos que has seguit?"); | |
} | |
} | |
if ($("#tipoNodo").val()==="MULTIPLE" && $("#numNodosHijo").val()<3){ | |
modalAlertError(false,"Un Nodo Múltiple debe tener al menos 3 transiciones"); | |
return; | |
} | |
//VALIDACIONES- tipoTransicion, textoEs y tipoNodo obligatorios | |
if ($('#tipoTransicion').val() === "" || $('#tipo').val() === "0") { | |
$('#tipoTransicion').focus(); | |
$('#tipoTransicionLabel').css('color', 'red'); | |
$('#tipoTransicionError').show(); | |
validate = false; | |
} else { | |
$('#tipoTransicionError').hide(); | |
$('#tipoTransicionLabel').css('color', 'rgb(51, 51, 51)'); | |
} | |
if ( $("#subtipoNodo").val()!=="Directo" | |
&& $("#tipoNodo").val()!=="FEEDBACK" && origenEdit!=="ATRIBUTOS" | |
&& $(".form-group.required input[id*='DEFAULT'], .form-group.required textarea[id*='DEFAULT']").length > 0){ | |
$(".form-group.required input[id*='DEFAULT'][id^='nodeText_'], .form-group.required textarea[id*='DEFAULT'][id^='nodeText_']").each(function(){ | |
var id = $(this).attr("id"); | |
if($(this).val() === ""){ | |
var idAplicacion = id.split("_")[1]; | |
var perfil = id.split("_")[2]; | |
var codigoIdioma = id.split("_")[3]; | |
seleccionarCustomizacion(idAplicacion,perfil,codigoIdioma); | |
$(this).focus(); | |
$('#' + id + 'Label').css('color', 'red'); | |
$('#' + id + 'Error').show(); | |
validate = false; | |
} else { | |
$('#' + id + 'Error').hide(); | |
$('#' + id + 'Label').css('color', 'rgb(51, 51, 51)'); | |
} | |
}); | |
} | |
if ($('#tipoNodo').val() === "" || $('#tipo').val() === "0") { | |
$('#tipoNodo').focus(); | |
$('#tipoNodoLabel').css('color', 'red'); | |
$('#tipoNodoError').show(); | |
validate = false; | |
} else { | |
$('#tipoNodoError').hide(); | |
$('#tipoNodoLabel').css('color', 'rgb(51, 51, 51)'); | |
} | |
if ($("#subtipoNodo").val()==="Click to Call" || ($("#idSubtipoHidden").val()!=="Escalado CA" && idNode>0)) { | |
$(".form-group.required input[id*='DEFAULT'][id^='phone_'], .form-group.required textarea[id*='DEFAULT'][id^='phone_']").each(function(){ | |
var id = $(this).attr("id"); | |
if($(this).val() === ""){ | |
var idAplicacion = id.split("_")[1]; | |
var perfil = id.split("_")[2]; | |
var codigoIdioma = id.split("_")[3]; | |
seleccionarCustomizacion(idAplicacion,perfil,codigoIdioma); | |
$(this).focus(); | |
$('#' + id + 'Label').css('color', 'red'); | |
$('#' + id + 'Error').show(); | |
validate = false; | |
} else { | |
$('#' + id + 'Error').hide(); | |
$('#' + id + 'Label').css('color', 'rgb(51, 51, 51)'); | |
} | |
}); | |
$(".form-group.required input[id*='DEFAULT'][id^='phoneText_'], .form-group.required textarea[id*='DEFAULT'][id^='phoneText_']").each(function(){ | |
var id = $(this).attr("id"); | |
if($(this).val() === ""){ | |
var idAplicacion = id.split("_")[1]; | |
var perfil = id.split("_")[2]; | |
var codigoIdioma = id.split("_")[3]; | |
seleccionarCustomizacion(idAplicacion,perfil,codigoIdioma); | |
$(this).focus(); | |
$('#' + id + 'Label').css('color', 'red'); | |
$('#' + id + 'Error').show(); | |
validate = false; | |
} else { | |
$('#' + id + 'Error').hide(); | |
$('#' + id + 'Label').css('color', 'rgb(51, 51, 51)'); | |
} | |
}); | |
} | |
//Validar rejected double | |
if( $('#altaNodoForm #rejectIncrement:visible').length > 0){ | |
var regEx = /^\d{1,3}(?:\.\d{1,2})?$/ | |
var valor = $('#altaNodoForm #rejectIncrement').val().replace(",", "."); | |
if ( !$.isNumeric(valor) || !regEx.test(valor) ){ | |
$("#rejectIncrementError").show("slow"); | |
$('#rejectIncrementLabel').css('color', 'red'); | |
validate = false; | |
} | |
else{ | |
$("#rejectIncrementError").hide("slow"); | |
$('#rejectIncrementLabel').css('color', 'rgb(51, 51, 51)'); | |
$('#altaNodoForm #rejectIncrement').val(valor); | |
} | |
} | |
if(validate){ | |
if (idNode==="-1") { | |
$('#numNodosHijo').attr("disabled",false); | |
} | |
altaNodo(textoAlertaLink); | |
} | |
}); | |
$('#tipoNodo').on('change', function(event) { | |
event.preventDefault(); | |
tipoNodo=$("#tipoNodo").val(); | |
$('#numNodosHijoDiv').attr("disabled",false); | |
$('#subtipoNodoDiv').show(); | |
$('#tipoTransicionDiv').show(); | |
$('#nombreNodeEsDiv').show(); | |
$('div[id$="_nodeText"]').show(); | |
$('div[id$="_nodeText"]').prop('readonly', false); | |
$('div[id$="_nodeText"]').val(""); | |
$('#feedbackDiv').hide(); | |
$('#utilidadDiv').hide(); | |
$('#rejectIncrementDiv').hide(); | |
$('div[id$="_phone"]').hide(); | |
$('div[id$="_phoneText"]').hide(); | |
$('div[id$="_phoneText"]').prop('readonly', false); | |
$('div[id$="_phoneText"]').val(""); | |
$('#numNodosHijoDiv').show(); | |
$('#numNodosHijo').attr("disabled",false); | |
$('#topicDiv').hide(); | |
$('#topic').val(""); | |
$("#perfilado").show(); | |
var option = document.createElement("option"); | |
var delUnoAlDiez= [1,2,3,4,5,6,7,8,9,10]; | |
$('#numNodosHijo option').remove(); | |
delUnoAlDiez.forEach( function(valor) { | |
option = document.createElement("option"); | |
option.text = valor; | |
$('#numNodosHijo')[0].add(option); | |
}); | |
if(tipoNodo === "BINARIO" ){ | |
//Eliminamos los subtipos y ponemos los correspondientes | |
$("#subtipoNodo option").remove(); | |
option.text = "Estandar"; | |
$('#subtipoNodo')[0].add(option); | |
option = document.createElement("option"); | |
option.text = "Custom"; | |
$('#subtipoNodo')[0].add(option); | |
$("#tipoTransicion option").remove(); | |
option = document.createElement("option"); | |
option.text = "button"; | |
$('#tipoTransicion')[0].add(option); | |
$('#numNodosHijo').val("2"); | |
$('#numNodosHijo').attr("disabled",true); | |
} | |
if(tipoNodo === "SALIDA"){ | |
//Eliminamos los subtipos y ponemos los correspondientes | |
$("#subtipoNodo option").remove(); | |
option.text = "Texto"; | |
$('#subtipoNodo')[0].add(option); | |
option = document.createElement("option"); | |
option.text = "Directo"; | |
$('#subtipoNodo')[0].add(option); | |
option = document.createElement("option"); | |
option.text = "Click to Call"; | |
$('#subtipoNodo')[0].add(option); | |
option = document.createElement("option"); | |
option.text = "Escalado CA"; | |
$('#subtipoNodo')[0].add(option); | |
option = document.createElement("option"); | |
option.text = "Reformular"; | |
$('#subtipoNodo')[0].add(option); | |
$('#feedbackDiv').show(); | |
if (($('#feedback').val()==="0")) { | |
$('#utilidadDiv').show(); | |
}else{ | |
$('#utilidadDiv').hide(); | |
} | |
$("#tipoTransicion option").remove(); | |
$('#tipoTransicionDiv').hide(); | |
$('#numNodosHijoDiv').hide(); | |
} | |
if(tipoNodo === "MULTIPLE"){ | |
//Eliminamos los subtipos y ponemos los correspondientes | |
$("#subtipoNodo option").remove(); | |
option = document.createElement("option"); | |
option.text = "Boton"; | |
$('#subtipoNodo')[0].add(option); | |
option = document.createElement("option"); | |
option.text = "Listado"; | |
$('#subtipoNodo')[0].add(option); | |
$("#tipoTransicion option").remove(); | |
option = document.createElement("option"); | |
option.text = "button"; | |
$('#tipoTransicion')[0].add(option); | |
var delTresAlDiez= [3,4,5,6,7,8,9,10]; | |
$('#numNodosHijo option').remove(); | |
delTresAlDiez.forEach( function(valor) { | |
option = document.createElement("option"); | |
option.text = valor; | |
$('#numNodosHijo')[0].add(option); | |
}); | |
$('#numNodosHijo').attr("disabled",false); | |
$('#numNodosHijo').val("3"); | |
} | |
if(tipoNodo === "PROCEDIMIENTO" ){ | |
$("#subtipoNodo option").remove(); | |
$("#tipoTransicion option").remove(); | |
option.text = "auto"; | |
$('#tipoTransicion')[0].add(option); | |
option = document.createElement("option"); | |
option.text = "button"; | |
$('#tipoTransicion')[0].add(option); | |
option = document.createElement("option"); | |
option.text = "option"; | |
$('#tipoTransicion')[0].add(option); | |
$('#numNodosHijo').val("1"); | |
$('#numNodosHijo').attr("disabled",true); | |
$('#subtipoNodoDiv').hide(); | |
} | |
if( tipoNodo === "FEEDBACK"){ | |
$("#perfilado").hide(); | |
//Eliminamos los subtipos y ponemos los correspondientes | |
$("#subtipoNodo option").remove(); | |
$("#tipoTransicion option").remove(); | |
$('#subtipoNodoDiv').hide(); | |
$('#tipoTransicionDiv').hide(); | |
$('div[id$="_nodeText"]').hide(); | |
$('#feedbackDiv').hide(); | |
$('#utilidadDiv').hide(); | |
$('#numNodosHijo').val("2"); | |
$('#numNodosHijo').attr("disabled",true); | |
} | |
if( tipoNodo === ""){ | |
$('#subtipoNodoDiv').hide(); | |
$('#tipoTransicionDiv').hide(); | |
$('#nombreNodeEsDiv').hide(); | |
$('div[id$="_nodeText"]').show(); | |
$('#numNodosHijoDiv').hide(); | |
} | |
}); | |
$('#subtipoNodo').on('change', function(event) { | |
$('#nombreNodeEsDiv').show(); | |
$('div[id$="_nodeText"]').show(); | |
//Requerido campos cuya id termine en "_nodeText" que pertenezcan al perfil default y app prioritaria | |
$("#perfilado [id^=aplicacionContentDiv_]:first div[id$='_nodeText'][id*='DEFAULT']").addClass("required"); | |
$("#perfilado [id^=aplicacionContentDiv_]:first div[id$='_phone'][id*='DEFAULT']").addClass("required"); | |
$("#perfilado [id^=aplicacionContentDiv_]:first div[id$='_phoneText'][id*='DEFAULT']").addClass("required"); | |
$('textarea[id^="nodeText_"]').prop('readonly', false); | |
$('textarea[id^="nodeText_"]').val(""); | |
$('#rejectIncrementDiv').hide(); | |
$('div[id$="_phone"]').hide(); | |
$('input[id^="phone_"]').prop('readonly', false); | |
$('input[id^="phone_"]:not([id$="_TopicDetalle"])').val(""); | |
$('div[id$="_phoneText"]').hide(); | |
$('input[id^="phoneText_"]').prop('readonly', false); | |
$('input[id^="phoneText_"]').val(""); | |
$('#topicDiv').hide(); | |
$('#topic').val(""); | |
$('#topic').prop('readonly', false) | |
$("#perfilado").show(); | |
if (tipoNodo === "MULTIPLE") { | |
var option = document.createElement("option"); | |
if ($('#subtipoNodo').val() === "Listado") { | |
$("#tipoTransicion option").remove(); | |
option.text = "option"; | |
$('#tipoTransicion')[0].add(option); | |
}else{ | |
$("#tipoTransicion option").remove(); | |
option.text = "button"; | |
$('#tipoTransicion')[0].add(option); | |
} | |
} | |
if ((tipoNodo === "SALIDA")) { | |
if ($('#subtipoNodo').val() === "Directo") { | |
$("#perfilado").hide(); | |
$('div[id$="_nodeText"]').hide(); | |
$('#feedbackDiv').show(); | |
if (($('#feedback').val()=== "1")){ | |
$('#utilidadDiv').hide(); | |
}else { | |
$('#utilidadDiv').show(); | |
} | |
$('#nombreNodeEsDiv').hide(); | |
} | |
if ($('#subtipoNodo').val() === "Click to Call"){ | |
$('div[id$="_phone"]').show(); | |
$('div[id$="_phoneText"]').show(); | |
$('#feedbackDiv').hide(); | |
$('#utilidadDiv').hide(); | |
} | |
if ($('#subtipoNodo').val() === "Escalado CA"){ | |
$('div[id$="_phone"]').show(); | |
$('div[id$="_phoneText"]').show(); | |
$('div[id$="_nodeText"]').removeClass("required"); | |
$('div[id$="_phone"]').removeClass("required"); | |
$('div[id$="_phoneText"]').removeClass("required"); | |
$('input[id^="phone_"]').each(function(){ | |
var id = $(this).attr("id"); | |
var idAplicacion = id.split("_")[1]; | |
var perfil = id.split("_")[2]; | |
var codigoIdioma = id.split("_")[3]; | |
$(this).val($('#phone_'+idAplicacion+'_'+perfil+'_'+codigoIdioma+'_TopicDetalle').val()); | |
$(this).prop('readonly', true); | |
}); | |
$('input[id^="phoneText_"]').each(function(){ | |
var id = $(this).attr("id"); | |
var idAplicacion = id.split("_")[1]; | |
var perfil = id.split("_")[2]; | |
var codigoIdioma = id.split("_")[3]; | |
$(this).val($('#descripcion_'+idAplicacion+'_'+perfil+'_'+codigoIdioma+'_TopicDetalle').val()); | |
$(this).prop('readonly', true); | |
}); | |
$('textarea[id^="nodeText_"]').each(function(){ | |
var id = $(this).attr("id"); | |
var idAplicacion = id.split("_")[1]; | |
var perfil = id.split("_")[2]; | |
var codigoIdioma = id.split("_")[3]; | |
$(this).val($('#descripcion_'+idAplicacion+'_'+perfil+'_'+codigoIdioma+'_TopicDetalle').val()); | |
$(this).prop('readonly', true); | |
}); | |
$('#topicDiv').show(); | |
$('#topic').val($('#idWatsonTopicDetalle').val()); | |
$('#topic').prop('readonly', true); | |
$('#feedbackDiv').hide(); | |
$('#utilidadDiv').hide(); | |
} | |
if ($('#subtipoNodo').val() === "Texto") { | |
$('#feedbackDiv').show(); | |
if ($('#feedback').val() === "1"){ | |
$('#utilidadDiv').hide(); | |
}else { | |
$('#utilidadDiv').show(); | |
} | |
$('div[id$="_nodeText"]').show(); | |
$('#nombreNodeEsDiv').show(); | |
} | |
if ($('#subtipoNodo').val() === "Reformular"){ | |
$('#feedbackDiv').hide(); | |
$('#utilidadDiv').hide(); | |
$('#rejectIncrementDiv').show(); | |
} | |
} | |
}); | |
$('#feedback').on('change', function() { | |
if (($('#feedback').val() === "0")) { | |
$('#utilidadDiv').show(); | |
}else{ | |
$('#utilidadDiv').hide(); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment