< script type = "text/javascript" > var CentrosGUID = "", IndicadoresAgrupadosGUID = "", EFQMSubcriterioGUID = "", EFQMCriterioGUID = "", ProcesosGUID = "", ObjetivosGUID = "", PersonalCVGUID = ""; $(document).ready(function() { String.prototype.repeat = function(a) { return Array(a + 1).join(this) }; $('input[id^="Estado_"]').closest("tr").hide(); $('select[id^="EstadoDelSeguimiento_"]').closest("tr").hide(); $('input[id^="IndicadorId_"]').closest("tr").hide(); $('input[id^="IndicadorOculto_"]').closest("tr").hide(); $('input[id^="YO_"]').closest("tr").hide(); $('input[id^="MetaFin_"]').closest("tr").hide(); $('input[id^="MetaInicio_"]').closest("tr").hide(); $('input[id^="NombreCentro_"]').closest("tr").hide(); SP.SOD.executeFunc("sp.js", "SP.ClientContext", function() { SP.SOD.executeFunc("SP.UserProfiles.js", "SP.UserProfiles", SetUserField()) }); GetGUIDS(); SetCentros(); SetSubcriterio(); SetProcesoPrincipal(); SetMeta(); $('input[id^="Anyo_"]').change(function(a) { SetAgrupacion(); SetObjetivo() }); $('select[id^="Centro_"]').change(function(a) { SetProcesoPrincipal(); SetObjetivo() }); $('select[id^="TipoDeMeta_"]').change(function(a) { SetMeta() }) }); function SetUserField() { var a = $().SPServices.SPGetCurrentUser({ fieldName: "Username", debug: !1 }); $('input[id^="YO_"]').val(a) } function GetGUIDS() { devolverListas("Centros;Indicadores Agrupados;EFQM Diagn\u00f3stico Subcriterios;EFQM Diagn\u00f3stico Criterios;Procesos;Objetivos;Personal".split(";"), !1, function(a) { CentrosGUID = a[0]; IndicadoresAgrupadosGUID = a[1]; EFQMSubcriterioGUID = a[2]; EFQMCriterioGUID = a[3]; ProcesosGUID = a[4]; ObjetivosGUID = a[5]; PersonalCVGUID = a[6] }) } function SetCentros() { var a = "" + _spPageContextInfo.userId + "", c = $('select[id^="Centro_"]'), b = $('select[id^="Centro_"] option:selected').val(); c.empty(); c.append(""); $().SPServices({ operation: "GetListItems", async: !1, listName: PersonalCVGUID, CAMLViewFields: "", CAMLQuery: a, completefunc: function(a, b) { $(a.responseXML).SPFilterNode("z:row").each(function() { for (var a = $(this).attr("ows_CentrosPertenece").split(";#"), b = 0; b < a.length; b += 2) c.append("") }) } }); $('select[id^="Centro_"] option[value="' + b + '"]').prop("selected", !0) } function SetAgrupacion() { var a = $('select[id^="Agrupacion_"]').attr("title"); $().SPServices.SPFilterDropdown({ relationshipList: IndicadoresAgrupadosGUID, relationshipListColumn: "Title", columnName: a, CAMLQuery: "" + $('input[id^="Anyo_"]').val() + "", completefunc: null, debug: !1 }) } function SetSubcriterio() { if ("" != EFQMCriterioGUID && "EFQM Diagn\u00f3stico Criterios" != EFQMCriterioGUID) { var a = "", c = "Resultado", b = ""; $().SPServices({ operation: "GetListItems", async: !1, listName: EFQMCriterioGUID, CAMLViewFields: a, CAMLQuery: c, completefunc: function(a, c) { $(a.responseXML).SPFilterNode("z:row").each(function() { b += $(this).attr("ows_ID") + ";" }) } }); a = ""; c = ""; b = b.split(";"); --b.length; if (0 != b.length) { if (1 == b.length) c += "" + b[0] + ""; else for (c += "".repeat(b.length - 1), c += "" + b[0] + "" + b[1] + "", a = 2; a < b.length; a++) c += "" + b[a] + ""; a = $('select[id^="SubcriterioEFQM_"]').attr("title"); $().SPServices.SPFilterDropdown({ relationshipList: EFQMSubcriterioGUID, relationshipListColumn: "Title", columnName: a, CAMLQuery: c, completefunc: null, debug: !1 }) } } } function SetProcesoPrincipal() { var a = $('select[id^="Procesos_"]').attr("title"); $().SPServices.SPFilterDropdown({ relationshipList: ProcesosGUID, relationshipListColumn: "Title", columnName: a, CAMLQuery: "" + $('select[id^="Centro_"]').val() + "", completefunc: null, debug: !1 }) } function SetObjetivo() { var a = $('select[id^="Centro_"]').val(), c = $('input[id^="Anyo_"]').val(), b = $('select[id^="Objetivo_"]').attr("title"); $().SPServices.SPFilterDropdown({ relationshipList: ObjetivosGUID, relationshipListColumn: "Title", columnName: b, CAMLQuery: "" + c + "" + a + "", completefunc: null, debug: !1 }) } function SetMeta() { "Meta Fija" == $('select[id^="TipoDeMeta_"]').val() ? ($('input[id^="Meta_"]').closest("tr").show(), $('input[id^="MetaFin_"]').closest("tr").hide(), $('input[id^="MetaInicio_"]').closest("tr").hide(), $('input[id^="MetaFin_"]').val(""), $('input[id^="MetaInicio_"]').val(""), $('select[id^="ValoresMejores_"]').prop("disabled", !1)) : ("Meta Rango" == $('select[id^="TipoDeMeta_"]').val() ? ($('input[id^="Meta"]').closest("tr").hide(), $('input[id^="Meta"]').val(""), $('input[id^="MetaFin"]').closest("tr").show(), $('input[id^="MetaInicio"]').closest("tr").show()) : ($('input[id^="Meta"]').closest("tr").hide(), $('input[id^="Meta"]').val(""), $('input[id^="MetaFin"]').closest("tr").hide(), $('input[id^="MetaInicio"]').closest("tr").hide(), $('input[id^="MetaFin"]').val(""), $('input[id^="MetaInicio"]').val("")), $('select[id^="ValoresMejores"]').prop("disabled", !0)) } function PreSaveAction() { "Meta Rango" == $('select[id^="TipoDeMeta_"]').val() && $('input[id^="Meta"]').val($('input[id^="MetaFin"]').val()); return !0 }; < /script>