<%
/******************************************************************************
 * 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.Catalogue_Bean"%>
<%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %>
<jsp:useBean class="com.edeal.frontline.custom.Catalogue_Bean" id="Catalogue_" 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;
	

	try {
	    id = Catalogue_.getID();
	} catch (FieldNotInitializedException fnie) {}

	
%>
<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_catalogue_.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');
}

</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="Catalogue_" property="Cg_ID" alt=""/>','Catalogue_','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>&nbsp;
				<a  class="doc_fusion pdf" title="<fl:getMessage code="L6557" alt="Générer Document PDF"/>" href="javascript:doWord('<fl:getProperty name="Catalogue_" property="Cg_ID" alt=""/>','Catalogue_', '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>

<fl:access operation="edit" name="Catalogue_">
    <tr>
        <td class="actions_cell_left"></td>
        <td>
            <div class="actions_tablecell_1">
                <a href="<fl:link list="true" url="<%= \"/edit_catalogue_.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="Catalogue_">
    <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>
