2010-02-23 15:27:18 +00:00
|
|
|
$(document).ready(function()
|
|
|
|
{
|
|
|
|
$('.dialogcmd').live('click', function(){
|
|
|
|
var title = $(this).attr('title');
|
|
|
|
var href = $(this).attr('href');
|
|
|
|
var dialogOpts = {
|
|
|
|
bgiframe: true,
|
|
|
|
title: title,
|
|
|
|
width: 550,
|
|
|
|
height: 300,
|
|
|
|
modal: true,
|
|
|
|
open: function(event, ui) {
|
|
|
|
$(this).html('Chargement...');
|
|
|
|
$(this).load(href);
|
|
|
|
},
|
2010-07-07 15:30:17 +00:00
|
|
|
buttons: {
|
2010-07-08 14:07:20 +00:00
|
|
|
Valider: function() {
|
2010-08-12 14:40:19 +00:00
|
|
|
if ($('form[name=commande]').length){
|
|
|
|
$('form[name=commande]').submit();
|
|
|
|
$('#dialogcmd').dialog('option','buttons','');
|
|
|
|
$('#dialogcmd > #output').html('Commande en cours, Veuillez patienter ...');
|
|
|
|
} else {
|
|
|
|
$(this).dialog('close');
|
|
|
|
}
|
2010-07-08 14:07:20 +00:00
|
|
|
},
|
2010-07-07 15:30:17 +00:00
|
|
|
Annuler: function() { $(this).dialog('close'); }
|
|
|
|
},
|
2010-02-23 15:27:18 +00:00
|
|
|
close: function() { $('#dialogcmd').remove(); }
|
|
|
|
};
|
|
|
|
$('<div id="dialogcmd"></div>').dialog(dialogOpts);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2010-06-22 07:31:15 +00:00
|
|
|
$('span.fichier > a').live('click', function(e){
|
|
|
|
e.preventDefault();
|
2010-05-12 10:31:56 +00:00
|
|
|
var objet = $(this).parent('span');
|
|
|
|
objet.html('<br/>Chargement du fichier...');
|
|
|
|
var url = $(this).attr('href');
|
2010-07-08 14:07:20 +00:00
|
|
|
$.post( url, function (data, textStatus)
|
2010-05-12 10:31:56 +00:00
|
|
|
{
|
|
|
|
if( data=='' || data=='FALSE' || textStatus=='timeout' )
|
|
|
|
{
|
|
|
|
data = '<br/>Le chargement du fichier a échoué';
|
|
|
|
}
|
2010-05-24 14:46:00 +00:00
|
|
|
objet.replaceWith(data);
|
2010-05-12 10:31:56 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2010-06-22 07:31:15 +00:00
|
|
|
$('a.multiactes').live('click', function(e){
|
|
|
|
e.preventDefault();
|
2010-05-12 10:31:56 +00:00
|
|
|
var url = $(this).attr('href');
|
|
|
|
var objet = $(this).parent('td');
|
|
|
|
objet.html('Commande en cours...');
|
2010-07-08 14:07:20 +00:00
|
|
|
$.post( url, function (data, textStatus)
|
2010-05-12 10:31:56 +00:00
|
|
|
{
|
|
|
|
if( data=='' || data=='FALSE' || textStatus=='timeout' )
|
|
|
|
{
|
|
|
|
data = 'Erreur lors de la requete.';
|
|
|
|
}
|
|
|
|
objet.html(data);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|