diff --git a/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj b/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj index 6ac747cb5..f4c70dd9c 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj +++ b/AYA.SlnSynor/AYA.SlnSynor/AYA.SlnSinort.csproj @@ -7411,6 +7411,7 @@ + @@ -7436,6 +7437,7 @@ + @@ -7548,6 +7550,8 @@ + + diff --git a/AYA.SlnSynor/AYA.SlnSynor/Controllers/LoginController.cs b/AYA.SlnSynor/AYA.SlnSynor/Controllers/LoginController.cs index 2017d94b6..c2ce18d7b 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Controllers/LoginController.cs +++ b/AYA.SlnSynor/AYA.SlnSynor/Controllers/LoginController.cs @@ -17,6 +17,17 @@ namespace AYA.SlnSinort.Controllers.Login InitControllers(); return View(); } + public ActionResult Signup() + { + InitControllers(); + return View(); + } + public ActionResult LoginExterno() + { + InitControllers(); + return View(); + } + [HttpPost] public JsonResult ObtenerUsuarioAD(LoginJSON model) { diff --git a/AYA.SlnSynor/AYA.SlnSynor/Scripts/_references.js b/AYA.SlnSynor/AYA.SlnSynor/Scripts/_references.js index 1b17e5839..2f8fb6d9d 100644 Binary files a/AYA.SlnSynor/AYA.SlnSynor/Scripts/_references.js and b/AYA.SlnSynor/AYA.SlnSynor/Scripts/_references.js differ diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/LoginExterno.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/LoginExterno.js new file mode 100644 index 000000000..0899a96e9 --- /dev/null +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/LoginExterno.js @@ -0,0 +1,136 @@ +var model = {}; +var username; +var fullname; +jQuery(document).ready(function () { + + getDataModel(); +}); + +this.getDataModel = function () +{ + $("#btnRegistro").unbind("click"); + $("#btnRegistro").click(function () { + url = $("#hiddenHref").val(); + url = url.replace("View", "Signup"); + url = url.replace("Controller", "Login"); + + document.location.href = url; + }); +} +$('#btnIniciar').keyup(function (e) { + if (e.which == 13) { + validarFormulario(); + + } +}); + +$('#txtContrasena').keyup(function (e) { + if (e.which == 13) { + validarFormulario(); + + } +}); + +function validarFormulario() { + + var Contador = 0; + + if ($('#txtUsuarioUnico').val().length > 0) { + var usuario = document.getElementById("txtUsuarioUnico").value; + var patron = /^[a-zñ]+$/; + if (patron.test(usuario)) { + Contador++; + } + } + + if ($('#txtContrasena').val().length > 0) { + Contador++; + } + + if (Contador >= 2) { + enviado = true; + ObtenerUsuarioAD(); + + } else { + toastr.warning('Los campos son obligatorio', Message_Warning); + } + + +}//validarFormulario + +$('#txtUsuarioUnico').change(function () { + var txtUsuarioUnico = $('#txtUsuarioUnico').val(); + $('#txtUsuarioUnico').val(txtUsuarioUnico.trim()); +}); + +this.ObtenerUsuarioAD = function () { + + + var uri = SinorLoginWCF + '/api/ObtenerUsuarioAD'; + model = { + Usuario: $('#txtUsuarioUnico').val(), + Contrasena: $('#txtContrasena').val() + } + + AjaxPostData(uri, model, false, true, VerificarUsurarioBD, null, null); + + +} + +this.VerificarUsurarioBD = function (data) { + if (data.CodigoRespuesta == 'EXITOSO') { + + + var uri = SinorLoginWCF + '/api/VerificarUsuarioBD'; + model = { + codigo: data.LoginUsuario + } + + AjaxPostData(uri, model, false, false, IniciarSesion, null, null); + + } + +} + +this.IniciarSesion = function (data) { + if (data.usuario.UsuarioSistema != null) { + var ArrayPermisos = []; + var lista = data.pantallas; + + $.each(lista, function (key, item) { + + ArrayPermisos.push(item.Descripcion); + }); + + var uri = server + 'Login/InicioSesion'; + model = { + UserName: data.usuario.UsuarioSistema, + UserFullName: data.usuario.NombreUsuario, + PermisosUsuario: ArrayPermisos + }; + localStorage['ListaOpciones'] = ArrayPermisos; + url = $("#hiddenHref").val(); + url = url.replace("View", "Index"); + url = url.replace("Controller", "Home"); + $.ajax({ + type: "POST", + url: uri, + data: JSON.stringify(model), + contentType: "application/json; charset=utf-8", + dataType: "json", + success: function () { + document.location.href = url; + }, + error: function () { + + document.location.href = url; + } + + + }); + } else { + ENDREQUEST(); + toastr.warning('No se ha obtenido los datos del usuario', Message_Warning); + } +} + diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js index 8266dca7b..32a50d726 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js @@ -248,7 +248,11 @@ this.getDataModel = function () { if (EsPromotor == false && Participa == true || EsPromotor == true) { $("#divRespuestaMatriz").empty(); - $("#lblComentarioMatriz").text("Comentario"); + $("#lblAsuntoM").text("*Asunto"); + $("#lblCapitulo").text("*Capítulo"); + $("#lblApartado").text("*Apartado"); + $("#lblTextoOriginal").text("*Texto Original"); + $("#lblComentarioMatriz").text("*Comentario"); $("#txtAsuntoMatriz").val(''); $("#txtComentarioMatriz").val(''); $("#txtCapituloMatriz").val(''); @@ -256,6 +260,11 @@ this.getDataModel = function () { $("#txtTextoOriginal").val(''); $("#txtTextoPropuesto").val(''); $('#btnVerAdjuntosMatriz').prop("disabled", false); + $('#txtAsuntoMatriz').attr('readonly', false); + $('#txtCapituloMatriz').attr('readonly', false); + $('#txtApartadoMatriz').attr('readonly', false); + $('#txtTextoOriginal').attr('readonly', false); + $('#txtTextoPropuesto').attr('readonly', false); EsRespuesta = false; $('#modalElemento-footer').css("display", "block"); $('#modalElemento').modal('show'); @@ -1013,6 +1022,10 @@ this.VerDetalleAporte = function (IdComentario, IdTipoComentario) { if (IdTipoComentario == Comentarios.Matriz.Codigo) { $("#divRespuestaMatriz").empty(); + $("#lblAsuntoM").text("Asunto"); + $("#lblCapitulo").text("Capítulo"); + $("#lblApartado").text("Apartado"); + $("#lblTextoOriginal").text("Texto Original"); $("#lblComentarioMatriz").text("Comentario"); $("#txtAsuntoMatriz").val(comentario.Asunto); $("#txtComentarioMatriz").val(comentario.Comentario); @@ -1023,6 +1036,11 @@ this.VerDetalleAporte = function (IdComentario, IdTipoComentario) { $('#modalElemento-footer').css("display", "none"); $('#modalElemento').modal('show'); $('#btnVerAdjuntosMatriz').prop("disabled", true); + $('#txtAsuntoMatriz').attr('readonly', true); + $('#txtCapituloMatriz').attr('readonly', true); + $('#txtApartadoMatriz').attr('readonly', true); + $('#txtTextoOriginal').attr('readonly', true); + $('#txtTextoPropuesto').attr('readonly', true); CargarDocumentosMatriz(comentario.IdDocumento); } @@ -1143,12 +1161,22 @@ this.ResponderComentarioMatriz = function (IdComentario) { }); $("#lblComentarioMatriz").text("Respuesta"); - $("#txtAsuntoMatriz").val(''); + $("#lblAsuntoM").text("Asunto"); + $("#lblCapitulo").text("Capítulo"); + $("#lblApartado").text("Apartado"); + $("#lblTextoOriginal").text("Texto Original"); + $("#txtAsuntoMatriz").val(comentario.Asunto); $("#txtComentarioMatriz").val(''); - $("#txtCapituloMatriz").val(''); - $("#txtApartadoMatriz").val(''); - $("#txtTextoOriginal").val(''); - $("#txtTextoPropuesto").val(''); + $("#txtCapituloMatriz").val(comentario.Capitulo); + $("#txtApartadoMatriz").val(comentario.Apartado); + $("#txtTextoOriginal").val(comentario.TextoOriginal); + $("#txtTextoPropuesto").val(comentario.TextoPropuesto); + $('#txtAsuntoMatriz').attr('readonly', true); + $('#txtCapituloMatriz').attr('readonly', true); + $('#txtApartadoMatriz').attr('readonly', true); + $('#txtTextoOriginal').attr('readonly', true); + $('#txtTextoPropuesto').attr('readonly', true); + $('#btnVerAdjuntosMatriz').prop("disabled", true); $('#modalElemento-footer').css("display", "block"); $('#modalElemento').modal('show'); } @@ -2420,7 +2448,7 @@ this.ExportarAExcel = function (TipoComentario, filename) { html = html + '' + '' + - '' + + '' + '' + '' + '' + @@ -2437,10 +2465,10 @@ this.ExportarAExcel = function (TipoComentario, filename) { $.each(listaComentariosMatriz, function (key, item) { html = html + '' html = html + '' - html = html + '' - html = html + '' - html = html + '' - html = html + '' + html = html + '' + html = html + '' + html = html + '' + html = html + '' html = html + ''; diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Signup.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Signup.js new file mode 100644 index 000000000..97001569c --- /dev/null +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/Signup.js @@ -0,0 +1,108 @@ +var model = {}; +var usuario; + +jQuery(document).ready(function () { + + //getDataModel(); +}); +this.getDataModel = function () { + $("#btnRegistrar").unbind("click"); + $("#btnRegistrar").click(function () { + url = $("#hiddenHref").val(); + url = url.replace("View", "Signup"); + url = url.replace("Controller", "Login"); + + document.location.href = url; + }); +} +$('#btnRegistrar').keyup(function (e) { + if (e.which == 13) { + validarFormulario(); + } +}); +function validarFormulario() { + + var Contador = 0; + var patron = /^[a-zñA-ZÑ\u00E0-\u00FC]+$/; + + if ($('#txtNombre').val().length > 0) { + var usuario = document.getElementById("txtNombre").value; + + if (patron.test(usuario)) { + Contador++; + } + } + if ($('#txtApellido1').val().length > 0) { + var apellido1 = document.getElementById("txtApellido1").value; + if (patron.test(apellido1)) { + Contador++; + } + } + if ($('#txtApellido2').val().length > 0) { + var apellido2 = document.getElementById("txtApellido2").value; + if (patron.test(apellido2)) { + Contador++; + } + } + if ($('#txtEmail').val().length > 0) { + var email = document.getElementById("txtEmail").value; + var caract = new RegExp(/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/); + + if (caract.test(email)) { + Contador++; + } + else { + toastr.warning('El email no es valido', Message_Warning); + } + } + if ($('#txtContrasena').val().length > 0) { + var password = document.getElementById("txtContrasena").value; + if (patron.test(password)) { + toastr.warning('No se permiten caracteres especiales en la contraseña', Message_Warning); + } + else { + Contador++; + } + } + if ($('#txtConfContrasena').val().length > 0){ + if ($('#txtContrasena').val() == $('#txtConfContrasena').val()) { + Contador++; + } + else { + toastr.warning('Las contraseñas no coinciden', Message_Warning); + } + } + + if (Contador >= 6) { + enviado = true; + usuario = normalize($('#txtNombre').val().charAt(0).toLowerCase() + $('#txtApellido1').val()).toLowerCase(); + //ObtenerUsuarioAD(); + + } else { + toastr.warning('Los campos son obligatorios', Message_Warning); + } + + + +}//validarFormulario +var normalize = (function () { + var from = "ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛãàáäâèéëêìíïîòóöôùúüûÑñÇç", + to = "AAAAAEEEEIIIIOOOOUUUUaaaaaeeeeiiiioooouuuunncc", + mapping = {}; + + for (var i = 0, j = from.length; i < j; i++) + mapping[from.charAt(i)] = to.charAt(i); + + return function (str) { + var ret = []; + for (var i = 0, j = str.length; i < j; i++) { + var c = str.charAt(i); + if (mapping.hasOwnProperty(str.charAt(i))) + ret.push(mapping[c]); + else + ret.push(c); + } + return ret.join(''); + } + +})(); \ No newline at end of file diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Login/LoginExterno.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Login/LoginExterno.cshtml new file mode 100644 index 000000000..1f1e90226 --- /dev/null +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Login/LoginExterno.cshtml @@ -0,0 +1,163 @@ +@{ + ViewBag.Title = "LoginExterno"; + Layout = null; +} + + + + + + + + + SINORT + + + + + + @* + + + *@ + + + + + + +
+ + +
+ +
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + +
Asunto Capítulo Apartado/Sección/Parráfo
' + item.Asunto + ' algo algo algo algo ' + item.Capitulo + '' + item.Apartado + '' + item.TextoOriginal + '' + item.TextoPropuesto + '' + item.Comentario + '
+ + + + + + + + + + + + + + +
+ +
+ + + +
+ + + +
+ + Recuperar contraseña +
+
+ +
+ + + + + @*
+
+
+
+

SINORT | Costa Rica | Copyright © @DateTime.Now.Year

+
+
+
+
*@ + + + + +@Styles.Render("~/Content/themes/base/css") +@Styles.Render("~/Content/sinort-css") +@Scripts.Render("~/bundles/modernizr") +@Scripts.Render("~/bundles/jquery") +@Scripts.Render("~/bundles/bootstrap") +@Scripts.Render("~/bundles/jqueryui") +@Scripts.Render("~/bundles/jqueryval") +@Scripts.Render("~/bundles/moment") +@Scripts.Render("~/bundles/toastr") +@Scripts.Render("~/Script-Global") +@Scripts.Render("~/Sinort-Scripts/LoginExterno.js") + + + + + diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/Login/Signup.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/Login/Signup.cshtml new file mode 100644 index 000000000..e58353d46 --- /dev/null +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/Login/Signup.cshtml @@ -0,0 +1,200 @@ + +@{ + ViewBag.Title = "Signup"; + Layout = null; +} + + + + + + + + + SINORT + + + + + + @* + + + *@ + + + + + + +
+ + +
+ +
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ +
+
+
+
+
+ + +
+ +
+
+ + +
+

SINORT | Costa Rica | Copyright © @DateTime.Now.Year

+
+ +
+ + + +@Styles.Render("~/Content/themes/base/css") +@Styles.Render("~/Content/sinort-css") +@Scripts.Render("~/bundles/modernizr") +@Scripts.Render("~/bundles/jquery") +@Scripts.Render("~/bundles/bootstrap") +@Scripts.Render("~/bundles/jqueryui") +@Scripts.Render("~/bundles/jqueryval") +@Scripts.Render("~/bundles/moment") +@Scripts.Render("~/bundles/toastr") +@Scripts.Render("~/Script-Global") +@Scripts.Render("~/Sinort-Scripts/Signup.js") + + + + + + + + diff --git a/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/DetallePropuesta.cshtml b/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/DetallePropuesta.cshtml index c82e15699..89eeba421 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/DetallePropuesta.cshtml +++ b/AYA.SlnSynor/AYA.SlnSynor/Views/PropuestaNormativa/DetallePropuesta.cshtml @@ -750,7 +750,7 @@ background-image:url(http://AYA-VSRV-APPTT:2525/dist/img/ajax-loader.gif);backgr @*---------------------Asunto ---------------------------------------------------------*@
- +
@@ -758,7 +758,7 @@ background-image:url(http://AYA-VSRV-APPTT:2525/dist/img/ajax-loader.gif);backgr @*---------------------Capitulo ---------------------------------------------------------*@
- +
@@ -766,7 +766,7 @@ background-image:url(http://AYA-VSRV-APPTT:2525/dist/img/ajax-loader.gif);backgr @*---------------------Apartado ---------------------------------------------------------*@
- +
@@ -778,7 +778,7 @@ background-image:url(http://AYA-VSRV-APPTT:2525/dist/img/ajax-loader.gif);backgr @*--------------------- Original ---------------------------------------------------------*@
- +