Edit C:\Users\Administrator\Desktop\Back\Livraison EVQG22\siteweb\webform\webform.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 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<String,Vector<String>> mapQuestionResponse=(LinkedHashMap<String,Vector<String>>)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; %> <html> <head> <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; } f.submit(); } </script> <link media="screen" href="<fl:webapp/>/siteweb/webform/webform.css" type="text/css" rel="stylesheet"> <body style="width:960px;margin:10px auto;background-color: #CFD6F2;" onload=""> <div id="webform" class="webform" style="background-color: #CFD6F2;"> <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" style="text-align: center"><img src="<fl:webapp/>/icons/logis.jpg" width="100px" height="100px" alt=""/></div> <div id="webform_title" class="webform_title"> <fl:getProperty name="Form" property="FrmLabel" alt=""/> </div> <br> <% 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 style="width: 100%;" ><%= webHeader %></div> <div style="width: 90%;font-weight: bold;"> <p style="margin-bottom: 2px;"><%= Person.toString()%></p> <p style="margin-bottom: 2px;"><%= Utils.getMessage(context, "fr_FR", "LF1DD", "Logis") + " : " + enterprise%></p> <p style="margin-bottom: 2px;"><%= Utils.getMessage(context, "fr_FR", "LF1DC", "N° Affilié") + " : " + Contrat_Helper.getAffiliateNumber(context, perEntID)%></p> </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> <% } %> <div class="webform_container" style="border: 2px solid #ED6E3A;padding-bottom: 14px;" id="<%= "PARA" +p %>"> <p class="webform_paragraph" style="background-color: #ED6E3A;color : #ffffff;"><%=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("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); %> <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) %> <div id="webform_links" class="webform_container"> <%-- <span id="WebForm_TemporarySave"> <a href="javascript:tempSave(<%= endPos %>);">Enregistrer pour reprendre plus tard</a> </span> --%> <% if (hasPreviousQuestions) { %> <a href="javascript:doSubmit('prev=<%= positionFirstQuestion %>')"><< précédent </a> <% } %> <a href="javascript:doSubmit('leavemode=seeyou&complete=false');"><%= Utils.getMessage(context, "fr_FR", "A0003", "Enregistrer") %></a> <span>|</span> <a href="javascript:doSubmit('leavemode=bye&complete=true&validate=false');"><%= Utils.getMessage(context, "fr_FR", "LF375", "Signer en ligne") %></a> <% if(canValidate || canIntegrate){ %> <span>|</span> <a href="javascript:doSubmit('leavemode=bye&complete=true&validate=true&integrate=false');"><%= Utils.getMessage(context, "fr_FR", "A2001", "Valider") %></a> <span>|</span> <a href="javascript:doSubmit('leavemode=bye&complete=true&validate=true&integrate=true');"><%= Utils.getMessage(context, "fr_FR", "LF175", "Intégrer") %></a> <span>|</span> <a href="javascript:doSubmit('leavemode=bye&complete=true&validate=true&integrate=true');"><%= Utils.getMessage(context, "fr_FR", "LF1DE", "Version Initiale") %></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