<% /****************************************************************************** * 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.*, java.lang.reflect.*,com.edeal.frontline.navigation.*"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <% 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 id = null; try{ id = ScriptElement.getID(); }catch(FieldNotInitializedException fnie){ id = flRequest.getRequestParameterOrAttribute("id"); } int seqNum = 0; try { seqNum = ScriptElement.getSceSeqNum(); } catch (FieldNotInitializedException fnie) { seqNum = CounterFactory.getCounter(context , "ScriptElementNum"); ScriptElement.setSceSeqNum(seqNum); } DecimalFormat df = FlLocale.getInstance(session).getDecimalFormat("0000"); try { ScriptElement.getSceLanguage(); } catch (FieldNotInitializedException e) { ScriptElement.setSceLanguage((String)session.getAttribute("actorLng")); } try { ScriptElement.getSceType(); } catch (FieldNotInitializedException fnie) { ScriptElement.setSceType(dico.getRefIdByCode("SceType", "FRE")); } String sceType = null; try { sceType = ScriptElement.getSceType(); } catch (FieldNotInitializedException fnie) { } int hasAnswers = 0; try { hasAnswers = ScriptElement.getSceHasAnswers(); } catch (FieldNotInitializedException e) { } String sizeTab="100%"; if (hasAnswers==1){ sizeTab="50%"; } try { ScriptElement.getSceDispType(); } catch (FieldNotInitializedException fnie) { ScriptElement.setSceDispType(dico.getRefIdByCode("SceDispType", "COMBO")); } String sceDispType = null; try { sceDispType = ScriptElement.getSceDispType(); } catch (FieldNotInitializedException fnie) { } int sceAssociatedText = 0; try { sceAssociatedText = ScriptElement.getSceAssociatedText(); } catch (FieldNotInitializedException fnie) { } //if script element has recorded answers, it should not be modified boolean canBeModified = true; if (id != null) { String[][] query3 = {{"SerLseID:LseScriptElementID = " + Utils.formatToSQL(context, id)}}; String[] fields3 = {"SerID"}; //Utils.showQuery(fields3, query3); Vector responses = ScriptElementResponseBean.listSummary(session , fields3, query3); //logger.debug("Responses " + responses); if (responses != null && responses.size() > 0) { canBeModified = false; } } //if we are importing values from a reference table, delete existing values then grab and set new ones String importRefTableID = Utils.getRequestParameter(context, request, "ImportRefTableID"); if (importRefTableID != null && !"".equals(importRefTableID)) { Vector values = dico.getRefList(session, importRefTableID, "Te1"); Class sceClass = Class.forName("com.edeal.frontline.ScriptElementBean"); for (int i = 0 ; i < 15 ; i++) { Class[] params = {new String().getClass()}; Method method = sceClass.getMethod("setSceLstAnswer" + i, params); if (i < values.size()) { Object[] objects = {(String)((Vector)values.elementAt(i)).elementAt(1)}; method.invoke(ScriptElement, objects); } else { Object[] objects = {new String()}; method.invoke(ScriptElement, objects); } } } //Refresh variables String isRefresh = Utils.getRequestParameter(context, request, "IsRefresh"); String linksValues = Utils.getRequestParameter(context, request, "LinksValues"); String linksTexts = Utils.getRequestParameter(context, request, "LinksTexts"); %> <fl:getMessage code="L61EF" alt="Elément de script"/> <fl:getMessage code="L2025" alt="e-Deal"/> " bean="ScriptElement"> " ou="<%=\"/edit_scriptelement.fl\" +(id!=null ? \"?id=\"+id :\"\")%>" listTitle="<%=Utils.getMessage(session, \"L61F0\", false, true, \"Liste des éléments de script\")%>"> "> ">
<% if (hasAnswers == 1) { %> <% if (sceType.equals(dico.getRefIdByCode("SceType", "REF"))) { %> <% } %> <% if (sceType.equals(dico.getRefIdByCode("SceType", "LST"))) { %> <% } %> <% if ( (sceType.equals(dico.getRefIdByCode("SceType", "REF")) || sceType.equals(dico.getRefIdByCode("SceType", "LST"))) && (sceDispType.equals(dico.getRefIdByCode("SceDispType", "RADIO")) || sceDispType.equals(dico.getRefIdByCode("SceDispType", "CHECK"))) ) { %> <% } %> <% } %>
>
 
<% if (hasAnswers == 1 && sceType.equals(dico.getRefIdByCode("SceType", "FRE"))) { %> <% } %> <% if (hasAnswers == 1) { %> <% if (sceType.equals(dico.getRefIdByCode("SceType", "REF")) || sceType.equals(dico.getRefIdByCode("SceType", "LST"))) { %> <% } %> <% if (sceType.equals(dico.getRefIdByCode("SceType", "REF")) || sceType.equals(dico.getRefIdByCode("SceType", "LST"))) { %> <% } %> <%////////MODIFIER PAR UHMAROC (L'ajout d'un div pour le <% } %> <% } %>
<% int associatedText = 0; try { associatedText = ScriptElement.getSceAssociatedText(); } catch (FieldNotInitializedException fnie) { } %>
<% int hasOther = 0; try { hasOther = ScriptElement.getSceHasOther(); } catch (FieldNotInitializedException fnie) { } %>
<% if (hasAnswers == 1 && sceType.equals(dico.getRefIdByCode("SceType", "LST"))) { %> ">
<% } %> <% String sceRefTable = null; try { sceRefTable = ScriptElement.getSceRefTable(); } catch (FieldNotInitializedException fnie) { } if (hasAnswers == 1 && sceType.equals(dico.getRefIdByCode("SceType", "REF")) && sceRefTable != null) { %> ">
<% boolean isBlueRef = false; try { Vector refList = dico.getRefList(session, sceRefTable , "Te1"); if (refList != null && refList.size() > 0) { for (int i=0 ; i < refList.size() ; i++) { String refValTe1 = (String) ((Vector) refList.elementAt(i)).elementAt(1); %> <% isBlueRef = !isBlueRef; } } } catch (FrontlineException fe) { } %>
" class="dataValueX borderLineOne" width="10%" > <%= i+1 %> " class="dataValueX borderLineOne" width="80%" > <%= refValTe1 %>
<% }//End if hasAnswer == 1 and type = REF %> ">
+