Edit C:\galaxie\Back\galaxie\sales\giftcheque_\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="java.util.Date"%> <%@ page import="java.util.Vector"%> <%@ page import="com.edeal.frontline.FieldNotInitializedException"%> <%@ page import="com.edeal.frontline.custom.GiftCheque_Bean"%> <%@ page import="com.edeal.frontline.ActorBean"%> <%@ page import="com.edeal.frontline.FrontlineException" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <jsp:useBean class="com.edeal.frontline.custom.GiftCheque_Bean" id="GiftCheque_" 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 roleADM = false; // 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"); } } } // on vérifie si l'acteur est du rôle ADM_CC try { ActorBean act = new ActorBean(actID, context); Vector<String> actRolesIDs = new Vector<String>(); // On récupère les roles actRolesIDs.addAll(act.getRoles()); String roleADMCCID = dico.getRefIdByCode("ActRoles", "ADM_CC"); /* Role Administrateur chèque cadeaux*/ String actRoleIDactuel = null; if(!(actRolesIDs.isEmpty())) { // on parcours les rôles for (int i = 0; i < actRolesIDs.size(); i++) { actRoleIDactuel = (String) actRolesIDs.elementAt(i); if(actRoleIDactuel.equals(roleADMCCID)) { roleADM = true; } } } } catch (FieldNotInitializedException e) { } catch (FrontlineException e) { } try { id = GiftCheque_.getID(); } catch (FieldNotInitializedException fnie) {} // ramener les ids des 13 états possibles du Dossier /* CR Crée TP A imprimer PR Imprimé IN Facturé PO Pointé TB A payer KO Invalidé OT Périmé NU Inutilisable PA Payé RE Remplacé */ String cheqCreeStateID = null; String cheqAimpStateID = null; String cheqimpStateID = null; String cheqFactStateID = null; String cheqPointeStateID = null; String cheqApayerStateID = null; String cheqInvalideStateID = null; String cheqPerimeStateID = null; String cheqInutilisableStateID = null; String cheqPayeStateID = null; String cheqRemplaceStateID = null; try { cheqCreeStateID = dico.getRefIdByCode("Ch_", "Te1", "CR"); cheqAimpStateID = dico.getRefIdByCode("Ch_", "Te1", "TP"); cheqimpStateID = dico.getRefIdByCode("Ch_", "Te1", "PR"); cheqFactStateID = dico.getRefIdByCode("Ch_", "Te1", "IN"); cheqPointeStateID = dico.getRefIdByCode("Ch_", "Te1", "PO"); cheqApayerStateID = dico.getRefIdByCode("Ch_", "Te1", "TB"); cheqInvalideStateID = dico.getRefIdByCode("Ch_", "Te1", "KO"); cheqPerimeStateID = dico.getRefIdByCode("Ch_", "Te1", "OT"); cheqInutilisableStateID = dico.getRefIdByCode("Ch_", "Te1", "NU"); cheqPayeStateID = dico.getRefIdByCode("Ch_", "Te1", "PA"); cheqRemplaceStateID = dico.getRefIdByCode("Ch_", "Te1", "RE"); } catch (Exception e) { cheqCreeStateID = ""; cheqAimpStateID = ""; cheqimpStateID = ""; cheqFactStateID = ""; cheqPointeStateID = ""; cheqApayerStateID = ""; cheqInvalideStateID = ""; cheqPerimeStateID = ""; cheqInutilisableStateID = ""; cheqPayeStateID = ""; cheqRemplaceStateID = ""; } // Détecter l'état du Chèque cadeau String statutID = null; try { statutID = GiftCheque_.getGchStatusID(); } catch (FieldNotInitializedException e) { statutID = ""; } Boolean invPopup = true; String idGch = null; try { idGch = GiftCheque_.getGchCgcID(); } catch (FieldNotInitializedException e) { invPopup = false; } Boolean invalidateState = false; if(cheqInvalideStateID.equals(statutID)){ invalidateState = true; } // Détecter l'état de validité du chèque cadeau Boolean valide = true; try { Date dateValidite = GiftCheque_.getGchValidityDt(); // Date du jour : Date dateDuJour = new Date(); if(dateValidite != null && dateValidite.before(dateDuJour)){ valide = false; } } catch (FieldNotInitializedException e) { } // On récupère l'ID du tiers UseWith String adhID = null; try { adhID = GiftCheque_.getGchUseWithAdherent(); } 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="<%= \"/delete_giftcheque_.fl?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 bordereau() { window.open('<fl:link list="false" url="<%= \"/choisir_bordereau_.fl?$$presentFields=&id=\" + id %>"/>','GiftCheque_', 'width=750,height=310,scrollbars=yes,resizable=yes,toolbar=no'); } function imputerCheque() { window.open('<fl:link list="false" url="<%= \"/choisir_cheque_impute_.fl?$$presentFields=&id=\" + id %>"/>','GiftCheque_', 'width=750,height=310,scrollbars=yes,resizable=yes,toolbar=no'); } function adherent() { window.open('<fl:link list="false" url="<%= \"/choisir_adherent_.fl?$$presentFields=&id=\" + id %>"/>','GiftCheque_', 'width=750,height=310,scrollbars=yes,resizable=yes,toolbar=no'); } function cheqperime() { var conf = confirm('Le chèque cadeau est périmé. Voulez-vous le remplacer?'); if (conf) { window.parent.location = '<fl:link url="<%= \"/remplacer_giftcheque_.fl?id=\" + id%>"/>'; } } function invaliderChequeCadeau() { if(<%=invPopup%>) { var args = '&initGchID=' + '<%=id%>'; args = args + '&id=' + "<%=idGch%>"; var link = '<fl:link list="false" url="/demander_num_invalider.fl?$$presentFields="/>' + args; //alert(link); window.open(link, 'CmdGiftCheque_', 'width=750,height=310,scrollbars=yes,resizable=yes,toolbar=no'); } else { window.parent.location = '<fl:link url="<%= \"/invalider_giftcheque_.fl?id=\" + id%>"/>'; } } function remplacerChequeCadeau() { if(<%=invPopup%>) { var args = '&initGchID=' + '<%=id%>'; args = args + '&id=' + "<%=idGch%>"; var link = '<fl:link list="false" url="/demander_num_remplacer.fl?$$presentFields="/>' + args; //alert(link); window.open(link, 'CmdGiftCheque_', 'width=750,height=310,scrollbars=yes,resizable=yes,toolbar=no'); } else { //alert('dddddddddddd'); window.parent.location = '<fl:link url="<%= \"/remplacer_giftcheque_.fl?id=\" + id%>"/>'; } } </script> <% if(cheqCreeStateID.equalsIgnoreCase(statutID) || cheqAimpStateID.equalsIgnoreCase(statutID)) { %> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link list="true" url="<%= \"/edit_giftcheque_.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> <!-- <span> <a class="doc_fusion word" title="<fl:getMessage code="L6126" alt="Générer Document Word"/>" href="javascript:doWord('<fl:getProperty name="GiftCheque_" property="GchID" alt=""/>','GiftCheque_','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="GiftCheque_" property="GchID" alt=""/>','GiftCheque_', '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> --> <td class="actions_cell_left"></td> <td class="actions_tablecell_seperator"></td> <td class="actions_cell_right"></td> </tr> </fl:access> <%} %> <% if(cheqCreeStateID.equalsIgnoreCase(statutID)) { %> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link list="true" url="<%= \"/aimprimer_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="LF123" alt="Le chèque est à 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> <%} else if(cheqAimpStateID.equalsIgnoreCase(statutID)) { %> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link list="true" url="<%= \"/imprimer_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="LF120" alt="Imprimer le chèque"/></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(cheqimpStateID.equalsIgnoreCase(statutID)) { %> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link list="true" url="<%= \"/facturer_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="LF1CD" alt="Le chèque a été facturé" /></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(cheqPointeStateID.equalsIgnoreCase(statutID)) { %> <%-- <fl:access operation="edit" name="PaymentSlip_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:bordereau()"> <p class="actions_tabletext"><fl:getMessage code="LF126" alt="Ajouter à un bordereau Existant" js="true"/></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="PaymentSlip_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link url="/create_paymentslip_.fl?" />&initGchUseWithAdherentID=<%=adhID%>&initGchID=<%= (id == null ? "" : id) %>"> <p class="actions_tabletext"><fl:getMessage code="LF125" alt="Ajouter à un nouveau bordereau"/></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(cheqFactStateID.equalsIgnoreCase(statutID)) { %> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <% if(valide){%> <div class="actions_tablecell_1"> <a href="javascript:adherent()"> <p class="actions_tabletext"><fl:getMessage code="LF128" alt="Pointer le chèque Cadeau" js="true"/></p> </a> </div> <%} else { %> <div class="actions_tablecell_1"> <a href="javascript:cheqperime()"> <p class="actions_tabletext"><fl:getMessage code="LF128" alt="Pointer le chèque Cadeau" js="true"/></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(valide && adhID != null){%> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link list="true" url="<%= \"/pointer_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="LF1D0" alt="Valider le pointage du chèque" /></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="javascript:remplacerChequeCadeau()"> <%-- <a href="<fl:link list="true" url="<%= \"/remplacer_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> --%> <p class="actions_tabletext"><fl:getMessage code="LF129" alt="Remplacer le chèque" /></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 list="true" url="<%= \"/perimer_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="LF141" alt="Rendre le chèque périmé" /></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 list="true" url="<%= \"/inutiliser_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="LF142" alt="Rendre le chèque inutilisable" /></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(cheqPerimeStateID.equalsIgnoreCase(statutID)) { %> <%-- <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="<fl:link list="true" url="<%= \"/payer_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> <p class="actions_tabletext"><fl:getMessage code="FF1E7" alt="Payer le chèque" /></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="javascript:adherent()"> <p class="actions_tabletext"><fl:getMessage code="LF128" alt="Pointer le chèque Cadeau" js="true"/></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="javascript:remplacerChequeCadeau()"> <!-- <a href="<fl:link list="true" url="<%= \"/remplacer_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> --> <p class="actions_tabletext"><fl:getMessage code="LF129" alt="Remplacer le chèque" /></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(cheqCreeStateID.equalsIgnoreCase(statutID) || cheqimpStateID.equalsIgnoreCase(statutID) || cheqAimpStateID.equalsIgnoreCase(statutID)) { %> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:invaliderChequeCadeau()"> <%-- <a href="<fl:link list="true" url="<%= \"/invalider_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> --%> <p class="actions_tabletext"><fl:getMessage code="LF122" alt="Invalider le chèque"/></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(roleADM && !invalidateState) { %> <fl:access operation="edit" name="GiftCheque_"> <tr> <td class="actions_cell_left"></td> <td> <div class="actions_tablecell_1"> <a href="javascript:imputerCheque()"> <%-- <a href="<fl:link list="true" url="<%= \"/remplacer_giftcheque_.fl\" + ( id != null ? \"?id=\" + id : \"\") %>"/>"> --%> <p class="actions_tabletext"><fl:getMessage code="LF143" alt="Ré-imputer le chèque"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> </fl:access> <%} %> <%-- 40745 : Demande de suppression de chèques cadeaux --%> <fl:access operation="delete" name="GiftCheque_"> <% if((roleADM && !invalidateState) || cheqCreeStateID.equalsIgnoreCase(statutID) || cheqimpStateID.equalsIgnoreCase(statutID) || cheqAimpStateID.equalsIgnoreCase(statutID)){ %> <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:doDelete();"> <p class="actions_tabletext"><fl:getMessage code="A0007" alt="Supprimer"/></p> </a> </div> </td> <td class="actions_cell_right"></td> </tr> </fl:access>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de