%@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 %> <%-- <% if (mapQuestionResponse!=null && mapQuestionResponse.size()>0) { %> --%> <%= Utils.getMessage(context, lngCode, "LF1DD", true,true,"Logis") + " : " + enterprise%> <%-- <%} %> --%> <% if(tiersType != null && !tiersType.isEmpty() && tiersTypeLabels != null && !tiersTypeLabels.isEmpty()){%> <%for (int i = 0; i < tiersType.size(); i++) {%> <%= tiersType.get(i)%> <%}} %> <%= 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, "LF1DD", true,true,"Logis") + " : " + enterprise%> <%= 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++) {%> <%}} %> <%if(init == null || Utils.isEmpty(init) || !"ok".equalsIgnoreCase(init)){ %> <%if (contratRompu != null){ %> <% if (hasPreviousQuestions) { %> << Précédent <% } if(actcode != null && !"ano".equalsIgnoreCase(actcode)){ %> <%-- <%= Utils.getMessage(context, lngCode, "FF2B7", true,true,"J'imprime le questionnaire") %> --%> --%> <%= Utils.getMessage(context, lngCode, "FF2B7", true,true,"J'imprime le questionnaire") %> <% if(LoadWebFormPvtAction.isItOkToShowPrevaliderButtons(context,Person.getPerID(),Form.getFrmEventID()) && !"TRUE".equals(printOnly) ){ %> <%-- <%= Utils.getMessage(context, lngCode, "MF192", true,true,"Pré-valider Chambres") %> --%> <%= Utils.getMessage(context, lngCode, "MF192", true,true,"Pré-valider Chambres") %> | <%= Utils.getMessage(context, lngCode, "MF193", true,true,"Pré-valider Divers") %> <%}%> <%if(printOnly == null){ %> <%= Utils.getMessage(context, lngCode, "F6003", true,true,"Valider") %> <%} %> <% }else if(actcode == null || "ano".equalsIgnoreCase(actcode)){ %> <%= Utils.getMessage(context, lngCode, "FF2B3", true,true,"J'imprime mon questionnaire") %> <%= Utils.getMessage(context, lngCode, "FF2B2", true,true,"J'enregistre et je finaliserai ma saisie plus tard (mon inscription n'est pas validée)") %> <%= Utils.getMessage(context, lngCode, "FF2B4", true,true,"J'ai terminé ma saisie et je valide mon inscription au guide") %> <% }if (hasNextQuestions) { %> Suivant >> <% } %> <%} %> <%} %> <%} %> <%= Utils.getMessage(context, lngCode, "L639B", true,true,"Chargement ...") %> <%= Utils.getMessage(context, lngCode, "L639B", true,true,"Chargement ...") %> <%=Utils.getMessage(context, lngCode, "MF121", true,true,"Votre navigateur a désactivé javascript pour cette page. Malheureusement, pour valider ce formulaire il faut que javascript soit activé. Veuillez activer javascript et rafraîchir la page. ") %>