<% /****************************************************************************** * 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.*, com.edeal.frontline.navigation.*"%> <%@ page import="java.util.Vector,com.edeal.frontline.controller.ControllerServlet" %> <%@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(); Vector jsBeenIncluded = (Vector)request.getAttribute(ControllerServlet.JS_BEEN_INCLUDED_ATTR); if (jsBeenIncluded == null) jsBeenIncluded = new Vector(); String id = null; try{ id = ScriptElement.getID(); }catch(Exception e){ id = flRequest.getRequestParameterOrAttribute("id"); } int seqNum = 0; try { seqNum = ScriptElement.getSceSeqNum(); } catch (FieldNotInitializedException fnie) { } DecimalFormat df = FlLocale.getInstance(session).getDecimalFormat("0000"); 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) {} try { ScriptElement.getSceDispType(); } catch (FieldNotInitializedException fnie) { ScriptElement.setSceDispType(dico.getRefIdByCode("SceDispType", "COMBO")); } String sceDispType = null; try { sceDispType = ScriptElement.getSceDispType(); } catch (FieldNotInitializedException fnie) { } //we want to show how many scripts use that element. String utilisation = "0"; String[][] query = {{"LseScriptElementID = " + Utils.formatToSQL(context, id)}}; String[] fields = {"LseID" , "LseScriptID" , "LseScriptID:ScrLabel", "LseScriptID:ScrSeqNum"}; String[] orderBy = {"LseScriptID:ScrSeqNum"}; Vector linksList = LinkScriptElementBean.listSummary(session , fields, query, orderBy); if (linksList != null && linksList.size() > 0) { if (linksList.size() == 1) { String scriptID = (String)((Hashtable)linksList.elementAt(0)).get("LseScriptID"); utilisation = "1"; } else { utilisation = "" + linksList.size() + ""; } } boolean canBeModified = true; String[][] query3 = {{"SerLseID:LseScriptElementID = " + Utils.formatToSQL(context, id)}}; String[] fields3 = {"SerID"}; Vector responses = ScriptElementResponseBean.listSummary(session , fields3, query3); //if the element is used by more than one script OR there are recorded responses, it can't be modified. if ((linksList!=null && linksList.size() > 1) || (responses != null && responses.size() > 0)) { canBeModified = false; } boolean canBeDeleted = true; if (responses != null && responses.size() > 0) { canBeDeleted = false; } boolean isPopUp = false; String popUp = flRequest.getRequestParameterOrAttribute("popUp"); if ("1".equals(popUp)){ isPopUp = true; } %> <%if (isPopUp){%> <%}%> <% if(! jsBeenIncluded.contains("/js/smalltabs.jsp")){%> <%}%> <% if(! jsBeenIncluded.contains("/js/utils.js")){%> <%}%> <% if (isPopUp) {%> <% if(! jsBeenIncluded.contains("/js/ajax/ajax.js")){%> <%}%> <% if(! jsBeenIncluded.contains("/js/master_js.jsp")){%> <%}%> <% if(! jsBeenIncluded.contains("/js/ajax/sarissa.js")){%> <% } %> <% } %> <%if (isPopUp){%> <fl:getMessage code="L2025" alt="e-Deal"/>
<%}%> " ou="<%=\"/read_scriptelement.fl?id=\"+id%>">
<% if (sceType.equals(dico.getRefIdByCode("SceType", "FRE"))) { %> <% } %> <% 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"))) && (sceDispType.equals(dico.getRefIdByCode("SceDispType", "RADIO")) || sceDispType.equals(dico.getRefIdByCode("SceDispType", "CHECK"))) ) { %> <% } %>
<%= df.format((long)seqNum) %>
<%= (hasAnswers == 1) ? Utils.getMessage(session, "L2005", "Oui") : Utils.getMessage(session, "L2006", "Non") %>
<% if (sceType.equals(dico.getRefIdByCode("SceType", "REF"))) { %> <% } %> <% 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"))) && (sceDispType.equals(dico.getRefIdByCode("SceDispType", "RADIO")) || sceDispType.equals(dico.getRefIdByCode("SceDispType", "CHECK"))) ) { %> <% } %>
 <%=(isPopUp == false ? utilisation : (linksList != null ? ""+linksList.size() : "0"))%> 
<% String oldSceTabID = null; try { oldSceTabID = ScriptElement.getSceRefTable(); } catch (FieldNotInitializedException e) { } String[] tabFields = {"TabID", "TabName"}; String[] tabOrderBy = {"TabName"}; String[][] tabQuery = {{"TabID = " + Utils.formatToSQL(context, oldSceTabID)}}; Vector tablesList = TablesBean.listSummary(session, tabFields, tabQuery, tabOrderBy); if (tablesList != null && tablesList.size() == 1) { Hashtable line = (Hashtable)tablesList.elementAt(0); String tabID = (String)line.get("TabID"); String tabName = (String) line.get("TabName"); %> <%= tabName %> <% } %>
<% int associatedText = 0; try { associatedText = ScriptElement.getSceAssociatedText(); } catch (FieldNotInitializedException fnie) { } %> <% if (associatedText == 0) { %> <% } else { %> <% } %>
<% int hasOther = 0; try { hasOther = ScriptElement.getSceHasOther(); } catch (FieldNotInitializedException fnie) { } %> <% if (hasOther == 0) { %> <% } else { %> <% } %>
<% if (sceType.equals(dico.getRefIdByCode("SceType", "LST"))) { %> ">
<% } %> <% String sceRefTable = null; try { sceRefTable = ScriptElement.getSceRefTable(); } catch (FieldNotInitializedException fnie) { } if (sceType.equals(dico.getRefIdByCode("SceType", "REF"))) { %> ">
<% 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 %>
<% } %> " onselect="refreshObj();"> " /> <% try { String picID = ScriptElement.getSceImage(); %> ">
<fl:getMessage code=">
<% } catch (FieldNotInitializedException ex) {} %>