Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\siteweb\webform\webform-envies.jsp
<% /****************************************************************************** * 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" %> <jsp:useBean class="com.edeal.frontline.FormBean" id="Form" scope="request"/> <jsp:useBean class="com.edeal.frontline.PersonBean" id="Person" scope="request"/> <jsp:useBean class="com.edeal.frontline.FormResponseBean" id="FormResponse" scope="request"/> <% 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("Millesime"); } catch (Exception e2) { logger.error("Option 'Millesime' not found :" + e2.getMessage()); } } 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<String,Vector<String>> mapQuestionResponse=(LinkedHashMap<String,Vector<String>>)flRequest.getAttribute(LoadWebFormPvtAction._REQ_ATTRIB_QUESTIONRESPONSEMAP); LinkedHashMap<String,Vector<String>> mapInitialQuestionResponse=(LinkedHashMap<String,Vector<String>>)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; %> <html> <head> <script type="text/javascript" src="<fl:webapp/>/js/edeal/libraries/jquery/jquery-1.8.2.js"></script> <script language="javascript"> function _tempSave(endPos) { var f = document.forms[0]; f.action = '<fl:webapp/>/save_partial_web_form.fl?fromToSave=0&toToSave=' + endPos; f.submit(); } function _save() { var f = document.forms[0]; f.action = '<fl:webapp/>/save_web_form.fl'; f.submit(); } function doSubmit(navigation) { f=document.forms[0]; if (navigation) { f.action+= '&' + navigation; } $("*[disabled]").removeAttr("disabled"); f.submit(); } </script> <link href="<fl:webapp/>/siteweb/webform/webform.css" type="text/css" rel="stylesheet"> <link media="print" href="<fl:webapp/>/siteweb/webform/webform_print.css" type="text/css" rel="stylesheet"> <title>Réponse au questionnaire</title> </head> <body onload=""> <div id="webform" class="webform"> <fl:form action="/save_web_form.fl" bean="Form"> <input type="hidden" name="FormID" value="<fl:getProperty name="Form" alt="" property="FrmID"/>"> <input type="hidden" name="PerID" value="<fl:getProperty name="Person" alt="" property="PerID"/>"> <input type="hidden" name="EventID" value="<fl:getProperty name="Form" alt="" property="FrmEventID"/>"> <input type="hidden" name="savemode" value="<%= (isFormPaginated?"partial":"full") %>"/> <div id="logo"><img id="logo_img" src="<fl:webapp/>/icons/logis.jpg" alt=""/></div> <div id="webform_title" class="webform_title"> <div id="div_web_form_title">FEDERATION INTERNATIONALE DES LOGIS</div> <div id="div_web_form_title_sub"><fl:getProperty name="Form" property="FrmLabel" alt=""/></div> </div> <% if (fDoDisplayIntro) { %> <div id="webform_intro" class="webform_container"> <%= webIntro %> </div> <% if (askForStatus) { %> <div id="webform_status" class="webform_container"> <ul class="webform_list"> <% 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); %> <li id="webform_status<%= Integer.toString(statusPos) %>" class="webform_status"> <label class="webform_answer"> <input type="radio" name="EventStatus" value="<%= Integer.toString(statusPos) %>" <%= (statusPos == iPvtStatus)? "checked" : "" %> ><%= statusLabel %> </label> </li> <% } } %> </ul> </div> <% } else { //if ( formEveStChMode != null && "AUTO".equals(dico.getRefCode("FrmEveStChMode" , formEveStChMode)) ) { %> <input type="hidden" name="EventStatus" value="<%= pvtStatus %>"> <% } boolean fHasBasicQuestion=false; try { fHasBasicQuestion=(Form.getFrmBasicQuestion0()!=null); } catch (Exception e) {} if (fHasBasicQuestion) { %> <div id="webform_basicquestions" class="webform_container"> <ul class="webform_list"> <% 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) { %> <li id="webform_basicquestion<%= Integer.toString(i) %>" class="webform_basicquestion"> <label class="webform_answer"> <input type="checkbox" name="BasicResponse<%= Integer.toString(i) %>" value="1" <%= bresponse ? "checked" : "" %>><%= basicQuestion %> </label> </li> <% } } } %> </ul> </div> <% } // if (fHasBasicQuestion) %> <% } // Display Intro %> <% if (mapQuestionResponse!=null && mapQuestionResponse.size()>0) { %> <div id="webform_header" class="webform_container"> <div id="webform_header" class="webform_container"> <div id="div_web_form_header"><%= webHeader %></div> <div id="div_web_form_header_sub"> <p class="p_web_form_header"><%= Person.toString()%></p> <p class="p_web_form_header"><%= Utils.getMessage(context, "fr_FR", "LF1DD", "Logis") + " : " + enterprise%></p> <p class="p_web_form_header"><%= Utils.getMessage(context, "fr_FR", "LF1DC", "N° Affilié") + " : " + Contrat_Helper.getAffiliateNumber(context, perEntID)%></p> </div> <div id="div_web_form_header_sub2"> <p id="p_div_web_form_header_sub2"> <%=Utils.getMessage(context, lngCode, "LF22B", "A retourner impérativement à votre Association Logis")%><br/><%=Utils.getMessage(context, lngCode, "LF22C", "AVANT LE")%> <%=sExpireDt %><br/><%=Utils.getMessage(context, lngCode, "LF22D", "DERNIER DELAI")%> </p> </div> </div> </div> <% // Variables servant au mode paginé Iterator<String> itQuestionResponse=mapQuestionResponse.keySet().iterator(); boolean fFirstQuestion=true; int lfqPosition=Integer.MIN_VALUE; int p=0; for (Entry<String, Vector<String>> 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<String> 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){ %> </div> <%if(p == 2){ %> <div id="div_sub_form_text"> Le site internet des Logis au delà du moteur de recherche classique Logis (ville, hôtels, date...) propose à ses clients un moteur de recherche par "Envies". Celui-ci a pour vocation de mettre en relief les spécificités de chaque Logis et de montrer la richesse et la diversité de notre offre. A travers ce moteur de recherche, le client peut cibler ses "envies" et sélectionner in fine un ou des établissements qui peuvent correspondre à ses attentes. Nous comptons sur vous et nous vous demandons de remplir ce questionnaire avec la plus grande exactitude afin de mettre en valeur les prestations que vous proposez aux clients. </div> <% }} %> <div class="div_webform_container" id="<%= "PARA" +p %>"> <p class="webform_paragraph" id="p_webform_paragraph"><%=Utils.getMessage(context, lngCode, paragraph, paragraph)%></p> <% } 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 %> <jsp:include page="webform_question.jsp"> <jsp:param name="lfqPos" value="<%= lfqPosition %>"/> <jsp:param name="lfqID" value="<%= lfqID %>"/> </jsp:include> <% if (fFirstQuestion) { positionFirstQuestion=lfqPosition-1; %> <input type="hidden" name="firstQuestionPos" value="<%= lfqPosition %>"> <% } // first question fFirstQuestion=false; }//N'est pas un paragraph } // while positionLastQuestion=lfqPosition; if(p >= 1){ %> </div> <% } %> <input type="hidden" name="lastQuestionPos" value="<%= lfqPosition %>"> <div id="webform_footer" class="webform_container"> <%= webFooter %> </div> <% } //<% if (mapQuestionResponse!=null) %> <%if(init == null || Utils.isEmpty(init) || !"ok".equalsIgnoreCase(init)){ %> <div id="webform_links" class="webform_container"> <% if (hasPreviousQuestions) { %> <a href="javascript:doSubmit('prev=<%= positionFirstQuestion %>')"><< précédent </a> <% } %> <% if(actcode != null && !"ano".equalsIgnoreCase(actcode)){ %> <a href="javascript:doSubmit('leavemode=seeyou&complete=false');"><%= Utils.getMessage(context, lngCode, "FF2B2", "J'enregistre et je finaliserai ma saisie plus tard (mon inscription n'est pas validée)") %></a> <br> <a href="javascript:doSubmit('leavemode=bye&complete=true&validate=true&integrate=false');"><%= Utils.getMessage(context, lngCode, "A2001", "Valider") %></a> <%-- <span>|</span> <a href="javascript:doSubmit('leavemode=bye&complete=true&validate=true&integrate=true');"><%= Utils.getMessage(context, lngCode, "LF175", "Intégrer") %></a> --%> <% }else if(actcode == null || "ano".equalsIgnoreCase(actcode)){ %> <a href="javascript:doSubmit('leavemode=seeyou&complete=false');"><%= Utils.getMessage(context, lngCode, "FF2B2", "J'enregistre et je finaliserai ma saisie plus tard (mon inscription n'est pas validée)") %></a> <br> <a href="javascript:doSubmit('leavemode=bye&complete=true&validate=false');"><%= Utils.getMessage(context, lngCode, "FF2B4", "J'ai terminé ma saisie et je valide mon inscription au guide") %></a> <% }if (hasNextQuestions) { %> <a href="javascript:doSubmit('next=<%= positionLastQuestion %>')"> suivant >></a> <% } %> </div> <% } %> <div id="webform_termsofuse" class="webform_container"> <%= webTermsOfUse %> </div> </fl:form> </div> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de