Validacion Promotor de Proyecto

git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C215
This commit is contained in:
dmendez 2018-07-12 20:04:02 +00:00
parent b552532d5f
commit 6de3a6a750

View file

@ -2,6 +2,7 @@
var IDTipoProyecto;
var model = {};
var EsRespuesta = false;
var EsPromotor = false;
var IDComentario = 0;
var EsForo = false;
var NombreDocumento;
@ -10,6 +11,9 @@ var SubTipoproyecto;
var respuestaForo;
var IdPropuestaNormativa;
var Promotor;
var Estado;
jQuery(document).ready(function () {
$(document).tooltip();
@ -40,6 +44,12 @@ jQuery(document).ready(function () {
IDPropuesta = ObtenerParametros().propuesta;
IDTipoProyecto = ObtenerParametros().tipo;
Promotor = ObtenerParametros().promotor;
Estado = ObtenerParametros().estado;
if (IsNullOrEmpty(IDPropuesta)) {
alert("No ha seleccionado una propuesta");
$("#formDetallePropuesta").FormReadOnly();
@ -62,12 +72,13 @@ jQuery(document).ready(function () {
};
IdPropuestaNormativa = ROT47(IDPropuesta.toString());
ObtenerPropuesta();
getDataModel();
ObtenerPropuesta();
if ($("#txtPromotorProyecto").val() == UsuarioSistema) {
$("#txtFechaFinalizacion").noReadOnly();
$('#btnModificar').enable();
EsPromotor = true;
}
@ -100,12 +111,14 @@ 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;
if (EsPromotor == false) {
if (ValidarPermisos('Ingreso y actualización de área de foro').length <= 0 || Estado != Estados.Inicial.Codigo) {
toastr.warning('No tiene permisos para ejecutar esta opción', Message_Warning);
return;
}
}
$("#divRespuesta").empty();
$("#lblcomentario").text("Comentario");
$("#txtAsunto").val('');
@ -169,16 +182,21 @@ 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]
});
if (EsPromotor == false) {
if (ValidarPermisos('Ingreso y actualización de área de proyecto').length <= 0 || Estado != Estados.Inicial.Codigo ) {
$("#tabs").tabs({
disabled: [2]
});
}
if (ValidarPermisos('Accesar expediente de foro').length <= 0 || Estado != Estados.Inicial.Codigo ) {
$("#tabs").tabs({
disabled: [3]
});
}
}
CargarUsuarios();
@ -1206,15 +1224,21 @@ $('#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 (EsPromotor == false) {
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;
}
}
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);