// SAVE
function activedirectory_activedirectory_save_link(){
	var data = $.getForm('#ad-correspondance');
	data.id = $('#ad-correspondance').attr('data-id');
	$.action(data,function(r){
		$.message('success','Enregistré');
		$('#ad-correspondance input').val('');
		$('#ad-correspondance').attr('data-id','');
		$('#active-directory-form-settings').load(document.URL +  ' #active-directory-form-settings');
	});
}

// EDIT
function activedirectory_activedirectory_edit_link(element){
	var line = $(element).closest('tr');
	$.action({
		action:'activedirectory_activedirectory_edit_link',
		id:line.attr('data-id')
	},function(r){
		$.setForm('#ad-correspondance',r);
		$('#ad-correspondance').attr('data-id',r.id);
	});
}