<% /****************************************************************************** * 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 lngCode = dico.getRefCode("EntRefLngID_", languageID); // 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 utk = flRequest.getRequestParameterOrAttribute("utk"); if(utk != null) flRequest.setAttribute("utk", utk); String eventCode = flRequest.getRequestParameterOrAttribute("event"); if(eventCode != null) flRequest.setAttribute("event", eventCode); //////////////////////////////////// Bring the enterprise from an utk holder String entID = ""; String sqlQuery = "select PerEntID from Person where PerToken = " + Utils.formatToSQL(context, utk) + " AND PerID like '%"+utk+"%' "; java.sql.Connection con = null; java.sql.Statement stmt = null; java.sql.ResultSet rs = null; try { con = context.getConnection(); stmt = con.createStatement(); rs = stmt.executeQuery(sqlQuery); while (rs.next()) { entID = rs.getString("PerEntID"); } }catch(java.sql.SQLException e){ } finally { try { rs.close(); } catch (Exception e) { } try { stmt.close(); } catch (Exception e) { } try { con.close(); } catch (Exception e) { } } ///////////////////////////////////// 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(); } //http://u-project2.umanis.com/view.php?id=39749 : Export guide / localités et Millésime /* Date expireDt = null; 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("Quest.Stat.Millesime"); } catch (Exception e2) { logger.error("Option 'Millesime' not found :" + e2.getMessage()); } } /* String entMil = ""; try { entMil = context.getContextParameter("Quest.Stat.Millesime"); if(entMil!=null && entMil.length()==4) millesime = entMil; } catch (Exception e) { } */ String enterprise = ""; String perEntID = null; /* try{ perEntID = Person.getPerEntID(); enterprise = new EnterpriseBean(perEntID,context).toString(); }catch(FrontlineException fe){} */ try{ perEntID = Person.getPerEntID(); enterprise = (String)EnterpriseBean.lookup(context, "EntDispName_", perEntID); }catch(FrontlineException ee){ } 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); LinkedHashMap> mapInitialQuestionResponse=(LinkedHashMap>)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_INIT_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; // 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; } %> Réponse au questionnaire
"> "> "> "/>


<%= Utils.getMessage(context, lngCode, "LF1DC", true,true,"N° Affilié") + " : " + Contrat_Helper.getAffiliateNumberByPersonID(context, Person.getPerID())%>  

<%=Utils.getMessage(context, lngCode, "LF22E", true,true,"FEDERATION INTERNATIONALE DES LOGIS")%>
<%--
--%>
<%=Utils.getMessage(context, lngCode, "MF147", true,true,"Questionnaire Statistiques").toUpperCase() + " " + (Integer.parseInt(millesime))+"
" + Utils.getMessage(context, lngCode, "MF177", true,true," (1 er janvier ") +" "+ (Integer.parseInt(millesime)) +" " + Utils.getMessage(context, lngCode, "MF178", true,true," au 31 décembre ") +" " + (Integer.parseInt(millesime)) + ")" %>
<% 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, lngCode, "LF1DD", true,true,"Logis") + " : " + enterprise%>

<%--

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

--%>
<%--
<%= webHeader %>

<%= Person.toString()%>

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

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

<%=Utils.getMessage(context, lngCode, "LF22B", "A retourner impérativement à votre Association Logis")%>
<%=Utils.getMessage(context, lngCode, "LF22C", "AVANT LE")%> <%=sExpireDt %>
<%=Utils.getMessage(context, lngCode, "LF22D", "DERNIER DELAI")%>

--%>


<% // 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){ %>
<% } %>
">

<%=Utils.getMessage(context, lngCode, paragraph, paragraph).replaceAll("::millesime::", millesime).replaceAll("::millesime\\+1::", (Integer.parseInt(millesime)+1)+"").replaceAll("::millesime-1::", (Integer.parseInt(millesime)-1)+"")%>

<% } 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("initialresponses",mapInitialQuestionResponse); request.setAttribute("isActorLogis",actcode != null && !"ano".equalsIgnoreCase(actcode)); 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){ %>
<%} %> <% } %> <% String editing = flRequest.getRequestParameterOrAttribute("editing"); // 'SAVE' & 'SIGN' String printOnly = flRequest.getRequestParameterOrAttribute("printOnly"); //'TRUE' if(editing==null)editing =""; if(printOnly==null || !"TRUE".equals(printOnly)) printOnly=null; if((init == null || Utils.isEmpty(init) || !"ok".equalsIgnoreCase(init)) && contratRompu != null){ %> <% }else{ %> <% } %>
<%= webTermsOfUse %>