<%@page import="module.mission.domain.PersonMissionAuthorization"%> <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic"%> <%@ taglib uri="http://fenix-ashes.ist.utl.pt/fenix-renderers" prefix="fr"%> <%@ taglib uri="http://fenix-ashes.ist.utl.pt/workflow" prefix="wf"%> <%@page import="module.organization.domain.OrganizationalModel"%> <%@page import="pt.ist.bennu.core.domain.MyOrg"%> <%@page import="pt.ist.bennu.core.domain.User"%> <%@page import="module.organization.domain.AccountabilityType"%> <%@page import="module.organizationIst.domain.IstAccountabilityType"%> <%@page import="java.util.Collections"%> <%@page import="module.mission.domain.MissionSystem"%> <%@page import="java.util.Set"%> <% final OrganizationalModel organizationalModel = MyOrg.getInstance().hasAnyOrganizationalModels() ? MyOrg.getInstance().getOrganizationalModelsIterator().next() : null; %> <% final PersonMissionAuthorization personMissionAuthorizationX = (PersonMissionAuthorization) request.getAttribute("personMissionAuthorization"); final boolean hasAuthority = personMissionAuthorizationX.hasAuthority() || personMissionAuthorizationX.hasDelegatedAuthority(); if (hasAuthority) { %> <% if (personMissionAuthorizationX.hasAuthority()) { %> <% } else { %>
<% } %> <% if (personMissionAuthorizationX.hasAuthority()) { %> <% } else { %> <% } %> <% final User user = User.findByUsername("ist11791"); final MissionSystem instance = MissionSystem.getInstance(); final Set accountabilityTypes = instance.getAccountabilityTypesThatAuthorize(); //final AccountabilityType accountabilityType = IstAccountabilityType.PERSONNEL_RESPONSIBLE_MISSIONS.readAccountabilityType(); final boolean hasChild = personMissionAuthorizationX.getUnit().hasChildAccountabilityIncludingAncestry(accountabilityTypes, user.getPerson()); final boolean hasNext = personMissionAuthorizationX.hasNext(); final boolean hasNextAthority = hasNext && (personMissionAuthorizationX.getNext().hasAuthority() || personMissionAuthorizationX.getNext().hasDelegatedAuthority()); final boolean result = hasAuthority && hasChild && (!hasNext || !hasNextAthority); %> <% if (personMissionAuthorizationX.canUnAuthoriseParticipantActivity()) { %> <% } %> <% } else { %> <% if (personMissionAuthorizationX.canAuthoriseParticipantActivity()) { %> <% } %> <% } %>