Edit C:\galaxie\Back\galaxie\sales\cmdgiftcheque_\read_action.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"%> <%@ 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.custom.CmdGiftCheque_Bean"%> <%@ page import="com.edeal.frontline.custom.TmpGiftCheques_Bean"%> <%@ page import="com.edeal.frontline.custom.GiftCheque_Bean"%> <%@ page import="com.edeal.frontline.ActorBean"%> <%@ page import="com.edeal.frontline.FrontlineException"%> <%@ page import="java.util.Vector" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.custom.CmdGiftCheque_Bean" id="CmdGiftCheque_" 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; Boolean modifOK = false; try { id = CmdGiftCheque_.getID(); } catch (FieldNotInitializedException fnie) {} Boolean ccGen = false; try { ccGen = CmdGiftCheque_.isCgcGeneratedCcs(); } catch (FieldNotInitializedException fnie) {} Boolean existeCcs = false; // Verif si la commande contient des CCs if(id != null){ String[] fields = {"Tg_ID"}; String[][] query = {{"Tg_CmdGiftChequeID = '" + id + "'"}}; Vector list = TmpGiftCheques_Bean.listSummary(context, fields, query); if(list != null && !list.isEmpty()) { existeCcs = true; } } String idStatus = null; try { idStatus = dico.getRefIdByCode("GchStatusID", "TP"); } catch (FrontlineException e) { } String idStatusCree = null; try { idStatusCree = dico.getRefIdByCode("GchStatusID", "CR"); } catch (FrontlineException e) { } String idStatusImpr = null; try { idStatusImpr = dico.getRefIdByCode("GchStatusID", "PR"); } catch (FrontlineException e) { } String idStatusFact = null; try { idStatusFact = dico.getRefIdByCode("GchStatusID", "IN"); } catch (FrontlineException e) { } Boolean existeCcAimp = false; if(id != null){ String[] fields = {"GchID"}; String[][] query = {{"GchCgcID = '" + id + "'" , "GchStatusID = '" + idStatus + "'"}}; Vector list = GiftCheque_Bean.listSummary(context, fields, query); if(list != null && !list.isEmpty()) { existeCcAimp = true; } } Boolean existeCcCree = false; if(id != null){ String[] fields = {"GchID"}; String[][] query = {{"GchCgcID = '" + id + "'" , "GchStatusID = '" + idStatusCree + "'"}}; Vector list = GiftCheque_Bean.listSummary(context, fields, query); if(list != null && !list.isEmpty()) { existeCcCree = true; } } Boolean existeCcAConf = false; if(id != null){ String[] fields = {"GchID"}; String[][] query = {{"GchCgcID = '" + id + "'" , "GchConfImpr = 1"}}; Vector list = GiftCheque_Bean.listSummary(context, fields, query); if(list != null && !list.isEmpty()) { existeCcAConf = true; } } Boolean existeCcimp = false; // Verif si la commande contient des CCs à l'état à imprimer if(id != null){ String[] fields = {"GchID"}; String[][] query = {{"GchCgcID = '" + id + "'" , "GchStatusID = '" + idStatusImpr + "'"}}; Vector list = GiftCheque_Bean.listSummary(context, fields, query); if(list != null && !list.isEmpty()) { existeCcimp = true; } } Boolean existeCcfact = false; if(id != null){ String[] fields = {"GchID"}; String[][] query = {{"GchCgcID = '" + id + "'" , "GchStatusID = '" + idStatusFact + "'"}}; Vector list = GiftCheque_Bean.listSummary(context, fields, query); if(list != null && !list.isEmpty()) { existeCcfact = true; } } // 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"); } } } Boolean modiifOk = false; 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"); /* adm ckdo */ if(!(actRolesIDs.isEmpty())) { // on prend le 1er role de l'acteur connecté String actRoleIDactuel = actRolesIDs.get(0).toString(); if ( (actRoleIDactuel.equals(roleADMID) || actRoleIDactuel.equals(roleTECHADMID) || actRoleIDactuel.equals(roleAdmKDOID) || actRoleIDactuel.equals(roleAdmFINID) || actRoleIDactuel.equals(roleComptaID) || actRoleIDactuel.equals(roleAssComptaID)) ) { modiifOk = true; } } } catch (FrontlineException 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="<%= \"/delete_cmdgiftcheque_.fl?id=\" + id%>"/>'; } } function doWord(id,obj,informat) { format = "Word"; if (informat && informat == "PDF") { format = "PDF"; } window.open('<fl:webapp/>/fusion_document.fl?format=' + format + '&idObj='+id+'&object='+obj, 'listOpp', 'menubar=no,status=no,toolbar=no,scrollbars=auto,resizable=yes,width=860,height=460'); } function doWordCmdGiftCheque(id,obj,informat) { format = "Word"; if (informat && informat == "PDF") { format = "PDF"; } window.open('<fl:webapp/>/fusion_document_cmdgiftcheque.fl?format=' + format + '&idObj='+id+'&object='+obj, 'listOpp', 'menubar=no,status=no,toolbar=no,scrollbars=auto,resizable=yes,width=860,height=460'); } function generer() { window.open('<fl:link list="false" url="<%= \"/generer_gift_calage.fl?$$presentFields=&id=\" + id %>"/>','CmdGiftCheque_', 'width=750,height=310,scrollbars=yes,resizable=yes,toolbar=no'); } function confirmer() { window.location = '<fl:link url="<%= \"/confirmer_cmdgiftcheque_.fl?id=\" + id%>"/>'; } function fichier() { window.open('<fl:link list="false" url="<%= \"/addfile_cmdgiftcheque_.fl?$$presentFields=&id=\" + id %>"/>','Fichier', 'width=450,height=200,scrollbars=yes,resizable=no,toolbar=no'); } function ExportSageTimeOut(){ window.location = '<fl:link url="<%= \"/export_sage_CCadeaux.fl?&typeExport=VCC&initGchCgcID=\" + id%>"/>'; setTimeout(function(){doRefresh(); }, 3000); } function doAjaxGiftChqWord(type){ var args = '&CgcID=<%=id%>'; var ajaxURL = '<fl:link url="/update_numeros_ccs.fl?"/>' + args; if(type == "VISU") { doAjax(ajaxURL, doAjaxGiftChqWordCallbackVisu); } else if(type == "MAIL") { doAjax(ajaxURL, doAjaxGiftChqWordCallbackMail); } } function doAjaxGiftChqWordCallbackVisu(arrIndex){ if (eDealXmlhttpArr[arrIndex].readyState == 4) { hideWaiting(); doWordCmdGiftCheque('<%=id%>','CmdGiftCheque_','PDF'); } } function doAjaxGiftChqWordCallbackMail(arrIndex){ if (eDealXmlhttpArr[arrIndex].readyState == 4) { hideWaiting(); sendMailCmdGiftCheque_WithDocuments('<%=id%>', 'CmdGiftCheque_', null, 'CgcCustomer:CorPerID:PerMail'); } } function confirmerImpressionCC(){ if (confirm('<fl:getMessage code="MF0E0" alt="Etes-vous sûr de vouloir confirmer?" js="true"/>')) { window.parent.location = '<fl:link url="<%= \"/confirmerImpression_cmdgiftcheque_.fl?id=\" + id%>"/>'; } } </script> <% if(modiifOk){ %> <fl:access operation="edit" name="CmdGiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link list="true" url="<%= \"/edit_cmdgiftcheque_.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="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="/create_giftcheque_.fl?" />&initGchCgcID=<%=id%>"> <p class="actions_tabletext"><fl:getMessage code="FF1E6" alt="Chèque Cadeau +"/></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(existeCcAimp) { %> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="/imprimer_Cmdgiftcheques_.fl?" />&initGchCgcID=<%=id%>"> <p class="actions_tabletext"><fl:getMessage code="LF1E4" alt="Imprimer les Chèques cadeaux non encore imprimés"/></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(existeCcCree) { %> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="/Aimprimer_Cmdgiftcheques_.fl?" />&initGchCgcID=<%=id%>"> <p class="actions_tabletext"><fl:getMessage code="MF122" alt="Les chèques sont à imprimer"/></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(existeCcAConf) { %> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:confirmerImpressionCC()"> <p class="actions_tabletext"><fl:getMessage code="FF1CB" alt="Confirmer l'impression"/></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(!ccGen && existeCcs && !existeCcAimp){ %> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:generer()"> <%-- <a href="<fl:link url="/generer_giftcheque_.fl?" />&initGchCgcID=<%=id%>"> --%> <p class="actions_tabletext"><fl:getMessage code="LF1C5" alt="Générer les 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> <%} else if (ccGen && existeCcs && !existeCcAimp && !existeCcAConf) {%> <tr> <td class="actions_cell_left"> </td> <td> <div class="actions_tablecell_1"> <a href="javascript:doAjaxGiftChqWord('VISU');"/> <!-- <a href="javascript:doWordOpportunity('<fl:getProperty name="Opportunity" property="OppID" alt=""/>','Opportunity', 'PDF', '');"/> --> <img src="<fl:webapp/>/icons/ico_acrobat_inv.gif" style="width: 15; height: 15;" alt="<fl:getMessage code="FF228" alt="Visualiser le PDF"/>" title="<fl:getMessage code="FF228" alt="Visualiser le PDF"/>"> <p class="actions_tabletext"><fl:getMessage code="FF228" alt="Jusitificatif de paiement"/></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="javascript:doAjaxGiftChqWord('MAIL');"/> <img src="<fl:webapp/>/icons/ico_interaction/mail.png" style="width: 15; height: 15;" alt="<fl:getMessage code="LF1CA" alt="Visualiser le PDF"/>" title="<fl:getMessage code="LF1CA" alt="Visualiser le PDF"/>"> <p class="actions_tabletext"><fl:getMessage code="LF1CA" 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> <% if (existeCcimp){ %> <tr> <td class="actions_cell_left"> </td> <td> <div class="actions_tablecell_1"> <a href="javascript:confirmer()"> <p class="actions_tabletext"><fl:getMessage code="LF1E5" alt="Confirmer l'envoi du justificatif"/></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 (existeCcfact){ <tr> <td class="actions_cell_left"> </td> <td> <div class="actions_tablecell_1"> <a href="javascript:ExportSageTimeOut();"> <p class="actions_tabletext"><fl:getMessage code="LF1FA" alt="Export Sage 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 operation="delete" name="CmdGiftCheque_"> <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> <%} %> <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>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de