1var menuskin=1 2var display_url=0 3 4var opt_no_frames = false; 5var opt_integrated_mode = false; 6 7test=0; 8 9function VerifForm_nl(form_name) 10{ 11 if (typeof form_name == 'undefined') 12 form = document.formu_nl; 13 else 14 form = document.getElementsByName(form_name)[0]; 15 16 if (typeof adresse == 'undefined') 17 adresse = form.email_nl.value; 18 var place = adresse.indexOf("@", 1); 19 var point = adresse.indexOf(".", place + 1); 20 if ((place > -1) && (adresse.length > 2) && (point > 1)) 21 { 22 form.submit(); 23 } 24 else 25 { 26 alert('Entrez une adresse e-mail valide !'); 27 } 28} 29 30function VerifForm_erevue() 31 { 32 adresse = document.formu_erevue.email_nl.value; 33 var place = adresse.indexOf("@",1); 34 var point = adresse.indexOf(".",place+1); 35 if ((place > -1)&&(adresse.length >2)&&(point > 1)) 36 {document.formu_erevue.submit();} 37 else 38 {alert('Entrez une adresse e-mail valide !');} 39 } 40 41function ZyVa() { 42 remoteWin=window.open('','remoteWin','width=268,height=110,marginwidth=0,marginheight=0,resizable=no,scrollbars=no') 43if (remoteWin != null) 44 { 45 remoteWin.toto = parent; 46 remoteWin.location = "chg_couleur.php3"; 47 } 48} 49 50var remote2=null; 51 52function ZyVa2() { 53 remote2=window.open('','remote2','width=400,height=120,marginwidth=0,marginheight=0,resizable=no,scrollbars=no') 54if (remote2 != null) 55 { 56 remote2.toto = self; 57 remote2.location = "telecom3.htm"; 58 } 59} 60 61function FW_OpenWindow(theURL,features) { 62 window.open(theURL,'Detail',features); 63} 64 65function showmenuie5(){ 66var rightedge=document.documentElement.clientWidth - event.clientX - ie5menu.offsetParent.offsetLeft 67var bottomedge=document.documentElement.clientHeight - event.clientY - ie5menu.offsetParent.offsetTop 68 69if (rightedge<ie5menu.offsetWidth) 70 ie5menu.style.left=document.documentElement.scrollLeft + event.clientX - ie5menu.offsetWidth - ie5menu.offsetParent.offsetLeft 71else 72 ie5menu.style.left=document.documentElement.scrollLeft + event.clientX - ie5menu.offsetParent.offsetLeft; 73 74if (bottomedge<ie5menu.offsetHeight) 75 ie5menu.style.top=document.documentElement.scrollTop + event.clientY - ie5menu.offsetHeight - ie5menu.offsetParent.offsetTop 76else 77 ie5menu.style.top=document.documentElement.scrollTop + event.clientY - ie5menu.offsetParent.offsetTop 78 79ie5menu.style.visibility="visible" 80return false 81} 82 83function hidemenuie5(){ 84 ie5menu.style.visibility="hidden" 85} 86 87function highlightie5(){if (event.srcElement.className=="menuitems"){ 88 event.srcElement.style.backgroundColor="highlight" 89 event.srcElement.style.color="white" 90 if (display_url==1) 91 window.status=event.srcElement.url 92 } 93} 94 95function lowlightie5(){ 96 if (event.srcElement.className=="menuitems"){ 97 event.srcElement.style.backgroundColor="" 98 event.srcElement.style.color="black" 99 window.status='' 100 } 101} 102 103function jumptoie5(){ 104 if (event.srcElement.className=="menuitems"){ 105 if (event.srcElement.getAttribute("target")!=null) 106 window.open(event.srcElement.url,event.srcElement.getAttribute("target")) 107 else 108 window.location=event.srcElement.url 109 } 110} 111 112function personalise(string) { 113 document.FormEditeur.ContenuEditeur.value=document.FormEditeur.ContenuEditeur.value+'|%'+string+'%|'; 114 document.FormEditeur.Contenu_texte.value=document.FormEditeur.Contenu_texte.value+'|%'+string+'%|'; 115 } 116 117function MM_callJS(jsStr) { //v2.0 118 return eval(jsStr) 119} 120 121function MM_preloadImages() { //v3.0 122 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); 123 var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) 124 if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} 125} 126 127function MM_swapImgRestore() { //v3.0 128 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; 129} 130 131function MM_findObj(n, d) { //v3.0 132 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { 133 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} 134 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; 135 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x; 136} 137 138//Correction de la fonction apporté par Mohammed. (EI - 22/09/10) 139function MM_showHideLayers() { //v6.0 140 var i,p,v,obj,args=MM_showHideLayers.arguments; 141 for (i=0; i<(args.length-2); i+=3) if ((obj=document.getElementById(args[i]))!=null) { v=args[i+2]; 142 if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; } 143 obj.visibility=v; } 144} 145 146function MM_swapImage() { //v3.0 147 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) 148 if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} 149} 150
151function MM_displayStatusMsg(msgStr) { //v1.0 152 status=msgStr; 153 document.MM_returnValue = true; 154} 155 156function MM_openBrWindow(theURL,winName,features) { //v2.0 157 window.open(theURL,winName,features); 158} 159 160var win=null; 161function openfenetre(mypage,myname,w,h,scroll,pos){ 162 if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;} 163 if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;} 164 else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20} 165 settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes'; 166 win=window.open(mypage,myname,settings); 167 } 168 169 170function check_log_jquery() 171{ 172 173/* if ($("#form_std input:text").empty()) { 174// $("#boiteConnexion").animate( { background-color:"#F4DEC3" }, { queue:false, duration:1000 }); 175// $("#errorlogin").fadein(); 176 $("#boiteConnexion input:text").css("background-color", "#F3CD4E"); 177 } 178 if ($("#form_std input:password").empty()) { 179 $("#boiteConnexion input:password").css("background-color", "#F4D3CE"); 180// alert("Merci de renseigner le champ Mot de passe"); 181 } 182 else 183 document.getElementsById("form_std").submit(); 184 185*/ 186 check_log(1); 187} 188 189/* 190 * DEPRECATED : Call NA_check_log() instead 191 */ 192function check_log(etape) { 193 var formu = (etape == 1 ? document.formulaire_login1 : document.formulaire_login3); 194 195 if (formu.login_s.value=="") 196 { 197 alert(polyglot.t("profile.please_enter_your_login")); 198 formu.login_s.focus(); 199 return false; 200 } 201 else if (formu.pswd_s.value=="") 202 { 203 alert(polyglot.t("profile.please_enter_your_password_exclamation")); 204 formu.pswd_s.focus(); 205 return false; 206 } 207 else 208 { 209 var password = formu.pswd_s.value; 210 211 var md5pass = $("[name=pswd_s]").data('md5'); 212 if (typeof md5pass == 'undefined' || md5pass == 1) 213 formu.password_c.value = md5(password); 214 else 215 formu.password_c.value = password; 216 217 //alert(password); 218 formu.pswd_s.value = ""; 219 //formu.submit(); 220 221 return true; 222 } 223} 224 225function verif_url(url) { 226 var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; 227 if (regexp.test(url) == false) 228 alert(polyglot.t("profile.please_enter_valid_url_exclamation")); 229 return regexp.test(url); 230} 231 232function MM_reloadPage(init) { //reloads the window if Nav4 resized 233 if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { 234 document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} 235 else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); 236} 237MM_reloadPage(true); 238 239function ZyVanamail1() { 240 remotenamail1=window.open('','namail1','width=800,height=600,resizable=yes,status=1,scrollbars=yes') 241 if (remotenamail1 != null) { 242 remotenamail1.toto = self; 243 } 244} 245 246function fenetre_fiche_histopro(as_no,adresse) { 247 fen = window.open("/gene/stock_adresse_pro.php?as_no_stock=" + as_no + "&adresse_stock=" + adresse , "", "width=700,height=500,scrollbar=yes"); 248 if (!fen.opener) fen.opener = self; 249} 250 251function fenetre_fiche_histopro_view(as_no) { 252 fen = window.open("/gene/view_stock_adresse_pro.php?as_no_stock=" + as_no, "", "width=700,height=500,scrollbars=yes"); 253 if (!fen.opener) fen.opener = self; 254} 255function limite_aera(zone,max) { 256 if(zone.value.length>=max){zone.value=zone.value.substring(0,max);} 257} 258 259function Agrandie(num,legende,larg,haut,id_photo) { 260 if(haut>700) { 261 rapport=700/haut; 262 haut=haut*rapport; 263 larg=larg*rapport; 264 } 265 if(larg<450) {haut2=haut+30;} else {haut2=haut+20;} 266 267 browser=window.open('details_photo.php?numero='+num+'&legende='+legende+'&largeur='+larg+'&hauteur='+haut+'&id_photo='+id_photo,'','width='+larg+',height='+haut2); 268 window.onerror = null;
269 browser.moveTo ((screen.availWidth )/2-250,20); 270 browser.focus(); 271} 272 273/********************************************** 274 Affichage d'une page 275***********************************************/ 276 277function Affiche_popup(large, haut, type, id, groupe, ecole, espace, title) 278{ 279 var data = "type=" + type + "&groupe=" + groupe + "&ecole=" + ecole + "&espace=" + espace; 280 281 if (large > window.innerWidth) { 282 large = window.innerWidth; 283 } 284 if (haut > window.innerHeight) { 285 haut = window.innerHeight; 286 } 287 288 $.post("/global/ressources/template/recup_contenu_popup_ajax.php", data, 289 function (theResponse) 290 { 291 $('#dialog-alert').dialog( 292 { 293 title: title != undefined ? title : '', 294 height: haut, 295 width: large, 296 modal: true 297 298 } 299 ).html(theResponse); 300 $('.ui-dialog').removeClass('ui-widget-content').addClass('ui-widget-content-modal'); 301 $('.ui-widget-content-modal').css({ 302 "height": haut + "px", 303 "background": "url('images/ui-bg_spotlight_0_ffffff_600x600.png') 50% 2% repeat-x rgb(255, 255, 255)", 304 "color": "rgb(52, 73, 94)" 305 }); 306 }); 307} 308/*****************************************/ 309 310 311function show_menu_groupe(id) { 312 if(!id) id=0; 313 314 for(i=1;i<=5;i++) { 315 if(document.getElementById('niveau1_groupe_'+i)) { 316 if(id == i) { 317 if(document.getElementById('zoneSousMenu_groupe_'+i).style.display!='block') { 318 document.getElementById('niveau1_groupe_'+i).style.display='block'; 319 hauteur_cellule = document.getElementById('niveau1_groupe_'+i).offsetHeight; 320 document.getElementById('niveau1_groupe_'+i).style.marginTop=-hauteur_cellule+"px"; 321 if(i==5) 322 document.getElementById('zoneSousMenu_groupe_'+i).style.marginLeft = -79+"px"; 323 document.getElementById('zoneSousMenu_groupe_'+i).style.height=hauteur_cellule+"px"; 324 timerMenu = setTimeout("derouler_groupe("+i+")",10); 325 } 326 } else { 327 document.getElementById('niveau1_groupe_'+i).style.display='none'; 328 document.getElementById('zoneSousMenu_groupe_'+i).style.height=0; 329 } 330 } 331 } 332} 333 334function derouler_groupe(id) { 335 //hauteur_cellule = document.getElementById('niveau1_'+id).offsetHeight; 336 position = parseInt(document.getElementById('niveau1_groupe_'+id).style.marginTop.substring(0,(document.getElementById('niveau1_groupe_'+id).style.marginTop.length - 2))); 337 if(position < -10) { 338 document.getElementById('niveau1_groupe_'+id).style.marginTop = (position + 10)+"px"; 339 timerMenu = setTimeout("derouler_groupe("+id+")",10); 340 } else { 341 document.getElementById('niveau1_groupe_'+id).style.marginTop = 0+"px"; 342 clearTimeout(timerMenu); 343 } 344} 345 346 347 348// initialise les menues déroulants (basé sur jquery) 349function init_menus() { 350 351 // On modifie l'evenement "click" sur les liens dans les items de liste 352 // qui portent la classe "toggleSubMenu" : 353 $("div.menuSecondaireLienElem > a").mouseover( function () { 354 355 // Si le sous-menu etait deja ouvert, on le referme : 356 if ($(this).next("div.menu3niv:visible").length != 0) { 357 $(this).next("div.menu3niv").slideUp("normal", function () { $(this).parent().removeClass("open") } ); 358 } 359 // Si le sous-menu est cache, on ferme les autres et on l'affiche : 360 else { 361 $("div.menu3niv").slideUp("normal", function () { $(this).parent().removeClass("open") } ); 362 $(this).next("div.menu3niv").slideDown("normal", function () { $(this).parent().addClass("open") } ); 363 } 364 // On empêche le navigateur de suivre le lien : 365 return false; 366 367 }); 368} // function init_menus 369 370function addEvent(source, type, callback) { 371 // fonction d'abstraction pour enregistrer un gestionnaire d'evenement 372 // source : objet sur lequel ajouter le gestionnaire d'evenement 373 // type : type d'evenement 374 // callback : fonction qui traitera l'evenement 375 if (source.addEventListener){ // code standard DOM 376 source.addEventListener(type, callback, false); 377 return true; 378 } else if (source.attachEvent){ // code propriétaire MSIE 379 var r = source.attachEvent("on"+type, callback); 380 return r; 381 }
381 else { // code navigateur sans support DOM-event 382 eval('source.on' + type + '= callback') ; 383 } 384} 385 386addEvent(window, 'load', init_menus); 387 388function updatePres(contener) 389{ 390 if (!contener) 391 contener = ''; 392 else 393 contener = contener+' '; 394 $(contener+'.ui-state-default').css('cursor', 'pointer').hover(function(){$(this).addClass('ui-state-hover');}, 395 function(){$(this).removeClass('ui-state-hover');}); 396} 397 398function showProfile(alias) 399{ 400 window.location = "/profil/" + alias; 401} 402 403function dialog_alert(titre,contenu,width,height) 404{ 405 if(!titre) titre = "Alerte"; 406 if(!contenu) contenu = ""; 407 if(!width) width = 300; 408 if(!height) height = 150; 409 410 $('#dialog-alert').attr('title',titre); 411 $('#dialog-alert').html(contenu); 412 $('#dialog-alert').dialog({ 413 modal: true, 414 width: width, 415 height: height 416 }); 417} 418 419function val_abs(valeur){ 420 421 valeur = Math.abs(valeur); 422 423 return valeur; 424 425} 426 427function is_nan(valeur, valeur_defaut){ 428 429 if(!valeur_defaut) valeur_defaut = 0; 430 431 if(isNaN(valeur)){ 432 433 valeur = valeur_defaut; 434 } 435 436 return valeur; 437 438} 439 440// Fonction pour la validation des formulaires 441function verifFormulaire(formulaire, display_error) 442{ 443 //indicatif tel 444 if (formulaire.find('.telInput').length) 445 { 446 formulaire.find('.telInput').each(function () { 447 if ($(this).parent().parent().parent().find('.indicatifTelInput').length) 448 { 449 var telInput = window.intlTelInputGlobals.getInstance(this); 450 if (typeof telInput != 'undefined') 451 $(this).parent().parent().parent().find('.indicatifTelInput').val(telInput.getNumber()); 452 } 453 }); 454 } 455 456 var error_forumlaire = false; 457 var error_email = false; 458 459 var lang_selected = undefined; 460 461 if( typeof langue_selected != 'undefined') 462 lang_selected = langue_selected; 463 464 if (typeof lang_selected == 'undefined') 465 { 466 if ($('#langue_selected').length && $('#langue_selected').val()) 467 lang_selected = $('#langue_selected').val(); 468 else 469 lang_selected = ''; 470 } 471 472 var list_error = []; 473 474 formulaire.find('.in_error').removeClass('in_error'); 475 476 formulaire.find('.obligatoire').each( function(){ 477 478 var force_check_not_visible = false; 479 480 if (!$(this).is(':visible')) 481 { 482 var parents = $(this).parents(); 483 var all_parents_visible = true; 484 485 parents.each(function () { 486 // si un parent est caché explicitement (onglet non sélectionné non inclus) 487 if ($(this).css('display') == 'none' && !($(this).hasClass('ui-tabs-panel') && $(this).hasClass('ui-tabs-hide'))) { 488 all_parents_visible = false; 489 } 490 }); 491 492 if ( 493 // si le champs est obligatoire mais dans un onglet non sélectionné 494 $(this).parents('div.ui-tabs-panel.ui-tabs-hide').size() && 495 // et que la ligne n'est pas cachée par autre chose 496 all_parents_visible 497 ) { 498 // alors il faut quand même faire la verif du champs 499 force_check_not_visible = true; 500 } 501 else { 502 return; 503 } 504 } 505 506 if ($(this).is('.multipleSelect')) 507 { 508 if (!$(this).find('.nOption input:checked').size()) 509 { 510 $(this).removeClass('in_ok').addClass('in_error'); 511 error_forumlaire = true; 512 } 513 else if (!$(this).is('.verif-mail')) 514 { 515 $(this).removeClass('in_error'); 516 } 517 } 518 else if ($(this).is('.tinymce_emploi, .tinymce_mail, .tinymce, .tinymce_all')) 519 { 520 var id_span = $(this).attr('id'); 521 var html_span = $("#" + id_span + "_ifr").contents().find('body').html(); 522 523 if (id_span && ( html_span == '<p><br mce_bogus="1"></p>' || html_span == '<p><br _mce_bogus="1"></p>' || html_span == '<p><br></p>' || html_span == '<p><br data-mce-bogus="1"></p>' )) 524 { 525 $("#" + id_span + "_ifr").closest('td').removeClass('in_ok').addClass('in_error'); 526 error_forumlaire = true; 527 } 528 else if (!$(this).is('.verif-mail')) 529 { 530 $("#" + id_span + "_ifr").closest('td').removeClass('in_error'); 531 } 532 } 533 else if ($(this).is('.simple-search') || $(this).is('.na-select2-autocomplete')) 534 { 535 myElement = $(this).get(0); 536 537 // get first next element .select2-selection 538 myElement = myElement.nextElementSibling; 539 myElement = myElement.getElementsByClassName('select2-selection')[0]; 540 541 if ($(this).val() == null || $(this).val() == '' || !$(this).val().length || $(this).val() == 'null') 542 { 543 myElement.classList.add('in_error'); 544 error_forumlaire = true; 545 } else{ 546 myElement.classList.remove('in_error'); 547 } 548 } 549 else if( $(this).hasClass('radio_mandatory')) 550 { 551 552 var error_forumlaire_tmp = true; 553 $(this).find("[type='radio']").each(function () { 554 if( $(this).is(':checked') ) { 555 error_forumlaire_tmp = false; 556 } 557 }); 558 559 if( error_forumlaire_tmp ) { 560 $(this).addClass('in_error'); 561 error_forumlaire = error_forumlaire_tmp; 562 } else { 563 $(this).removeClass('in_error'); 564 } 565 } 566 else if($(this).hasClass('checkbox_mandatory')) 567 { 568 var error_forumlaire_tmp = true; 569 $(this).find("[type='checkbox']").each(function () { 570 if( $(this).is(':checked') ) { 571 error_forumlaire_tmp = false; 572 } 573 }); 574 575 if( error_forumlaire_tmp ) { 576 $(this).addClass('in_error'); 577 error_forumlaire = error_forumlaire_tmp; 578 } else { 579 $(this).removeClass('in_error'); 580 } 581 } 582 else if($(this).hasClass('checkbox_mandatory_inline')) 583 { 584 var error_forumlaire_tmp = true; 585 $(this).find("[type='checkbox']").each(function () { 586 if( $(this).is(':checked') ) { 587 error_forumlaire_tmp = false; 588 } 589 }); 590 591 if( error_forumlaire_tmp ) { 592 $(this).addClass('error'); 593 $(this).find('a').each(function() { 594 $(this).addClass('error'); 595 }); 596 597 error_forumlaire = error_forumlaire_tmp; 598 } else { 599 $(this).removeClass('error'); 600 $(this).find('a').each(function() { 601 $(this).removeClass('error'); 602 }); 603 } 604 } 605 else if ($(this).hasClass('bool-slider')) 606 { 607 var input_name = $(this).data('name'); 608 if ($(this).find('[name="' + input_name + '"]').val() === '') { 609 error_forumlaire = true; 610 $(this).addClass('error'); 611 } 612 else { 613 $(this).removeClass('error'); 614 } 615 } 616 else 617 { 618 var val = $(this).val(); 619 if($(this).hasClass('not-accept-0') && val === '0') 620 val = ''; 621 622 if (!val && !($(this).hasClass('accept-0') && val === 0) ) 623 { 624 if ($(this).is(":visible") || force_check_not_visible) 625 { 626 $(this).removeClass('in_ok').addClass('in_error'); 627 error_forumlaire = true; 628 list_error.push($(this).data('libelle'));
629 } 630 } 631 else if (!$(this).is('.verif-mail')) 632 { 633 $(this).removeClass('in_error'); 634 } 635 else if ($(this).is('.verif-mail')) { 636 $(this).addClass('in_error'); 637 error_forumlaire = true; 638 } 639 } 640 }); 641 642 if(error_forumlaire) 643 { 644 var title; 645 var msg; 646 647 title = polyglot.t("core.error"); 648 msg = polyglot.t("profile.please_fill_mandatory_fields"); 649 650 if( typeof display_error != 'undefined' && display_error && list_error.length ) { 651 msg += "<div style='text-align:left;margin-left:45px;'>"; 652 list_error.forEach(function(entry) { 653 654 msg += "<br /> - " + entry; 655 }); 656 msg += "</div>"; 657 } 658 659 confirmSwal(title, function() { $.fancybox.hideActivity();}, msg, '', true, false,'#8CD4F5' ); 660 return false; 661 662 //sweetAlert( title , msg ); 663 //return false; 664 665 swal( 666 { 667 title: title, 668 text: msg, 669 type: typeof type != 'undefined' ? type : '',
670 showCancelButton: false, 671 confirmButtonText: "Ok", 672 confirmButtonColor: "#8CD4F5", 673 closeOnConfirm: true 674 }, 675 function () 676 { 677 if ( $('#fancybox-content').length > 0 ) 678 $.fancybox.hideActivity(); 679 } 680 ); 681 return false; 682 683 } 684 else if (error_email) { 685 var msg; 686 msg = polyglot.t("profile.email_incorrect"); 687 dialog_alert('Erreur','<p style="text-align:center;">'+msg+'</p>'); 688 return false; 689 } 690 else if (formulaire.find('input[type="text"][name*="mail"][value!=""].in_error').size()) 691 { 692 var msg; 693 msg = polyglot.t("profile.email_incorrect_sure_continue"); 694 return confirm(msg); 695 } 696 else 697 { 698 return true; 699 } 700} 701 702/***************** 703 * Transforme les liens makeButton en bouton jquery 704 ****************/ 705function displayButton() 706{ 707 $(".makeButton").not('.ui-button').each(function() { 708 $(this).button({ 709 icons: { 710 primary: $(this).attr("icon"), 711 secondary: $(this).attr("iconRight") 712 }, 713 text : $(this).html() 714 }).removeAttr("icon").removeAttr("iconRight").removeClass("makeButton"); 715 }); 716} 717 718function display_profile(alias, type_visu) 719{ 720 var publication = 0; 721 var publication_site = 0; 722 723 // Début : Préparation du tableau 724 var x = new Array(); 725 var a = new Array(); 726 727 $("form[name=formulaire_maj] input:checked").each( 728 function() 729 { 730 if ($(this).attr('name')) 731 { 732 str = $(this).attr('name'); 733 motif = /\[([^\[]*)\]/g; 734 keys = str.match(motif); 735 736 for (k in keys) 737 { 738 keys[k] = keys[k].substring(1, keys[k].length - 1); 739 } 740 a = recursiveTab(keys, $(this).val(), a); 741 } 742 } 743 ); 744 745 x = a; 746 x = serialize(x); 747 748 // Fin : Préparation du tableau 749 var data = "alias=" + alias; 750 data += "&ajax=" + 1; 751 data += "&type_visu=" + type_visu; 752 data += "&publication_ajax=" + x; 753 754 $.ajax({ 755 url: '/global/gene/ajax_saveTemporaryPrivacyParams.php', 756 type: 'POST', 757 async: false,// Pour nepas être bloqué par les bloqueurs de pop-up 758 data: { 'privacy' : x }, 759 success: function() { 760 MM_openBrWindow('/profil/' + alias + '?viewAs=' + type_visu, 'Votreprofil', 'width=1050,height=900,scrollbars=yes'); 761 } 762 }); 763} 764 765function recursiveTab(keyList, value, tab) 766{ 767 var res; 768 769 res = new Array(); 770 if (tab instanceof Array) 771 { 772 res = tab; 773 } 774 775 if(keyList) 776 if (keyList.length == 1) 777 { 778 res[keyList[0]] = value; 779 } 780 else 781 { 782 var key1 = keyList[0]; 783 784 if (!typeof res[key1] == Array) 785 res[key1] = new Array(); 786 787 keyList.shift(); 788 res[key1] = recursiveTab(keyList, value, res[key1]); 789 } 790 return res; 791} 792 793$(function() { 794 $("#dialog_profile").dialog({ 795 height: 600, 796 width: 900, 797// position:top, pour une raison inconnu, fait bugger le chargement des widget sous firefox (lors d'un chargement depuis une iframe) 798 modal: true, 799 autoOpen: false, 800 buttons: { [polyglot.t('common.ok')]: function() { $(this).dialog("close");}} 801 }); 802 $("#tabs_carnet").tabs({ ajaxOptions: { 803 beforeSend: function(){ 804 $('#tabs_carnet div:visible').empty().append('<div align="center"><img src="/global/images/loading_bar_red.gif" /></div>'); 805 } 806 }, 807 load: function(event, ui){ 808 updatePres('#tabs_carnet div:visible'); 809 } 810 }); 811 812 //$("select[multiple]").selectMultiple({ height : 'css' });
813 814 if (typeof fancybox != 'undefined') 815 $(".fancyPics").fancybox({'hideOnContentClick': true}); 816 817 $(document).on('submit', 'form:not(.no_obligatoire)', function() { 818 var res = verifFormulaire($(this)); 819 $(this).trigger('verifFormulaireDone', res); 820 return res; 821 }); 822 823 displayButton(); 824}); 825 826 827 828function supprimer_documents(id_doc){ 829 if(id_doc){ 830 831 if(confirm(polyglot.t("doc.confirm_delete_doc"))) { 832 var data = "del_id_doc=" + id_doc; 833 834 $.ajax({ 835 836 url: "/global/ressources/ajax/suppression_document.php", 837 type: "POST", 838 data: data, 839 success: function(html){ 840 if(!html){ 841 polyglot.t("doc.doc_deleted"); 842 $(".ligne_document_" + id_doc).fadeOut(); 843 } else { 844 alert("Une erreur est survenue, la suppression n'a pu \352tre effectu\351"); 845 } 846 } 847 }); 848 } 849 } else { 850 polyglot.t("doc.no_document_selected"); 851 } 852} 853 854 855function stockHisto(as_no, adresse) 856{ 857 858 $('#stockHisto'+adresse).hide(); 859 860 var $tabs = $('#EventEditorContainer').tabs(); 861 var current = $tabs.tabs('option', 'selected'); 862 $( "#EventEditorContainer" ).tabs({ selected: current+1 }); 863 864 865 $.post('/global/module/ep/ressources/ajax/ajax_hasHistoAdresse.php', {'as_no' : as_no }, function(data) { 866 addStockHisto(as_no, adresse, data); 867 }); 868 869} 870 871 872function addStockHisto(as_no, adresse, num) 873{ 874 if (num != 'no') 875 { 876 num++; 877 addHisto(); 878 } 879 else 880 { 881 num = 1; 882 } 883 884 $.post('/global/module/ep/ressources/ajax/ajax_getAdressePro.php', { 885 'as_no': as_no, 886 'ordre': adresse 887 }, function (data) { 888 var entree_pro = ''; 889 var tab_entree_pro; 890 891 var sortie_pro = ''; 892 var tab_sortie_pro; 893 894 if (!data || typeof data['entree_pro'] === 'undefined' || data['entree_pro'] === '0000-00-00') 895 { 896 var date_debut = new Date(); 897 entree_pro = date_debut.getFullYear() + '-' + (date_debut.getMonth().length < 2 ? '0' + date_debut.getMonth() : date_debut.getMonth()) + '-' + (date_debut.getDate().length < 2 ? '0' + date_debut.getDate() : date_debut.getDate()); 898 tab_entree_pro = entree_pro.split('-'); 899 tab_entree_pro[1] = parseInt(tab_entree_pro[1]) + 1; 900 if (tab_entree_pro[1].length < 2) 901 tab_entree_pro[1] = '0' + tab_entree_pro[1]; 902 entree_pro = tab_entree_pro[0] + '-' + tab_entree_pro[1] + '-' + tab_entree_pro[2]; 903 } 904 else if (data && data['entree_pro'] !== '0000-00-00') 905 { 906 tab_entree_pro = data['entree_pro'].split('-'); 907 if (tab_entree_pro[1].length < 2) 908 tab_entree_pro[1] = '0' + tab_entree_pro[1]; 909 entree_pro = tab_entree_pro[0] + '-' + tab_entree_pro[1] + '-' + tab_entree_pro[2]; 910 } 911 912 if (!data || typeof data['sortie_pro'] === 'undefined' || data['sortie_pro'] === '0000-00-00') 913 { 914 var date_fin = new Date(); 915 sortie_pro = date_fin.getFullYear() + '-' + (date_fin.getMonth().length < 2 ? '0' + date_fin.getMonth() : date_fin.getMonth()) + '-' + (date_fin.getDate().length < 2 ? '0' + date_fin.getDate() : date_fin.getDate()); 916 tab_sortie_pro = sortie_pro.split('-'); 917 tab_sortie_pro[1] = parseInt(tab_sortie_pro[1]) + 1; 918 tab_sortie_pro[1] = tab_sortie_pro[1].toString(); 919 if (tab_sortie_pro[1].length < 2) { 920 tab_sortie_pro[1] = '0' + tab_sortie_pro[1]; 921 } 922 if (tab_sortie_pro[2].length < 2) { 923 tab_sortie_pro[2] = '0' + tab_sortie_pro[2]; 924 } 925 926 sortie_pro = tab_sortie_pro[0] + '-' + tab_sortie_pro[1] + '-' + tab_sortie_pro[2]; 927 } 928 else if (data && data['sortie_pro'] !== '0000-00-00') 929 { 930 tab_sortie_pro = data['sortie_pro'].split('-'); 931 if (tab_sortie_pro[1].length < 2) 932 tab_sortie_pro[1] = '0' + tab_sortie_pro[1]; 933 sortie_pro = tab_sortie_pro[0] + '-' + tab_sortie_pro[1] + '-' + tab_sortie_pro[2]; 934 } 935 936 $('#entree_histo' + num).val(entree_pro); 937 $('#sortie_histo' + num).val(sortie_pro); 938 939 if ($('#entree_histo_d_' + num).length) 940 $('#entree_histo_d_' + num).val(tab_entree_pro[2]); 941 942 if ($('#entree_histo_m_' + num).length) 943 $('#entree_histo_m_' + num).val(tab_entree_pro[1]); 944 945 if ($('#entree_histo_y_' + num).length) 946 $('#entree_histo_y_' + num).val(tab_entree_pro[0]); 947 948 if (sortie_pro) 949 { 950 if ($('#sortie_histo_d_' + num).length) 951 $('#sortie_histo_d_' + num).val(tab_sortie_pro[2]); 952 953 if ($('#sortie_histo_m_' + num).length) 954 $('#sortie_histo_m_' + num).val(tab_sortie_pro[1]); 955 956 if ($('#sortie_histo_y_' + num).length) 957 $('#sortie_histo_y_' + num).val(tab_sortie_pro[0]); 958 } 959 960 if (!data) 961 return; 962 963 $('#entreprise_histo' + num).val(data['entreprise']); 964 $('#direction_histo' + num).val(data['direction']); 965 $('#direction2_histo' + num).val(data['direction_2']); 966 $('#direction3_histo' + num).val(data['direction_3']); 967 $('#secteur_histo' + num).val(data['secteur']).trigger('change'); 968 $('#poste_histo' + num).val(data['poste']); 969 $('#fonction_histo' + num).val(data['id_fonction']).trigger('change'); 970 $('#pays_histo' + num).val(data['id_pays']); 971 $('#ville_histo' + num).val(data['ville']); 972 $('#histo_statut' + num).val(data['statut_pro']); 973 974 $('#contrat_histo' + num).val(data['contrat']); 975 976 if ($('#userfile_histo' + num).length) 977 $('#userfile_histo' + num).val(data['logo_entreprise']); 978 979 if ($('#direction_histo' + num).length) 980 $('#direction_histo' + num).val(data['direction']); 981 982 if ($('#direction_histo_2' + num).length) 983 $('#direction_histo_2' + num).val(data['direction_2']); 984 985 if ($('#direction_histo_3' + num).length) 986 $('#direction_histo_3' + num).val(data['direction_3']); 987 988 }, 'json'); 989}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.