2011-03-17 11:25:59 +00:00
|
|
|
function annonceAction(action, source, idan, siret) {
|
|
|
|
$.post('index.php',
|
|
|
|
{
|
|
|
|
page: 'saisieajax',
|
|
|
|
q: 'annonces/'+action,
|
|
|
|
idan: idan,
|
|
|
|
siret: siret,
|
|
|
|
source: source
|
|
|
|
},
|
2011-03-22 15:52:44 +00:00
|
|
|
function(data){ $('#result').html(data); }
|
2011-03-17 11:25:59 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2010-06-24 09:42:23 +00:00
|
|
|
$(document).ready(function(){
|
|
|
|
//Gestion boite dialog mandataire
|
2010-06-25 12:49:43 +00:00
|
|
|
$('a.annonceDelete').click(function(e){
|
|
|
|
e.preventDefault();
|
2010-06-24 09:42:23 +00:00
|
|
|
var title = $(this).attr('title');
|
|
|
|
var href = $(this).attr('href');
|
|
|
|
var dialogOpts = {
|
|
|
|
bgiframe: true,
|
|
|
|
title: title,
|
|
|
|
width: 350,
|
|
|
|
height: 150,
|
|
|
|
modal: true,
|
|
|
|
open: function(event, ui) {
|
|
|
|
$(this).html('Chargement...').load(href);
|
|
|
|
},
|
|
|
|
buttons: {
|
|
|
|
'Supprimer': function() {
|
|
|
|
var siret = $('input:hidden[name=siret]').val();
|
|
|
|
var idan = $('input:hidden[name=idan]').val();
|
2011-03-17 11:25:59 +00:00
|
|
|
var source = $('input:hidden[name=source]').val();
|
|
|
|
$('#result').html("Suppression en cours....");
|
2011-03-22 15:52:44 +00:00
|
|
|
annonceAction('delete', source, idan, siret);
|
2010-06-24 09:42:23 +00:00
|
|
|
},
|
|
|
|
'Quitter': function() { $(this).dialog('close'); }
|
|
|
|
},
|
2010-06-25 12:49:43 +00:00
|
|
|
close: function() { $('#dialog').remove(); }
|
2010-06-24 09:42:23 +00:00
|
|
|
};
|
2010-06-25 12:49:43 +00:00
|
|
|
$('<div id="dialog"></div>').dialog(dialogOpts);
|
2010-06-24 09:42:23 +00:00
|
|
|
});
|
|
|
|
|
2010-06-25 12:49:43 +00:00
|
|
|
$('a.annonceEdit').click(function(e){
|
|
|
|
e.preventDefault();
|
2010-06-24 09:42:23 +00:00
|
|
|
var title = $(this).attr('title');
|
|
|
|
var href = $(this).attr('href');
|
|
|
|
var dialogOpts = {
|
|
|
|
bgiframe: true,
|
|
|
|
title: title,
|
2010-06-25 14:07:19 +00:00
|
|
|
width: 650,
|
|
|
|
height: 500,
|
2010-06-24 09:42:23 +00:00
|
|
|
modal: true,
|
2010-06-25 12:49:43 +00:00
|
|
|
closeOnEscape: false,
|
2010-06-24 09:42:23 +00:00
|
|
|
open: function(event, ui) {
|
|
|
|
$(this).html('Chargement...').load(href);
|
|
|
|
},
|
|
|
|
buttons: {
|
2010-08-31 06:59:31 +00:00
|
|
|
'Enregistrer': function() {
|
|
|
|
if ($('form#saisie').length){
|
|
|
|
$('form#saisie').submit();
|
|
|
|
}
|
|
|
|
},
|
2010-06-24 09:42:23 +00:00
|
|
|
'Quitter': function() { $(this).dialog('close'); }
|
|
|
|
},
|
2010-06-25 12:49:43 +00:00
|
|
|
close: function() { $('#dialog').remove(); }
|
2010-06-24 09:42:23 +00:00
|
|
|
};
|
2010-06-25 12:49:43 +00:00
|
|
|
$('<div id="dialog"></div>').dialog(dialogOpts);
|
2010-06-24 09:42:23 +00:00
|
|
|
});
|
|
|
|
|
2010-06-25 12:49:43 +00:00
|
|
|
$('a.annonceCopy').click(function(e){
|
|
|
|
e.preventDefault();
|
2010-06-24 09:42:23 +00:00
|
|
|
var title = $(this).attr('title');
|
|
|
|
var href = $(this).attr('href');
|
|
|
|
var dialogOpts = {
|
|
|
|
bgiframe: true,
|
|
|
|
title: title,
|
|
|
|
width: 350,
|
2010-08-05 08:37:32 +00:00
|
|
|
height: 200,
|
2010-06-24 09:42:23 +00:00
|
|
|
modal: true,
|
2010-06-25 12:49:43 +00:00
|
|
|
closeOnEscape: false,
|
2010-06-24 09:42:23 +00:00
|
|
|
open: function(event, ui) {
|
|
|
|
$(this).html('Chargement...').load(href);
|
|
|
|
},
|
|
|
|
buttons: {
|
2010-08-05 08:37:32 +00:00
|
|
|
'Dupliquer': function() {
|
2011-03-24 13:31:37 +00:00
|
|
|
var siretIn = $('input[name=siretIn]').val();
|
|
|
|
var siretOut = $('input[name=siretOut]').val();
|
2010-08-05 08:37:32 +00:00
|
|
|
var idan = $('input:hidden[name=idan]').val();
|
2011-03-17 11:25:59 +00:00
|
|
|
var source = $('input:hidden[name=source]').val();
|
|
|
|
$('#result').html("Copie en cours....");
|
2011-03-24 13:31:37 +00:00
|
|
|
$.post('index.php',
|
|
|
|
{
|
|
|
|
page: 'saisieajax',
|
|
|
|
q: 'annonces/copy',
|
|
|
|
idan: idan,
|
|
|
|
siretIn: siretIn,
|
|
|
|
siretOut: siretOut,
|
|
|
|
source: source
|
|
|
|
},
|
|
|
|
function(data){ $('#result').html(data); }
|
|
|
|
);
|
2010-08-05 08:37:32 +00:00
|
|
|
},
|
2010-06-24 09:42:23 +00:00
|
|
|
'Quitter': function() { $(this).dialog('close'); }
|
|
|
|
},
|
2010-06-25 12:49:43 +00:00
|
|
|
close: function() { $('#dialog').remove(); }
|
2010-06-24 09:42:23 +00:00
|
|
|
};
|
2010-06-25 12:49:43 +00:00
|
|
|
$('<div id="dialog"></div>').dialog(dialogOpts);
|
2010-06-24 09:42:23 +00:00
|
|
|
});
|
|
|
|
});
|