%
/******************************************************************************
* Copyright (c) 2000-2005 e-Deal
*
* e-Deal S.A.
* 55 rue Brillat Savarin
* 75013 Paris
* France
*
* T: +33 (0)1 53 80 80 30
* F: +33 (0)1 73 01 69 77
* http://www.e-deal.com
*
* La diffusion de ce code source sous quelque forme que ce soit sans
* l'autorisation de E-DEAL est interdite.
*
* Vous êtes autorisés à modifier ce code source uniquement pour votre usage
* propre et sous réserve que les mentions de copyright demeurent intactes.
*
* Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou
* implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour
* responsable des dommages pouvant résulter de l'utilisation de ce code
* source.
******************************************************************************/
%><%@page session="true"%><%@ page import="com.edeal.frontline.navigation.FlRequest" %><%@ page import="com.edeal.frontline.AccessControlManager" %><%@ page import="com.edeal.frontline.PersonBean" %><%@ page import="com.edeal.frontline.LocationBean" %><%@ page import="com.edeal.frontline.InteractionBean" %><%@ page import="com.edeal.frontline.OpportunityBean" %><%@ page import="java.lang.reflect.Method" %><%@ page import="com.edeal.frontline.DataDictionary" %><%@ page import="com.edeal.frontline.ActorBean" %><%@ page import="com.edeal.frontline.AccessDeniedException" %><%@ page import="java.util.Date" %><%@ page import="com.edeal.frontline.FieldNotInitializedException" %><%@ page import="com.edeal.frontline.FlContext" %><%@ page import="com.edeal.frontline.Utils" %><%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %>
<%
String id;
try {
id = ExpenseFile.getID();
} catch (Exception e) {
id = null;
}
final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass());
FlRequest flRequest = new FlRequest(request);
FlContext context = flRequest.getContext();
DataDictionary dico = context.getDataDictionary();
String customPackage = context.getContextParameter("CustomPackage");
String redact = dico.getRefIdByCode("ExfEfsID", "REDACT");
String valact = dico.getRefIdByCode("ExfEfsID", "VALACT");
String valman = dico.getRefIdByCode("ExfEfsID", "VALMAN");
String valcom = dico.getRefIdByCode("ExfEfsID", "VALCOM");
String actID = (String) session.getAttribute("actorID");
ActorBean actor = null;
try {
actor = new ActorBean(actID, session);
} catch (AccessDeniedException ade) {
}
String exfActID = null;
String actManager = null;
try {
exfActID = ExpenseFile.getExfActID();
ActorBean creator = null;
creator = new ActorBean(exfActID, session);
actManager = creator.getActManager();
} catch (Exception ade) {
}
String exfEfsID = null;
Date exfEmitDate = null;
Date exfMangerDate = null;
Date exfAccountDate = null;
try {
exfEfsID = ExpenseFile.getExfEfsID();
exfEmitDate = ExpenseFile.getExfEmitDate();
exfMangerDate = ExpenseFile.getExfMangerDate();
exfAccountDate = ExpenseFile.getExfAccountDate();
} catch (FieldNotInitializedException fnie) {
}
String exfEmitDateWeb = "";
String exfMangerDateWeb = "";
String exfAccountDateWeb = "";
if (exfEmitDate != null) {
exfEmitDateWeb = Utils.formatToWebDate(session, exfEmitDate, false);
}
if (exfMangerDate != null) {
exfMangerDateWeb = Utils.formatToWebDate(session, exfMangerDate, false);
}
if (exfAccountDate != null) {
exfAccountDateWeb = Utils.formatToWebDate(session, exfAccountDate, false);
}
boolean isAccountant;
try {
isAccountant = ((Boolean)flRequest.getAttribute("isAccountant")).booleanValue();
} catch (Exception e) {
isAccountant = false;
}
isAccountant = true;
boolean isAdmin;
try {
isAdmin = ((Boolean)flRequest.getAttribute("isAdmin")).booleanValue();
} catch (Exception e) {
isAdmin = false;
}
boolean isManager = actID.equals(actManager) ? true : false;
String today = Utils.formatToWebDate(session, new Date(), false);
%>
<% if ((actID.equals(exfActID) && redact.equals(exfEfsID)) || (isManager && valact.equals(exfEfsID)) || (isAccountant && valman.equals(exfEfsID)) || isAdmin) { %>
|
|
|
<% } %>
<%
if (redact.equals(exfEfsID) || valcom.equals(exfEfsID)) {
if ((actID.equals(exfActID) && redact.equals(exfEfsID)) || isAdmin) {
%>
|
|
|
|
|
|
<% }
}
%>
<% if (!actID.equals(exfActID) && valman.equals(exfEfsID) && isAccountant) { %>
|
|
|
|
|
|
<% } %>
<% if (!actID.equals(exfActID) && valact.equals(exfEfsID) && isManager) { %>
|
|
|
|
|
|
<% } %>
<% if (actID.equals(exfActID) && redact.equals(exfEfsID)) { %>
|
|
|
|
|
|
<% } %>
<%
if (!actID.equals(exfActID) && ((valact.equals(exfEfsID) && isManager) || (valman.equals(exfEfsID) && isAccountant))) {
if (!isManager || !valact.equals(exfEfsID)) {
%>
|
|
|
|
|
|
<%
}
%>
|
|
|
|
|
|
<%
}
%>
<% if (!actID.equals(exfActID) && isAccountant) { %>
|
|
|
|
|
|
<% } %>