var subjectManager,contactManager,miniManager,ficheManager,matriceManager; function dynamicUpdate(a){var b=a instanceof Element,f=b&&"SPAN"==a.tagName&&"switch-left"==a.className,e=b&&"SPAN"==a.tagName&&"switch-both"==a.className,g=b&&"INPUT"==a.tagName&&"submit"==a.type,c=b&&"SPAN"==a.tagName&&("nav-mini"==a.parentNode.id||"nav-fiche"==a.parentNode.id),b=b&&"SPAN"==a.tagName&&"nav-contact"==a.parentNode.id;if(!(e||f||g||c||b)&&!0!==a)return!1;if(e)console.log("> switch firstname <-> lastname"),f=a.parentNode,a=f.children[8],f=f.children[10],e=a.value,a.value=f.value,f.value= e;else if(f){console.log("> switch firstname+lastname -> username");f=a.parentNode;e=f.children[6];a=f.children[8];f=f.children[10];if(0 dynamic update"),miniManager.fieldsToStorage(),ficheManager.fieldsToStorage(),contactManager.fieldsToStorage(),matriceManager.fieldsToStorage(),ficheManager.sync(),miniManager.sync(),miniManager.storageToFields(),ficheManager.storageToFields(), matriceManager.storageToFields(),(g||b)&&contactManager.storageToFields()} include("/js/includes/input-phone-subject.js",function(){include("/js/includes/input-phone-contact.js",function(){include("/js/includes/input-phone-mini.js",function(){include("/js/includes/input-phone-fiche.js",function(){include("/js/includes/input-phone-matrice.js",function(){subjectManager=new inputPhoneSubject($('article.subject-panel [data-name="number"]'),$('article.subject-panel [data-name="username"]'),$('article.subject-panel [data-name="firstname"]'),$('article.subject-panel [data-name="lastname"]'), $('article.subject-panel [data-name="submit"]'));subjectManager.attach();contactManager=new inputPhoneContact($("article.contact-panel"),$("#nav-contact"));contactManager.attach(dynamicUpdate);miniManager=new inputPhoneMini($("article.mini-relation-panel"),$("#nav-mini"));miniManager.attach(dynamicUpdate);ficheManager=new inputPhoneFiche($("article.relation-panel"),$("#nav-fiche"));ficheManager.attach(dynamicUpdate);matriceManager=new inputPhoneMatrice($("article.matrice-panel"));matriceManager.attach(dynamicUpdate); $('input#call_log-import[type="file"]').addEventListener("click",function(a){a.target.value=null},!1);$('input#call_log-import[type="file"]').addEventListener("change",function(a){a={path:"upload/call_log",phone_number:$("#subject_phone_number").value,file:a.target.files[0]};api.send(a,function(b){console.log(b);var a=null;if(0!=b.ModuleError)9==b.ModuleError?Notification.error("Erreur","Il est n\u00e9cessaire de saisir les informations du sujet avant d'exporter son journal d'appel"):Notification.error("Erreur", b.ModuleError);else{for(var a=Notification.info("Info","Chargement du journal d'appel"),e=0,g=[],c=0;cc;c++)g.push(b.calls[c].number);for(c=0;cc;c++)h.push(b.sms[c].number); for(c=0;c GATHERING ALL DATA"); subjectManager.fieldsToStorage();contactManager.fieldsToStorage();miniManager.fieldsToStorage();ficheManager.fieldsToStorage();if(!subjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du sujet"),!1;a=lsi["export"]("mini-fiches");for(var b in a)if(!a[b].valid)return Notification.warning("Attention","La fiche rapide "+(parseInt(b)+1)+" est incompl\u00e8te et/ou incorrecte"),!1;a=lsi["export"]("fiches");for(b in a)if(!a[b].valid)return Notification.warning("Attention", "La fiche compl\u00e8te "+(parseInt(b)+1)+" est incompl\u00e8te et/ou incorrecte"),!1;b={path:"input/phone",subject:lsi["export"]("subject")[0],contacts:lsi["export"]("contacts"),mini:lsi["export"]("mini-fiches"),fiches:lsi["export"]("fiches"),matrice:lsi["export"]("matrice")[0]};api.send(b,function(a){if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;console.log(a)},!1)},!1)})})})})});