diff --git a/js/action-script.js b/js/action-script.js index 8ebe456..3cf799c 100755 --- a/js/action-script.js +++ b/js/action-script.js @@ -135,8 +135,8 @@ var navMenu = function(section){ }; - /* (x) Si on change de page, on charge la nouvelle charge */ - ( DOM.CONTAINER.innerHTML.length === 0 || target.getData('link') != pageManager.page ) && pageManager.setPage( target.getData('link') ); + /* (x) Si première ou changement de page, on charge la nouvelle */ + pageManager.page != target.getData('link') && pageManager.setPage( target.getData('link') ); // Si on a `pageManager.activeXHR`, on met le handler, sinon on lance pageManager.activeXHR ? pageManager.activeXHR.addEventListener('loadend', handlerX, false) : handlerX.call(); @@ -242,10 +242,8 @@ LOGIN.hide.addEventListener('click', function(e){ LOGIN.page.className = ''; api.send({path:'download/menu'}, function(response){ // si erreur - if( response.ModuleError != 0 ){ - console.warn('menu load error: '+response.ModuleError); + if( response.ModuleError !== 0 ) return; - } // On initialise la liste des pages pagelist = []; @@ -254,7 +252,6 @@ api.send({path:'download/menu'}, function(response){ for( var i = 0 ; i < response.menu.length; i++ ) pagelist.push( response.menu[i].attributes['data-link'] ); - console.log('menu loaded', pagelist); /* (1) On initialisa pageManager */ pageManager = new pageManagerClass(); pageManager.setPage(null, '/view', DOM.CONTAINER, pagelist, null ); diff --git a/js/includes/input-phone-subject.js b/js/includes/input-phone-subject.js index dcbbb69..57ee073 100644 --- a/js/includes/input-phone-subject.js +++ b/js/includes/input-phone-subject.js @@ -1,7 +1,6 @@ /* [0] Constructeur -> définit le conteneur et le bouton d'ajout =========================================================*/ -function inputPhoneSubject(iTmpId, iSubjectId, store_button){ - this.tmp_id = iTmpId; +function inputPhoneSubject(iSubjectId, store_button){ this.subject_id = iSubjectId; this.store_button = store_button; } @@ -10,7 +9,6 @@ function inputPhoneSubject(iTmpId, iSubjectId, store_button){ =========================================================*/ inputPhoneSubject.prototype = { store_button: this.store_button, // Bouton d'ajout d'un formulaire - tmp_id: this.tmp_id, subject_id: this.subject_id, handler: null }; @@ -33,7 +31,6 @@ inputPhoneSubject.prototype.fieldsToStorage = function(){ // {2} On récupère et met en forme les valeurs du deflater // var obj = { - tmp_id: this.tmp_id.value, subject_id: this.subject_id.value }; @@ -58,10 +55,9 @@ inputPhoneSubject.prototype.storageToFields = function(){ // {1} On récupère les informations du sujet // var subjectData = lsi.get('p_subject', 0); - subjectData = subjectData || { tmp_id: '', subject_id: '' }; + subjectData = subjectData || { subject_id: '' }; // {2} On restore les valeurs // - this.tmp_id.value = subjectData.tmp_id; this.subject_id.value = subjectData.subject_id; @@ -81,13 +77,13 @@ inputPhoneSubject.prototype.attach = function(handler){ // Pointeur pour les scopes des addEventListener() this.handler = handler; - var ptr = this; + // Handler de mise à jour quand les champs sont bons - function fts(e){ - ptr.fieldsToStorage(); - ptr.handler(true); - ptr.storageToFields(); - } + var fts = function(e){ + this.fieldsToStorage(); + this.handler(true); + this.storageToFields(); + }.bind(this); /* (2) On attache l'évènement sur le bouton d'enregistrement */ diff --git a/js/includes/min/input-phone-subject.js b/js/includes/min/input-phone-subject.js index b3dc4a1..9f8b127 100644 --- a/js/includes/min/input-phone-subject.js +++ b/js/includes/min/input-phone-subject.js @@ -1,3 +1,3 @@ -function inputPhoneSubject(a,b,c){this.tmp_id=a;this.subject_id=b;this.store_button=c}inputPhoneSubject.prototype={store_button:this.store_button,tmp_id:this.tmp_id,subject_id:this.subject_id,handler:null};inputPhoneSubject.prototype.check=function(){return 0 span[data-link="+pageManager.page+'] + div.sub > span[data-sublink="'+pageManager.vars[0]+'"]'),b=null,b=a instanceof Element?a:null,b="string"==typeof a?$("#MENU-SIDE > span[data-link="+pageManager.page+'] + div.sub > span[data-sublink="'+a+'"]'):b,b=null==b?$("#MENU-SIDE > span[data-link="+pageManager.page+"] + div.sub > span[data-sublink]"):b;if(null==b)return!1;null!=c&&c.remClass("active");c=$$("#CONTAINER > section[data-sublink].active"); for(a=0;a section[data-sublink="'+b.getData("sublink")+'"]'),a=0;a #MENU-SIDE > span[data-link="'+pageManager.page+'"]'),b=null,b=a instanceof Element?a:null,b=(b="string"==typeof a?$('#WRAPPER > #MENU-SIDE > span[data-link="'+ a+'"]'):b)||$('#WRAPPER > #MENU-SIDE > span[data-link="'+pageManager.pagelist[0]+'"]');if(null==b)return!1;c&&c.remClass("active");b&&b.addClass("active");b.getData("link")&&(DOM.HEADER.addClass("loading"),a=function(){1<=pageManager.vars.length&&null!=$('#CONTAINER > section[data-sublink="'+pageManager.vars[0]+'"]')?navSubMenu(pageManager.vars[0]):navSubMenu(null);var a=$("#MENU-SIDE > span[data-link="+pageManager.page+"] + div.sub");null!=a&&a.addEventListener("click",function(a){for(a=a.target;a!= -document.body&&!a.getData("sublink");)a=a.parentNode;a.getData("sublink")&&navSubMenu(a)},!1);DOM.HEADER.remClass("loading")},0!==DOM.CONTAINER.innerHTML.length&&b.getData("link")==pageManager.page||pageManager.setPage(b.getData("link")),pageManager.activeXHR?pageManager.activeXHR.addEventListener("loadend",a,!1):a.call())};DOM={WRAPPER:$("body > #WRAPPER"),HEADER:$("body > #WRAPPER > #HEADER"),MENUSIDE:$("body > #WRAPPER > #MENU-SIDE"),CONTAINER:$("body > #WRAPPER > #CONTAINER")};api=new APIClass("/api/"); -Notification=new NotificationClass($("#notification-container"));Notification.defaultTimeout=4E3; -Notification.errorCodes={"-1":"Erreur de r\u00e9seau, veuillez recharger la page et r\u00e9essayer",0:"Erreur interne",1:"Erreur interne",2:"Erreur interne",3:"Le fichier est introuvable",4:"Erreur interne",5:"Erreur interne",6:"Erreur interne",7:"Erreur interne",8:"Erreur interne",9:"Certaines donn\u00e9es sont manquantes",10:"Erreur interne",11:"Erreur interne",12:"Erreur interne",13:"Erreur interne",14:"Erreur interne",15:"Erreur interne",16:"Vous n'avez pas la permission d'effectuer cette action", -17:"Le t\u00e9l\u00e9chargement a \u00e9chou\u00e9",18:"Le fichier est invalide (format incorrect)"};lsi.setStorage(localStorage);DOM.MENUSIDE.addEventListener("click",function(a){for(a=a.target;a!=document.body&&!a.getData("link");)a=a.parentNode;a.getData("link")&&navMenu(a.getData("link"))},!1);function reload(){navMenu(pageManager.page)}var LOGIN={show:document.getElementById("user-data"),hide:document.getElementById("login-close"),page:document.getElementById("LOGIN")}; -LOGIN.show.addEventListener("click",function(a){LOGIN.page.className="active"},!1);LOGIN.hide.addEventListener("click",function(a){LOGIN.page.className=""},!1); -api.send({path:"download/menu"},function(a){if(0!=a.ModuleError)console.warn("menu load error: "+a.ModuleError);else{pagelist=[];for(var c=0;c #WRAPPER"),HEADER:$("body > #WRAPPER > #HEADER"),MENUSIDE:$("body > #WRAPPER > #MENU-SIDE"),CONTAINER:$("body > #WRAPPER > #CONTAINER")};api=new APIClass("/api/");Notification=new NotificationClass($("#notification-container")); +Notification.defaultTimeout=4E3; +Notification.errorCodes={"-1":"Erreur de r\u00e9seau, veuillez recharger la page et r\u00e9essayer",0:"Erreur interne",1:"Erreur interne",2:"Erreur interne",3:"Le fichier est introuvable",4:"Erreur interne",5:"Erreur interne",6:"Erreur interne",7:"Erreur interne",8:"Erreur interne",9:"Certaines donn\u00e9es sont manquantes",10:"Erreur interne",11:"Erreur interne",12:"Erreur interne",13:"Erreur interne",14:"Erreur interne",15:"Erreur interne",16:"Vous n'avez pas la permission d'effectuer cette action",17:"Le t\u00e9l\u00e9chargement a \u00e9chou\u00e9", +18:"Le fichier est invalide (format incorrect)"};lsi.setStorage(localStorage);DOM.MENUSIDE.addEventListener("click",function(a){for(a=a.target;a!=document.body&&!a.getData("link");)a=a.parentNode;a.getData("link")&&navMenu(a.getData("link"))},!1);function reload(){navMenu(pageManager.page)}var LOGIN={show:document.getElementById("user-data"),hide:document.getElementById("login-close"),page:document.getElementById("LOGIN")}; +LOGIN.show.addEventListener("click",function(a){LOGIN.page.className="active"},!1);LOGIN.hide.addEventListener("click",function(a){LOGIN.page.className=""},!1);api.send({path:"download/menu"},function(a){if(0===a.ModuleError){pagelist=[];for(var c=0;cerror == ManagerError::Success )

Identifier l'enquêté

- + "),c.push("
"+ a.results[g].name+"
"),c.push("
"+a.results[g].creation+"
"),c.push("
"),c.push("
"),c.push("
"),c.push("
"),c.push("");sList.innerHTML= c.join("")})};sSubmit.addEventListener("click",tmpSubjectSearchListener,!1);sField.addEventListener("keypress",function(a){13===a.keyCode&&tmpSubjectSearchListener(a)},!1); -var pAlready=!1,pLoaded=[!1,!1,!1,!1,!1],phoneRoutine=function(){pLoaded[0]&&pLoaded[1]&&pLoaded[2]&&pLoaded[3]&&pLoaded[4]&&!pAlready&&(pAlready=!0,console.group("[phone] Initialization"),pSubjectManager=new inputPhoneSubject($('[data-sublink="phone"] article.subject-panel [data-name="tmp_id"]'),$('[data-sublink="phone"] article.subject-panel [data-name="subject_id"]'),$('[data-sublink="phone"] article.subject-panel [data-name="submit"]')),pSubjectManager.attach(pDynamicUpdate),pContactManager=new inputPhoneContact($('[data-sublink="phone"] article.contact-panel'), +var pAlready=!1,pLoaded=[!1,!1,!1,!1,!1],phoneRoutine=function(){pLoaded[0]&&pLoaded[1]&&pLoaded[2]&&pLoaded[3]&&pLoaded[4]&&!pAlready&&(pAlready=!0,console.group("[phone] Initialization"),pSubjectManager=new inputPhoneSubject($('[data-sublink="phone"] article.subject-panel [data-name="subject_id"]'),$('[data-sublink="phone"] article.subject-panel [data-name="submit"]')),pSubjectManager.attach(pDynamicUpdate),pContactManager=new inputPhoneContact($('[data-sublink="phone"] article.contact-panel'), $('[data-sublink="phone"] #p_nav-contact')),pContactManager.attach(pDynamicUpdate),pMiniManager=new inputPhoneMini($('[data-sublink="phone"] article.mini-relation-panel'),$('[data-sublink="phone"] #p_nav-mini')),pMiniManager.attach(pDynamicUpdate),pFicheManager=new inputPhoneFiche($('[data-sublink="phone"] article.relation-panel'),$('[data-sublink="phone"] #p_nav-fiche')),pFicheManager.attach(pDynamicUpdate),pMatriceManager=new inputPhoneMatrice($('[data-sublink="phone"] article.matrice-panel')), pMatriceManager.attach(pDynamicUpdate),$('[data-sublink="phone"] #p_clear-all').addEventListener("click",function(a){lsi.clear("p_subject");lsi.clear("p_contacts");lsi.clear("p_mini-fiches");lsi.clear("p_fiches");lsi.clear("p_matrice");lsi.clear("p_friends");pSubjectManager.storageToFields();pContactManager.storageToFields();pMiniManager.storageToFields();pFicheManager.storageToFields();pMatriceManager.storageToFields();Notification.success("OK","Les donn\u00e9es ont \u00e9t\u00e9 supprim\u00e9es")}, !1),$('[data-sublink="phone"] #p_export-all').addEventListener("click",function(a){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");a={subject:lsi["export"]("p_subject")[0],contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};var b=$('[data-sublink="phone"] #p_download-target');b.download="local-facebook-data.json";b.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(a)); @@ -11,16 +11,16 @@ a.ModuleError),!1;lsi.set("p_subject",0,a.local_data.subject);lsi["import"]("p_c pContactManager.fieldsToStorage();pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du sujet"),!1;a=lsi["export"]("p_mini-fiches");var b=0,c;for(c in a)if(!isNaN(c)&&(b++,!a[c].valid))return Notification.warning("Attention","La fiche rapide "+b+" est incompl\u00e8te et/ou incorrecte"),!1;a=lsi["export"]("p_fiches");for(c in a)if(!a[c].valid)return Notification.warning("Attention", "La fiche compl\u00e8te "+(parseInt(c)+1)+" est incompl\u00e8te et/ou incorrecte"),!1;c={path:"input/facebook",subject:lsi["export"]("p_subject")[0],contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};api.send(c,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;Notification.success("OK","L'identifiant du sujet est "+a.subject_id+" ! Tout s'est bien d\u00e9roul\u00e9.", 1E4);console.log(a)},!1)},!1),console.groupEnd("[phone] Initialization"))};include("/js/includes/input-phone-subject.js",function(){pLoaded[0]=!0;phoneRoutine()});include("/js/includes/input-phone-contact.js",function(){pLoaded[1]=!0;phoneRoutine()});include("/js/includes/input-phone-mini.js",function(){pLoaded[2]=!0;phoneRoutine()});include("/js/includes/input-phone-fiche.js",function(){pLoaded[3]=!0;phoneRoutine()});include("/js/includes/input-phone-matrice.js",function(){pLoaded[4]=!0;phoneRoutine()}); -var fAlready=!1,fLoaded=[!1,!1,!1,!1,!1],facebookRoutine=function(){fLoaded[0]&&fLoaded[1]&&fLoaded[2]&&fLoaded[3]&&fLoaded[4]&&!fAlready&&(fAlready=!0,console.group("[facebook] Initialization"),fSubjectManager=new inputFacebookSubject($('[data-sublink="facebook"] article.subject-panel [data-name="tmp_id"]'),$('[data-sublink="facebook"] article.subject-panel [data-name="subject_id"]'),$('[data-sublink="facebook"] article.subject-panel [data-name="submit"]')),fSubjectManager.attach(fDynamicUpdate), -fContactManager=new inputFacebookContact($('[data-sublink="facebook"] article.contact-panel'),$('[data-sublink="facebook"] #f_nav-contact')),fContactManager.attach(fDynamicUpdate),fMiniManager=new inputFacebookMini($('[data-sublink="facebook"] article.mini-relation-panel'),$('[data-sublink="facebook"] #f_nav-mini')),fMiniManager.attach(fDynamicUpdate),fFicheManager=new inputFacebookFiche($('[data-sublink="facebook"] article.relation-panel'),$('[data-sublink="facebook"] #f_nav-fiche')),fFicheManager.attach(fDynamicUpdate), -fMatriceManager=new inputFacebookMatrice($('[data-sublink="facebook"] article.matrice-panel')),fMatriceManager.attach(fDynamicUpdate),$('[data-sublink="facebook"] #f_clear-all').addEventListener("click",function(a){lsi.clear("f_subject");lsi.clear("f_contacts");lsi.clear("f_mini-fiches");lsi.clear("f_fiches");lsi.clear("f_matrice");lsi.clear("f_friends");fSubjectManager.storageToFields();fContactManager.storageToFields();fMiniManager.storageToFields();fFicheManager.storageToFields();fMatriceManager.storageToFields(); -Notification.success("OK","Les donn\u00e9es ont \u00e9t\u00e9 supprim\u00e9es")},!1),$('[data-sublink="facebook"] #f_export-all').addEventListener("click",function(a){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");a={subject:lsi["export"]("f_subject")[0],contacts:lsi["export"]("f_contacts"),mini:lsi["export"]("f_mini-fiches"),fiches:lsi["export"]("f_fiches"),matrice:lsi["export"]("f_matrice")[0]};var b=$('[data-sublink="facebook"] #f_download-target');b.download= -"local-phone-data.json";b.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(a));b.click()},!1),$('[data-sublink="facebook"] #f_import-all').addEventListener("click",function(a){$('[data-sublink="facebook"] #f_local-upload').click()},!1),$('[data-sublink="facebook"] #f_local-upload').addEventListener("click",function(a){a.target.value=null},!1),$('[data-sublink="facebook"] #f_local-upload').addEventListener("change",function(a){a={path:"upload/local_data",file:$('[data-sublink="facebook"] #f_local-upload').files[0]}; -api.send(a,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("Erreur",a.ModuleError),!1;lsi.set("f_subject",0,a.local_data.subject);lsi["import"]("f_contacts",a.local_data.contacts);lsi["import"]("f_mini-fiches",a.local_data.mini);lsi["import"]("f_fiches",a.local_data.fiches);lsi.set("f_matrice",0,a.local_data.matrice);pSubjectManager.storageToFields();pContactManager.storageToFields();pMatriceManager.storageToFields();pDynamicUpdate(!0)})},!1),$('[data-sublink="facebook"] #f_submit-all').addEventListener("click", -function(a){console.log("> GATHERING ALL DATA");pSubjectManager.fieldsToStorage();pContactManager.fieldsToStorage();pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du sujet"),!1;a=lsi["export"]("f_mini-fiches");var b=0,c;for(c in a)if(!isNaN(c)&&(b++,!a[c].valid))return Notification.warning("Attention","La fiche rapide "+b+" est incompl\u00e8te et/ou incorrecte"), -!1;a=lsi["export"]("f_fiches");for(c in a)if(!a[c].valid)return Notification.warning("Attention","La fiche compl\u00e8te "+(parseInt(c)+1)+" est incompl\u00e8te et/ou incorrecte"),!1;c={path:"input/phone",subject:lsi["export"]("f_subject")[0],contacts:lsi["export"]("f_contacts"),mini:lsi["export"]("f_mini-fiches"),fiches:lsi["export"]("f_fiches"),matrice:lsi["export"]("f_matrice")[0]};api.send(c,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError), -!1;Notification.success("OK","L'identifiant du sujet est "+a.subject_id+" ! Tout s'est bien d\u00e9roul\u00e9.",1E4);console.log(a)},!1)},!1),console.groupEnd("[facebook] Initialization"))};include("/js/includes/input-facebook-subject.js",function(){fLoaded[0]=!0;facebookRoutine()});include("/js/includes/input-facebook-contact.js",function(){fLoaded[1]=!0;facebookRoutine()});include("/js/includes/input-facebook-mini.js",function(){fLoaded[2]=!0;facebookRoutine()}); -include("/js/includes/input-facebook-fiche.js",function(){fLoaded[3]=!0;facebookRoutine()});include("/js/includes/input-facebook-matrice.js",function(){fLoaded[4]=!0;facebookRoutine()}); +var fAlready=!1,fLoaded=[!1,!1,!1,!1,!1],facebookRoutine=function(){fLoaded[0]&&fLoaded[1]&&fLoaded[2]&&fLoaded[3]&&fLoaded[4]&&!fAlready&&(fAlready=!0,console.group("[facebook] Initialization"),fSubjectManager=new inputFacebookSubject($('[data-sublink="facebook"] article.subject-panel [data-name="subject_id"]'),$('[data-sublink="facebook"] article.subject-panel [data-name="submit"]')),fSubjectManager.attach(fDynamicUpdate),fContactManager=new inputFacebookContact($('[data-sublink="facebook"] article.contact-panel'), +$('[data-sublink="facebook"] #f_nav-contact')),fContactManager.attach(fDynamicUpdate),fMiniManager=new inputFacebookMini($('[data-sublink="facebook"] article.mini-relation-panel'),$('[data-sublink="facebook"] #f_nav-mini')),fMiniManager.attach(fDynamicUpdate),fFicheManager=new inputFacebookFiche($('[data-sublink="facebook"] article.relation-panel'),$('[data-sublink="facebook"] #f_nav-fiche')),fFicheManager.attach(fDynamicUpdate),fMatriceManager=new inputFacebookMatrice($('[data-sublink="facebook"] article.matrice-panel')), +fMatriceManager.attach(fDynamicUpdate),$('[data-sublink="facebook"] #f_clear-all').addEventListener("click",function(a){lsi.clear("f_subject");lsi.clear("f_contacts");lsi.clear("f_mini-fiches");lsi.clear("f_fiches");lsi.clear("f_matrice");lsi.clear("f_friends");fSubjectManager.storageToFields();fContactManager.storageToFields();fMiniManager.storageToFields();fFicheManager.storageToFields();fMatriceManager.storageToFields();Notification.success("OK","Les donn\u00e9es ont \u00e9t\u00e9 supprim\u00e9es")}, +!1),$('[data-sublink="facebook"] #f_export-all').addEventListener("click",function(a){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");a={subject:lsi["export"]("f_subject")[0],contacts:lsi["export"]("f_contacts"),mini:lsi["export"]("f_mini-fiches"),fiches:lsi["export"]("f_fiches"),matrice:lsi["export"]("f_matrice")[0]};var b=$('[data-sublink="facebook"] #f_download-target');b.download="local-phone-data.json";b.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(a)); +b.click()},!1),$('[data-sublink="facebook"] #f_import-all').addEventListener("click",function(a){$('[data-sublink="facebook"] #f_local-upload').click()},!1),$('[data-sublink="facebook"] #f_local-upload').addEventListener("click",function(a){a.target.value=null},!1),$('[data-sublink="facebook"] #f_local-upload').addEventListener("change",function(a){a={path:"upload/local_data",file:$('[data-sublink="facebook"] #f_local-upload').files[0]};api.send(a,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("Erreur", +a.ModuleError),!1;lsi.set("f_subject",0,a.local_data.subject);lsi["import"]("f_contacts",a.local_data.contacts);lsi["import"]("f_mini-fiches",a.local_data.mini);lsi["import"]("f_fiches",a.local_data.fiches);lsi.set("f_matrice",0,a.local_data.matrice);pSubjectManager.storageToFields();pContactManager.storageToFields();pMatriceManager.storageToFields();pDynamicUpdate(!0)})},!1),$('[data-sublink="facebook"] #f_submit-all').addEventListener("click",function(a){console.log("> GATHERING ALL DATA");pSubjectManager.fieldsToStorage(); +pContactManager.fieldsToStorage();pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du sujet"),!1;a=lsi["export"]("f_mini-fiches");var b=0,c;for(c in a)if(!isNaN(c)&&(b++,!a[c].valid))return Notification.warning("Attention","La fiche rapide "+b+" est incompl\u00e8te et/ou incorrecte"),!1;a=lsi["export"]("f_fiches");for(c in a)if(!a[c].valid)return Notification.warning("Attention", +"La fiche compl\u00e8te "+(parseInt(c)+1)+" est incompl\u00e8te et/ou incorrecte"),!1;c={path:"input/phone",subject:lsi["export"]("f_subject")[0],contacts:lsi["export"]("f_contacts"),mini:lsi["export"]("f_mini-fiches"),fiches:lsi["export"]("f_fiches"),matrice:lsi["export"]("f_matrice")[0]};api.send(c,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;Notification.success("OK","L'identifiant du sujet est "+a.subject_id+" ! Tout s'est bien d\u00e9roul\u00e9.", +1E4);console.log(a)},!1)},!1),console.groupEnd("[facebook] Initialization"))};include("/js/includes/input-facebook-subject.js",function(){fLoaded[0]=!0;facebookRoutine()});include("/js/includes/input-facebook-contact.js",function(){fLoaded[1]=!0;facebookRoutine()});include("/js/includes/input-facebook-mini.js",function(){fLoaded[2]=!0;facebookRoutine()});include("/js/includes/input-facebook-fiche.js",function(){fLoaded[3]=!0;facebookRoutine()}); +include("/js/includes/input-facebook-matrice.js",function(){fLoaded[4]=!0;facebookRoutine()}); var pDynamicUpdate=function(a){var b=a instanceof Element,c=b&&"INPUT"==a.tagName&&"submit"==a.type,g=b&&"SPAN"==a.tagName&&("p_nav-mini"==a.parentNode.id||"p_nav-fiche"==a.parentNode.id),b=b&&"SPAN"==a.tagName&&"p_nav-contact"==a.parentNode.id;if(!c&&!g&&!b&&!0!==a)return!1;console.group("[phone] Dynamic Update");pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();pContactManager.fieldsToStorage();pMatriceManager.fieldsToStorage();pFicheManager.sync();pMiniManager.sync();!0===a?api.send({path:"subject/getFriends", subject_id:pSubjectManager.subject_id.value},function(a){if(0!=a.ModuleError)return!1;lsi["import"]("p_friends",a.subjects);pMiniManager.storageToFields();pFicheManager.storageToFields();pMatriceManager.storageToFields();pContactManager.storageToFields()}):(pMiniManager.storageToFields(),pFicheManager.storageToFields(),pMatriceManager.storageToFields(),(c||b)&&pContactManager.storageToFields());console.groupEnd("[phone] Dynamic Update")},fDynamicUpdate=function(a){var b=a instanceof Element,c=b&& "INPUT"==a.tagName&&"submit"==a.type,g=b&&"SPAN"==a.tagName&&("f_nav-mini"==a.parentNode.id||"f_nav-fiche"==a.parentNode.id),b=b&&"SPAN"==a.tagName&&"f_nav-contact"==a.parentNode.id;if(!c&&!g&&!b&&!0!==a)return!1;console.group("[facebook] Dynamic Update");fMiniManager.fieldsToStorage();fFicheManager.fieldsToStorage();fContactManager.fieldsToStorage();fMatriceManager.fieldsToStorage();fFicheManager.sync();fMiniManager.sync();!0===a?api.send({path:"subject/getFriends",subject_id:fSubjectManager.subject_id.value},