En la sección de beneficios adicionales del empleado se muestra correctamente si tiene los permisos: 'Consultar los beneficios adicionales(DetailsBeneficioAdicionalEmpleo)' y 'Editar los beneficios adicionales(EditBeneficioAdicionalEmpleo)'

alt text

Cuando le quitamos únicamente el permiso 'Editar los beneficios adicionales(EditBeneficioAdicionalEmpleo)' y tenemos el permiso de consulta no muestra los beneficios que realmente tiene el colaborador:

alt text

asked 16 Mar '18, 10:39

Jimy%20Tobar's gravatar image

Jimy Tobar ♦♦
(suspended)
accept rate: 56%


La solución propuesta temporalmente: la vista ~EvolutionAreasExpedientesViewsEmpleadoListadoBeneficiosEmpleo.ascx debe tener el siguiente cambio: línea 20 y 25, sacar la etiqueta th del if:


<% if (permisoParaEditar)
                       {%>
                            en esta línea encuentra la etiqueta de apertura "th" (th style="width:20px;" class="center")
                            <%  if (Model.Any())
                                {%>
                                    ...
                            <%  } %>
                            cierre etiqueta "th"
                    <%  } %>
cambiar por

                    colocar aquí etiqueta de apertura "th" (th style="width:20px;" class="center")
                    <% if (permisoParaEditar)
                       {%>
                            <%  if (Model.Any())
                                {%>
                                   ...
                            <%  } %>
                    <%  } %>
                    dejar aquí etiqueta de cierre "th"
Modificar la línea 37:

input name="codigosBeneficiosEmpleo" type="checkbox" value="<%= beneficioAdicional.CodigoBeneficio %>" <%= beneficioAdicional.Seleccionado ? "checked" : string.Empty %>/>
Agregar al final antes de la etiqueta de cierre si debe ser de lectura o no:


input name="codigosBeneficiosEmpleo" type="checkbox" value="<%= beneficioAdicional.CodigoBeneficio %>" <%= beneficioAdicional.Seleccionado ? "checked" : string.Empty%> <%= !permisoParaEditar ? "disabled=True" : string.Empty%>/>

Eliminar las líneas 34,35 (<% if (permisoParaEditar) {%>) y 39 (<% } %>) que son el inicio y cierre del IF Se creó el Issue EVO-3655

link

answered 16 Mar '18, 11:53

Jimy%20Tobar's gravatar image

Jimy Tobar ♦♦
(suspended)
accept rate: 56%

Puedes crear una vista custom de ListadoBeneficiosEmpleo.ascx (AreasExpedientesViewsEmpleado) con este contenido

<%@ Control Language="C#" Inherits="Aseinfo.Infrastructure.Base.Web.ViewUserControlBase<List<BeneficioAdicionalEmpleoModel>>" %>
<%@ Import Namespace="Aseinfo.VH4.Expedientes.Controllers"%>

<%@ Import Namespace="Aseinfo.Infrastructure.Strings" %>
<%  ViewData[Constants.DisplayInlineApplicationAndErrorMessagesViewDataKey] = false; %>
<%  Html.RenderPartial(Constants.AjaxErrorMessagesPartialViewName); %>
<%  Html.RenderPartial(Constants.ApplicationMessagesPartialViewName); %>

<% var permisoParaEditar = AuthenticatedUser.ValidateControllerAction("Expedientes", "Empleado", "EditBeneficioAdicionalEmpleo"); %>

<form>
    <%= Html.AntiForgeryToken() %>
    <%= Html.ApplicationValidationToken() %>
    <div class="controls">
        <fieldset>
            <table border="0" cellpadding="5" cellspacing="2" class="tabla_grid">
                <tr>
                    <% if (permisoParaEditar)
                       {%>
                            <th style="width:20px;" class="center">
                            <%  if (Model.Any())
                                {%>
                                    <input id="chkSeleccionarTodos" type="checkbox" value=""/>
                            <%  } %>
                            </th>
                    <%  }
                    else
                    {%>
                        <th style="width:20px;" class="center">&nbsp;</th>
                    <%  } %>
                    <th><%= this.GetLocalized("HeaderDescripcionBeneficio") %></th>
                </tr>
                <%  if (Model.Any())
                    {
                        foreach (var beneficioAdicional in Model)
                        {%>
                            <tr>
                                <%  if (permisoParaEditar)
                                    {%>
                                        <td class="center">
                                            <input name="codigosBeneficiosEmpleo" type="checkbox" value="<%= beneficioAdicional.CodigoBeneficio %>" <%= beneficioAdicional.Seleccionado ? "checked" : string.Empty %>/>
                                        </td>
                                 <%  }
                                    else
                                    {%>
                                        <td class="center">
                                            <input name="codigosBeneficiosEmpleo" type="checkbox" value="<%= beneficioAdicional.CodigoBeneficio %>" <%= beneficioAdicional.Seleccionado ? "checked" : string.Empty %>  disabled/>
                                        </td>
                                    <%  } %>
                                <td><%: beneficioAdicional.NombreBeneficio %></td>
                            </tr>
                    <%  } %>
                <%  }
                    else
                    {%>
                        <tr>
                            <td colspan="2" class="center"><%= this.GetLocalized("TablaGridSinRegistros")%></td>
                        </tr>
                <%  } %>
            </table>
        </fieldset>
    </div>
    <div class="panel_der_botones">
        <%  if (permisoParaEditar)
            {%>
                <input type="submit" id="btnGuardarBeneficioAdicionalEmpleo" name="btnGuardarBeneficioAdicionalEmpleo" value="<%= this.GetLocalized("Guardar") %>" onclick="GuardarBeneficiosAdicionales(this.form); return false;" />&nbsp;
        <%  } %>
        <%--<input type="button" name="btnRegresarListadoEmpleado" value="<%= this.GetLocalized("btnRegresarListadoEmpleado.Text") %>" onclick="RegresarAListado();" />--%>
    </div>
</form>

<script type="text/javascript">
    $(document).ready(function () {
        $('#chkSeleccionarTodos').change(selectAll);
    });
    function Regresar() {
        $('#<%= Constants.MessagesDivName %>').empty();
        VerEmpleo($('#EmpleosActivos').val());
    }

    function selectAll() {
        $('[name$=".CodigoBeneficio"]').attr('checked', $('#chkSeleccionarTodos').is(':checked'));
    }

    function GuardarBeneficiosAdicionales(form) {
        $('#<%= Constants.MessagesDivName %>').empty();
        $.post('<%= Url.Action("EditBeneficioAdicionalEmpleo", "Empleado") %>', $(form).serialize() + '&Codigo=' + $('#EmpleosActivos').val(), function (response) {
            $('.panel_der_contenido_simple').html(response);
        });
    }
</script>
link

answered 16 Mar '18, 11:44

sbarahona's gravatar image

sbarahona ♦♦
(suspended)
accept rate: 32%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Evolution en BitBucket

En este sitio puede acceder al código fuente, centro de descargas y reportar bugs, propuestas y mejoras para Evolution.

Evolution en JIRA

En este sitio puedes sugerir nueva funcionalidad para Evolution, o puedes votar por la funcionalidad ya propuesta por otros usuarios.

Tags:

×2
×2
×1

Asked: 16 Mar '18, 10:39

Seen: 522 times

Last updated: 16 Mar '18, 11:53

[Acerca de] [Preguntas Frecuentes] [Privacidad] [Soporte] [Contacto]
Copyright 2013-2018. Asesores en Informática