$(document).ready(function(){ $(".date input[type=text]").datepicker({ regional: 'fr', dateFormat: $.datepicker.W3C, showAnim: "fadeIn", showOtherMonths: true, selectOtherMonths: true, firstDay: 1, showOn: "both", buttonImage: "styles/images/icon_calendar.png", buttonImageOnly: true, buttonText: 'Choisir une date', showButtonPanel: true }).css({width: '7em'}); $(".date_fr input").datepicker({ regional: 'fr', dateFormat: 'dd/mm/yy', showAnim: "fadeIn", changeYear: true, yearRange: 'c-90:c+3', shortYearCutoff: +3, showOtherMonths: true, selectOtherMonths: true, firstDay: 1, showOn: "both", buttonImage: "styles/images/icon_calendar.png", buttonImageOnly: true, buttonText: 'Choisir une date', showButtonPanel: true }).css({width: '7em'});// Champ "date" avec datepicker function isDateTypeAccepted() { var el = document.createElement('input'), notADateValue = 'not-a-date'; el.setAttribute('type','date'); el.setAttribute('value', notADateValue); return !(el.value === notADateValue); }; if ( !isDateTypeAccepted() ) { $("div.input-group.datepicker_BS input[type=date]").each( function() { var input_el = $(this); input_el.attr("type","text"); input_el.datepicker({ regional: 'fr', dateFormat: $.datepicker.W3C, showAnim: "fadeIn", showOtherMonths: true, selectOtherMonths: true, firstDay: 1, showOn: "focus", showButtonPanel: true }).css({width: '7em'}); input_el.parent().append('
'); input_el.siblings(".datepicker_BS_trigger").click(function() { input_el.datepicker("show"); }); }); } $('[id^="etudiant_inscription_payee_select_"]').hide();; $('[id^="etudiant_inscription_tarif_select_"]').hide();; //alert('DEV'); $('[class^="eval_col_note_finale_pc"]').hide(); //alert('DEV'); $('input[id*="document_date_obtention"]').parent().hide(); //console.info('IF'); $('[class^="paiements_liste_col_ordre_recette"]').show(); $('[class^="paiements_liste_col_contrat_numero"]').hide(); $('.etudiant_paiement_date_effet').hide(); $('#cours-recette-minimale-div').hide(); }); // Test la "fraicheur" du token gmail. function testGmailTokenValide() { var reponse = false; $.ajax({ url: "gconsent.php", data: { "action": "checkToken", "hantok": "" }, crossDomain: true, async: false, //pour pas que 'return reponse' soit executé avant la fin de l'appel ajax. success: function(msg) { //console.info('msg='+msg); if ( msg == 0 ) { } else if ( msg == 1 ) { reponse = true; } else { //window.location.href = "msg"; window.open(msg); //window.open('gconsent.php?redirect='+msg); } } }); return reponse; } // La meme que au dessus mais retourne directement un objet promise function testGmailTokenValid_promise() { var prom = new Promise( function( resolv,reject) { $.ajax({ url: "gconsent.php", data: { "action": "checkToken", "hantok": "" }, //crossDomain: true, success: function(msg) { console.info('msg='+msg); if ( msg == 1 ) resolv(); else if ( msg == 0 ) reject(0); else { window.open(msg, '_blank'); reject(1); } } }); }); return prom; } // Objet generic pour beneficier du gettext dans PHP. const Hanaf_tpl = { // pour Hanaf.addPersonnePicker() dans defaults.js 'addPersonnePicker': { 'libelle_dft': { 'form' : { 'champs': { 'nom': 'Nom', 'prenom': 'Prénom', 'date_naissance': 'Date de naissance', 'identifiant_manuel': 'Identifiant Manuel' }, 'btn': { 'chercher': 'Chercher', 'reinitialiser': 'Reinitialiser', } }, 'details' : { 'champs' : { 'civilite': 'Civilité', 'genre': 'Genre', 'nom': 'Nom', 'prenom': 'Prénom', 'date_naissance': 'Date de Naissance', 'ville_naissance': 'Ville de naissance', 'pays_naissance': 'Pays de naissance', 'nationalite': 'Nationalité', 'telepphon1': 'Télèphone 1', 'email1': 'Email 1' }, 'btn': { 'selection': 'Selectionner cette personne' } } } } };