Edit C:\galaxie\Back\galaxie\sales\interaction\realize.jsp
<%@page import="com.edeal.frontline.FieldBean"%> <%@page import="com.edeal.frontline.helper.InteractionBaseHelper.ContextObjectInformation"%> <%@page import="java.util.Iterator"%> <%@page import="com.sun.syndication.feed.impl.ObjectBean"%> <%@page import="com.edeal.frontline.helper.ActorBaseHelper"%> <%@page import="java.util.Calendar"%> <%@page import="com.edeal.frontline.helper.InteractionBaseHelper"%> <%@page import="com.edeal.frontline.ActorBean"%> <%@page import="com.edeal.frontline.PersonEventBean"%> <%@page import="com.edeal.frontline.EventBean"%> <%@page import="com.edeal.frontline.MessagesBean"%> <%@page import="com.edeal.frontline.OpportunityBean"%> <%@page import="org.apache.commons.lang.StringUtils"%> <%@page import="java.util.Date"%> <%@page import="com.edeal.frontline.navigation.FlRequest"%> <%@page import="com.edeal.frontline.FlContext"%> <%@page import="com.edeal.frontline.DataDictionary"%> <%@page import="com.edeal.frontline.FieldNotInitializedException"%> <%@page import="com.edeal.frontline.Utils"%> <%@ taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.InteractionBean" id="Interaction" scope="request" /> <% FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); InteractionBaseHelper ibh = new InteractionBaseHelper(Interaction); HashMap<ObjectsBean, ContextObjectInformation> contextObjectInformation = ibh.getContextObjectInformation(); String id = null; try { id = Interaction.getID(); } catch (FieldNotInitializedException fnie) {} String categoryCode = null; try { categoryCode = dico.getRefCode("Acv", null, Interaction.getIntAtvID()); } catch (FieldNotInitializedException fnie) {} EventBean event = (EventBean) request.getAttribute("event"); EventBean eventFromPersonEvent = (EventBean) request.getAttribute("eventFromPersonEvent"); OpportunityBean opportunity = (OpportunityBean) request.getAttribute("opportunity"); PersonEventBean personEvent = (PersonEventBean) request.getAttribute("personEvent"); String typeInterID = null; String typeInteraction = ""; String titreFen; String codetitreFen; try{ typeInterID = (String)Interaction.getCustomProperty("IntType_"); }catch(FieldNotInitializedException e){ typeInterID = ""; } if(typeInterID.equals(dico.getRefIdByCode("IntType_", "ACT"))){ titreFen = "Todo"; codetitreFen ="FF072"; typeInteraction = "TODO"; } else if (typeInterID.equals(dico.getRefIdByCode("IntType_", "COR"))){ titreFen = "Correspondance"; codetitreFen ="FF09A"; typeInteraction = "CORR"; } else { titreFen = "Interaction"; codetitreFen ="L30B2"; } // Get message for outmail messaging MessagesBean message = null; if("OUTEMAIL".equals(categoryCode)) { try { message = new MessagesBean(Interaction.getIntMsgID(), session); } catch (FieldNotInitializedException fnie) { message = new MessagesBean(session); } pageContext.setAttribute("message", message); } String taskDoneRefID = dico.getRefIdByCode("Sti", null, "DONE"); //http://u-project2.umanis.com/view.php?id=30488 //0030488: Correspondances : heures de début et de fin incohérentes %> <script type="text/javascript" src="<fl:webapp/>/js/wysiwyg/ckeditor/ckeditor.js"></script> <script type="text/javascript" src="<fl:webapp/>/js/wysiwyg/ckeditor/adapters/jquery.js"></script> <script type="text/javascript"> <% if(!"OUTEMAIL".equals(categoryCode) && !"CORROUT".equals(categoryCode)) { %> $(document).ready(function () { var editor = CKEDITOR.replace('IntReport', { toolbar : [ ['Format','Font','FontSize','-','Bold','Italic','Underline','StrikeThrough','-','Undo','Redo','-','Cut','Copy','Paste','Find','Replace','-','Outdent','Indent','-','Print'], ['NumberedList','BulletedList','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Table','-','Link','TextColor','BGColor','Source'] ] }); CKEDITOR.on( 'dialogDefinition', function( ev ){ var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if ( dialogName == 'image' ){ dialogDefinition.removeContents('advanced'); // Get a reference to the 'Image Info' tab. var infoTab = dialogDefinition.getContents('info'); // Remove unnecessary widgets from the 'Image Info' tab. infoTab.remove('txtHeight'); infoTab.remove('txtWidth'); infoTab.remove('txtBorder'); infoTab.remove('txtHSpace'); infoTab.remove('txtVSpace'); infoTab.remove('cmbAlign'); infoTab.remove('btnLockSizes'); infoTab.remove('btnResetSize'); infoTab.remove('previewImage'); infoTab.remove('ImagePreviewLoader'); infoTab.remove('ImagePreviewBox'); infoTab.remove('previewImage'); } }); }); <% } %> </script> <style> <!-- .centralHeader .container .dataLabel { width: 1%; } .centralHeader .container .dataLabel div{ width: 100px; } .centralHeader #IntTimeBeg, .centralHeader #IntDate { margin-left: 0; } .reportInformation .editContext .dataLabel{ width: 1% } .reportInformation .editContext .dataLabel div { width: 100px; } .reportInformation .editContext .dataValue select { width: auto; } .dataLabel { vertical-align: middle; } --> </style> <% String formulaireAction="/save_realize_interaction.fl"; if("CORROUT".equals(categoryCode)) { formulaireAction="/save_and_fusion_mail_interaction.fl"; } // Case of interaction custom fields String customContextFobBeanStr = ""; if (contextObjectInformation!=null) { Iterator<ObjectsBean> contextObjectBeanIt = contextObjectInformation.keySet().iterator(); while (contextObjectBeanIt.hasNext()) { ObjectsBean contextObjectBean = contextObjectBeanIt.next(); ContextObjectInformation contextInfo = contextObjectInformation.get(contextObjectBean); // is it a context object from a custom field? if (!contextInfo.getInteractionFobField().isFldStd()) { customContextFobBeanStr+=";"+contextObjectBean.getObjSql(); } } } %> <fl:form action="<%= formulaireAction %>" bean="<%= \"Interaction\"+(opportunity!=null ? \";opportunity\": \"\")+(message!=null ? \";message\": \"\")+(personEvent!=null ? \";personEvent\": \"\")+customContextFobBeanStr %>" > <% String IntStiIDValue = taskDoneRefID; if("OUTEMAIL".equals(categoryCode)) { IntStiIDValue = Interaction.getIntStiID(); } %> <input type="hidden" name="IntStiID" id="IntStiID" value="<%= IntStiIDValue %>"> <input type="hidden" name="$$presentFields" value="" /> <fl:bigTabs objectTitle="<%= Utils.getMessage(session, codetitreFen, titreFen) %>" ou="<%= \"/edit_interaction.fl\" + (id != null ? \"?id=\" + id : \"\") %>"> <table class="container" cellpadding="0"> <tr> <% if(typeInteraction.equals("CORR")){%> <td style="width: 0; padding-right: 10px; padding-left: 10px;" valign="top"> <img src="<fl:webapp/>/icons/ico_interaction/big_<%= Interaction.getCategoryImg() %>" alt="<%= Interaction.getCategoryAltImg() %>" style="border: none;"> </td> <%}%> <td class="centralHeader"> <table class="container " cellpadding="0"> <!-- subject --> <fl:fieldEdit property="IntSubject" mandatoryMsgCode="M60C4"/> <!-- Time & date --> <tr class="fieldline"> <td class="dataLabel"><fl:label field="IntDate"/></td> <td class="dataValue"> <table class="container" cellpadding="0"> <tr class="fieldline"> <td nowrap="nowrap"> <fl:input property="IntDate" mandatoryMsgCode="M2006" onchange="this.form.initIntDate.value = this.value;" nodiv="true" /> </td> <% if (Interaction.hasTimePeriodDisplay()) { Date begHour = null; try { begHour = Interaction.getIntTimeBeg(); } catch (FieldNotInitializedException fnie) { } Date endHour = null; try { endHour = Interaction.getIntTimeEnd(); } catch (FieldNotInitializedException fnie) { } String begHourS = Utils.formatToWebTime(session, begHour, true); String endHourS = Utils.formatToWebTime(session, endHour, true); boolean isMorning = false; boolean isAfternoon = false; boolean isAllDay = false; if ("08:30:00".equals(begHourS) && "12:00:00".equals(endHourS)) { isMorning = true; } else if ("14:00:00".equals(begHourS) && "17:30:00".equals(endHourS)) { isAfternoon = true; } else if ("08:30:00".equals(begHourS) && "17:30:00".equals(endHourS)) { isAllDay = true; } %> <td nowrap="nowrap" style="width:100%; padding-left:10px;"> <input name="IntTimeBeg" type="hidden" value="<fl:getProperty name="Interaction" property="IntTimeBeg" alt="" format="HH:mm"/>"> <input name="IntTimeEnd" type="hidden" value="<fl:getProperty name="Interaction" property="IntTimeEnd" alt="" format="HH:mm"/>"> <input name="periode" id="periode_1" type="radio" class="radio" <%= isMorning ? "checked" : "" %> value="" onclick="document.forms[0].IntTimeBeg.value='08:30';document.forms[0].IntTimeEnd.value='12:00';"> <label class="radioLabel" for="periode_1"><fl:getMessage code="L62AC" alt="matin" /></label><br /> <input name="periode" id="periode_2" type="radio" class="radio" <%= isAfternoon ? "checked" : "" %> value="" onclick="document.forms[0].IntTimeBeg.value='14:00';document.forms[0].IntTimeEnd.value='17:30';"> <label class="radioLabel" for="periode_2"><fl:getMessage code="F60AC" alt="après-midi" /></label/><br /> <input name="periode" id="periode_3" type="radio" class="radio" <%= isAllDay ? "checked" : "" %> value="" onclick="document.forms[0].IntTimeBeg.value='08:30';document.forms[0].IntTimeEnd.value='17:30';"> <label class="radioLabel" for="periode_3"> <fl:getMessage code="L62AD" alt="Toute la journée" /> </label> </td> <% } else { %> <td nowrap="nowrap" style="width:100%; padding-left:10px;"> <fl:input property="IntTimeBeg" size="3" onblur="if(document.forms[0].IntTimeEnd.value == '') doEditTimeEnd();" nodiv="true"/> <input type="hidden" name="duree" value="<%= Interaction.getDefaultDuration() %>"> <fl:label code="L2059" nodiv="true" /> <fl:input property="IntTimeEnd" size="3" nodiv="true" /> <input type="hidden" name="origIntTimeEnd" value=""> </td> <% } %> </tr> </table> </td> </tr> </table> </td> <% if (opportunity != null || personEvent != null || event != null) { %> <td class="titreFiche" style="width: 500px; text-align: right;"> <%@include file="context_info.jsp" %> </td> <% } %> </tr> <tr> <td colspan="3"> <% if("CORROUT".equals(categoryCode)) { %> <%@include file="realize_letter.jsp" %> <% } else if("OUTEMAIL".equals(categoryCode)) { %> <%@include file="realize_email.jsp" %> <% } else if("OUTPHONE".equals(categoryCode)) { %> <%@include file="realize_phone.jsp" %> <% } else if("RDVCOM".equals(categoryCode)) { %> <%@include file="realize_appointement.jsp" %> <% } %> </td> </tr> <% if(!"OUTEMAIL".equals(categoryCode) && !"CORROUT".equals(categoryCode)) { %> <tr> <td colspan="3" class="reportInformation" style="padding-top: 40px;"> <fieldset class="fieldset"> <legend class="legend"><fl:getMessage code="L82C8" alt="Réaliser le compte rendu"/></legend> <table class="container" cellpadding="0" style="width: 100%"> <tr> <td valign="top" style="width: 50%"> <% String details = null; try { details = Interaction.getIntDetails(); } catch (FieldNotInitializedException e) {} if (details!=null) { %> <fl:label field="IntDetails"/> <fl:getProperty property="IntDetails" alt="" name="Interaction"></fl:getProperty> <% } %> </td> <td valign="top" style="width: 50%"> <% Vector<Vector<String>> shouldBeDisplayedFields = dico.getRefCodeList("Iuf", null); %> <table class="container editContext"> <% if (opportunity != null) { %> <fl:fieldRead property="IntOppID" bean="true" alt="" href="true" disp="<%=flRequest.computeURL(\"/read_opportunity.fl\")%>" /> <% for (int i=0; i<shouldBeDisplayedFields.size(); i++) { String fieldName = shouldBeDisplayedFields.get(i).get(1); if(fieldName.startsWith("Opp")) {%> <fl:fieldEdit property="<%= fieldName %>" name="opportunity"></fl:fieldEdit> <% } } %> <% } if (personEvent != null) { %> <fl:fieldRead property="PvtEventID" name="personEvent" bean="true"/> <% for (int i=0; i<shouldBeDisplayedFields.size(); i++) { String fieldName = shouldBeDisplayedFields.get(i).get(1); if(fieldName.startsWith("Pvt")) { %> <fl:fieldEdit property="<%= fieldName %>" name="opportunity"></fl:fieldEdit> <% } } } %> <% // Case of interaction custom fields Iterator<ObjectsBean> contextObjectBeanIt = contextObjectInformation.keySet().iterator(); while (contextObjectBeanIt.hasNext()) { ObjectsBean contextObjectBean = contextObjectBeanIt.next(); ContextObjectInformation contextInfo = contextObjectInformation.get(contextObjectBean); // is it a context object from a custom field? if (!contextInfo.getInteractionFobField().isFldStd()) { %> <fl:fieldRead property="<%= contextInfo.getInteractionFobField().getFldSql() %>" bean="true" alt=""/> <% for (FieldBean field: contextInfo.getFieldsToDisplayInInteractionView()) { %> <fl:fieldEdit property="<%= field.getFldSql() %>" name="<%= contextObjectBean.getObjSql() %>"></fl:fieldEdit> <% } } } %> </table> </td> </tr> <tr> <td colspan="2"> <fl:label field="IntReport"/> <fl:input height="350px" property="IntReport" nodiv="true"/> </td> </tr> <tr> <td colspan="2" style="padding: 5px;padding-top: 25px;"> <fl:attach name="Interaction" colID="IntAttID" /> </td> </tr> </table> </fieldset> </td> </tr> <% } %> </table> </fl:bigTabs> </fl:form> <% if("CORROUT".equals(categoryCode) || "OUTEMAIL".equals(categoryCode) || "OUTPHONE".equals(categoryCode)) { /* Calendar newIntTimeBeg = Calendar.getInstance(); Calendar newIntTimeEnd = Calendar.getInstance(); newIntTimeEnd.add(Calendar.MINUTE, (int)(Interaction.getDefaultDuration()*60)); Interaction.setIntTimeBeg(newIntTimeBeg.getTime()); Interaction.setIntTimeEnd(newIntTimeEnd.getTime()); Interaction.setIntDate(newIntTimeBeg.getTime()); Date begHour = null; try { begHour = Interaction.getIntTimeBeg(); } catch (FieldNotInitializedException fnie) { } Date endHour = null; try { endHour = Interaction.getIntTimeEnd(); } catch (FieldNotInitializedException fnie) { } if(id==null || (begHour==null && endHour==null)){ */ %> <script type="text/javascript"> function setHours(){ var today = new Date(); var h = today.getHours(); var h2 = today.getHours() + 1; var m = today.getMinutes(); if(m<10) m = '0'+m; // add a zero in front of numbers<10 //m = checkTime(m); document.getElementById('IntTimeBeg').value = h + ":" + m ; document.getElementById('IntTimeEnd').value = h2 + ":" + m ; } setHours(); </script> <% } %> <script type="text/javascript"> function deleteAttachment_MsgAttID(attID) { document.getElementById('MsgAttID').value = document.getElementById('MsgAttID').value.split('|').filter(function(item,i,allItems){ return i==allItems.indexOf(item); }).join('|'); document.getElementById('MsgAttID').value = document.getElementById('MsgAttID').value.replace(attID+'|','').replace('|'+attID,''); document.getElementById('MsgAttID').value = document.getElementById('MsgAttID').value.split("||").join("|"); //alert(document.getElementById('MsgAttID').value); var table = document.getElementById('grid-data').childNodes[1]; var rowCount = table.rows.length; for(var i=0; i < rowCount; i++){ if(table.rows[i].innerHTML.indexOf(attID) > -1){ table.deleteRow(i); } } } document.getElementById('MsgAttID').value = "<% String IntSolicitation_ = ""; String IntDossierID_=""; Vector<String> atts = new Vector<String>(); String iddd = ""; try{ atts = (Vector<String>) Interaction.getIntAttID(); for(int i=0;i<atts.size();i++){ try{ iddd = iddd+(String) atts.get(i)+"|"; out.print(iddd+'|'); }catch(Exception e){ } } }catch(Exception e){ } try{ IntSolicitation_ = (String) Interaction.getCustomProperty("IntSolicitation_"); SolicitationBean soll = new SolicitationBean(IntSolicitation_,context); for(int i=0;i<soll.getSolAttID().size();i++){ try{ iddd = iddd+(String) soll.getSolAttID().get(i)+"|"; out.print(iddd+'|'); }catch(Exception e){ } } }catch(Exception e){ } try{ IntDossierID_ = (String) Interaction.getCustomProperty("IntDossierID_"); Dossier_Bean doss = new Dossier_Bean(IntDossierID_,context); for(int i=0;i<doss.getDs_Fichiers().size();i++){ try{ iddd = iddd+(String) doss.getDs_Fichiers().get(i)+"|"; out.print(iddd+'|'); }catch(Exception e){ } } }catch(Exception e){ } %>"; </script>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de