function AJAXserviceRequestCreation_refreshSiteClient(codeSociete, codeClient, idSiteClient) { var xhr = getXHRObject(); if (idSiteClient == -1) { return false; } xhr.onreadystatechange = function() { if(xhr.readyState == 4) { if(xhr.status == 200) { eval(xhr.responseText); } else { alert("AJAX Error :"+xhr.responseText); } } }; xhr.open("POST", INDEX_LINK+"?ajax=serviceRequestCreation_refreshSiteClient", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send("codeSociete="+codeSociete+"&codeClient="+codeClient+"&idSiteClient="+idSiteClient); } function AJAXticketRequestCreation_refreshQuantiteTicketsPrevue() { var xhr = getXHRObject(); var qtt = -1; var idPresta = -1; var idMajorationHoraire = -1; var idMajorationUrgence = -1 var tmpIndex = -1; var idContratService = encodeURIComponent(document.getElementById('hdnIdContratService').value); if (document.getElementById('txtQuantite')) { if (document.getElementById('txtQuantite').value.length > 0 && !isNaN(document.getElementById('txtQuantite').value)) { qtt = document.getElementById('txtQuantite').value; } } if (document.getElementById('selPrestationTicket')) { tmpIndex = document.getElementById('selPrestationTicket').selectedIndex; if (tmpIndex > 0 && document.getElementById('selPrestationTicket').options[tmpIndex].value > 0) { idPresta = document.getElementById('selPrestationTicket').options[tmpIndex].value; } } if (document.getElementById('selMajorationTicketHoraire')) { tmpIndex = document.getElementById('selMajorationTicketHoraire').selectedIndex; if (tmpIndex > 0 && document.getElementById('selMajorationTicketHoraire').options[tmpIndex].value > 0) { idMajorationHoraire = document.getElementById('selMajorationTicketHoraire').options[tmpIndex].value; } } if (document.getElementById('selMajorationTicketUrgence')) { tmpIndex = document.getElementById('selMajorationTicketUrgence').selectedIndex; if (tmpIndex > 0 && document.getElementById('selMajorationTicketUrgence').options[tmpIndex].value > 0) { idMajorationUrgence = document.getElementById('selMajorationTicketUrgence').options[tmpIndex].value; } } if (qtt < 0 || idPresta < 0 || idMajorationHoraire < 0 || idMajorationUrgence < 0) { if (document.getElementById('tdQttTicketsPrevue')) { document.getElementById('tdQttTicketsPrevue').innerHTML = "Veuillez compléter les champs ci-dessus." } return false; } waitOverlay(1); xhr.onreadystatechange = function() { if(xhr.readyState == 4) { if(xhr.status == 200) { eval(xhr.responseText); } else { alert("AJAX Error :"+xhr.responseText); } } }; xhr.open("POST", INDEX_LINK+"?ajax=ticketRequestCreation_refreshQuantiteTicketsPrevue", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send("quantite="+qtt+"&idPrestationTicket="+idPresta+"&idMajorationHoraire="+idMajorationHoraire+"&idMajorationUrgence="+idMajorationUrgence+"&idContratService="+idContratService); } function AJAXcontactClient_delete(idContactClient) { var xhr = getXHRObject(); if (!confirm("Etes-vous certain de vouloir supprimer ce contact ?")) { return false; } idContactClient = encodeURIComponent(idContactClient); waitOverlay(1); xhr.onreadystatechange = function() { if(xhr.readyState == 4) { if(xhr.status == 200) { eval(xhr.responseText); } else { alert("AJAX Error :"+xhr.responseText); } } }; xhr.open("POST", INDEX_LINK+"?ajax=contactClient_delete", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send("idContactClient="+idContactClient); } function AJAXserviceRequestCreate_refreshContactClient(idContactClient) { var xhr = getXHRObject(); // On vérifie qu'il ne s'agit pas du code par défaut if (idContactClient == -1) { return true; } idContactClient = encodeURIComponent(idContactClient); waitOverlay(1); xhr.onreadystatechange = function() { if(xhr.readyState == 4) { if(xhr.status == 200) { eval(xhr.responseText); } else { alert("AJAX Error :"+xhr.responseText); } } }; xhr.open("POST", INDEX_LINK+"?ajax=serviceRequestCreation_refreshContactClient", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send("idContactClient="+idContactClient); } function AJAXCheckNumeroSerie(numeroSerie, codeSociete) { var xhr = getXHRObject(); fieldLoadingIndicator('fieldNumeroSerie', 1); xhr.onreadystatechange = function() { if(xhr.readyState == 4) { if(xhr.status == 200) { eval(xhr.responseText); } else { alert("AJAX Error :"+xhr.responseText); } } }; xhr.open("POST", INDEX_LINK+"?ajax=checkNumeroSerie", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send("numeroSerie="+numeroSerie+"&codeSociete="+codeSociete); } var count = 0; function doDropDown(numeroSerie, codeSociete) { count = count+1; setTimeout("dropDownGo("+count+", '"+numeroSerie+"', '"+codeSociete+"')",200); } function dropDownGo(currCount, numeroSerie, codeSociete) { if(currCount == count) { count = 0; AJAXCheckNumeroSerie(numeroSerie, codeSociete); } }