Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\service\solicitation\edit.jsp
<% /****************************************************************************** * Copyright (c) 2000-2010 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.*, com.edeal.frontline.navigation.*"%> <%@ page import="com.edeal.frontline.controller.actions.SelectAction" %> <%@ page import="com.edeal.frontline.SilhouetteBean" %> <%@ page import="com.edeal.frontline.FieldNotInitializedException" %> <jsp:useBean id="Solicitation" class="com.edeal.frontline.SolicitationBean" scope="request" /> <%@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(); SilhouetteBean Silhouette = (SilhouetteBean)request.getAttribute("Silhouette"); String id = null; try { id = Solicitation.getID(); } catch(Exception e) { id = flRequest.getRequestParameterOrAttribute("id"); } String solSilID=null; try { Solicitation.getSolCreID(); } catch (FieldNotInitializedException ex) { Solicitation.setSolCreID((String)session.getAttribute("actorID")); Solicitation.setSolCrDt(new Date()); } String solID = null; try { solID = Solicitation.getID(); } catch (FieldNotInitializedException ex) { } String perEntID = flRequest.getRequestParameterOrAttribute("perEntID"); String initSolPerID = null; try{ initSolPerID = Solicitation.getSolPerID(); } catch(FieldNotInitializedException fnie) { } if (initSolPerID==null){ initSolPerID = flRequest.getRequestParameterOrAttribute("PerID"); } if (initSolPerID != null && !"".equals(initSolPerID)) { Solicitation.setSolPerID(initSolPerID); } if (initSolPerID == null){ try{ solSilID = Solicitation.getSolSilID(); }catch(FieldNotInitializedException fnie){} if (solSilID==null){ solSilID = flRequest.getRequestParameterOrAttribute("SilID"); } } if(Silhouette != null) { try { Silhouette.getSilFstName(); }catch (FieldNotInitializedException e){ Silhouette.setSilFstName(Utils.getMessage(session, "F611C", true, "<Prénom>")); } try { Silhouette.getSilName(); }catch (FieldNotInitializedException e){ Silhouette.setSilName(Utils.getMessage(session, "F611D", true, "<Nom>")); } request.setAttribute("Silhouette", Silhouette); } String strCatCode = null; try { strCatCode = dico.getRefCode("SolCatID", Solicitation.getSolCatID()); } catch (FieldNotInitializedException ex) {} String sfwID = flRequest.getRequestParameterOrAttribute("SfwID"); String kb = flRequest.getRequestParameterOrAttribute("kb"); /* Si l'état de la sollicitation n'est pas défini on l'initialise à "OPEN" */ String strSolCode = null; try { strCatCode = dico.getRefCode("SolStsID", Solicitation.getSolCatID()); } catch (FieldNotInitializedException ex) {} /* On initialise toujours l'acteur en charge à l'utilisateur connecté (sera remplacé lors de l'enregistrement par le 1er acteur présent dans le champs SolActeursCharge_)*/ String actID = null; if (session != null) { actID = (String)session.getAttribute("effectiveActorID"); if (actID == null) { actID = (String)session.getAttribute("actorID"); if (actID == null) { throw new FrontlineException("there is not an actor ID in session"); } } } String solActID = null; try { solActID = Solicitation.getSolActID(); } catch (FieldNotInitializedException ex) { Solicitation.setSolActID(actID); } // ramener les ids des 6 états de la sollicitation String waitingState; // En Attente String openState; // Ouverte String assignedState; // Assignée String notifyState; // Accusé de récéption String closedState; // Fermée String investigState; // Vérification try { waitingState = dico.getRefIdByCode("Sts", "Te1", "WAITING"); openState = dico.getRefIdByCode("Sts", "Te1", "OPEN"); assignedState = dico.getRefIdByCode("Sts", "Te1", "ASSIGNED"); notifyState = dico.getRefIdByCode("Sts", "Te1", "NOTIFY"); closedState = dico.getRefIdByCode("Sts", "Te1", "CLOSED"); investigState = dico.getRefIdByCode("Sts", "Te1", "INVESTIG"); } catch (Exception e) { waitingState = null; openState = null; assignedState = null; notifyState = null; closedState = null; investigState = null; } // ramener les ids des 4 catégories de la sollicitation String reservationCatID; // Plainte d'un Guest suite à une réservation String fidelisationStateID; // Plainte liée au programme de fidélisation String mecontentementStateID; // Plainte de mécontentement (suivi qualité) String complimentStateID; // Compliment try { reservationCatID = dico.getRefIdByCode("So_", "Te1", "SPRES"); fidelisationStateID = dico.getRefIdByCode("So_", "Te1", "SPFID"); mecontentementStateID = dico.getRefIdByCode("So_", "Te1", "SPQA"); complimentStateID = dico.getRefIdByCode("So_", "Te1", "SCOM"); } catch (Exception e) { reservationCatID = null; fidelisationStateID = null; mecontentementStateID = null; complimentStateID = null; } // Détecter l'état de la sollicitation String statutID; try { statutID = Solicitation.getSolStsID(); } catch (FieldNotInitializedException e) { statutID = openState; /*Par défaut on la considère dans l'état "Ouverte"*/ } // source plainte id String solSourcePlainteID = null; try { solSourcePlainteID = (String)Solicitation.getCustomProperty("SolSourcePlainte_"); } catch (FieldNotInitializedException e) { solSourcePlainteID = ""; } // Catégorie oplainte String solCategorieID = null; try { solCategorieID = (String)Solicitation.getCustomProperty("SolCategorie_"); } catch (FieldNotInitializedException e) { solCategorieID = ""; } String valRestr=""; if(solCategorieID.equalsIgnoreCase(reservationCatID)) { valRestr ="PT;PH;PR"; } else if ( solCategorieID.equalsIgnoreCase(fidelisationStateID)) { valRestr ="ERIT;ERCEN;ERCLI;ERHOT"; } Date dateSol = null; try { dateSol = (Date) Solicitation.getCustomProperty("SolDate_"); } catch (FieldNotInitializedException e) { // Date du jour : Date dateDuJour = new Date(); Solicitation.setCustomProperty("SolDate_", dateDuJour); } java.util.GregorianCalendar calendar = new GregorianCalendar(); java.util.Date time = calendar.getTime(); Solicitation.setCustomProperty("SolHeureDebut_", time); %> <link href="<fl:webapp/>/css/smalltabs_css.jsp" rel="stylesheet" type="text/css"> <style> .SolSubCatID { width: 100%; } .SolSubCatID select { color: #000000 ; background-color: #FAFDFD; font-family: Arial, Verdana, sans-serif; vertical-align: middle; font-size: 12px; border: 1px solid #A3A6AB; display: inline; padding: 1px 1px; width: 50%; } </style> <script language="javascript"> function doEntDepartmentID_Change() { doRefreshSolicitation(); } function doRefreshSolicitation() { var f = document.forms[0]; f.action = "<fl:webapp/>/refresh_solicitation_custom.fl"; f.submit(); } function loadSourcePlainte(ctrID) { if (ctrID == undefined || ctrID == null || ctrID == '') { $("#SolSourcePlainte_").html("<option value=''> </option>"); $("#SolSourcePlainte_").width($("#div_SolSourcePlainte_").width()); return; } $.getJSON("<fl:webapp/>/get_source_plainte.fl?SolCategorie_=" + ctrID, function(data) { if (data != null) { if(data.length == 0 ){ $("#SolSourcePlainte__label").hide(); $("#SolSourcePlainte__value").hide(); } else { $("#SolSourcePlainte__label").show(); $("#SolSourcePlainte__value").show(); } var optContent = "<option value=''> </option>"; for (var i = 0; i < data.length; i++) { var optValue = data[i].value; var optText = data[i].text; optContent += "<option" if (optValue == '<%=solSourcePlainteID%>') { optContent += " selected"; } optContent += " value='" + optValue + "'>" + optText + "</option>" } $("#SolSourcePlainte_").html(optContent); $("#SolSourcePlainte_").width($("#div_SolSourcePlainte_").width());//For IE7 } }); } function doSubmit() { return true; } function doOnLoad() { //loadSourcePlainte($('#SolCategorie_ option:selected').val()); } </script> <fl:form action="/save_solicitation.fl" bean="Solicitation"> <fl:bigTabs objectTitle="<%=Utils.getMessage(session, \"L60E8\", false, true, \"Sollicitations\")%>" ou="<%=\"/edit_solicitation.fl\" + (id != null ? \"?id=\" + id : \"\") %>"> <input name="$$presentFields" type="hidden" value=""> <input name="ou" type="hidden" value="/edit_solicitation.fl"> <input name="id" type="hidden" value="<fl:getProperty name="Solicitation" property="SolID" alt=""/>"> <input name="SolActID" type="hidden" value="<%=Solicitation.getSolActID()%>"> <input type="hidden" name="$$returnedHtmlHead" value=""> <input type="hidden" name="$$returnedHtmlBody" value="..."> <table class="container" cellpadding="0"> <tr> <td colspan="5" class="titreFiche"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td class="labelTitreFiche"> <fl:label field="SolSubject" labelClassName="titreFiche"/> </td> <td class="fieldTitreFiche"> <fl:input property="SolSubject" mandatoryMsgCode="L6509"/> </td> </tr> </table> </td> </tr> <tr class="ligne_separation"><td></td></tr> <tr> <td class="column2"> <table class="container" cellpadding="0"> <% if( statutID.equalsIgnoreCase(openState)){%> <fl:fieldEdit property="SolCategorie_" alt="" mandatoryMsgCode="M602C" onchange="loadSourcePlainte(this.value);"/> <fl:fieldEdit property="SolStsID" alt=""/> <fl:fieldEdit property="SolChnID" alt="" mandatoryMsgCode="MF03D"/> <fl:fieldEdit property="SolGravite_" alt=""/> <%-- <fl:fieldEdit property="SolToken" alt=""/> --%> <fl:fieldEdit property="SolSolliciteurs_" alt="" mandatoryMsgCode="MF060" /> <fl:fieldEdit property="SolDate_" mandatoryMsgCode="MF05E" alt=""/> <fl:fieldEdit property="SolHeureDebut_" alt="" mandatoryMsgCode="MF03A"/> <fl:fieldEdit property="SolHeureFin_" alt=""/> <fl:fieldEdit property="SolTiersConcerne_" alt="" mandatoryMsgCode="MF0DF"/> <fl:fieldEdit property="SolResponsabilite_"/> <fl:fieldEdit property="SolReservation_" alt=""/> <fl:fieldEdit property="SolDateSejourDebut_" alt=""/> <fl:fieldEdit property="SolDateSejourFin_" alt=""/> <%} else { %> <fl:fieldEdit property="SolCategorie_"/> <fl:fieldEdit property="SolStsID" alt=""/> <fl:fieldRead property="SolChnID" alt="" /> <fl:fieldRead property="SolGravite_" alt=""/> <fl:fieldRead property="SolToken" alt=""/> <fl:fieldRead property="SolSolliciteurs_" separator="<br>" bean="true" href="true" disp="<%= flRequest.computeURL(\"/read_person.fl\") %>"/> <fl:fieldRead property="SolDate_" alt=""/> <fl:fieldRead property="SolHeureDebut_" alt="" /> <fl:fieldRead property="SolHeureFin_" alt=""/> <fl:fieldRead property="SolTiersConcerne_" separator="<br>" bean="true" href="true" disp="<%= flRequest.computeURL(\"/read_enterprise.fl\") %>"/> <fl:fieldRead property="SolResponsabilite_" separator="<br>" bean="true" href="true" disp="<%= flRequest.computeURL(\"/read_correspondent.fl\") %>"/> <fl:fieldRead property="SolReservation_" separator="<br>" bean="true" href="true" disp="<%= flRequest.computeURL(\"/read_reservation_.fl\") %>"/> <fl:fieldRead property="SolDateSejourDebut_" alt=""/> <fl:fieldRead property="SolDateSejourFin_" alt=""/> <%} %> </table> </td> <td class="separation"><div class="separation"></div></td> <td class="column2"> <table class="container" cellpadding="0"> <% if (statutID.equalsIgnoreCase(closedState)) { %> <% if (solCategorieID.equalsIgnoreCase(reservationCatID) || solCategorieID.equalsIgnoreCase(fidelisationStateID)) { %> <fl:fieldEdit property="SolSourcePlainte_" alt="" mandatoryMsgCode="MF05D" except="<%=valRestr%>"/> <% } if (solCategorieID.equalsIgnoreCase(reservationCatID) || solCategorieID.equalsIgnoreCase(fidelisationStateID) || solCategorieID.equalsIgnoreCase(mecontentementStateID)) { %> <fl:fieldEdit property="SolCommentaire_" alt=""/> <% } if (solCategorieID.equalsIgnoreCase(reservationCatID)) { %> <fl:fieldEdit property="SolMontantIndemn_" alt=""/> <fl:fieldEdit property="SolTypeIndemn_" alt=""/> <% } %> <%} %> <!-- On ne peut modifier les acteurs que dans l'état d'une sollicitation Ouverte ou en Accusé de réception --> <% if( statutID.equalsIgnoreCase(openState) || statutID.equalsIgnoreCase(notifyState) ){%> <fl:fieldEdit property="SolActeursCharge_" alt="" mandatoryMsgCode="MF05F"/> <%} else { %> <fl:fieldRead property="SolActeursCharge_" separator="<br>" bean="true" href="true" disp="<%= flRequest.computeURL(\"/read_actor.fl\") %>"/> <%} if( statutID.equalsIgnoreCase(closedState) ){%> <fl:fieldRead property="SolClsDate" alt=" " format="date"/> <%} %> </table> </td> </tr> <tr class="ligne_separation"><td></td></tr> </table> <table class="container" cellpadding="0"> <tr> <td><fl:label field="SolNotes_" labelClassName="titrePartie"/></td> </tr> <tr> <td class="dataValue noPaddingLeft"><fl:input property="SolNotes_" nodiv="false"/></td> </tr> <tr class="ligne_separation"><td></td></tr> <tr class="ligne_separation_couleur"><td></td></tr> <tr class="ligne_separation"><td></td></tr> </table> <fl:smallTabs name="DETAIL"> <fl:sTab id="AttFiles" title="<%=Utils.getMessage(session, \"L201C\", false, true, \"Fichiers\")%>"> <div> <table class="container" cellpadding="0"> <tr class="fieldline"> <td> <fl:attach name="Solicitation" colID="SolAttID" /> </td> </tr> </table> </div> </fl:sTab> </fl:smallTabs> </fl:bigTabs> </fl:form>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de