diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js index ebb5f1401..886ab6b29 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/PropuestaNormativa/DetallePropuestaNormativa.js @@ -61,8 +61,9 @@ jQuery(document).ready(function () { IdProyectoNormativo: ROT47(IDPropuesta.toString()) }; IdPropuestaNormativa = ROT47(IDPropuesta.toString()); - getDataModel(); + ObtenerPropuesta(); + getDataModel(); if ($("#txtPromotorProyecto").val() == UsuarioSistema) { $("#txtFechaFinalizacion").noReadOnly(); @@ -99,6 +100,12 @@ this.getDataModel = function () { $("#btnAgregarComentario").unbind("click"); $("#btnAgregarComentario").click(function () { + + if (ValidarPermisos('Ingreso y actualización de área de foro').length <= 0 || $('#txtEstado').val() != "Inicial") { + toastr.warning('No tiene permisos para ejecutar esta opción', Message_Warning); + return; + } + $("#divRespuesta").empty(); $("#lblcomentario").text("Comentario"); $("#txtAsunto").val(''); @@ -118,6 +125,7 @@ this.getDataModel = function () { $("#btnAgregarElemento").unbind("click"); $("#btnAgregarElemento").click(function () { + $("#divRespuestaMatriz").empty(); $("#lblComentarioMatriz").text("Comentario"); $("#txtAsuntoMatriz").val(''); @@ -148,7 +156,7 @@ this.getDataModel = function () { $("#btnGuardarEvento").click(function () { GuardarEvento(); }); - + $("#txtFechaFinalizacion").datepicker(); $("#txtNombreProyecto").readOnly(); @@ -161,16 +169,24 @@ this.getDataModel = function () { $("#txtEstado").readOnly(); $('#btnModificar').disable(); + if (ValidarPermisos('Ingreso y actualización de área de proyecto').length <= 0 || $('#txtEstado').val() != "Inicial" ) { + $("#tabs").tabs({ + disabled: [2] + }); + } + + if (ValidarPermisos('Accesar expediente de foro').length <= 0 || $('#txtEstado').val() != "Inicial") { + $("#tabs").tabs({ + disabled: [3] + }); + } + CargarUsuarios(); } this.ActualizarItem = function (accion) { - - //if (!$("#formDetallePropuesta").valid()) { - // toastr.warning("Ingresar todos los campos que son requeridos."); - // return false; - //} + if (!confirm((accion == true) ? "Se guardarán los cambios.\n ¿Desea continuar?" : "Desea eliminar el registro.\n ¿Desea continuar?")) { return; } @@ -1189,6 +1205,18 @@ $('#tableDocMatriz').on('click', 'button', function () { }); this.AbrirAdjuntos = function (id) { + + if (id == 2 && ValidarPermisos('Accesar documentos auxiliares del foro').length <= 0) { + toastr.warning('No tiene permisos para ejecutar esta opción', Message_Warning); + return; + } + + if (id == 3 && ValidarPermisos('Accesar expediente de propuesta normativa').length <= 0) { + toastr.warning('No tiene permisos para ejecutar esta opción', Message_Warning); + return; + } + + $('#hiddenSubTipoDocumento').val(id); @@ -1554,4 +1582,117 @@ $('#tableDocEvento').on('click', 'button', function () { window.open(data[4]); -}); \ No newline at end of file +}); + +this.Export2Doc = function (element, filename) { + + var preHtml = "

PROYECTO NORMATIVO N. ' + model.ProyectoNormativo.IdProyectoNormativo + ' NOMBRE: ' + model.ProyectoNormativo.NombreProyectoNormativo + '
' ; + + html = html + '
ASUNTO :' + item.Asunto + '
Comentario : ' + item.Comentario + '
Respuesta ' + lstitem.Comentario + '
' + lstitem.UsuarioSistema + ' - ' + lstitem.FechaCreacion + '