Edit C:\Windows\install\galaxie_p01_01-10\marketing\formresponse\view_response_ajax.jsp
<% /****************************************************************************** * Copyright (c) 2000-2004 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.text.*,java.lang.reflect.*"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <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 contextPath = (String) session.getAttribute("contextPath"); String parentTarget = " target=\"_parent\" "; String blankTarget = " target=\"_blank\" "; String id = Utils.getRequestParameter(context, request, "id"); String isVrp = Utils.getRequestParameter(context, request, "vrp"); %> <style> .transparent_bg { background-image: url(<fl:link url="/icons/object_background.jpg"/>); background-repeat: repeat-x; background-color: white; z-index: 1; } </style> <div class="transparent_bg"> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, \"L63F4\", false, true, \"Réponse au questionnaire\") %>"> <% String perID = null; try { perID = FormResponse.getFrpPersonID(); } catch (FieldNotInitializedException fnie) { } String formID = null; try { formID = FormResponse.getFrpFormID(); } catch (FieldNotInitializedException fnie) { } String[][] queryForm = {{"FrmID = " + Utils.formatToSQL(context, formID)}}; String[] fieldsForm = {"FrmLabel" , "FrmSeqNum" , "FrmBasicQuestion0" , "FrmBasicQuestion1" , "FrmBasicQuestion2", "FrmEventID"}; String formLabel = "???"; String formNumber = "???"; String formEventID = null; Vector listForm = FormBean.listSummary(session , fieldsForm , queryForm); if (listForm != null && listForm.size() > 0) { formEventID = (String) ((Hashtable) listForm.elementAt(0)).get("FrmEventID"); formLabel = (String) ((Hashtable) listForm.elementAt(0)).get("FrmLabel"); Integer formNumberI = (Integer) ((Hashtable) listForm.elementAt(0)).get("FrmSeqNum"); if (formNumberI != null) { DecimalFormat df = FlLocale.getInstance(session).getDecimalFormat("0000"); formNumber = df.format((long) (formNumberI.intValue())); } } String[][] queryPer = {{"PerID = " + Utils.formatToSQL(context, perID)}}; String[] fieldsPer = {"PerCivID:Val" , "PerName" , "PerFstName"}; String perCompleteName = "???"; Vector listPer = PersonBean.listSummary(session , fieldsPer , queryPer); if (listPer != null && listPer.size() > 0) { String perCiv = (String) ((Hashtable) listPer.elementAt(0)).get("PerCivID:Val"); String perName = (String) ((Hashtable) listPer.elementAt(0)).get("PerName"); String perFstName = (String) ((Hashtable) listPer.elementAt(0)).get("PerFstName"); perCompleteName = (perCiv != null ? perCiv : "") + " " + (perFstName != null ? perFstName : "") + " " + (perName != null ? perName : ""); } %> <div align="center" style="font-size: 12pt ; font-weight: bold"><%= formNumber %> - <%= formLabel %></div> <div align="center" style="font-size: 10pt ; font-weight: bold"><a href="<fl:webapp/>/read_person.fl?&id=<%= perID %>" target="_self" style="font-size: 10pt"><%= perCompleteName %><a></div> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <% String basicQuestion0 = (String) ((Hashtable) listForm.elementAt(0)).get("FrmBasicQuestion0"); if (basicQuestion0 != null) { boolean basicResp0 = false; try { basicResp0 = FormResponse.isFrpBasicResponse0(); } catch (FieldNotInitializedException fnie) { } %> <tr><td valign="top" class="transparent dataLabel"> <%= basicQuestion0 %> </td> <td class="dataLabel"> <%= basicResp0 ? Utils.getMessage(session, "L2005", "Oui") : Utils.getMessage(session, "L2006", "Non") %> </td></tr> <% } String basicQuestion1 = (String) ((Hashtable) listForm.elementAt(0)).get("FrmBasicQuestion1"); if (basicQuestion1 != null) { boolean basicResp1 = false; try { basicResp1 = FormResponse.isFrpBasicResponse1(); } catch (FieldNotInitializedException fnie) { } %> <tr><td valign="top" class="transparent dataLabel"> <%= basicQuestion1 %> </td> <td class="dataLabel"> <%= basicResp1 ? Utils.getMessage(session, "L2005", "Oui") : Utils.getMessage(session, "L2006", "Non") %> </td></tr> <% } String basicQuestion2 = (String) ((Hashtable) listForm.elementAt(0)).get("FrmBasicQuestion2"); if (basicQuestion2 != null) { boolean basicResp2 = false; try { basicResp2 = FormResponse.isFrpBasicResponse2(); } catch (FieldNotInitializedException fnie) { } %> <tr><td valign="top" class="transparent dataLabel"> <%= basicQuestion2 %> </td> <td class="dataLabel"> <%= basicResp2 ? Utils.getMessage(session, "L2005", "Oui") : Utils.getMessage(session, "L2006", "Non") %> </td></tr> <% } String[][] query = {{"LfqFormID = " + Utils.formatToSQL(context, formID)}}; String[] fields = {"LfqID" , "LfqFormQuestionID" , "LfqParagraph", "LfqPosition"}; String[] orderBy = {"LfqPosition"}; Vector lfqList = LinkFormQuestionBean.listSummary(session, fields, query, orderBy); if (lfqList != null && lfqList.size() > 0) { for (int i=0 ; i < lfqList.size() ; i++) { Hashtable line = (Hashtable) lfqList.elementAt(i); String questionID = (String) line.get("LfqFormQuestionID"); String paragraph = (String) line.get("LfqParagraph"); Integer lfqPosI = (Integer) line.get("LfqPosition"); String lfqID = (String) line.get("LfqID"); int lfqPosition = 99; if (lfqPosI != null) { lfqPosition = lfqPosI.intValue(); } String lfqPos = Integer.toString(lfqPosition); if (paragraph != null) { %> <tr><th colspan="2"><%= paragraph %></th></tr> <% } else { FormQuestionBean curQuestion = null; try { curQuestion = new FormQuestionBean(questionID , session); } catch (AccessDeniedException ade) { } catch (FrontlineException fex) { } if (curQuestion != null) { String qLabel = null; try { qLabel = curQuestion.getFqtLabel(); } catch (FieldNotInitializedException fnie) { } String qTypeID = null; try { qTypeID = curQuestion.getFqtType(); } catch (FieldNotInitializedException fnie) { } String qRefTableID = null; String qType = "FRE"; if ( qTypeID != null && qTypeID.equals(dico.getRefIdByCode("FqtType" , "REF")) ) { qType = "REF"; try { qRefTableID = curQuestion.getFqtRefTable(); } catch (FieldNotInitializedException fnie) { } } if ( qTypeID != null && qTypeID.equals(dico.getRefIdByCode("FqtType" , "LST")) ) { qType = "LST"; } %> <tr> <td valign="top" class="transparent dataLabel"> <input type="hidden" name="<%= lfqPos %>_LfqID" value="<%= lfqID %>"> <%= qLabel == null ? " " : qLabel %> </td> <td class="dataLabel"> <% String[][] queryQrs = {{"QrsFrpID = " + Utils.formatToSQL(context, id), "QrsLfqID = " + Utils.formatToSQL(context, lfqID)}}; String[] orderByQrs = {"QrsInstance"}; Vector listQrs = QuestionResponseBean.list(session , queryQrs, orderByQrs); if (listQrs != null && listQrs.size() > 0) { for (int j=0 ; j < listQrs.size() ; j++) { QuestionResponseBean curQrs = (QuestionResponseBean) listQrs.elementAt(j); if ("FRE".equals(qType)) { //- debut cas FRE String qrsText = null; try { qrsText = curQrs.getQrsText(); } catch (FieldNotInitializedException fnie) { } %> <%= qrsText != null ? qrsText : " " %><%= j < listQrs.size() - 1 ? "<br>" : "" %> <% } //- fin cas FRE if ("LST".equals(qType)) { //- debut cas LST int qrsPosition = -1; try { qrsPosition = curQrs.getQrsPosition(); } catch (FieldNotInitializedException fnie) { } String lstAnswer = null; try { Method getter = Class.forName("com.edeal.frontline.FormQuestionBean").getMethod("getFqtLstAnswer" + qrsPosition , null); lstAnswer = (String) getter.invoke(curQuestion , null); } catch (Exception e) { logger.error("DBG: " + e.getClass().getName() + " : " + e.getMessage()); } String qrsMoreText = null; try { qrsMoreText = curQrs.getQrsMoreText(); } catch (FieldNotInitializedException fnie) { } if (lstAnswer != null) { %> <%= lstAnswer %><%= qrsMoreText != null ? " (" + qrsMoreText + ")" : "" %><%= j < listQrs.size() - 1 ? "<br>" : "" %> <% } } //- fin cas LST if ("REF".equals(qType)) { //- debut cas REF String qrsRefValID = null; try { qrsRefValID = curQrs.getQrsRefValID(); } catch (FieldNotInitializedException fnie) { } String qrsMoreText = null; try { qrsMoreText = curQrs.getQrsMoreText(); } catch (FieldNotInitializedException fnie) { } String refAnswer = null; try { refAnswer = (String) dico.getRefDisp(session, qRefTableID , "Te1" , qrsRefValID); } catch (FrontlineException fe) { } if (refAnswer != null) { %> <%= refAnswer %><%= qrsMoreText != null ? " (" + qrsMoreText + ")" : "" %><%= j < listQrs.size() - 1 ? "<br>" : "" %> <% } } //- fin cas REF } } %> </td> <% } } } } %> </table> </fl:bigTabs> </div>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de