Edit C:\Users\Administrator\Desktop\Back\Livraison EVQG22\sales\enterprise\read_tabtauxgen.jsp
<%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.helper.ContextHelper" %> <%@page import="com.edeal.frontline.helper.custom.EnterpriseHelper"%> <%@ page import="com.edeal.frontline.*" %> <%@ page import="java.util.*" %> <%@ page import="com.edeal.frontline.grid.GridData" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %> <!-- http://u-project2.umanis.com/view.php?id=48902 | Ajout de l'onglet : Taux de générosité | mmi --> <%-- Taux de générosité --%> <form name="tauxgenerosite" class="fieldTable" id="tauxgenerosite"> <table class="container" cellpadding="0"> <tr> <td> <span class="criteriaLabel"><fl:getMessage code="FF2AF" alt="Taux hôtel"/> </span> <% FlRequest flRequest=new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico=flRequest.getContext().getDataDictionary(); String id = flRequest.getParameter("id"); try { Vector<Vector<String>> values = dico.getRefList(session, "Tg_", "Nu1"); %> <select name="Gt_TauxHotelRefID" id="Gt_TauxHotelRefID" style="background-color: #FDCBCC" > <% if (values != null) { for (Vector val : values) { String refID = (String)val.firstElement(); Object refDisp = val.elementAt(1); %> <option value="<%= Utils.formatToWeb(refID, true) %>"><%= Utils.formatToWeb(refDisp, false) %>%</option> <% } } %> </select> <% }catch (FrontlineException fle) { } %> </td> <td> <span class="criteriaLabel"><fl:getMessage code="F6138" alt="Date de début"/></span> <input name="Gt_DateDebut" type="text" onchange="onchangeDateDebut();" onfocus="this.select();" id="Gt_DateDebut" onblur="ctrlDateField(this, '<fl:getMessage code="M202B" alt="Format de date incorrect. Veuillez corriger." js="true"/>');" tabindex="11" size="20" maxlength="10" style="background-color: #FDCBCC"> <a href="javascript:openCalendar(document.tauxgenerosite.Gt_DateDebut)" onmouseover="window.status = '<fl:getMessage code="A2000" alt="Afficher le calendrier" js="true"/>';" onmouseout="window.status = '';" > <img src="<fl:webapp/>/icons/ico/clock_neutre.gif" class="icon"> </a> </td> <td> <span class="criteriaLabel"><fl:getMessage code="F6132" alt="Date de fin"/> </span> <input name="Gt_DateFin" type="text" onfocus="this.select();" id="Gt_DateFin" tabindex="11" size="20" maxlength="10" disabled="disabled" > <img src="<fl:webapp/>/icons/ico/clock_neutre.gif" class="icon"> </td> <td> <span class="criteriaLabel"><fl:getMessage code="FF1A2" alt="Millésime"/> </span> <input name="Gt_Millesime" type="text" id="Gt_Millesime" size="20px" style="background-color: #FDCBCC"/> </td> <fl:access name="TauxGenerosite_" operation="create"> <td class="smallFieldPart"><a href="javascript:addTauxGenerosite();"> <img src="<fl:webapp/>/icons/ico/save_all_long.gif" id="bt_addEnv2" title="<fl:getMessage code="A000F" alt="Ajouter"/>"></a> </td> </fl:access> </tr> <tr><td colspan="4" class="ligne_separation"/></tr> <tr><td colspan="4" class="ligne_separation"/></tr> <tr><td colspan="4" class="ligne_separation"/></tr> </table> </form> <fl:grid name="LTG01" ajaxUrl="<%= \"/embedded_list_ajax.fl?code=LTG01&Gt_EntID=\" + id %>"/> <script language="javascript"> function updateFin(){ var f = window.document.tauxgenerosite; var dateDebut = f.Gt_DateDebut.value; var parts = dateDebut.split('/'); var year = parts[2]; document.getElementById('Gt_DateFin').value = '31/12/2050'; } function initializeForm(){ var date = new Date(); var year = date.getFullYear(); var month = date.getMonth()+2; if(month>12){ month = month - 12; year = year + 1; } if(month<10) { month = '0' + month; } document.getElementById('Gt_DateDebut').value = '01/'+ month +'/'+year; document.getElementById('Gt_DateFin').value = '31/12/2050'; document.getElementById('Gt_Millesime').value = year; } function addTauxGenerosite(){ var f = window.document.tauxgenerosite; var args = '&Gt_EntID=<%=id%>'; var dateDebut = new Date(parseDateT(f.Gt_DateDebut.value)); if (f.Gt_TauxHotelRefID.value != '') { args += '&Gt_TauxHotelRefID=' + encodeURIComponent(f.Gt_TauxHotelRefID.value); }else{ alert('<fl:getMessage code="MF1AF" alt="Veuillez choisir un taux de générosité" js="true"/>'); f.Gt_TauxHotelRefID.focus(); return; } if (f.Gt_DateDebut.value != '') { var day = dateDebut.getDate(); if (day==1) { args += '&Gt_DateDebut=' + encodeURIComponent(f.Gt_DateDebut.value); }else{ alert('<fl:getMessage code="MF1AE" alt="La date de début dois être le début du mois" js="true"/>'); f.Gt_DateDebut.focus(); return; } }else{ alert('<fl:getMessage code="MF086" alt="Veuillez choisir la date de début" js="true"/>'); f.Gt_DateDebut.focus(); return; } if (f.Gt_Millesime.value != '') { if(f.Gt_Millesime.value==dateDebut.getFullYear()){ args += '&Gt_Millesime=' + encodeURIComponent(f.Gt_Millesime.value); args += '&Gt_DateFin=' + encodeURIComponent(f.Gt_DateFin.value); }else{ alert('<fl:getMessage code="MF1B2" alt="Veuillez choisir le bon millésime" js="true"/>'); f.Gt_Millesime.focus(); return; } }else{ alert('<fl:getMessage code="MF081" alt="Veuillez choisir le millésime" js="true"/>'); f.Gt_Millesime.focus(); return; } $.ajax({ type: "GET", url: "<fl:webapp/>/check_dateDebut.fl?"+args, timeout: 20000, contentType: "application/json;charset=utf-8", dataType: 'json', async: true, success: function (data) { var result = data.result[0]; if(result=='OK'){ var ajaxURL = '<fl:link url="/save_tauxgenerosite_ajax.fl?"/>' + args; doAjax(ajaxURL, tauxGenerositeCallback); } else { alert('<fl:getMessage code="MF1BB" alt="Un enregistrement avec la même date de début existe, merci d\'effectuer une modification" js="true"/>'); return; } } }); } function tauxGenerositeCallback(arrIndex){ if (eDealXmlhttpArr[arrIndex].readyState == 4) { hideWaiting(); setTimeout('refreshTauxGenerosite()', 10); initializeForm(); } } function deleteMarkedGt_ID(Gt_ID) { if (confirm('<fl:getMessage code="MF1B4" alt="Etes-vous sûr de vouloir supprimer ce taux ?" js="true"/>')) { doAjax('<fl:webapp/>/delete_object_ajax.fl?type=TauxGenerosite_&id=' + Gt_ID , waitNrefreshSLGt_); } } function waitNrefreshSLGt_(arrIndex) { if(eDealXmlhttpArr[arrIndex].readyState == 4) { var rtrn = trimStr(eDealXmlhttpArr[arrIndex].responseText); if (rtrn == '') { refreshTauxGenerosite(); window.scrollTo(0,1000); } else { hideWaiting(); alert('<fl:getMessage code="MF1B1" alt="Impossible de supprimer le taux seléctionné." js="true"/>'); } } } function refreshTauxGenerosite(){ _grid__LTG01_js_.render(); } function onchangeDateDebut(){ var f = window.document.tauxgenerosite; var dateDebut = new Date(parseDateT(f.Gt_DateDebut.value)); var day = dateDebut.getDate(); if (day!=1) { f.Gt_DateDebut.value = '01' + f.Gt_DateDebut.value.substring(2); } updateFin(); } initializeForm(); </script>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de