<% /****************************************************************************** * Copyright (c) 2000-2009 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" import="com.edeal.frontline.*,java.util.*,java.util.Map.Entry,java.text.*,java.lang.reflect.*,com.edeal.frontline.navigation.*,com.edeal.frontline.helper.custom.*"%> <%@page session="true" import="com.edeal.frontline.Utils"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <%@ page import="com.edeal.frontline.helper.custom.FormHelper" %> <%@ page import="com.edeal.frontline.controller.actions.custom.LoadWebFormPvtAction" %> <% 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 languageID = dico.getRefIdByCode("Lna", "Te1", "fr_FR"); String countryID = dico.getRefIdByCode("Ctr", "Te1", "FR"); FlLocale locale = FlLocale.getInstance(context, languageID, countryID); String utk = flRequest.getRequestParameterOrAttribute("utk"); if(utk != null) flRequest.setAttribute("utk", utk); String eventCode = flRequest.getRequestParameterOrAttribute("event"); if(eventCode != null) flRequest.setAttribute("event", eventCode); String enterprise = ""; String perEntID = null; try{ perEntID = Person.getPerEntID(); enterprise = new EnterpriseBean(perEntID,context).toString(); }catch(FrontlineException fe){} Boolean askForStatus = (Boolean)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_ASKUSEREVTSTATUS); String pvtStatus = ""; try { pvtStatus = ((Integer)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_PVTSTATUS)).toString(); } catch (Exception e) {} int iPvtStatus=Integer.MIN_VALUE; try { iPvtStatus=Integer.parseInt(pvtStatus); } catch (Exception e) {} Vector eventStatusList=(Vector)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_EVTSTATUSLIST); String webIntro = ""; String webHeader = ""; //String webConclusion = ""; String webFooter = ""; String webTermsOfUse = ""; try { webIntro = FormHelper.makeHtmlCrLf(Form.getFrmWebIntro()); } catch (Exception e) {} try { webHeader = FormHelper.makeHtmlCrLf(Form.getFrmWebHeader()); } catch (Exception e) {} // try { webConclusion = Form.getFrmWebConclusion(); } catch (Exception e) {} try { webFooter = FormHelper.makeHtmlCrLf(Form.getFrmWebFooter()); } catch (Exception e) {} try { webTermsOfUse =FormHelper.makeHtmlCrLf(Form.getFrmWebTermsOfUse()); } catch (Exception e) {} // get the question and response LinkedHashMap> mapQuestionResponse=(LinkedHashMap>)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_QUESTIONRESPONSEMAP); boolean fDoDisplayIntro=false; try { fDoDisplayIntro=(Boolean)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_DISPLAYINTRO); } catch (Exception e) {} // get the link for navigation boolean hasNextQuestions=false; boolean hasPreviousQuestions=false; boolean canValidate= false; boolean canIntegrate = false; boolean isFormPaginated=false; int positionFirstQuestion=-1; int positionLastQuestion=-1; %>
"> "> "> "/>

<% if (fDoDisplayIntro) { %>
<%= webIntro %>
<% if (askForStatus) { %>
    <% if (eventStatusList != null && eventStatusList.size() > 0) { for (int i=0 ; i < eventStatusList.size() ; i++) { // evtCurrentStatus int statusPos = Integer.parseInt((String) ((Vector) eventStatusList.elementAt(i)).elementAt(0)); String statusLabel = (String) ((Vector) eventStatusList.elementAt(i)).elementAt(1); %>
  • <% } } %>
<% } else { //if ( formEveStChMode != null && "AUTO".equals(dico.getRefCode("FrmEveStChMode" , formEveStChMode)) ) { %> <% } boolean fHasBasicQuestion=false; try { fHasBasicQuestion=(Form.getFrmBasicQuestion0()!=null); } catch (Exception e) {} if (fHasBasicQuestion) { %>
    <% if (Form != null) { for (int i=0 ; i < 3 ; i++) { String basicQuestion = null; try { basicQuestion = (String) Form.getProperty("FrmBasicQuestion" + Integer.toString(i)); } catch (Exception e) { logger.debug("Error printing basic question number " + Integer.toString(i), e); } boolean bresponse = false; try { if (i == 0) bresponse = FormResponse.isFrpBasicResponse0(); if (i == 1) bresponse = FormResponse.isFrpBasicResponse1(); if (i == 2) bresponse = FormResponse.isFrpBasicResponse2(); } catch (Exception e) {} if (basicQuestion != null) { %>
  • <% } } } %>
<% } // if (fHasBasicQuestion) %> <% } // Display Intro %> <% if (mapQuestionResponse!=null && mapQuestionResponse.size()>0) { %>
<%= webHeader %>

<%= Person.toString()%>

<%= Utils.getMessage(context, "fr_FR", "LF1DD", "Logis") + " : " + enterprise%>

<%= Utils.getMessage(context, "fr_FR", "LF1DC", "N° Affilié") + " : " + Contrat_Helper.getAffiliateNumber(context, perEntID)%>

<% // Variables servant au mode paginé Iterator itQuestionResponse=mapQuestionResponse.keySet().iterator(); boolean fFirstQuestion=true; int lfqPosition=Integer.MIN_VALUE; int p=0; for (Entry> entry : mapQuestionResponse.entrySet()) { String lfqID = entry.getKey(); LinkFormQuestionBean lfq=new LinkFormQuestionBean(lfqID,context); // Question or paragraph ? String questionID=null; try { questionID=lfq.getLfqFormQuestionID(); } catch (Exception e) {} String paragraph=null; try { paragraph=lfq.getLfqParagraph(); p++;} catch (Exception e) {} Vector resps = entry.getValue(); //String responseID = mapQuestionResponse.get(lfqID); String responseID = null; if(resps != null && resps.size() > 0) responseID = resps.elementAt(0); // may be null try { lfqPosition=lfq.getLfqPosition(); } catch (Exception e) {} // removed from here if (paragraph != null) { if(p > 1){ %>
<% } %>
">

<%=paragraph%>

<% } else { FormQuestionBean question = null; QuestionResponseBean questionResponse=null; try { question = new FormQuestionBean(questionID , context); if (responseID!=null) { questionResponse = new QuestionResponseBean(responseID,context); } } catch (Exception e) { } request.setAttribute("responses",resps); request.setAttribute("curQuestion",question); // La question a poser request.setAttribute("curQrs",questionResponse); // La réponse éventuellement existente //request.setAttribute("curQrsPosition",curQrsPosition); // La position //request.setAttribute("curQrsRefValID",curQrsRefValID); %> <% if (fFirstQuestion) { positionFirstQuestion=lfqPosition-1; %> <% } // first question fFirstQuestion=false; }//N'est pas un paragraph } // while positionLastQuestion=lfqPosition; if(p >= 1){ %>
<%} %> <% } //<% if (mapQuestionResponse!=null) %>
<%= webTermsOfUse %>