$('input#call_log-import[type="file"]').addEventListener("click",function(b){b.target.value=null},!1);$('input#call_log-import[type="file"]').addEventListener("change",function(b){b={path:"upload/call_log",phone_number:$("#subject_phone_number").value,file:b.target.files[0]};api.send(b,function(a){console.log(a);varb=null;if(0!=a.ModuleError)9==a.ModuleError?Notification.error("Erreur","Il est n\u00e9cessaire de saisir les informations du <b>sujet</b> avant d'exporter son journal d'appel"):Notification.error("Erreur",
a.ModuleError);else{for(varb=Notification.info("Info","Chargement du journal d'appel"),f=0,g=[],c=0;c<a.calls.length&&10>c;c++)g.push(a.calls[c].number);for(c=0;c<g.length;c++){vard=a.directory[g[c]].name.split(" ");lsi.set("contacts",f,{uid:f,number:g[c],username:1==d.length?d[0]:"",firstname:1<d.length?d[0]:"",lastname:1<d.length?d.splice(1).join(" "):"",countsms:a.directory[g[c]].sms,countcall:a.directory[g[c]].calls,call:c,sms:-1});f++}console.warn(1);for(varh=[],c=0;c<a.sms.length&&10>c;c++)h.push(a.sms[c].number);
lsi.clear("fiches");lsi.clear("matrice");subjectManager.storageToFields();contactManager.storageToFields();miniManager.storageToFields();ficheManager.storageToFields();matriceManager.storageToFields();Notification.success("OK","Les donn\u00e9es ont \u00e9t\u00e9 supprim\u00e9es")},!1);$("#export-all").addEventListener("click",function(b){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");b={subject:lsi["export"]("subject")[0],contacts:lsi["export"]("contacts"),
function(b){console.log("> GATHERING ALL DATA");subjectManager.fieldsToStorage();contactManager.fieldsToStorage();miniManager.fieldsToStorage();ficheManager.fieldsToStorage();if(!subjectManager.check())returnNotification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;b=lsi["export"]("mini-fiches");for(varainb)if(!b[a].valid)returnNotification.warning("Attention","La <i>fiche rapide</i> <b>"+(parseInt(a)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;b=lsi["export"]("fiches");
for(ainb)if(!b[a].valid)returnNotification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(a)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;a={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(a,function(a){if(0!=a.ModuleError)returnNotification.error("ERREUR",a.ModuleError),!1;console.log(a)},!1)},!1)})})})})});