2009-03-03 16:09:27 +00:00
|
|
|
$(document).ready(function(){
|
2010-05-03 08:19:48 +00:00
|
|
|
|
2010-02-18 17:27:48 +00:00
|
|
|
//Chargement du menu Accordion
|
2010-05-03 08:19:48 +00:00
|
|
|
$("#Menu").accordion({autoHeight: false, collapsible: true, active: 0});
|
2010-02-18 17:27:48 +00:00
|
|
|
|
|
|
|
//Auto Scroll
|
|
|
|
$(window).scroll(function() {
|
|
|
|
var offset = $(document).scrollTop();
|
|
|
|
$("#floatMenu").css('margin-top',offset);
|
|
|
|
});
|
2010-02-23 15:27:18 +00:00
|
|
|
|
2010-05-03 08:19:48 +00:00
|
|
|
//Autocomplete sur le champs NAF
|
|
|
|
$('#formR-naf').autocomplete({
|
|
|
|
minLength:3,
|
|
|
|
source: function(request, response) {
|
|
|
|
$.getJSON('./pages/nafajax.php', { q: request.term },
|
|
|
|
function(data) { response(data); }
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2010-05-04 07:55:20 +00:00
|
|
|
//Champs de recherche
|
|
|
|
$('input[name=formR[siret]]').focus();
|
|
|
|
$('form[name=form_recherche]').submit(function(){
|
|
|
|
var reg = /[a-z]{3}/i;
|
|
|
|
var siret = $('input[name=formR[siret]]').val();
|
|
|
|
if(siret.match(reg)){
|
|
|
|
$('input[name=formR[raisonSociale]]').attr('value',siret);
|
|
|
|
$('input[name=formR[siret]]').attr('value','');
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
});
|
2010-05-04 10:21:08 +00:00
|
|
|
$('input.button').button();
|
|
|
|
$('input.button:reset').click(function(){
|
|
|
|
$('input:text','form[name=form_recherche]').val('');
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2010-02-23 15:27:18 +00:00
|
|
|
//Boite de dialog surveillance
|
|
|
|
$('.dialogsurv').live('click', function(){
|
|
|
|
var title = $(this).attr('title');
|
|
|
|
var href = $(this).attr('href')+'&dialog=1';
|
|
|
|
var dialogOpts = {
|
|
|
|
bgiframe: true,
|
|
|
|
title: title,
|
|
|
|
width: 500,
|
2010-04-09 16:27:39 +00:00
|
|
|
height: 350,
|
2010-02-23 15:27:18 +00:00
|
|
|
modal: true,
|
|
|
|
open: function(event, ui) {
|
|
|
|
$(this).html('Chargement...');
|
2010-05-05 10:20:20 +00:00
|
|
|
$(this).load(href);
|
|
|
|
$('#dialogsurv').keypress(function(e){
|
|
|
|
if (e.keyCode == 13){
|
|
|
|
e.preventDefault();
|
|
|
|
survSubmit();
|
|
|
|
}
|
|
|
|
});
|
2010-02-23 15:27:18 +00:00
|
|
|
},
|
|
|
|
buttons: {
|
2010-05-05 10:20:20 +00:00
|
|
|
Ok: function() { survSubmit(); },
|
2010-02-23 15:27:18 +00:00
|
|
|
Annuler: function() { $(this).dialog('close'); }
|
|
|
|
},
|
|
|
|
close: function() { $('#dialogsurv').remove(); }
|
|
|
|
};
|
|
|
|
$('<div id="dialogsurv"></div>').dialog(dialogOpts);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2010-05-05 10:20:20 +00:00
|
|
|
function survSubmit(){
|
|
|
|
var buttons = $('#dialogsurv').dialog('option','buttons');
|
|
|
|
for( var button in buttons ){
|
|
|
|
$(":button:contains('"+button+"')").attr('disabled','disabled');
|
|
|
|
}
|
|
|
|
var formAction = $('#frmSurv').attr('action');
|
2010-05-05 16:29:33 +00:00
|
|
|
var href = $(location).attr('href');
|
2010-05-05 10:20:20 +00:00
|
|
|
var serData = $('#frmSurv').serialize();
|
|
|
|
$('#frmSurv').replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
|
|
|
|
$.post(formAction, serData, function(data) {
|
|
|
|
if(data==''){
|
|
|
|
$('#frmSurv').html("L'entité a été placé sous surveillance.\n");
|
|
|
|
$(location).attr('href', href);
|
|
|
|
}else{
|
|
|
|
$('#frmSurv').html(data);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2010-05-07 15:48:45 +00:00
|
|
|
$('a[idobjet]').click(function()
|
|
|
|
{
|
|
|
|
idObject=$(this).attr('idobjet');
|
|
|
|
$('#document'+idObject).html('Construction du document en cours...');
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: "/",
|
|
|
|
data: "page=getmarques&idObject="+idObject,
|
|
|
|
success: function(msg){$('#document'+idObject).html(msg)},
|
|
|
|
error: function(){$('#document'+idObject).html('Erreur');}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
//Tooltip date de maj
|
2010-05-05 16:29:33 +00:00
|
|
|
$('.datemaj').qtip({
|
|
|
|
content: $(this).attr('alt'),
|
|
|
|
style: { name: 'cream', width: 170 },
|
|
|
|
position: {
|
|
|
|
corner: { target: 'bottomMiddle',
|
|
|
|
tooltip: 'topMiddle' } }
|
|
|
|
});
|
2010-05-07 15:48:45 +00:00
|
|
|
|
2010-05-05 10:20:20 +00:00
|
|
|
//Tooltip de surveillance
|
2010-04-27 13:25:14 +00:00
|
|
|
$('u[tooltip]').each(function(){
|
|
|
|
$(this).qtip({
|
|
|
|
content: $(this).attr('tooltip'),
|
|
|
|
style: { name: 'dark' },
|
|
|
|
position: {
|
|
|
|
corner: { target: 'topMiddle',
|
|
|
|
tooltip: 'bottomMiddle' } }
|
|
|
|
});
|
|
|
|
});
|
2010-05-12 10:31:56 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Vérifie l'adresse email fournit en paramètre
|
|
|
|
*/
|
|
|
|
function checkEmail(eMail){
|
|
|
|
var isMail = eMail.length;
|
2010-05-19 15:43:12 +00:00
|
|
|
var verif = '/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/';
|
2010-05-12 10:31:56 +00:00
|
|
|
if(!isMail || verif.exec(eMail)==null){
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|