Edit C:\Users\Administrator\Desktop\Umanis\backup 04062020\galaxie\siteweb\webform\webform_question.jsp
<%@page session="true" import="com.edeal.frontline.*,java.util.*,java.text.*,java.lang.reflect.*,com.edeal.frontline.navigation.*"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <%@ page import="com.edeal.frontline.helper.custom.FormHelper" %> <jsp:useBean class="com.edeal.frontline.FormQuestionBean" id="curQuestion" scope="request"/> <jsp:useBean class="com.edeal.frontline.QuestionResponseBean" id="curQrs" scope="request"/> <jsp:useBean class="com.edeal.frontline.EnterpriseBean" id="Enterprise" 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=flRequest.getContext().getDataDictionary(); String EntID = flRequest.getParameter("EntID"); String lfqPos = flRequest.getParameter("lfqPos"); String millesime = flRequest.getParameter("millesime"); String lfqID = flRequest.getParameter("lfqID"); String hiddenlnkID = flRequest.getParameter("hiddenlnk"); LinkFormQuestionBean linkFqt = new LinkFormQuestionBean(lfqID,context); LinkFormQuestionBean hiddenlnk = new LinkFormQuestionBean(lfqID,context); String languageID = flRequest.getParameter("languageID");//dico.getRefIdByCode("Lna", "Te1", "fr_FR"); String lngCode = flRequest.getParameter("lngCode");/*dico.getRefCode("EntRefLngID_", languageID);*/ String countryID = flRequest.getParameter("countryID");/*dico.getRefIdByCode("Ctr", "Te1", "FR");*/ FlLocale locale = FlLocale.getInstance(context, languageID, countryID); Vector<String> responses = (Vector<String>)flRequest.getAttribute("responses"); //logger.info("response : "+responses); LinkedHashMap<String,Vector<String>> initialresponses = (LinkedHashMap<String,Vector<String>>)flRequest.getAttribute("initialresponses"); //logger.info("initialresponse : "+initialresponses); boolean isActorLogis = (Boolean) flRequest.getAttribute("isActorLogis"); //logger.info("isActorLogis : "+isActorLogis); Vector<String> initialResponse = (initialresponses.get(lfqID)); QuestionResponseBean initCurQrs = (new QuestionResponseBean(initialResponse.elementAt(0),context)); String qLabel=null; String qLabelCode = null; try { qLabel = curQuestion.getFqtLabel().replaceAll("::millesime::", millesime).replaceAll("::millesime\\+1::", (Integer.parseInt(millesime)+1)+"").replaceAll("::millesime-1::", (Integer.parseInt(millesime)-1)+""); qLabel = (qLabel == null? "" : qLabel); qLabelCode = (String)curQuestion.getCustomProperty("FqtLabelCode_"); qLabelCode = (qLabelCode == null? "" : qLabelCode); qLabelCode = Utils.getMessage(context, lngCode, qLabelCode, false,true,"<non sp�cifi�>").replaceAll("::millesime::", millesime).replaceAll("::millesime\\+1::", (Integer.parseInt(millesime)+1)+"").replaceAll("::millesime-1::", (Integer.parseInt(millesime)-1)+""); } catch (Exception e) {} boolean disabled = false; try{ disabled = (Boolean)hiddenlnk.getCustomProperty("LfqHtmlDisabled_"); //logger.info("disabled"+disabled); }catch(Exception e){ //logger.info("disabled"+disabled); } String code = ""; try{ code = (String)hiddenlnk.getCustomProperty("LfqCode_"); }catch(Exception e){} String name = ""; try{ name = (String)hiddenlnk.getCustomProperty("LfqName_"); }catch(Exception e){} String qType = null; try { qType = curQuestion.getFqtType(); } catch (FieldNotInitializedException fnie) { } String typeOfQuestion = ""; try{ typeOfQuestion = FormHelper.getIntervalTypeOfDateOrDouble(context,name,code); }catch(Exception e){ //logger.warn(e.getMessage()); } if("Fermetures_".equals(name) && Utils.explodeList(code, "|").size()>1) typeOfQuestion = "java.util.Date|java.util.Date"; if(typeOfQuestion.length()==0){ String lfqQuestionType_ = null; try{ lfqQuestionType_ = (String)hiddenlnk.getCustomProperty("LfqQuestionType_"); }catch(Exception e){} if(lfqQuestionType_ == null || lfqQuestionType_.length()==0 || lfqQuestionType_.equals(dico.getRefIdByCode("Tq_", "Te1", "TEXT")) ) typeOfQuestion = "java.lang.String"; else{ if(lfqQuestionType_.equals(dico.getRefIdByCode("Tq_", "Te1", "DOUBLE"))) typeOfQuestion = "java.lang.Double"; if(lfqQuestionType_.equals(dico.getRefIdByCode("Tq_", "Te1", "DATE"))) typeOfQuestion = "java.util.Date"; if(lfqQuestionType_.equals(dico.getRefIdByCode("Tq_", "Te1", "INTEGER"))) typeOfQuestion = "java.lang.Integer"; if(qType.equals(dico.getRefIdByCode("FqtType" , "INT"))) typeOfQuestion = typeOfQuestion +"|"+typeOfQuestion; } } String value = ""; try{ value = (String)hiddenlnk.getCustomProperty("LfqValue_"); }catch(Exception e){} String lblID = null; String lblLabel = ""; try { lblID = (String)curQuestion.getCustomProperty("FqtPreTextLabel_"); lblLabel = Utils.getMessage(context,lngCode,lblID,false,true,"").replaceAll("::millesime::", millesime).replaceAll("::millesime\\+1::", (Integer.parseInt(millesime)+1)+"").replaceAll("::millesime-1::", (Integer.parseInt(millesime)-1)+""); } catch (FieldNotInitializedException fnie) { } catch (FrontlineException e) { } String postlblID = null; String postlblLabel = ""; try { postlblID = (String)curQuestion.getCustomProperty("FqtPostTextLabel_"); postlblLabel = Utils.getMessage(context,lngCode,postlblID,false,true,"").replaceAll("::millesime::", millesime).replaceAll("::millesime\\+1::", (Integer.parseInt(millesime)+1)+"").replaceAll("::millesime-1::", (Integer.parseInt(millesime)-1)+""); } catch (FieldNotInitializedException fnie) { } catch (FrontlineException e) { } String helpText = ""; try { helpText = curQuestion.getFqtHelpText(); } catch (FieldNotInitializedException fnie) { } %> <% if(qType != null && qType.equals(dico.getRefIdByCode("FqtType" , "HIDE")) ){ String qrsText = ""; try { qrsText = curQrs.getQrsText(); } catch (Exception e) {} %> <%-- <input type="hidden" name="<%= lfqPos %>_LfqID" value="<%= lfqID %>"> <input type="hidden" name="<%= code %>" id="<%= name %>" value="<%= value %>"/> --%> <% }else{ %> <div class="webform_questionblock"> <input type="hidden" name="<%= lfqPos %>_LfqID" value="<%= lfqID %>"> <%-- <input type="hidden" name="<%= code %>" id="<%= name %>" value="<%= value %>"/> --%> <% if(qType == null || qType.equals(dico.getRefIdByCode("FqtType" , "ATTFILE"))){ String qrsText = ""; String qrsTextInitial = ""; try { qrsText = curQrs.getQrsText(); qrsTextInitial = initCurQrs.getQrsText(); } catch (Exception e) {} %> <p id="p_webform_questionblock" class="pre_post_labels"><%=lblLabel %></p> <p id="WebForm_ValQuestion<%= lfqPos %>" class="webform_answer_photo"> <table id="table_photo"> <tr><td id="td_label_photo"> <div id="div1_w10fl" class="webform_label"> <%-- <%= qLabelCode != null ? qLabelCode : qLabel %> --%> <input type="hidden" id="photoAttID" name="photoAttID" value="<%= qrsText %>"> </div> </td><td id="td_photo_photo"> <div id="div1_w70fl"> <%-- <input type="hidden" id="photoAttID" name="photoAttID" value="<%= qrsText %>"> --%> <%if(qrsText != null && !Utils.isEmpty(qrsText)){ %> <img id="photo" src="<fl:webapp/>/download?id=<%= qrsText %>" /> <% } %> <br/> <br/> <span style="font: 12px 'Lucida Grande', Helvetica, Sans-Serif;font-weight: bold; font-style: italic;text-align:left !important"> <%=Utils.getMessage(context,lngCode,"LF391",false,true,"Je confirme que la photo ci-dessus est libre de droit.") %> </span> </div> </td></tr></table> </p> <% }else if(qType == null || qType.equals(dico.getRefIdByCode("FqtType" , "FRE"))){ String ETAB = dico.getRefIdByCode("EntTyeID", "ETAB"); /* Hotel-Restaurant */ String entTyeID = (String) EnterpriseBean.lookup(context, "EntTyeID", EntID); if((curQuestion.getFqtSeqNum() == 106 && entTyeID.equals(ETAB)) || curQuestion.getFqtSeqNum() != 106){ int inputSize = 0; try { inputSize = curQuestion.getFqtInputSize(); } catch (FieldNotInitializedException fnie) { } String qrsText = ""; String qrsTextInitial = ""; try { qrsText = curQrs.getQrsText(); qrsTextInitial = initCurQrs.getQrsText(); } catch (Exception e) {} int qrsInstance = 0; try { qrsInstance = curQrs.getQrsInstance(); } catch (FieldNotInitializedException fnie) { } %> <% String initRsp1 = initialResponse.get(0); String rep1 = null; try{ rep1=curQrs.getQrsID(); }catch(Exception e){ rep1=null; } if(lfqPos.equals("428") && (rep1==null || rep1.equals(initRsp1)) ) { qrsText = ""; } %> <p id="p2_webform_questionblock" class="pre_post_labels"><%=lblLabel %></p> <p id="WebForm_ValQuestion<%= lfqPos %>" class="webform_answer"> <div id="div1_w25fl" class="webform_label"> <%= qLabelCode != null ? qLabelCode : qLabel %> </div> <div id="div1_w50fl" ><input id="input1_w100" class="webform_input" type="text" name="<%= lfqPos %>_ResponseTxt" value="<%= qrsText %>" onchange="javascript:formatSiret(this);" <% if("java.lang.Double".equals(typeOfQuestion)){ %> style="width:90%;" <%} %> <%= (disabled ? "disabled" : "") %>> <%if(!disabled && isActorLogis && qrsTextInitial != null && !Utils.isEmpty(qrsTextInitial)){ %> <i style="color:red;font: 12px 'Lucida Grande', Helvetica, Sans-Serif;font-weight: bold; font-style: italic;text-align:left !important"><%= qrsTextInitial %></i> <% } %> <% if("java.lang.Double".equals(typeOfQuestion)){if(!"118".equals(lfqPos)){ %><span style="font-weight: bold;"> €</span><%}else{%><span style="font-weight: bold;"> %</span><%}} %> </div> </p> <p id="p3_webform_questionblock" class="pre_post_labels"> <%=postlblLabel %></p> <% } }else if ( qType.equals(dico.getRefIdByCode("FqtType" , "FRL")) ) { int inputSize = 0; try { inputSize = curQuestion.getFqtInputSize(); } catch (FieldNotInitializedException fnie) { } String qrsText = ""; String qrsTextInitial = ""; try { qrsText = curQrs.getQrsText(); qrsTextInitial = initCurQrs.getQrsText(); } catch (Exception e) {} int qrsInstance = 0; try { qrsInstance = curQrs.getQrsInstance(); } catch (FieldNotInitializedException fnie) { } %> <p id="p32_webform_questionblock" class="pre_post_labels"><%=lblLabel %></p> <p id="WebForm_ValQuestion<%= lfqPos %>" class="webform_answer"> <div id="div1_w25fl" class="webform_label"><%= qLabelCode != null ? qLabelCode : qLabel %></div> <div id="div1_w50fl input textarea"> <textarea id="<%= lfqPos %>_ResponseTxt" style="width:505px; height:100px; margin:0px" name="<%= lfqPos %>_ResponseTxt" class="input textarea" ><%= qrsText %></textarea> <%if(!disabled && isActorLogis && qrsTextInitial != null && !Utils.isEmpty(qrsTextInitial)){ %> <i style="color:red;font: 12px 'Lucida Grande', Helvetica, Sans-Serif;font-weight: bold; font-style: italic;text-align:left !important;"><%= qrsTextInitial %></i> <% } %> </div> </p> <p id="p4_webform_questionblock" class="pre_post_labels"> <%=postlblLabel %></p> <% }else if(qType != null && qType.equals(dico.getRefIdByCode("FqtType" , "INT"))){ QuestionResponseBean qrs1 = null; String qrsText1 = ""; String qrsText1Initial = ""; int qrsInstance1 = -1; int instance = -1; int initqrsInstance1 = -1; int initinstance = -1; try{ if(responses != null && responses.size() > 0) qrs1 = new QuestionResponseBean((String)responses.elementAt(0),context); try { qrsText1 = qrs1.getQrsText(); } catch (Exception e) {} try { qrsText1Initial = initCurQrs.getQrsText(); } catch (Exception e) {} try { qrsInstance1 = qrs1.getQrsInstance(); if(qrsInstance1 == 0) instance = 1; else instance = 2; } catch (FieldNotInitializedException fnie) { } try { initqrsInstance1 = initCurQrs.getQrsInstance(); if(initqrsInstance1 == 0) initinstance = 1; else initinstance = 2; } catch (FieldNotInitializedException fnie) { } }catch(Exception e){ } QuestionResponseBean qrs2 = null; String qrsText2 = ""; String qrsText2Initial = ""; int qrsInstance2 = -1; int initqrsInstance2 = -1; try{ if(responses != null && responses.size() > 0) qrs2 = new QuestionResponseBean((String)responses.elementAt(1),context); try { qrsText2 = qrs2.getQrsText(); } catch (Exception e) {} try { qrsText2Initial = (new QuestionResponseBean(initialResponse.elementAt(1),context)).getQrsText(); } catch (Exception e) {} try { qrsInstance2 = qrs2.getQrsInstance(); if(qrsInstance2 == 0) instance = 2; else instance = 1; } catch (FieldNotInitializedException fnie) { } try { initqrsInstance2 = (new QuestionResponseBean(initialResponse.elementAt(1),context)).getQrsInstance(); if(initqrsInstance2 == 0) initinstance = 2; else initinstance = 1; } catch (FieldNotInitializedException fnie) { } if(initinstance != 1){ String temp = qrsText1Initial; qrsText1Initial = qrsText2Initial; qrsText2Initial = temp; } }catch(Exception e){ } %> <% String initRsp = initialResponse.get(0); String rep2 = null; try{ rep2=qrs2.getQrsID(); }catch(Exception e){ rep2=null; } if(lfqPos.equals("429") && (rep2==null || rep2.equals(initRsp) || initialResponse.contains(rep2))) { qrsText2 = ""; qrsText1 = ""; } %> <p id="p5_webform_questionblock" class="pre_post_labels"><%=lblLabel %></p> <p id="WebForm_ValQuestion<%= lfqPos %>" class="webform_answer"> <div id="div1_w40fl" class="webform_label"><%= qLabelCode != null ? qLabelCode : qLabel %></div> <div id="div3_w50fl" class="webform_label"> <%= "Fermetures_".equals(name) ? Utils.getMessage(context, lngCode, "L3128", "Du") : Utils.getMessage(context, lngCode, "L621C", "De") %> <input type="text" name="<%= lfqPos %>_ResponseInt" value="<%= instance == 1 ? qrsText1 : qrsText2 %>" size="20" onblur="javascript:areTheyValid('<%=typeOfQuestion%>',this);"> <%if(!disabled && isActorLogis && qrsText1Initial != null && !Utils.isEmpty(qrsText1Initial)){ %><i style="color:red"><%= qrsText1Initial %></i> <% } %><%= "Fermetures_".equals(name) ? " " : " "+"€" %> <%= "Fermetures_".equals(name) ? Utils.getMessage(context, lngCode, "L63B4", "Au") : Utils.getMessage(context, lngCode, "L8254", "A") %> <input type="text" name="<%= lfqPos %>_ResponseInt" value="<%= instance == 1 ? qrsText2 : qrsText1 %>" size="20" onblur="javascript:areTheyValid('<%=typeOfQuestion%>',this);"> <%if(!disabled && isActorLogis && qrsText2Initial != null && !Utils.isEmpty(qrsText2Initial)){ %><i style="color:red"><%= qrsText2Initial %></i> <% } %><%= "Fermetures_".equals(name) ? " " : " "+"€" %> <%if(typeOfQuestion.equals("java.util.Date|java.util.Date")){ %> <img src="<fl:webapp/>/icons/bigvalid_non.gif" onclick="javascript:clearDates('<%= lfqPos %>_ResponseInt')"> <%} %> </div> </p> <p id="p6_webform_questionblock" class="pre_post_labels"><%=postlblLabel %></p> <% } else { //Pas Texte libre, c-a-d REF ou LST Vector<String> refvals = new Vector<String>(); boolean isREF = false; boolean isLST = false; if ( qType.equals(dico.getRefIdByCode("FqtType" , "REF")) ) { isREF = true; if(responses != null && responses.size() > 0){ QuestionResponseBean qrs = null; for(int i=0; i<responses.size(); i++){ qrs = new QuestionResponseBean(responses.elementAt(i),context); String refresp = null; try{ refresp = qrs.getQrsRefValID(); refvals.add(refresp); }catch(FieldNotInitializedException fe){ } } } } if ( qType.equals(dico.getRefIdByCode("FqtType" , "LST")) ) { isLST = true; } boolean isCombo = true; boolean isRadio = false; boolean isCheck = false; String dispType = null; try { dispType = curQuestion.getFqtDispType(); } catch (FieldNotInitializedException fnie) { } if (dispType != null && dispType.equals(dico.getRefIdByCode("FqtDispType", "RADIO"))) { isCombo = false; isRadio = true; } if (dispType != null && dispType.equals(dico.getRefIdByCode("FqtDispType", "CHECK"))) { isCombo = false; isCheck = true; } int complementaryText = 0; try { complementaryText = curQuestion.getFqtAssociatedText(); } catch (FieldNotInitializedException fnie) { } int nbColumn = 1; try { nbColumn = curQuestion.getFqtColumnsNb(); } catch (FieldNotInitializedException fnie) { } int hasOther = 0; try { hasOther = curQuestion.getFqtHasOther(); } catch (FieldNotInitializedException fnie) { } String refTableID = null; try { refTableID = curQuestion.getFqtRefTable(); } catch (FieldNotInitializedException fnie) { } Vector listSelectedRef = null; String selectedRefStr = null; try{ listSelectedRef = (Vector)curQuestion.getCustomProperty("FqtRefsDisp_"); selectedRefStr = Utils.implodeList(listSelectedRef, "|"); }catch(FieldNotInitializedException e){} Vector listRef2Init = null; String refToInitStr = null; try{ listRef2Init = (refvals != null && refvals.size()>0) ? refvals : (Vector)curQuestion.getCustomProperty("FqtRefsInit_"); refToInitStr = Utils.implodeList(listRef2Init, "|"); }catch(FieldNotInitializedException e){} Vector possibleResponses = new Vector(); possibleResponses = listSelectedRef; if ( isLST ) { for (int j=0 ; j < 15 ; j++) { String lstAnswer = null; try { Method getter = Class.forName("com.edeal.frontline.FormQuestionBean").getMethod("getFqtLstAnswer" + j , null); lstAnswer = (String) getter.invoke(curQuestion , null); } catch (Exception e) { } if (lstAnswer != null) { Vector oneResponse = new Vector(); oneResponse.add(Integer.toString(j)); oneResponse.add(lstAnswer); possibleResponses.add(oneResponse); } } } else { String[] fields = {"RefID","RefVal"}; String[][] query = {{"RefTabID = " + Utils.formatToSQL(context, refTableID)}}; String[] orderBy = {"RefTe1 ASC"}; } Vector<String> initrefvals = new Vector<String>(); if ( qType.equals(dico.getRefIdByCode("FqtType" , "REF")) ) { isREF = true; if(initialResponse != null && initialResponse.size() > 0){ QuestionResponseBean qrs = null; for(int i=0; i<initialResponse.size(); i++){ qrs = (new QuestionResponseBean(initialResponse.elementAt(i),context)); String refresp = null; try{ if(lfqPos.equals("431")){ refresp = qrs.getQrsText(); if(refresp==null){ refresp = qrs.getQrsRefValID(); } initrefvals.add(refresp); }else{ refresp = qrs.getQrsRefValID(); initrefvals.add(refresp); } }catch(FieldNotInitializedException fe){ } } } } Vector initlistSelectedRef = null; String initselectedRefStr = null; try{ initlistSelectedRef = (Vector)curQuestion.getCustomProperty("FqtRefsDisp_"); initselectedRefStr = Utils.implodeList(initlistSelectedRef, "|"); }catch(FieldNotInitializedException e){} Vector initlistRef2Init = null; String initrefToInitStr = null; try{ initlistRef2Init = (initrefvals != null && initrefvals.size()>0) ? initrefvals : (Vector)curQuestion.getCustomProperty("FqtRefsInit_"); initrefToInitStr = Utils.implodeList(initlistRef2Init, "|"); }catch(FieldNotInitializedException e){} Vector initpossibleResponses = new Vector(); initpossibleResponses = initlistSelectedRef; String initresponseSelected = ""; for (int j=0 ; initpossibleResponses!=null && j < initpossibleResponses.size() ; j++) { String initresponseChoice = (String) initpossibleResponses.elementAt(j); String initresponseLabel = (String)dico.getRefDisp(locale, refTableID, "Te1", initresponseChoice); String qrsRefVal = null; boolean isRefVal = false; boolean isInitVal = (initlistRef2Init != null ? initlistRef2Init.contains(initresponseChoice) : false); int qrsPos = -1; if (!isLST) { try { qrsRefVal = initCurQrs != null ? initCurQrs.getQrsRefValID() : ""; isRefVal = qrsRefVal.equals(initresponseChoice); } catch (Exception e) {} } else { try { qrsPos = initCurQrs.getQrsPosition(); isRefVal = (new Integer(initresponseChoice).intValue() == qrsPos); } catch (Exception e) {} } initresponseSelected = isInitVal ? initresponseLabel : initresponseSelected ; } // Evolution EB030 Boolean isClassement = false; String entTyeID = null; String HOTEL = dico.getRefIdByCode("EntTyeID", "HOTEL"); /* Hotel sans Restaurant */ String ETAB = dico.getRefIdByCode("EntTyeID", "ETAB"); /* Hotel-Restaurant */ try{ entTyeID = (String) EnterpriseBean.lookup(context, "EntTyeID", EntID); }catch(Exception e){ e.printStackTrace(); entTyeID = null; } if(code.equals("EntCheNbID_") || code.equals("EntCocNbID_") || code.equals("EntStarClassID_") || code.equals("EntAnx_")){ if (!entTyeID.equals(HOTEL) && !entTyeID.equals(ETAB)) { isClassement = true; } } if (isCombo) { if (isClassement == false) { %> <p id="WebForm_ValQuestion<%= lfqPos %>" class="webform_answer" style="float: none !important;"> <% if(disabled) { %> <div id="div1_w25fl" class="webform_label"><%= qLabelCode != null ? qLabelCode : qLabel %></div> <div id="div1_w50fl" > <% if(possibleResponses != null && possibleResponses.size() > 0){ String responseSelected = ""; String responseChoice = ""; String responseChoiceSelected = ""; for (int j=0 ; j < possibleResponses.size() ; j++) { responseChoice = (String) possibleResponses.elementAt(j); String responseLabel = (String)dico.getRefDisp(locale, refTableID, "Te1", responseChoice); String qrsRefVal = null; boolean isRefVal = false; boolean isInitVal = (listRef2Init != null ? listRef2Init.contains(responseChoice) : false); int qrsPos = -1; if (!isLST) { try { qrsRefVal = curQrs != null ? curQrs.getQrsRefValID() : ""; isRefVal = qrsRefVal.equals(responseChoice); } catch (Exception e) {} } else { try { qrsPos = curQrs.getQrsPosition(); isRefVal = (new Integer(responseChoice).intValue() == qrsPos); } catch (Exception e) {} } responseSelected = isInitVal ? responseLabel : responseSelected ; responseChoiceSelected = isInitVal ? responseChoice : responseChoiceSelected ; } %> <input type="hidden" name="<%= lfqPos %>_<%= isLST ? "ResponsePosition" : "ResponseRefID" %>" value="<%= responseChoiceSelected %>" /> <input id="input1_w100" class="webform_input" type="text" name="_<%= lfqPos %>_<%= isLST ? "ResponsePosition" : "ResponseRefID" %>" value ="<%=responseSelected %>" size="<%= Integer.toString(complementaryText) %>" <%= (disabled ? "disabled" : "") %>/> <%if(!disabled && isActorLogis && responseSelected != null && !Utils.isEmpty(responseSelected)){ %> <i style="color:red"><%= responseSelected %></i> <% } %> <% }}else{ %> <div id="div3_w25fl" class="webform_label"><%= qLabelCode != null ? qLabelCode : qLabel %></div> <div id="div2_w70fl"> <select class="webform_select" name="<%= lfqPos %>_<%= isLST ? "ResponsePosition" : "ResponseRefID" %>" <%= (disabled ? "disabled" : "") %>> <% if(possibleResponses != null && possibleResponses.size() > 0) %> <option value=""></option> <% for (int j=0 ; j < possibleResponses.size() ; j++) { String responseChoice = (String) possibleResponses.elementAt(j); String responseLabel = (String)dico.getRefDisp(locale, refTableID, "Te1", responseChoice); String qrsRefVal = null; boolean isRefVal = false; boolean isInitVal = (listRef2Init != null ? listRef2Init.contains(responseChoice) : false); int qrsPos = -1; if (!isLST) { try { qrsRefVal = curQrs != null ? curQrs.getQrsRefValID() : ""; isRefVal = qrsRefVal.equals(responseChoice); } catch (Exception e) {} } else { try { qrsPos = curQrs.getQrsPosition(); isRefVal = (new Integer(responseChoice).intValue() == qrsPos); } catch (Exception e) {} } %> <option value="<%= responseChoice %>" <%= (isInitVal ? "selected" : "") %>><%= responseLabel %></option> <% } %> </select> <%if(!disabled && isActorLogis && initresponseSelected != null && !Utils.isEmpty(initresponseSelected)){ %> <i style="color:red"><%= initresponseSelected %></i> <% } %> <%} %> <% if (complementaryText > 0) { String cplText = null; try { cplText = curQrs != null ? curQrs.getQrsMoreText() : ""; } catch (Exception e) {} %> <input class="webform_input" type="text" name="<%= lfqPos %>_ResponseComplementaryText_Any" value="<%= (cplText != null) ? curQrs.getQrsMoreText() :"" %>" size="<%= Integer.toString(complementaryText) %>"> <% } %> </div> </p> <% } } else { // pas combo , c-a-d checkbox ou radio String tagType = "checkbox"; if (isRadio) { tagType = "radio"; } //int nbResByColumn = possibleResponses.size() / nbColumn; //if ( nbColumn * nbResByColumn < possibleResponses.size() ) nbResByColumn++; //int cptPossibleResponse = 0; if(possibleResponses != null && possibleResponses.size() > 0 && possibleResponses.size() == 1){ int nbResByColumn = possibleResponses.size() / nbColumn; if ( nbColumn * nbResByColumn < possibleResponses.size() ) nbResByColumn++; int cptPossibleResponse = 0; String responseChoice = (String) possibleResponses.elementAt(0); String responseLabel = qLabel; boolean isInitVal = (listRef2Init != null ? listRef2Init.contains(responseChoice) : false); String initresponseChoice = (String) initpossibleResponses.elementAt(0); boolean initisInitVal = (initlistRef2Init != null ? initlistRef2Init.contains(initresponseChoice) : false); %> <p id="WebForm_ValQuestion<%= lfqPos %>" class="webform_answer"> <div id="div1_w95fl" class="webform_label"> <p id="p7_webform_questionblock" class="pre_post_labels"><%=lblLabel %></p> <input type="<%= tagType %>" name="<%= lfqPos %>_<%= isLST ? "ResponsePosition" : "ResponseRefID" %>" value="<%= responseChoice %>" <%= isInitVal ? "checked" : "" %>> <%=initisInitVal && isActorLogis ? "<i style=\"color:red\">"+(qLabelCode != null ? qLabelCode : qLabel)+"</i>" : (qLabelCode != null ? qLabelCode : qLabel) %> <p id="p8_webform_questionblock" class="pre_post_labels"><%=postlblLabel %></p> </div> <% }else if(possibleResponses != null && possibleResponses.size() > 1){ int nbResByColumn = possibleResponses.size() / nbColumn; if ( nbColumn * nbResByColumn < possibleResponses.size() ) nbResByColumn++; int cptPossibleResponse = 0; %> <p id="WebForm_ValQuestion<%= lfqPos %>" class="webform_answer"> <p id="p9_webform_questionblock" class="pre_post_labels"><%= lblLabel %></p> <div class="webform_label" id="div2_w95fl"><%= qLabelCode != null ? qLabelCode : qLabel %></div> <ul id="WebForm_ValQuestion<%= lfqPos %>" class="webform_list ul_w95ofh"> <% boolean isChecked=false; for (int j=0 ; j < possibleResponses.size() ; j++) { String responseChoice = (String) possibleResponses.elementAt(j); String responseLabel = (String)dico.getRefDisp(locale, refTableID, "Te1", responseChoice); String qrsRefVal = null; boolean isRefVal = false; boolean isInitVal = (listRef2Init != null ? listRef2Init.contains(responseChoice) : false); boolean initisInitVal = (initlistRef2Init != null ? initlistRef2Init.contains(responseChoice) : false); if(isInitVal==true) isChecked=true; int qrsPos = -1; if (!isLST) try { qrsRefVal = curQrs != null ? curQrs.getQrsRefValID() : ""; isRefVal = qrsRefVal.equals(responseChoice); } catch (Exception e) {} else try { qrsPos = curQrs.getQrsPosition(); isRefVal = (new Integer(responseChoice).intValue() == qrsPos); } catch (Exception e) {} String cplText = null; try { cplText = curQrs != null ? curQrs.getQrsMoreText() : ""; } catch (Exception e) {} %> <li style="float:left;display:inline;width:<%= (100/nbColumn) + "%" %>;"> <% if (cptPossibleResponse % nbResByColumn == 0) { %> <% if (cptPossibleResponse > 0) { %> <% } %> <label class="webform_answer" id="label1_fs12fwb"><%= "radio".equals(tagType)? "<span class='spanaroundradio'>":"" %><input type="<%= tagType %>" name="<%= lfqPos %>_<%= isLST ? "ResponsePosition" : "ResponseRefID" %>" value="<%= responseChoice %>" <%= isRefVal || isInitVal ? "checked" : initisInitVal && !isChecked ? "checked": "" %>> <%=initisInitVal && isActorLogis ? "<i style=\"color:red\">"+responseLabel+"</i>" : responseLabel %> <%= "radio".equals(tagType)? "</span>":"" %></label> <% } else { %> <label class="webform_answer" id="label2_fs12fwb"><%= "radio".equals(tagType)? "<span class='spanaroundradio'>":"" %><input type="<%= tagType %>" name="<%= lfqPos %>_<%= isLST ? "ResponsePosition" : "ResponseRefID" %>" value="<%= responseChoice %>" <%= isRefVal || isInitVal ? "checked" : "" %>> <!-- #006120--> <%=initisInitVal && isActorLogis ? "<i style=\"color:red\">"+responseLabel+"</i>" : responseLabel %> <%= "radio".equals(tagType)? "</span>":"" %></label> <% } if ( (complementaryText > 0) || (hasOther > 0 && j == possibleResponses.size() - 1) ) { %> <input type="text" name="<%= lfqPos %>_ResponseComplementaryText_<%= responseChoice %>" value="<%= cplText != null && isRefVal ? cplText : "" %>" size="<%= complementaryText > 0 ? Integer.toString(complementaryText) : Integer.toString(hasOther) %>"> <% } %> </li> <% cptPossibleResponse++; } %> </ul> </p> <p id="p10_webform_questionblock" class="pre_post_labels"><%= postlblLabel %></p> <% } //if > 1 %> <% } } %> </div> <% } %>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de