Edit C:\galaxie\deploy\Tomcat6\webapps\galaxie\sales\person\read_action.jsp
<%@ page import="com.edeal.frontline.helper.MultifunctionHelper"%> <%@ page import="com.edeal.frontline.helper.ContextHelper"%> <%@ page session="true" import="com.edeal.frontline.*"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.custom.*" %> <%@ page import="com.edeal.frontline.helper.custom.DocumentHelper" %> <%@ page import="com.edeal.frontline.ActorBean"%> <%@ page import="com.edeal.frontline.EnterpriseBean"%> <%@ page import="java.util.Vector" %> <%@ page import="com.edeal.frontline.helper.custom.Contrat_Helper" %> <%@ taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.PersonBean" id="Person" 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 = Person.getID(); } catch (FieldNotInitializedException e) { id = null; } String entID; try { entID = Person.getPerEntID(); } catch (FieldNotInitializedException e) { entID = null; } // On récupère l'ID de l'acteur connecté 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 corrID; try { corrID = dico.getRefIdByCode("IntType_", "COR"); } catch (FieldNotInitializedException e) { corrID = ""; } String deleteUrl = ""; // l'id de la fonction "guest" String guestFctID; try { guestFctID = dico.getRefIdByCode("PerFctID", "GST"); } catch (FieldNotInitializedException e) { guestFctID = ""; } // on récupère la fonction du contact String perFctID; try { perFctID = Person.getPerFctID(); } catch (FieldNotInitializedException e) { perFctID = null; } if (ContextHelper.hasMultifunction(context)) { if (ContextHelper.isB2C(context)) { deleteUrl = "/delete_function_b2c.fl"; } else { deleteUrl = "/delete_function.fl"; } } else { if (ContextHelper.isB2C(context)) { deleteUrl = "/delete_person_b2c.fl"; } else { deleteUrl = "/delete_person.fl"; } } String perFctParentID = null; if (ContextHelper.hasMultifunction(context)) { try { perFctParentID = Person.getPerFctParentID(); } catch (FieldNotInitializedException e){ } } Boolean isArchived = false; try { isArchived = Person.isPerFctIsActive(); } catch (FieldNotInitializedException e) { } MultifunctionHelper mltFunHlp = new MultifunctionHelper(Person); //Gestion des droits spécifiques pour la modif du contact //vérifier le tiers du contact, selon ce tiers on va decider si on peut ou non modifier le contact Boolean modifOk = true; Boolean kdoOK = false; String typOrganisation = ""; String ct_id = null; Boolean isAssociation = false; Boolean isPartenaire = false; Boolean isLogis = false; Boolean isProspect = false; try { EnterpriseBean ent = null; try{ ent = Person.getPerEnterprise(); } catch(FieldNotInitializedException ex) { } // rappatrier le type d'entreprise if(ent != null) { typOrganisation = ent.getEntTyeID(); } try { ActorBean act = new ActorBean(actID, context); Vector<String> actRolesIDs = new Vector<String>(); // On récupère les roles actRolesIDs.addAll(act.getRoles()); String roleADMID = dico.getRefIdByCode("ActRoles", "ADMIN"); /* Role Administrateur*/ String roleTECHADMID = dico.getRefIdByCode("ActRoles", "S_ADM_TECH"); /* Role Administrateur Technique*/ String roleAdmFINID = dico.getRefIdByCode("ActRoles", "A_RESP_ADM_FIN"); /* resp adm et finance */ String roleComptaID = dico.getRefIdByCode("ActRoles", "A_RESP_COMP"); /* resp compta */ String roleAssComptaID = dico.getRefIdByCode("ActRoles", "A_ASSIST_COMP"); /* resp ass compta */ String roleADMKDOID = dico.getRefIdByCode("ActRoles", "ADM_CC"); /* Role Administrateur Technique*/ String roleCommercialID = dico.getRefIdByCode("ActRoles", "COMMERCIAL"); /* Commercial */ String rolerespAffID = dico.getRefIdByCode("ActRoles", "R_RESP_RES_AFFIL"); /* Role Responsable Affilies */ String roleRespChargDevID = dico.getRefIdByCode("ActRoles", "P_RESP_CHARG_DEV"); /* Role responsable chargé de Dev */ String roleAssistChargDevID = dico.getRefIdByCode("ActRoles", "P_ASSIST_CHARG_DEV"); /* Role Assistant chargé de Dev */ String consTechID = dico.getRefIdByCode("ActRoles", "C_CONS_TECH"); /* Role Conseiller Technique */ String assoSalID = dico.getRefIdByCode("ActRoles", "ASSO_SAL"); /* Role Association avec Salarié */ String assoSansSalID = dico.getRefIdByCode("ActRoles", "ASSO_SANS_SAL"); /* Role Association sans Salarié*/ String attDirection = dico.getRefIdByCode("ActRoles", "D_ATTACH_DIR"); /* Role Attache de Direction*/ String secrDirection = dico.getRefIdByCode("ActRoles", "D_SECR_DIR"); /* Role Secretariat de direction */ String resQuiviQualite = dico.getRefIdByCode("ActRoles", "Q_RESP_SUIVI_QUAL"); /* Role Secretariat de direction */ if(!(actRolesIDs.isEmpty())) { // on prend le 1er role de l'acteur connecté String actRoleIDactuel = actRolesIDs.get(0).toString(); // on distingue le type du Tiers avec lequel on a affaire isAssociation = typOrganisation.equals((String)dico.getRefIdByCode("EntTyeID", "ASSO")); isPartenaire = typOrganisation.equals((String)dico.getRefIdByCode("EntTyeID", "PART")); // savoir si on a un affilié Contrat_Bean ctrB = new Contrat_Bean(context); Contrat_Helper ct_help = new Contrat_Helper(ctrB); //ct_id = ct_help.getActifContractID(context, entID); LE et L ct_id = ct_help.getActifAdhContractID(context, entID); // Tout sauf FA, PR et PT if (ct_id != null) { // le tiers est un logis isLogis = true; } else if (!isAssociation && !isPartenaire && ct_id == null) { // le tiers est un prospect isProspect = true; } /* // le cas d'un contact qui est relié à un partenaire if(actRoleIDactuel.equals(roleCommercialID) && isPartenaire) { modifOk = true; } else if ((actRoleIDactuel.equals(attDirection) || actRoleIDactuel.equals(secrDirection)) && isAssociation) { modifOk = true; } else if ((actRoleIDactuel.equals(rolerespAffID) || actRoleIDactuel.equals(roleRespChargDevID)) && isLogis) { modifOk = true; } else if ((actRoleIDactuel.equals(roleRespChargDevID) || actRoleIDactuel.equals(consTechID) || actRoleIDactuel.equals(assoSalID) || actRoleIDactuel.equals(assoSansSalID) ) && isProspect) { modifOk = true; } else if (entID == null && (actRoleIDactuel.equals(roleRespChargDevID) || actRoleIDactuel.equals(resQuiviQualite) || actRoleIDactuel.equals(consTechID) || actRoleIDactuel.equals(assoSalID) || actRoleIDactuel.equals(assoSansSalID)) ){ // un Guest modifOk = true; } else if ( (actRoleIDactuel.equals(roleADMID) || actRoleIDactuel.equals(roleTECHADMID)) ){ // un Guest modifOk = true; kdoOK=true; }else if ( (actRoleIDactuel.equals(roleAdmFINID) || actRoleIDactuel.equals(roleComptaID) || actRoleIDactuel.equals(roleAssComptaID) || actRoleIDactuel.equals(roleADMKDOID)) ){ kdoOK=true; modifOk = true; } */ if ( (actRoleIDactuel.equals(roleADMID) || actRoleIDactuel.equals(roleTECHADMID)) ){ // un Guest kdoOK=true; }else if ( (actRoleIDactuel.equals(roleAdmFINID) || actRoleIDactuel.equals(roleComptaID) || actRoleIDactuel.equals(roleAssComptaID) || actRoleIDactuel.equals(roleADMKDOID)) ){ kdoOK=true; } } } catch (FrontlineException e) { } } catch (FieldNotInitializedException e) { } %> <script language="javascript"> function doDelete() { if (confirm('<fl:getMessage code="M2004" alt="Etes-vous sûr de vouloir supprimer?" js="true"/>')) { window.parent.location = '<fl:link url="<%= deleteUrl + ( id != null ? \"?id=\" + id : \"\") %>"/>'; } } function doWord(id,obj,informat) { format = "Word"; if (informat && informat == "PDF") { format = "PDF"; } window.open('<fl:webapp/>/fusion_document_person.fl?format=' + format + '&idObj='+id+'&object='+obj, 'listOpp', 'menubar=no,status=no,toolbar=no,scrollbars=auto,resizable=yes,width=860,height=460'); } function fichier() { window.open('<fl:link list="false" url="<%= \"/addfile_person.fl?$$presentFields=&id=\" + id %>"/>','Fichier', 'width=450,height=200,scrollbars=yes,resizable=no,toolbar=no'); } // 0038935: CTC Questionnaire de satisfaction // http://u-project2.umanis.com/view.php?id=38935 function doInscription() { window.open('<fl:webapp/>/edit_personevent_per.fl?initPerID=<%= id == null ? "" : id %>' , '<fl:getMessage code="MF17B" alt="Envoyer un questionnaire"/>', 'width=800,height=300,menubar=no,status=no,toolbar=no,scrollbars=auto,resizable=no'); } </script> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1 actions_nolabel" style="padding-left:0px;"> <%-- <span> <% if (ContextHelper.hasMultifunction(context)) { if (isArchived) { %> <a style="text-align: left;" href="<fl:link list="true" menu="true" url="<%= \"/read_person_consolidated.fl?id=\" + perFctParentID %>"/>"> <img src="<fl:webapp/>/icons/functionbar/consolidated_function.png" style="width: 15; height: 15;" alt="<fl:getMessage code="A4011" alt="Vue consolidée"/>" title="<fl:getMessage code="A4011" alt="Vue consolidée"/>"> </a> <a href="<fl:webapp/>/create_person.fl?PerFctParentID=<%= perFctParentID %>"> <img src="<fl:webapp/>/icons/functionbar/create_function.png" style="width: 15; height: 15;" alt="<fl:getMessage code="AA001" alt="Fonction +"/>" title="<fl:getMessage code="AA001" alt="Fonction +"/>"> </a> <%-- <a href="<fl:link list="true" menu="true" url="<%= \"/archive_function.fl?id=\" + id %>"/>"> <img src="<fl:webapp/>/icons/functionbar/archive_function.png" style="width: 15; height: 15;" alt="<fl:getMessage code="AA002" alt="Archiver fonction"/>" title="<fl:getMessage code="AA002" alt="Archiver fonction"/>"> </a> <% } else { %> <a href="<fl:link list="true" menu="true" url="<%= \"/reactive_function.fl?id=\" + id %>"/>"> <img src="<fl:webapp/>/icons/functionbar/create_function.png" style="width: 15; height: 15;" alt="<fl:getMessage code="LF00A" alt="Réactiver fonction"/>" title="<fl:getMessage code="LF00A" alt="Réactiver fonction"/>"> </a> <% } } %> </span> --%> <% if (DocumentHelper.hasDocumentWordML(session, context, "Person")) { %> <span> <a class="doc_fusion word" title="<fl:getMessage code="L6126" alt="Générer Document Word"/>" href="javascript:doWord('<fl:getProperty name="Person" property="PerID" alt=""/>','Person','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="Person" property="PerID" alt=""/>','Person', '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> </span> <% } %> <span> <fl:access name="Interaction" operation="create"> <a class="doc_fusion pdf" title="<fl:getMessage code="F808B" alt="Envoyer par e-mail"/>" href="javascript:sendMailWithDocuments('<%= id %>', 'Person', null, 'PerMail')"> <img src="<fl:webapp/>/icons/ico_interaction/mail.png" border="0" width="15"height="15" alt="<fl:getMessage code="F808B" alt="Envoyer par e-mail"/>"> </a> </fl:access> </span> </div> </td> <td class="actions_cell_right"></td> </tr> <% if(modifOk == true) {%> <fl:access operation="edit" name="Person"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link list="true" url="<%= \"/edit_person.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> </fl:access> <fl:access operation="delete" name="Person"> <tr> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </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> <%if(perFctParentID != null){ %> <tr> <td class="actions_cell_left"> </td> <td> <div class="actions_tablecell_1"> <a href="<fl:webapp/>/create_person.fl?PerFctParentID=<%= perFctParentID %>"/> <img src="<fl:webapp/>/icons/functionbar/create_function.png" style="width: 15; height: 15;" alt="<fl:getMessage code="AA001" alt="Fonction +"/>" title="<fl:getMessage code="AA001" alt="Fonction +"/>"> <p class="actions_tabletext"><fl:getMessage code="AA001" alt="Fonction +"/></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> <% } %> <%} %> <% if (isArchived) { %> <%-- Devis + Commande --%> <fl:access operation="create" name="Opportunity"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="/create_opportunity.fl?" />&initOpp=DEV&initOppPerID=<%= id %>&initOppEntID=<%= (entID == null ? "" : entID) %>"> <p class="actions_tabletext"><fl:getMessage code="L653F" alt="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> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="/create_opportunity.fl?" />&initOpp=ORD&initOppPerID=<%= id %>&initOppEntID=<%= (entID == null ? "" : entID) %>"> <p class="actions_tabletext"><fl:getMessage code="LF035" alt="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> <% if( !guestFctID.equalsIgnoreCase(perFctID)) { %> <fl:access operation="create" name="Contrat_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="<%= \"/create_contrat_contact_.fl\" + ( id != null ? \"?initSgContact=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="LF015" alt="Contrat"/> +</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> <% } %> <% //http://u-project2.umanis.com/view.php?id=38935 // 0038935: CTC Questionnaire de satisfaction } %> <fl:access operation="create" name="PersonEvent"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:doInscription();"> <p class="actions_tabletext"><fl:getMessage code="MF17B" alt="Envoyer un questionnaire"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> <% if(isArchived){ %> <tr> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> <% } %> </fl:access> <% if(isArchived){ %> <% if(kdoOK){ %> <fl:access operation="create" name="CmdGiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="<%= \"/create_cmdgiftcheque_.fl\" + ( id != null ? \"?&initCgc=ORD&initCgcCustomer=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="FF1CA" alt="Commander des chèques cadeaux"/></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 %>&initIntPerID=<%= 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> <fl:access operation="create" name="Solicitation"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="/create_solicitation.fl?initSolActID=true" />&initSolSolliciteurs_=<%= id %>"> <p class="actions_tabletext"><fl:getMessage code="L60E8" alt="Sollicitation"/> +</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="Reservation_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="/create_reservation_.fl?" />&initRs_Contact=<%= id %>"> <p class="actions_tabletext"><fl:getMessage code="LF012" alt="Réservation"/> +</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(perFctParentID != null){ %> <tr> <td class="actions_cell_left"> </td> <td> <div class="actions_tablecell_1"> <a href="<fl:webapp/>/read_person_consolidated.fl?id=<%= perFctParentID %>"/> <img src="<fl:webapp/>/icons/functionbar/consolidated_function.png" style="width: 15; height: 15;" alt="<fl:getMessage code="A4011" alt="Vue consolidée"/>" title="<fl:getMessage code="A4011" alt="Vue consolidée"/>"> <p class="actions_tabletext"><fl:getMessage code="A4011" alt="Vue consolidée"/></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> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link list="true" url="<%= \"/perquicklook.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="L7009" alt="Quicklook"/></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 operation="edit" name="Person"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:fichier()"> <p class="actions_tabletext"><fl:getMessage code="FF0BE" alt="Fichier +"/></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> --%> <%-- <% boolean salesInvestIsActive = SalesInvestBean.isSalesInvestActive(context); if (salesInvestIsActive) { %> <fl:access name="SalesInvest" operation="create"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="<%= \"/create_salesinvest.fl\" + ( id != null ? \"?SinPerID=\" + id : \"\") + ( entID != null ? \"&SinEntID=\" + entID : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="L64EC" alt="Invest. ciaux"/> +</p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> </fl:access> <% } %> --%> <% } %> <%-- <%@include file="/marketing/formresponse/person_read_action.jsp" %> --%>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de