Edit C:\Windows\install\galaxie_p02_26-09\sales\opportunity\read_action.jsp
<% /****************************************************************************** * Copyright (c) 2000-2013 E-DEAL * * E-DEAL S.A. * 41, rue Périer * 92120 Montrouge * France * * T: +33 (0)1 73 03 29 80 * 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" %> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.custom.*" %> <%@ page import="java.util.*" %> <%@ page import="com.edeal.frontline.*" %> <%@ page import="com.edeal.frontline.process.business.api.ProcessActorRule" %> <%@ page import="com.edeal.frontline.process.business.api.ProcessInstance" %> <%@ page import="com.edeal.frontline.process.business.api.ProcessInstanceStatus" %> <%@ page import="com.edeal.frontline.process.business.api.ProcessRule" %> <%@ page import="com.edeal.frontline.process.business.api.ProcessRuleManager" %> <%@ page import="com.edeal.frontline.helper.custom.ProcessHelper" %> <%@ taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.OpportunityBean" id="Opportunity" 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; try { id = Opportunity.getID(); } catch (FieldNotInitializedException e) { id = null; } String entID; try { entID = Opportunity.getOppEntID(); } catch (FieldNotInitializedException e) { entID = null; } String perID; try { perID = Opportunity.getOppPerID(); } catch (FieldNotInitializedException e) { perID = null; } String almID = (String)flRequest.getAttribute("AlmID"); boolean existsAlert = almID != null; String needDetected; try { needDetected = dico.getRefIdByCode("Sto", "Te1", "NEED"); } catch (Exception e) { needDetected = null; } String corrID; try { corrID = dico.getRefIdByCode("IntType_", "COR"); } catch (FieldNotInitializedException e) { corrID = ""; } // Détecter statut de l'opportunité String statutID; try { statutID = Opportunity.getOppStoID(); } catch (FieldNotInitializedException e) { statutID = null; } boolean isValid = false; try { isValid = ((Boolean)Opportunity.getCustomProperty("OppIsValidated_")).booleanValue(); } catch (FieldNotInitializedException e) { isValid = false; } // expédition validée ou pas? boolean isValidEtiq = false; try { isValidEtiq = ((Boolean)Opportunity.getCustomProperty("OppValidEtiq_")).booleanValue(); } catch (FieldNotInitializedException e) { isValidEtiq = false; } // ramener les ids des 4 statuts de l'opportunité String devisState; String devrefState; String commandeState; String factureState; String typoStasi; try { devisState = dico.getRefIdByCode("Sto", "Te1", "DEV"); devrefState = dico.getRefIdByCode("Sto", "Te1", "DEVREF"); commandeState = dico.getRefIdByCode("Sto", "Te1", "ORD"); factureState = dico.getRefIdByCode("Sto", "Te1", "FAC"); typoStasi = dico.getRefIdByCode("Tc_", "Te1", "STASI"); } catch (Exception e) { devisState = null; devrefState = null; commandeState = null; factureState = null; typoStasi = null; } String devisDocTyp; String commandeDocTyp; String factureDocTyp; String etiqMasseDocTyp =""; String notifStaciDocTyp =""; try { devisDocTyp = dico.getRefIdByCode("To_", "Te1", "DEV"); commandeDocTyp = dico.getRefIdByCode("To_", "Te1", "ORD"); factureDocTyp = dico.getRefIdByCode("To_", "Te1", "FAC"); etiqMasseDocTyp = dico.getRefIdByCode("To_", "Te1", "ETQ"); notifStaciDocTyp = dico.getRefIdByCode("To_", "Te1", "STC"); } catch (Exception e) { devisDocTyp = null; commandeDocTyp = null; factureDocTyp = null; } // If "NEED" doesn't exist for some reason, just take the first one if (needDetected == null) { Vector vect = dico.getRefCodeList("OppStoID"); Vector firstElement = (Vector)vect.firstElement(); needDetected = (String)firstElement.firstElement(); } // Pour ne pas créer d'autres avoirs à partir d'une facture "Avoir" String oppFactAvoir = null; try { oppFactAvoir = (String) Opportunity.getCustomProperty("OppFactAvoir_"); } catch (FieldNotInitializedException e) { oppFactAvoir ="false"; } String pdfTitle = ""; String mailTitle = ""; String typeOppDocument = ""; String courrierTitle = ""; if((statutID != null) && (statutID.equalsIgnoreCase(devisState))) { pdfTitle ="LF158"; mailTitle = "FF1F9"; typeOppDocument = devisDocTyp; courrierTitle = "LF15B"; } else if ((statutID != null) && (statutID.equalsIgnoreCase(commandeState))) { pdfTitle ="LF159"; mailTitle = "FF1FA"; typeOppDocument = commandeDocTyp; courrierTitle = "LF15C"; } else if ((statutID != null) && (statutID.equalsIgnoreCase(factureState))) { pdfTitle ="LF15A"; mailTitle = "FF1FB"; typeOppDocument = factureDocTyp; courrierTitle = "LF15D"; } String oppTypo = null; boolean isCmdStasi = false; try { oppTypo = (String) Opportunity.getCustomProperty("OppCmdTypo_"); if (oppTypo.equalsIgnoreCase(typoStasi)) isCmdStasi = true; } catch (FieldNotInitializedException e) { } boolean isNotifierStaci = false; try { isNotifierStaci = ((Boolean)Opportunity.getCustomProperty("OppSTACINotification_")).booleanValue(); } catch (FieldNotInitializedException e) { isNotifierStaci = false; } %> <script type="text/javascript" language="javascript"> function createAlarm() { window.open('<fl:link url="/create_alarm_popup.fl?popup=1"/>&initOppID=<fl:getProperty name="Opportunity" property="OppID" alt=""/>', 'create_alarm', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=800,height=400'); } function modifyAlarm() { window.open('<fl:link list="true" url="<%= \"/edit_alarm_popup.fl?popup=1&id=\" + almID %>"/>', 'create_alarm', 'menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes,width=550,height=800'); } function doDelete() { if (confirm('<fl:getMessage code="M2004" alt="Etes-vous sûr de vouloir supprimer?" js="true"/>')) { window.parent.location = '<fl:link url="<%= \"/delete_opportunity.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>'; } } function doWordOpportunity(id,obj,informat,version) { format = "Word"; if (informat && informat == "PDF") { format = "PDF"; } window.open('<fl:webapp/>/fusion_document_opportunity.fl?typOppDoc=' + version + '&format=' + format + '&idObj='+id+'&object='+obj, 'listOpp', 'menubar=no,status=no,toolbar=no,scrollbars=auto,resizable=yes,width=860,height=460'); } function products() { var oppid=$('input[name$="id"]').val(); if (oppid!= '') { window.open('<fl:link list="false" url="<%= \"/edit_productopportunity.fl?\" %>"/>&OppID=' + oppid,'ChoixProduit', 'width=1024,height=668,resizable'); } } function saveNewOppAndOpenProducts() { if (!doSubmit()) { return; } var mf = document.forms[0]; var strUrl = '<fl:link url="/save_newopportunity_show_products_ajax.fl?type=Opportunity&$$presentFields="/>'; var oppTitle = mf.OppTitle.value; if (oppTitle != '') { strUrl += '&OppTitle=' + escape(oppTitle); } var oppPerID = mf.OppPerID.value; if (oppPerID != null && oppPerID != '') { strUrl += '&OppPerID=' + oppPerID; } var oppEntID = mf.OppEntID.value; if (oppEntID != null && oppEntID != '') { strUrl += '&OppEntID=' + oppEntID; } var oppStoID = mf.OppStoID.value; if (oppStoID == null || oppStoID == '') { oppStoID = '<%= needDetected %>'; } strUrl += '&OppStoID=' + oppStoID; doAjax(strUrl); } </script> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1 actions_nolabel"> <%-- <a class="doc_fusion word" title="<fl:getMessage code="L6126" alt="Générer Document Word"/>" href="javascript:doWord('<fl:getProperty name="Opportunity" property="OppID" alt=""/>','Opportunity','Word');"> <img src="<fl:webapp/>/icons/ico_word_inv.gif" border=0 width="15" height="15" alt="<fl:getMessage code="L6126" alt="Générer Document Word"/>"> </a> <a class="doc_fusion pdf" title="<fl:getMessage code="L6557" alt="Générer Document PDF"/>" href="javascript:doWord('<fl:getProperty name="Opportunity" property="OppID" alt=""/>','Opportunity', 'PDF');"> <img src="<fl:webapp/>/icons/ico_acrobat_inv.gif" border=0 width="15" height="15" alt="<fl:getMessage code="L6557" alt="Générer Document PDF"/>"> </a> --%> </div> </td> <td class="actions_cell_right"></td> </tr> <tr> <td class="actions_cell_left"> </td> <td> <div class="actions_tablecell_1"> <a href="javascript:doWordOpportunity('<fl:getProperty name="Opportunity" property="OppID" alt=""/>','Opportunity', 'PDF', '<%=typeOppDocument%>');"/> <img src="<fl:webapp/>/icons/ico_acrobat_inv.gif" style="width: 15; height: 15;" alt="<fl:getMessage code="<%=pdfTitle%>" alt="Visualiser le PDF"/>" title="<fl:getMessage code="<%=pdfTitle%>" alt="Visualiser le PDF"/>"> <p class="actions_tabletext"><fl:getMessage code="<%=pdfTitle%>" alt="Visualiser le PDF"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> <fl:access name="Opportunity" operation="edit"> <tr> <td class="actions_cell_left"> </td> <td> <div class="actions_tablecell_1"> <a href="javascript:sendMailOpportunityWithDocuments('<%= id %>', 'Opportunity', '<%=typeOppDocument%>', 'OppEntID:EntBillingMail_' , 'OppPerID:PerMail');"/> <img src="<fl:webapp/>/icons/ico_interaction/mail.png" style="width: 15; height: 15;" alt="<fl:getMessage code="<%=mailTitle%>" alt="Visualiser le PDF"/>" title="<fl:getMessage code="<%=mailTitle%>" alt="Visualiser le PDF"/>"> <p class="actions_tabletext"><fl:getMessage code="<%=mailTitle%>" alt="Visualiser le PDF"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> </fl:access> <fl:access operation="edit" name="Interaction"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="<%= \"/envoyer_opportunity_courrier_unitaire.fl\" + (id != null? \"?id=\" + id : \"\") %>"/>"> <img src="<fl:webapp/>/icons/ico_interaction/alerte_courrier.gif" style="width: 15; height: 15;" alt="<fl:getMessage code="<%=courrierTitle%>" alt="Envoyer le Courrier"/>" title="<fl:getMessage code="<%=courrierTitle%>" alt="Envoyer le Courrier"/>"> <p class="actions_tabletext"><fl:getMessage code="<%=courrierTitle%>" alt="Envoyer le Courrier"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> </fl:access> <% if((statutID != null) && (!isValid)){ %> <fl:access operation="edit" name="Opportunity"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link list="true" url="<%= \"/edit_opportunity.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="A0008" alt="Modifier"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> </fl:access> <fl:access operation="delete" name="Opportunity"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:doDelete();"/> <p class="actions_tabletext"><fl:getMessage code="A0007" alt="Supprimer"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> </fl:access> <%} %> <fl:access operation="create" name="Interaction"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="/create_interaction.fl?" />&IntType_=<%= corrID %>&initIntOppID=<%= id %>"> <p class="actions_tabletext"><fl:getMessage code="LF034" alt="Correspondance"/> +</p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> </fl:access> <% if (!existsAlert) { %> <fl:access name="Alarm" operation="create"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:createAlarm()"> <p class="actions_tabletext"><fl:getMessage code="L62E7" alt="Créer alerte"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> </fl:access> <% } else { %> <fl:access name="Alarm" operation="create"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:modifyAlarm()"> <p class="actions_tabletext"><fl:getMessage code="L62F3" alt="Modifier alerte"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> </fl:access> <% } %> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> <% if((statutID != null) && (statutID.equalsIgnoreCase(devisState))) { %> <fl:access operation="edit" name="Opportunity"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="<%= \"/valider_devis_opportunity.fl\" + (id != null? \"?initOppID=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="FF136" alt="Valider le Devis"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> </fl:access> <%} else if((statutID != null) && (statutID.equalsIgnoreCase(commandeState))) { %> <% if(isNotifierStaci && isCmdStasi) { %> <fl:access operation="edit" name="Opportunity"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:sendMailOpportunityWithDocuments('<%= id %>', 'Opportunity', '<%=notifStaciDocTyp%>', '' , '');"/> <img src="<fl:webapp/>/icons/ico_interaction/mail.png" style="width: 15; height: 15;" alt="<fl:getMessage code="FF1A9" alt="Notifier STACI"/>" title="<fl:getMessage code="FF1A9" alt="Notifier STACI"/>"> <p class="actions_tabletext"><fl:getMessage code="FF1A9" alt="Notifier STACI"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> </fl:access> <%} %> <fl:access operation="edit" name="Opportunity"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="<%= \"/valider_commande_opportunity.fl\" + (id != null? \"?initOppID=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="FF138" alt="Valider la Commande"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> </fl:access> <fl:access operation="edit" name="Opportunity"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:doWordOpportunity('<fl:getProperty name="Opportunity" property="OppID" alt=""/>','Opportunity', 'PDF', '<%=etiqMasseDocTyp%>');"/> <img src="<fl:webapp/>/icons/ico_word.gif" style="width: 15; height: 15;" alt="<fl:getMessage code="LF167" alt="Imprimer l'étiquette"/>" title="<fl:getMessage code="LF167" alt="Imprimer l'étiquette"/>"> <% if (!isValidEtiq) {%> <p class="actions_tabletext"><fl:getMessage code="LF167" alt="Imprimer l'étiquette"/></p> <%} else { %> <p class="actions_tabletext"><fl:getMessage code="LF169" alt="Ré-Imprimer l'étiquette"/></p> <%} %> </a> </div> </td> <td class="actions_cell_right"></td> </tr> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> </fl:access> <% if (!isValidEtiq) { %> <fl:access operation="edit" name="Opportunity"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="<%= \"/valider_impression_etiquette.fl\" + (id != null? \"?initOppID=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="LF168" alt="Valider l'mpression de l'étiquette"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> </fl:access> <%} %> <%} else if((statutID != null) && (statutID.equalsIgnoreCase(factureState)) && (!oppFactAvoir.equalsIgnoreCase("true"))) { %> <% if(isValid){ %> <fl:access operation="edit" name="Opportunity"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="/create_opportunity.fl?" />&initOppFactAvoir_=true&initOppStoID=<%= factureState %>"> <p class="actions_tabletext"><fl:getMessage code="LF151" alt="Créer un Avoir"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> </fl:access> <% } %> <% if(!isValid){ %> <fl:access operation="edit" name="Opportunity"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="<%= \"/valider_facture_opportunity.fl\" + (id != null? \"?initOppID=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="FF200" alt="Valider la facture"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> </fl:access> <%}} %> <fl:getProcessList nbEntry="4" withSeparation="true"/>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de