From b31983fa4bfc352f7b58d2ead876ffd5bc73d234 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 12 May 2016 14:30:42 +0200 Subject: [PATCH] =?UTF-8?q?Prise=20en=20compte=20des=20diff=C3=A9rents=20f?= =?UTF-8?q?ormats=20de=20journaux=20d'appels=20+=20import=20donn=C3=A9es?= =?UTF-8?q?=20cellulaires=20en=20zip=20contenant=20des=20csv=20pour=20exce?= =?UTF-8?q?l.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/phone_log_dict.json | 11 +- js/includes/input-html-data-min.js | 4 +- js/includes/input-html-data.js | 40 +- js/lib/notif-min.js | 2 +- js/lib/notif.js | 4 +- manager/module/call_log.php | 4 +- manager/module/upload.php | 3 +- src/upload/call_log/xdrm.xml | 1867 +++++++++++++--------------- view/js/input-min.js | 17 +- view/js/input.js | 17 +- 10 files changed, 910 insertions(+), 1059 deletions(-) diff --git a/doc/phone_log_dict.json b/doc/phone_log_dict.json index c53337b..f7840c9 100644 --- a/doc/phone_log_dict.json +++ b/doc/phone_log_dict.json @@ -18,10 +18,15 @@ "10": "55 à 60", "11": "60 à 65", "12": "65 à 70", "13": "70 à 75", "14": "75 à 80", "15": "80 à 85", "16": "85 à 90", "17": "90 à 95", "18": "95 à 100" }, - - "studies": { - ".": "Non défini" + "studies": { + ".": "Non défini", + "0": "Inconnu", + "1": "< BAC", + "2": "BAC", + "3": "BAC+2", + "4": "BAC+3", + "5": "BAC+4 et plus" }, "reltype": { diff --git a/js/includes/input-html-data-min.js b/js/includes/input-html-data-min.js index da2a4ca..6bbbbe4 100644 --- a/js/includes/input-html-data-min.js +++ b/js/includes/input-html-data-min.js @@ -1,3 +1,3 @@ var contactBuilder=new HTMLBuilder;contactBuilder.setLayout("

\n\t\n\t\n\t\n\t\n\t\n\t \n\t \n\t \n\t \n\t \n\t \n\t\n

\n\n"); -var miniFicheBuilder=new HTMLBuilder;miniFicheBuilder.setLayout("
\n\t\n\t\n\t

@name

\n\t
\t\t@countcall appels\t
\t
\t\t@countsms sms\t
\t
\n\t\t\n\t\t   \n\t
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n\t

Type de relation

\n\t
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n\t

O\u00f9 habite t-elle/il\u00a0?

\n\t
\n\t\t\u00c0 combien de temps est-ce de chez vous ?
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n
"); -var ficheBuilder=new HTMLBuilder;ficheBuilder.setLayout("
\n\t\n\t\n\t

@name

\n\t
\t\t@countcall appels\t
\t
\t\t@countsms sms\t
\t
\n\t\t\n\t\t   \n\t
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n\t
\n\t\tSituation familiale:
\n\t\t
\n\t\t   
\n\t\t   
\n\t\t   \n\t
\n\t
\n\t\t\n\t
\n\t

Type de relation

\n\t
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n\t

O\u00f9 habite t-elle/il\u00a0?

\n\t
\n\t\t\n\t\t\n\t
\n\t
\n\t\t\u00c0 combien de temps est-ce de chez vous ?
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n\t
\n\t\tDepuis quand connaissez-vous cette personne ?

\n\t\tmois\n\t\tet    ans.\n\t
\n\t

Contexte de rencontre

\n\t
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n\t
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n\t

Avec quelle fr\u00e9quence discutez-vous avec cette personne\u00a0?

\n\t
\n\t\tFace \u00e0 face
\n\t\t   \n\t\t   \n\t\t   \n\t\t   \n\t
\n\t
\n\t\tT\u00e9l\u00e9phone ou skype et \u00e9quivalent
\n\t\t   \n\t\t   \n\t\t   \n\t\t   \n\t
\n\t
\n\t\tSMS, et \u00e9quivalents
\n\t\t   \n\t\t   \n\t\t   \n\t\t   \n\t
\n\t
\n\t\tCourrier \u00e9lectronique
\n\t\t   \n\t\t   \n\t\t   \n\t\t   \n\t
\n\t
\n\t\tFacebook ou autre r\u00e9seau social
\n\t\t   \n\t\t   \n\t\t   \n\t\t   \n\t
\n\t

Comment \u00eates-vous \u00ab\u00a0connect\u00e9\u00a0\u00bb \u00e0 cette personne\u00a0?

\n\t
\n\t\tSes coordonn\u00e9es sont dans votre carnet d\u2019adresse
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tSon num\u00e9ro de mobile est enregistr\u00e9 sur votre mobile (ou vous-m\u00eames \u00eates sur le sien)
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tElle figure parmi vos amis facebook
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tElle figure parmi vos amis facebook et vous interagissez avec elle sur ce dispositif r\u00e9guli\u00e8rement
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tVous le suivez sur Twitter
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tVous communiquez avec cette personne sur Twitter
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tVous communiquez dans autre r\u00e9seau social : \n\t
\n\t
\n\t\tVous communiquez dans un autre dispositif (blogs, jeu vid\u00e9o ou autre) : \n\t
\n
\n"); +var miniFicheBuilder=new HTMLBuilder;miniFicheBuilder.setLayout("
\n\t\n\t\n\t

@name

\n\t
\t\t@countcall appels\t
\t
\t\t@countsms sms\t
\t
\n\t\t\n\t\t   \n\t
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n\t

Type de relation

\n\t
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n\t

O\u00f9 habite t-elle/il\u00a0?

\n\t
\n\t\t\u00c0 combien de temps est-ce de chez vous ?
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n
"); +var ficheBuilder=new HTMLBuilder;ficheBuilder.setLayout("
\n\t\n\t\n\t

@name

\n\t
\t\t@countcall appels\t
\t
\t\t@countsms sms\t
\t
\n\t\t\n\t\t   \n\t
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n\t
\n\t\tSituation familiale:
\n\t\t
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   \n\t
\n\t
\n\t\t\n\t
\n\t

Type de relation

\n\t
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n\t

O\u00f9 habite t-elle/il\u00a0?

\n\t
\n\t\t\n\t\t\n\t
\n\t
\n\t\t\u00c0 combien de temps est-ce de chez vous ?
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n\t
\n\t\tDepuis quand connaissez-vous cette personne ?

\n\t\tmois\n\t\tet    ans.\n\t
\n\t

Contexte de rencontre

\n\t
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n\t
\n\t\t   
\n\t\t   
\n\t\t   
\n\t
\n\t

Avec quelle fr\u00e9quence discutez-vous avec cette personne\u00a0?

\n\t
\n\t\tFace \u00e0 face
\n\t\t   \n\t\t   \n\t\t   \n\t\t   \n\t
\n\t
\n\t\tT\u00e9l\u00e9phone ou skype et \u00e9quivalent
\n\t\t   \n\t\t   \n\t\t   \n\t\t   \n\t
\n\t
\n\t\tSMS, et \u00e9quivalents
\n\t\t   \n\t\t   \n\t\t   \n\t\t   \n\t
\n\t
\n\t\tCourrier \u00e9lectronique
\n\t\t   \n\t\t   \n\t\t   \n\t\t   \n\t
\n\t
\n\t\tFacebook ou autre r\u00e9seau social
\n\t\t   \n\t\t   \n\t\t   \n\t\t   \n\t
\n\t

Comment \u00eates-vous \u00ab\u00a0connect\u00e9\u00a0\u00bb \u00e0 cette personne\u00a0?

\n\t
\n\t\tSes coordonn\u00e9es sont dans votre carnet d\u2019adresse
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tSon num\u00e9ro de mobile est enregistr\u00e9 sur votre mobile (ou vous-m\u00eames \u00eates sur le sien)
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tElle figure parmi vos amis facebook
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tElle figure parmi vos amis facebook et vous interagissez avec elle sur ce dispositif r\u00e9guli\u00e8rement
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tVous le suivez sur Twitter
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tVous communiquez avec cette personne sur Twitter
\n\t\t   \n\t\t   \n\t
\n\t
\n\t\tVous communiquez dans autre r\u00e9seau social : \n\t
\n\t
\n\t\tVous communiquez dans un autre dispositif (blogs, jeu vid\u00e9o ou autre) : \n\t
\n
\n"); diff --git a/js/includes/input-html-data.js b/js/includes/input-html-data.js index 538e47e..b343957 100644 --- a/js/includes/input-html-data.js +++ b/js/includes/input-html-data.js @@ -93,31 +93,12 @@ miniFicheBuilder.setLayout( "\t
\n"+ "\t\t\n"+ "\t
\n"+ @@ -286,8 +267,9 @@ ficheBuilder.setLayout( "\t\tSituation familiale:
\n"+ "\t\t
\n"+ "\t\t   
\n"+ - "\t\t   
\n"+ - "\t\t   \n"+ + "\t\t   
\n"+ + "\t\t   
\n"+ + "\t\t   \n"+ "\t
\n"+ "\t
\n"+ @@ -329,8 +311,8 @@ ficheBuilder.setLayout( "\t\t   
\n"+ "\t\t   
\n"+ "\t\t   
\n"+ - "\t\t   
\n"+ - "\t\t   
\n"+ + "\t\t   
\n"+ + "\t\t   
\n"+ "\t\t   
\n"+ "\t
\n"+ diff --git a/js/lib/notif-min.js b/js/lib/notif-min.js index 1556452..e1159d2 100644 --- a/js/lib/notif-min.js +++ b/js/lib/notif-min.js @@ -1,5 +1,5 @@ var NotificationClass=function(a){this.container=a};NotificationClass.prototype={container:this.container,stack:[],types:["warning","info","success","error"],defaultTimeout:2E3,errorCodes:{}};NotificationClass.prototype.pushStack=function(a,c,b){if(!(a instanceof Array&&b instanceof Array))return null;var e=-1,d;for(d in a)if(-1"+c+": "+b+"

";this.container.appendChild(d.element); var f=this.pushStack(this.stack,d,[null]);d.element.id=f;var g=this;d.element.className="notification-element notification-visible";setTimeout(function(){d.element.className="notification-element"},500+e);d.timeout=setTimeout(function(){g.hide(f)},500+e+500);d.element.addEventListener("click",function(a){g.hide(f)},!1);return d.element};NotificationClass.prototype.warning=function(a,c,b){return this.show("warning",a,c,b)}; NotificationClass.prototype.info=function(a,c,b){return this.show("info",a,c,b)};NotificationClass.prototype.success=function(a,c,b){return this.show("success",a,c,b)};NotificationClass.prototype.error=function(a,c,b){return this.show("error",a,c,b)}; diff --git a/js/lib/notif.js b/js/lib/notif.js index f1c75fd..e0dc740 100644 --- a/js/lib/notif.js +++ b/js/lib/notif.js @@ -80,8 +80,10 @@ NotificationClass.prototype.hide = function(id){ id = parseInt(id); + /* (1) Suppression de l'élément */ - this.container.removeChild( this.stack[id].element ); + if( this.stack[id].element instanceof Element ) + this.container.removeChild( this.stack[id].element ); /* (2) On supprime la notification de la pile */ this.stack[id] = null; diff --git a/manager/module/call_log.php b/manager/module/call_log.php index 55a124a..1dcd4c2 100644 --- a/manager/module/call_log.php +++ b/manager/module/call_log.php @@ -89,8 +89,8 @@ /* (5) On complète le log */ $phone_log = array( - 'source' => ($log['Direction']!='OUTCOMING') ? $number : Database::formatNumber($phone_number), - 'target' => ($log['Direction']!='OUTCOMING') ? Database::formatNumber($phone_number) : $number, + 'source' => ($log['Direction']!='OUTGOING') ? $number : Database::formatNumber($phone_number), + 'target' => ($log['Direction']!='OUTGOING') ? Database::formatNumber($phone_number) : $number, 'missed' => $log['Direction']==['MISSED'], 'type' => strtolower($log['Type']), 'date' => strtotime($log['Date']), diff --git a/manager/module/upload.php b/manager/module/upload.php index 2c97a10..bbd784c 100644 --- a/manager/module/upload.php +++ b/manager/module/upload.php @@ -158,8 +158,7 @@ // Vérification de tous les champs foreach($xml->Item as $log){ - $checkAttributes = isset($log['Id']); - $checkAttributes = $checkAttributes && isset($log['Number']); + $checkAttributes = isset($log['Number']); $checkAttributes = $checkAttributes && isset($log['Name']); $checkAttributes = $checkAttributes && isset($log['Date']); $checkAttributes = $checkAttributes && isset($log['Duration']); diff --git a/src/upload/call_log/xdrm.xml b/src/upload/call_log/xdrm.xml index 8757312..c11ac62 100755 --- a/src/upload/call_log/xdrm.xml +++ b/src/upload/call_log/xdrm.xml @@ -1,1001 +1,866 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/view/js/input-min.js b/view/js/input-min.js index 155d155..263388c 100644 --- a/view/js/input-min.js +++ b/view/js/input-min.js @@ -5,11 +5,12 @@ matriceManager.storageToFields(),(g||a)&&contactManager.storageToFields()}functi 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(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);var b=null;if(0!=a.ModuleError)9==a.ModuleError?Notification.error("Erreur","Il est n\u00e9cessaire de saisir les informations du sujet avant d'exporter son journal d'appel"):Notification.error("Erreur", -a.ModuleError);else{for(var b=Notification.info("Info","Chargement du journal d'appel"),f=0,g=[],c=0;cc;c++)g.push(a.calls[c].number);for(c=0;cc;c++)h.push(a.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;b=lsi["export"]("mini-fiches");for(var a in b)if(!b[a].valid)return Notification.warning("Attention","La fiche rapide "+(parseInt(a)+1)+" est incompl\u00e8te et/ou incorrecte"),!1;b=lsi["export"]("fiches"); -for(a in b)if(!b[a].valid)return Notification.warning("Attention","La fiche compl\u00e8te "+(parseInt(a)+1)+" 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)return Notification.error("ERREUR",a.ModuleError),!1;console.log(a)},!1)},!1)})})})})}); +a.ModuleError);else{for(var b=Notification.info("Info","Chargement du journal d'appel"),f=0,g=[],c=0;cc;c++)g.push(a.calls[c].number);for(c=0;cc;c++)h.push(a.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;b=lsi["export"]("mini-fiches");for(var a in b)if(!b[a].valid)return Notification.warning("Attention","La fiche rapide "+(parseInt(a)+1)+" est incompl\u00e8te et/ou incorrecte"), +!1;b=lsi["export"]("fiches");for(a in b)if(!b[a].valid)return Notification.warning("Attention","La fiche compl\u00e8te "+(parseInt(a)+1)+" 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)return Notification.error("ERREUR",a.ModuleError),!1;console.log(a)}, +!1)},!1)})})})})}); diff --git a/view/js/input.js b/view/js/input.js index d79edef..0def77d 100644 --- a/view/js/input.js +++ b/view/js/input.js @@ -277,7 +277,6 @@ include('/js/includes/input-phone-matrice.js', function(){ loadingNotif = Notification.info('Info', 'Chargement du journal d\'appel'); - var uid = 0; // Contiendra l'uid des contacts /* (3) On récupère les contacts les plus APPELLÉS */ @@ -287,14 +286,17 @@ include('/js/includes/input-phone-matrice.js', function(){ /* (4) On crée les 10 contacts les plus APPELÉS */ for( var i = 0 ; i < most_called.length ; i++ ){ - var splittedName = response.directory[most_called[i]].name.split(' '); + + var splittedName = ['']; + if( response.directory[most_called[i]].name != null ) + splittedName = response.directory[most_called[i]].name.split(' '); lsi.set('contacts', uid, { uid: uid, number: most_called[i], - username: splittedName.length == 1 ? splittedName[0] : '', // Si un seul mot -> pseudo - firstname: splittedName.length > 1 ? splittedName[0] : '', // Si plusieurs mots -> le 1er est le prénom - lastname: splittedName.length > 1 ? splittedName.splice(1).join(' ') : '', // et les autres sont le nom + username: splittedName.length > 0 ? splittedName[0] : '', // Si un seul mot -> pseudo + firstname: splittedName.length > 0 ? splittedName[0] : '', // Si plusieurs mots -> le 1er est le prénom + lastname: splittedName.length > 1 ? splittedName.splice(1).join(' ') : '', // et les autres sont le nom countsms: response.directory[most_called[i]].sms, // Nombre de sms countcall: response.directory[most_called[i]].calls, // Nombre d'appels call: i, // classement dans le top 10 des APPELS @@ -304,9 +306,6 @@ include('/js/includes/input-phone-matrice.js', function(){ uid++; } - console.warn(1); - - /* (5) On récupère les contacts les plus SMSÉS */ var most_sms = []; @@ -377,8 +376,6 @@ include('/js/includes/input-phone-matrice.js', function(){ uid++; } - console.warn(3); - /* (8) On met à jour l'affichage */ contactManager.storageToFields(); dynamicUpdate(true);