<%@page import="com.itextpdf.text.log.SysoLogger"%> <%@page import="java.util.Map.Entry"%> <%@page import="java.math.BigDecimal"%> <%@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 printOnly = flRequest.getRequestParameterOrAttribute("printOnly"); if(printOnly==null || !"TRUE".equals(printOnly)) printOnly=null; 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 entID = FormHelper.getEntIDFromUTK(context, utk); String lngId = ""; try{ lngId = (new EnterpriseBean(entID, context)).getCustomProperty("EntRefLngID_").toString(); }catch(Exception e){ lngId = dico.getRefIdByCode("Lna", "Te1", "fr_FR"); } String ctrId = ""; try{ ctrId = (new EnterpriseBean(entID, context)).getEntCtrID(); }catch(Exception e){ ctrId = dico.getRefIdByCode("Ctr", "Te1", "FR"); } String languageID = lngId;//dico.getRefIdByCode("Lna", "Te1", "fr_FR"); String lngCode = dico.getRefCode("EntRefLngID_", languageID); String countryID = ctrId;//dico.getRefIdByCode("Ctr", "Te1", "FR"); FlLocale locale = FlLocale.getInstance(context, languageID, countryID); String init = flRequest.getRequestParameterOrAttribute("init"); String actID = (String)request.getSession().getAttribute("actorID"); String actcode = null; if(actID != null){ ActorBean actor = new ActorBean(actID, context); actcode = actor.getActCode(); } Date expireDt = null; //http://u-project2.umanis.com/view.php?id=39749 : Export guide / localités et Millésime //String sExpireDt = ""; String millesime = ""; try{ /* expireDt = Form.getFrmAvailableToDt(); SimpleDateFormat sfd = new SimpleDateFormat("dd/MM/yyyy"); sExpireDt = sfd.format(expireDt); Calendar cal = Calendar.getInstance(); cal.setTime(expireDt); int year = cal.get(Calendar.YEAR); millesime = String.valueOf(year); */ millesime = String.valueOf((Integer)Form.getCustomProperty("FrmMillesime_")); }catch(Exception e){ logger.error(" The field 'FrmMillesime_' not initialized to get 'Millesime' :" + e.getMessage()); try { millesime = context.getContextParameter("Millesime"); } catch (Exception e2) { logger.error("Option 'Millesime' not found :" + e2.getMessage()); } } Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); int year = cal.get(Calendar.YEAR); // Boolean askForStatus = (Boolean)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_ASKUSEREVTSTATUS); String enterprise = ""; String perEntID = null; String ctType = null; //int entCotisationMil_ = 0; try{ perEntID = Person.getPerEntID(); // ctType = Contrat_Helper.getAffiliateType(context, perEntID); enterprise = (new EnterpriseBean(perEntID,context)).getCustomProperty("EntDispName_").toString(); // EnterpriseBean ent = new EnterpriseBean(perEntID,context); // entCotisationMil_ = (Integer)ent.getCustomProperty("entCotisationMil_"); }catch(Exception fe){ } //logger.info("contrat type :: " + ctType); // 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) {} HashMap allTiers = EnterpriseHelper.getListeIdsDesTiersAssocieGuide(context, entID); HashMap allPers = EnterpriseHelper.getListeIdsDesPersonsAssocieGuide(context, entID); Vector allTiersIDs = new Vector(allTiers.values()); logger.error(allTiersIDs); Set allTiersType = new HashSet(); Vector tiersType = new Vector(); Vector tiersTypeLabels = new Vector(); allTiersType = allTiers.keySet(); Iterator itr = allTiersType.iterator(); while(itr.hasNext()){ String typeValue = itr.next(); tiersType.add(typeValue); typeValue = typeValue.substring(0, 1) + typeValue.substring(1); if(!Utils.isNullEmptyString(typeValue) && typeValue.startsWith("H")){ tiersTypeLabels.add("Tiers"); } else{ typeValue = typeValue.replaceAll("\\s", ""); tiersTypeLabels.add(typeValue); } } Iterator itr1 = allTiers.keySet().iterator(); while(itr1.hasNext()){ String typeValue = itr1.next(); if(!Utils.isNullEmptyString(typeValue) && typeValue.startsWith("H")){ // allPers.put("Tiers", allPers.get(typeValue)); allPers.put("Tiers", Person.getPerID()); allPers.remove(typeValue); } else{ allPers.put(typeValue.replaceAll("\\s", ""), allPers.get(typeValue)); allPers.remove(typeValue); } } // get the question and response // LinkedHashMap> mapQuestionResponse=(LinkedHashMap>)flRequest. // getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_QUESTIONRESPONSEMAP); // LinkedHashMap> mapInitialQuestionResponse=(LinkedHashMap>)flRequest. // getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_INIT_QUESTIONRESPONSEMAP); // LinkedHashMap> mapCotQuestionResponse=(LinkedHashMap>)flRequest. // getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_QUESTIONRESPONSECOTMAP); HashMap>> allQuestionResponses = new HashMap(); if (allTiers.size() == 1) { allQuestionResponses.put("Tiers_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_INIT_QUESTIONRESPONSEMAP)); allQuestionResponses.put("Tiers_Init_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_INIT_QUESTIONRESPONSEMAP)); allQuestionResponses.put("Tiers_Cot_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_QUESTIONRESPONSECOTMAP)); } else { for (String type : tiersTypeLabels) { if (type.equals("Tiers")) { allQuestionResponses.put(type + "_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_INIT_QUESTIONRESPONSEMAP)); allQuestionResponses.put(type + "_Init_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_INIT_QUESTIONRESPONSEMAP)); allQuestionResponses.put(type + "_Cot_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_QUESTIONRESPONSECOTMAP)); } else if (type.equals("Restaurant")) { allQuestionResponses.put(type + "_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_INIT_QUESTIONRESPONSEMAP_R)); allQuestionResponses.put(type + "_Init_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_INIT_QUESTIONRESPONSEMAP_R)); } else if (type.equals("MaisonByLogis")) { allQuestionResponses.put(type + "_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_INIT_QUESTIONRESPONSEMAP_M)); allQuestionResponses.put(type + "_Init_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_INIT_QUESTIONRESPONSEMAP_M)); } else if (type.equals("InsoliteByLogis")) { allQuestionResponses.put(type + "_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_INIT_QUESTIONRESPONSEMAP_I)); allQuestionResponses.put(type + "_Init_Qst_Resp", (LinkedHashMap>) flRequest .getAttribute(LoadWebFormPvtAction.ATT_INIT_QUESTIONRESPONSEMAP_I)); } } } flRequest.setAttribute("allQuestionResponses", allQuestionResponses); // 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; // taritement sur l'évolution EB012 String contratRompu = null; try { //contratRompu = Contrat_Helper.getAffiliateNumber(context, perEntID); contratRompu = Contrat_Helper.getAffiliateNumberByPersonID(context, Person.getPerID()); //ABM correction après retour Sonia if (contratRompu.equals("")) { contratRompu = null; } } catch (Exception e1) { contratRompu = null; } %> <%-- --%> <%=Utils.getMessage(context, lngCode, "L63F4", true,true,"R�ponse au questionnaire")%> <% if (allQuestionResponses!=null && allQuestionResponses.size()>0) { %>
<%= Utils.getMessage(context, lngCode, "LF1DC", true,true,"N� Affili�") + " : " + Contrat_Helper.getAffiliateNumberByPersonID(context, Person.getPerID())%>  

<%=Utils.getMessage(context, lngCode, "MF10A", true,true,"Questionnaire Guide") + " " + millesime %>

<%= Utils.getMessage(context, lngCode, "LF22F", true,true,"LES RENSEIGNEMENTS INDIQUES FIGURERONT, EN PARTIE, DANS LE GUIDE ") + " " + millesime + " " + Utils.getMessage(context, lngCode, "LF230", "ET SUR INTERNET") %>
<% if(tiersType != null && !tiersType.isEmpty() && tiersTypeLabels != null && !tiersTypeLabels.isEmpty()){%> <%for (int i = 0; i < tiersType.size(); i++) {%> <%}} %>
<%} %>



<%= Utils.getMessage(context, lngCode, "L639B", true,true,"Chargement ...") %>




<%= Utils.getMessage(context, lngCode, "L639B", true,true,"Chargement ...") %>