Edit C:\galaxie\Back\galaxie\marketing\linkscriptelement\edit.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.*, com.edeal.frontline.navigation.*"%> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.LinkScriptElementBean" id="LinkScriptElement" 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 id=null; try{ id = LinkScriptElement.getID(); }catch(Exception e){ id = flRequest.getRequestParameterOrAttribute("id"); } String scriptID=null; try{ scriptID = LinkScriptElement.getLseScriptID(); }catch(Exception e){ scriptID = flRequest.getRequestParameterOrAttribute("LesScriptID"); } //get linkscriptelement position, either from total num of links for the script (if this is the creation) //or from the link if this is an edition String[][] query = {{"LseScriptID = " + Utils.formatToSQL(context, scriptID)}}; String[] fields = {"LseID"}; Vector linksList = LinkScriptElementBean.listSummary(session , fields, query); int maxPosition = id == null ? linksList.size() + 1 : linksList.size(); int ourPosition = maxPosition; try { ourPosition = LinkScriptElement.getLsePosition(); } catch (FieldNotInitializedException e) {} //get scriptElementID from the linkscriptelementbean (if this is edition) String scriptElementID = null; try { scriptElementID = LinkScriptElement.getLseScriptElementID(); } catch (FieldNotInitializedException e) {} String dispSce = null; if (scriptElementID != null) { ScriptElementBean sce = new ScriptElementBean(scriptElementID, context); dispSce = sce.getSceLabel(); } //Get transitions for that LinkScriptElement String[][] query2 = {{"SetLse1ID = " + Utils.formatToSQL(context, id)}}; String[] fields2 = {"SetID", "SetPosition"}; String[] orderBy2 = {"SetPosition"}; Vector transitionsList = ScriptElementTransitionBean.listSummary(session , fields2, query2, orderBy2); String[] pagesFields = {"ScpID", "ScpTitre", "ScpCode", "ScpPosition"}; String[][] pagesQuery = {{"ScpScriptID = " + Utils.formatToSQL(context, scriptID)}}; String[] pagesOrderBy = {"ScpPosition ASC"}; Vector pages = ScriptPageBean.listSummary(session, pagesFields, pagesQuery, pagesOrderBy); boolean pageMode = false; if (pages != null && pages.size() > 0) { pageMode = true; } %> <html> <head> <link rel="stylesheet" type="text/css" href="<fl:webapp/>/css/common_css.jsp"> <link rel="stylesheet" href="<fl:webapp/>/css/master_css.jsp" type="text/css"> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/ajax/sarissa.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/ajax/ajax.js"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/master_js.jsp"></script> <script type="text/javascript" language="javascript" src="<fl:webapp/>/js/ac/fobAC_js.jsp"></script> <script language="javascript" src="<fl:webapp/>/js/presentField.js"></script> <script language="javascript" src="<fl:webapp/>/js/checkFields.jsp"></script> <script language="javascript" src="<fl:webapp/>/js/utils.js"></script> <script language="javascript" type="text/javascript" src="<fl:webapp/>/js/smalltabs.jsp"></script> <script language="javascript"> function doSubmit() { var mf = document.forms[0]; presentFieldsValue(); if (mf.LseScriptElementID.value == "") { alert("<fl:getMessage code="M6073" alt="Veuillez sélectionner un élément de script." js="true"/>"); return; } mf.submit(); } function doUpPosition() { var mf = document.forms[0]; if (mf.LsePosition.value < <%=maxPosition%>) mf.LsePosition.value ++; } function doDownPosition() { var mf = document.forms[0]; if (mf.LsePosition.value > 1) mf.LsePosition.value = mf.LsePosition.value - 1; } function doEditTransition(id) { window.open("<fl:webapp/>/read_scriptelementtransition.fl?id=" + id, '', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=600'); } var submitFlag = false; function doDeleteTransition(id) { if(!submitFlag && confirm('<fl:getMessage code="M2004" alt="Etes-vous sûr de vouloir supprimer?" js="true"/>')) { submitFlag = true; var str = '<fl:link url="/delete_object_ajax.fl?type=ScriptElementTransition&id='+ id + '"/>'; doAjax(str, waitNreload); } } function addTransition(){ var win = window.open('<fl:webapp/>/edit_scriptelementtransition.fl?LseID='+'<%=id%>','','menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=300'); } <% if (pageMode) { %> var transitionDisabled = true; <% String scpQuery = "ScpScriptID = " + Utils.formatToSQL(context, scriptID); //Utils.urlEncode(context, scpQuery) %> function choosePage() { window.open("<fl:webapp/>/select.fl?type=ScriptPage&field=LsePageID&query=<%="ScpScriptID="+ Utils.formatToSQL(context, scriptID)%>"); } <% } %> function waitNreload(arrIndex) { if (eDealXmlhttpArr[arrIndex].readyState == 4) { reloadMe(); window.top.opener.waitNrefresh(); } } function myReload(){ reloadMe(); } function reloadMe(){ window.top.location = '<%=flRequest.computeURL("/edit_linkscriptelement.fl?id="+id)%>' } </script> <title><fl:getMessage code="L2025" alt="e-Deal"/></title> </head> <body class="popup_body"> <fl:form multivalSeparator=";" action="<%=\"/save_linkscriptelement.fl?1=1\"+(id!=null ? \"&id=\"+id : \"\")+\"&saved=true\"%>" bean="LinkScriptElement"> <input type="hidden" name="$$presentFields"> <input type="hidden" name="$$returnedHtmlHead" value=""> <input type="hidden" name="IsRefesh" value=""> <input type="hidden" name="LseScriptID" value="<%=scriptID%>"> <input type="hidden" name="ScriptID" value="<%=scriptID%>"> <fl:bigTabs objectTitle="<%=Utils.getMessage(session, \"L61EF\", false, true, \"Elément de script\")%>"> <table class="container" cellpadding="0"> <tr> <td colspan="3"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="labelTitreFiche"> <fl:getMessage code="L61EF" alt="Elément de script"/> </td> <td class="fieldTitreFiche"> <fl:input property="LseScriptElementID" mandatoryMsgCode="M6073" column1="true"/> </td> </tr> </table> </td> </tr> <tr><td colspan="3" class="ligne_separation"/></tr> <tr><td> <table class="container" cellpadding="0"> <tr> <td class="column2"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="dataLabel" ><fl:getMessage code="F300A" alt="Position"/></td> <td class="dataValue"> <% String flechAdd = ""; flechAdd = "<a href=\"javascript:doUpPosition()\"><img src=\""+request.getContextPath()+"/icons/ico/flecheH.gif\" border=\"0\"></a> <a href=\"javascript:doDownPosition()\"><img src=\""+request.getContextPath()+"/icons/ico/flecheB.gif\" border=\"0\"></a>"; %> <div class="fieldTable" ><table class="fieldTable" cellpadding="0"><tbody><tr><td class="principalText"><input id="LsePosition" name="LsePosition" value="<%= maxPosition %>" class="input number" style="text-align: right;" onblur="ctrlNumField(this, 'integer', 'Format incorrect. Veuillez corriger');" onfocus="this.blur()" type="text"></td><td class="postText"> <a href="javascript:doUpPosition()"><img src="<fl:webapp/>/icons/ico/flecheH.gif" border="0"></a> <a href="javascript:doDownPosition()"><img src="<fl:webapp/>/icons/ico/flecheB.gif" border="0"></a></td></tr></tbody></table></div> <%-- fl:input property="LsePosition" postText="<%= flechAdd %>" onfocus="this.blur()"/--%> </td> </tr> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table class="container" cellpadding="0"> <% if (pageMode) { %> <tr class="fieldeLine"> <td class="dataLabel"><fl:getMessage code="F608C" alt="Page"/></td> <td class="dataValue"> <fl:input property="LsePageID" query="<%=\"ScpScriptID=\" + Utils.formatToSQL(context, scriptID)%>"/> </td> </tr> <% }else { %> <tr class="fieldeLine"><td></td></tr> <% } %> </table> </td> </tr> </table> </td></tr> <tr><td colspan="3" class="ligne_separation"/></tr> </table> <% if (id != null && !pageMode) { %> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <fl:smallTabs name="ScriptTabs"> <fl:sTab id="TRANS" title="<%= Utils.getMessage(session, \"L621A\",\"Transitions\") %>"> <table width="100%" class="container"> <tr class="ligne_separation"><td></td></tr> <tr> <td style="width:10%"> <div class="button"> <a href="javascript:addTransition();"><fl:getMessage code="L621B" alt="Transition"/> +</a> </div> </td> <td colspan="3" style="width:90%"> </td> </tr> </table> <%-- Afin d'avoir un scroller sur les transition --%> <div style="overflow:auto;height:120px;"> <table width="100%"> <% if (transitionsList.size() > 0) { %> <%-- For every transition --%> <% for (int i=0 ; i < transitionsList.size() ; i++) { Hashtable curTransition = (Hashtable)transitionsList.elementAt(i); Integer position = (Integer)curTransition.get("SetPosition"); String transitionID = (String)curTransition.get("SetID"); //Ci dessous a refaire %> <tr class="fieldline"> <td colspan="4"> <%-- Display --%> <jsp:include page="/marketing/scriptelementtransition/view.jsp" flush="true"> <jsp:param name="id" value="<%= transitionID %>"/> <jsp:param name="Edit" value="1"/> </jsp:include> </td> </tr> <% } %> <% } else { %> <tr class="fieldline"> <td colspan="4" class="dataValue"> <fl:getMessage code="L6221" alt="Aucune transition n\'est définie pour cet élément de script."/> </td> </tr> <% } %> </table> </div> </fl:sTab> </fl:smallTabs> <% } %> </fl:bigTabs> <table class="container"> <tr class="ligne_separation"><td></td></tr> <tr class="fieldline"> <td width="30%"> </td> <td width="40%"> <div align="center"> <a href="javascript:doSubmit();"><img src="<fl:webapp/>/icons/ico/valid_green_long.gif"></a> <a href="javascript:window.top.close();"><img src="<fl:webapp/>/icons/ico/fermer_red_long.gif"> </div> </td> <td width="30%"> </td> </tr> </table> </fl:form> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de