From b3dfbeb7d98ad6a8b3c718b011221aabfabd3364 Mon Sep 17 00:00:00 2001 From: jmoya Date: Tue, 7 Aug 2018 18:10:26 +0000 Subject: [PATCH] git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C399 --- .../AYA.SlnSynor/Sinort-Scripts/Global.js | 36 ---------------- .../VerEncuestas.js | 43 +++++++++++++++++-- .../AYA.SlnSynor/Views/Shared/_Layout.cshtml | 3 +- 3 files changed, 40 insertions(+), 42 deletions(-) diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js index 1e2b6d24e..2be0fadd0 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Global.js @@ -5,7 +5,6 @@ var RepositorioVirtual = $("#hiddenRepositorioVirtual").val(); var RepositorioLocal = $("#hiddenRepositorioLocal").val(); var UsuarioSistema = $("#hiddenUsuarioSistema").val(); var NombreUsuario = $("#hiddenNombreUsuario").val(); -var esSuperUsuario = false; var server = window.location.protocol + "//" + "localhost" + "/" + (window.location.pathname.split('/')[1]) + "/"; var SinorLoginWCF = "http://localhost/AYA.SlnSinort.WCF/Sinort.svc"; @@ -196,42 +195,7 @@ this.ObtenerParametros = function (url) { return obj; } //verifica si el usuario conectado es tiene el rol pantalla de superusuario -this.ObtenerRolPantalla = function () { - var uri = CatalogosWCF + '/api/ObtenerRolesPantalla'; - var model = { - codigo: Pantallas.SuperUser.Codigo - }; - AjaxPostData(uri, model, true, false, ObtenerUsuarioRol, null, null); - -} -this.ObtenerUsuarioRol = function (data) { - - var modelPost = { - listaCodigos: [] - }; - - $.each(data, function (key, item) { - modelPost.listaCodigos.push(item.IdRol); - }); - - //funcional experto - //if (modelPost.listaCodigos.indexOf(1) == -1) - // modelPost.listaCodigos.push(Roles.FuncionalExperto.Codigo); - - var uri = CatalogosWCF + '/api/ObtenerUsuariosRol'; - AjaxPostData(uri, modelPost, true, false, VerificarSuperusuario, null, null); - -} -this.VerificarSuperusuario = function (data) { - - $.each(data, function (key, item) { - if (item.UsuarioSistema == UsuarioSistema) { - esSuperUsuario = true; - } - - }); -} this.RequiredToDisabled = function (controlId) { diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/VerEncuestas.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/VerEncuestas.js index 96dcc9cdb..e684edbb7 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/VerEncuestas.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/NormativaReglamentacionTecnica/VerEncuestas.js @@ -2,13 +2,13 @@ var data; var IdEncabezadoEncuesta; var Estado; +var esSuperUsuario = false; jQuery(document).ready(function () { + getDataModel(); + CargarEncuestas(); - $(window).on("load", function () { - getDataModel(); - }) }); this.getDataModel = function () { @@ -16,9 +16,44 @@ this.getDataModel = function () { $('#tableEncuestas').DataTable().column(0).visible(false); $('#tableEncuestas').DataTable().column(1).visible(false); Estado = 1; + ObtenerRolPantalla(); - CargarEncuestas(); +} +this.ObtenerRolPantalla = function () { + var uri = CatalogosWCF + '/api/ObtenerRolesPantalla'; + var model = { + codigo: Pantallas.SuperUser.Codigo + }; + AjaxPostData(uri, model, false, false, ObtenerUsuarioRol, null, null); + +} +this.ObtenerUsuarioRol = function (data) { + + var modelPost = { + listaCodigos: [] + }; + + $.each(data, function (key, item) { + modelPost.listaCodigos.push(item.IdRol); + }); + + //funcional experto + //if (modelPost.listaCodigos.indexOf(1) == -1) + // modelPost.listaCodigos.push(Roles.FuncionalExperto.Codigo); + + var uri = CatalogosWCF + '/api/ObtenerUsuariosRol'; + AjaxPostData(uri, modelPost, false, false, VerificarSuperusuario, null, null); + +} +this.VerificarSuperusuario = function (data) { + + $.each(data, function (key, item) { + if (item.UsuarioSistema == UsuarioSistema) { + esSuperUsuario = true; + } + + }); } this.CargarEncuestas = function () { diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml index 575ef2529..9bf695234 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Shared/_Layout.cshtml @@ -86,7 +86,7 @@ @@ -294,7 +294,6 @@ $(document).ready(function () { ObtenerDatosUsuario(); - ObtenerRolPantalla(); ObtenerCantidadTareasPendientes(); ObtenerCantidadGotitasPendientes();