Gestion de l'import de graphiques pour Gephi
This commit is contained in:
parent
361858e604
commit
623b75e67f
|
@ -116,17 +116,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* DOWNLOAD D'UN FICHIER CONTENANT LES DONNEES SELECTIONNEES
|
||||
*
|
||||
* @subjects<Array> Liste des identifiants des sujets à prendre en compte
|
||||
|
@ -298,9 +287,6 @@
|
|||
/* EXPORT POUR GEPHI OU AUTRE LOGICIEL SUR LE PRINCIPE NODES+EDGES
|
||||
*
|
||||
* @subjects<Array> Liste des identifiants des sujets à prendre en compte
|
||||
* @phone<Boolean> Si TRUE, prend en compte les données des questionnaires cellulaires
|
||||
* @facebook<Boolean> Si TRUE, prend en compte les données des questionnaires facebook
|
||||
* @survey<Boolean> Si TRUE, prend en compte les données des questionnaires ResTIC
|
||||
* @all<Boolean> Si TRUE, prend en compte tous les sujets (annule @subjects)
|
||||
*
|
||||
* @return data<File> Retourne une archive .zip contenant toutes les données sélectionnées
|
||||
|
@ -310,14 +296,11 @@
|
|||
|
||||
/* (0) Gestion du formattage des paramètres */
|
||||
$subjects = !is_array($subjects) ? [] : $subjects;
|
||||
$phone = !is_bool($phone) ? false : $phone;
|
||||
$facebook = !is_bool($facebook) ? false : $facebook;
|
||||
$survey = !is_bool($survey) ? false : $survey;
|
||||
$all = !is_bool($all) ? false : $all;
|
||||
|
||||
/* [0] On récupère le dictionnaire
|
||||
=========================================================*/
|
||||
$dict = file_get_contents(__BUILD__.'/src/dynamic/dictionary.json');
|
||||
$dict = file_get_contents(__BUILD__.'/lightdb/storage/dictionary.json');
|
||||
|
||||
/* (2) Si une erreur pour le fichier de conf */
|
||||
if( $dict === false )
|
||||
|
@ -331,184 +314,114 @@
|
|||
return [ 'ModuleError' => ManagerError::ParsingFailed ];
|
||||
|
||||
|
||||
/* [1] On construit l'arborescence des données
|
||||
/* [1] Initialisation
|
||||
=========================================================*/
|
||||
/* (1) Fichiers de sortie */
|
||||
$output = [
|
||||
'common_' => [
|
||||
'contacts' => '',
|
||||
'relations' => '',
|
||||
'dict' => ''
|
||||
],
|
||||
'logs/' => [] // Contiendra les journaux d'appels
|
||||
'gephi.nodes' => '', // contiendra les contacts et leurs données
|
||||
'gephi.edges' => '', // contiendra les relations
|
||||
'dict' => '' // contiendra le dictionnaire de valeurs
|
||||
];
|
||||
|
||||
/* (2) Base de données */
|
||||
$subjectdb = new lightdb('subject');
|
||||
$contactdb = new lightdb('contact');
|
||||
|
||||
|
||||
/* [2] On construit les fichiers de chaque sujet DE TELEPHONE
|
||||
/* [2] On construit la liste des sujets
|
||||
=========================================================*/
|
||||
if( $phone ){ // Si @phone vaut TRUE
|
||||
$subjectindexes = array_keys($subjectdb->index());
|
||||
$subjectids = [];
|
||||
|
||||
// On ouvre une instance de la base de données
|
||||
$db = new lightdb('phone_db');
|
||||
|
||||
// Si on doit prendre tous les sujets, on les récupère
|
||||
/* (1) On récupère tous les sujets si c'est spécifié */
|
||||
if( $all )
|
||||
$subjects = array_keys( $db->index() );
|
||||
|
||||
// Pour chaque sujet
|
||||
foreach($subjects as $s=>$subjectId){
|
||||
$subjectids = $subjectindexes;
|
||||
|
||||
/* (1) On récupère les données du sujet en cours */
|
||||
$subjectData = $db->fetch($subjectId);
|
||||
/* (2) Sinon on retire les ids incorrects */
|
||||
else
|
||||
|
||||
// Si on ne trouve rien, on passe au suivant
|
||||
if( $subjectData === false )
|
||||
foreach($subjects as $i=>$id)
|
||||
if( in_array($id, $subjectindexes) )
|
||||
$subjectids[] = intval($id);
|
||||
|
||||
|
||||
|
||||
/* (3) Si aucun sujet restant -> error */
|
||||
if( count($subjectids) === 0 )
|
||||
return ['ModuleError' => ManagerError::ParamError];
|
||||
|
||||
|
||||
/* [3] Export contacts/relations des sujets selectionnés
|
||||
=========================================================*/
|
||||
foreach($subjectids as $subid){
|
||||
|
||||
/* (1) On récupère les données du sujet */
|
||||
$subject = $subjectdb->fetch($subid);
|
||||
|
||||
// si pas trouvé -> suivant
|
||||
if( $subject === false )
|
||||
continue;
|
||||
|
||||
/* (2) On construit le log s'il existe */
|
||||
$output['logs/'][$subjectId] = self::parseCSV($subjectData['logs'], $dict['logs']);
|
||||
|
||||
/* (3) On complète les relations */
|
||||
// {1} On retire les valeurs ou le type = 0 //
|
||||
$formattedRelations = [];
|
||||
foreach($subjectData['relations'] as $i=>$relation)
|
||||
if( $relation['type'] != 0 )
|
||||
array_push($formattedRelations, [
|
||||
'source' => $relation['idA'],
|
||||
'target' => $relation['idB'],
|
||||
'weight' => ($relation['idA']==$subjectId) ? .1 : 1, // plus de poids aux relations alter/alter
|
||||
'type' => 'Undirected'
|
||||
]);
|
||||
|
||||
// {2} On ajoute au contenu //
|
||||
$output['common_']['relations'] .= self::parseCSV($formattedRelations, [], strlen($output['common_']['relations']) == 0 ); // On affiche les colonnes pour la première fois uniquement
|
||||
|
||||
/* (4) On ajoute les contacts à la liste */
|
||||
$output['common_']['contacts'] .= self::parseCSV($subjectData['contacts'], $dict['contacts'], strlen($output['common_']['contacts']) == 0 ); // On affiche les colonnes pour la première fois uniquement
|
||||
|
||||
}
|
||||
|
||||
// On ferme l'instance de la base de données
|
||||
$db->close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* [3] On construit les fichiers de chaque sujet DE FACEBOOK
|
||||
=========================================================*/
|
||||
if( $facebook ){ // Si @facebook vaut TRUE
|
||||
|
||||
// On ouvre une instance de la base de données
|
||||
$db = new lightdb('facebook_db');
|
||||
|
||||
// Si on doit prendre tous les sujets, on les récupère
|
||||
if( $all )
|
||||
$subjects = array_keys( $db->index() );
|
||||
|
||||
// Pour chaque sujet
|
||||
foreach($subjects as $s=>$subjectId){
|
||||
|
||||
/* (1) On récupère les données du sujet en cours */
|
||||
$subjectData = $db->fetch($subjectId);
|
||||
|
||||
// Si on ne trouve rien, on passe au suivant
|
||||
if( $subjectData === false )
|
||||
/* (2) Si aucun contact -> suivant */
|
||||
if( !isset($subject['contacts']) || !is_array($subject['contacts']) )
|
||||
continue;
|
||||
|
||||
/* (2) On complète les relations */
|
||||
// {1} On retire les valeurs ou le type = 0 //
|
||||
$formattedRelations = [];
|
||||
foreach($subjectData['relations'] as $i=>$relation)
|
||||
if( $relation['type'] != 0 )
|
||||
array_push($formattedRelations, [
|
||||
'source' => $relation['idA'],
|
||||
'target' => $relation['idB'],
|
||||
'weight' => ($relation['idA']==$subjectId) ? .1 : 1, // plus de poids aux relations alter/alter
|
||||
'type' => 'Undirected'
|
||||
]);
|
||||
/* (3) Pour chaque contact */
|
||||
foreach($subject['contacts'] as $c=>$contactid){
|
||||
|
||||
// {2} On ajoute au contenu //
|
||||
$output['common_']['relations'] .= self::parseCSV($formattedRelations, [], strlen($output['common_']['relations']) == 0 ); // On affiche les colonnes pour la première fois uniquement
|
||||
// {3.1} On récupère le contact //
|
||||
$contact = $contactdb->fetch($contactid);
|
||||
|
||||
/* (3) On ajoute les contacts à la liste */
|
||||
$output['common_']['contacts'] .= self::parseCSV($subjectData['contacts'], $dict['contacts'], strlen($output['common_']['contacts']) == 0 ); // On affiche les colonnes pour la première fois uniquement
|
||||
|
||||
}
|
||||
|
||||
// On ferme l'instance de la base de données
|
||||
$db->close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* [4] On construit les fichiers de chaque sujet DE FORMULAIRE
|
||||
=========================================================*/
|
||||
if( $survey ){ // Si @survey vaut TRUE
|
||||
|
||||
// On ouvre une instance de la base de données
|
||||
$db = new lightdb('survey_db');
|
||||
|
||||
// Si on doit prendre tous les sujets, on les récupère
|
||||
if( $all )
|
||||
$subjects = array_keys( $db->index() );
|
||||
|
||||
// Pour chaque sujet
|
||||
foreach($subjects as $s=>$subjectId){
|
||||
|
||||
/* (1) On récupère les données du sujet en cours */
|
||||
$subjectData = $db->fetch($subjectId);
|
||||
|
||||
// Si on ne trouve rien, on passe au suivant
|
||||
if( $subjectData === false )
|
||||
// si pas trouvé -> suivant
|
||||
if( $contact === false )
|
||||
continue;
|
||||
|
||||
/* (2) On complète les relations */
|
||||
// {1} On retire les valeurs ou le type = 0 //
|
||||
$formattedRelations = [];
|
||||
foreach($subjectData['relations'] as $i=>$relation)
|
||||
if( $relation['type'] != 0 ) // On retire les relations ego/alter
|
||||
array_push($formattedRelations, [
|
||||
'source' => $relation['idA'],
|
||||
'target' => $relation['idB'],
|
||||
'weight' => ($relation['idA']==$subjectId) ? .1 : 1, // plus de poids aux relations alter/alter
|
||||
// {3.2} On ajoute le contact au fichier des FICHES //
|
||||
if( array_key_exists('studies2', $contact) ){
|
||||
// On affiche les colonnes pour le premier contact uniquement
|
||||
$contact['type'] = 'fiche';
|
||||
$output['gephi.nodes'] .= self::parseCSV([$contact], $dict['contacts'], strlen($output['gephi.nodes']) == 0 );
|
||||
|
||||
// {3.3} On ajoute le contact au fichier des MINI //
|
||||
}elseif( array_key_exists('studies1', $contact) ){
|
||||
// On affiche les colonnes pour le premier contact uniquement
|
||||
$contact['type'] = 'mini';
|
||||
$output['gephi.nodes'] .= self::parseCSV([$contact], $dict['contacts'], strlen($output['gephi.nodes']) == 0 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* (4) Si aucune relation -> suivant */
|
||||
if( !isset($subject['relations']) || !is_array($subject['relations']) )
|
||||
continue;
|
||||
|
||||
/* (5) On ajoute les relations */
|
||||
foreach($subject['relations'] as $r=>$rel)
|
||||
|
||||
$output['gephi.edges'] .= self::parseCSV(
|
||||
[[
|
||||
'source' => $rel['idA'],
|
||||
'target' => $rel['idB'],
|
||||
'weight' => ($rel['idA']==$subid) ? .5 : 1,
|
||||
'type' => 'Undirected'
|
||||
]);
|
||||
]],
|
||||
[],
|
||||
strlen($output['gephi.edges']) == 0
|
||||
);
|
||||
|
||||
// {2} On ajoute au contenu //
|
||||
$output['common_']['relations'] .= self::parseCSV($formattedRelations, [], strlen($output['common_']['relations']) == 0 ); // On affiche les colonnes pour la première fois uniquement
|
||||
|
||||
/* (3) On ajoute les contacts à la liste */
|
||||
$output['common_']['contacts'] .= self::parseCSV($subjectData['contacts'], $dict['contacts'], strlen($output['common_']['contacts']) == 0 ); // On affiche les colonnes pour la première fois uniquement
|
||||
|
||||
}
|
||||
|
||||
// On ferme l'instance de la base de données
|
||||
$db->close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* [5] On ajoute le dictionnaire
|
||||
=========================================================*/
|
||||
$output['common_']['dict'] .= "\"sheet\";\"field\";\"key\";\"value\"\r\n";
|
||||
$output['dict'] .= "\"sheet\";\"field\";\"key\";\"value\"\r\n";
|
||||
foreach($dict as $ds=>$dataset)
|
||||
foreach($dataset as $f=>$field)
|
||||
foreach($field as $key=>$value)
|
||||
$output['common_']['dict'] .= "\"$ds\";\"$f\";\"$key\";\"$value\"\r\n";
|
||||
$output['dict'] .= "\"$ds\";\"$f\";\"$key\";\"$value\"\r\n";
|
||||
|
||||
|
||||
/* [6] Création de l'archive
|
||||
|
@ -517,12 +430,10 @@
|
|||
$fname = __TMP__.'/'.time().'.zip';
|
||||
$zip->open($fname, \ZipArchive::CREATE);
|
||||
|
||||
foreach($output as $folder=>$files){
|
||||
|
||||
foreach($files as $file=>$content)
|
||||
foreach($output as $file=>$content)
|
||||
if( strlen($content) > 0 )
|
||||
$zip->addFromString($folder.$file.'.csv', $content);
|
||||
}
|
||||
$zip->addFromString($file.'.csv', $content);
|
||||
|
||||
$zip->close();
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
/* TRAITE LES DONNÉES D'UN FORMULAIRE DE TYPE TÉLÉPHONIQUE
|
||||
*
|
||||
* @subject<Array> Tableau contenant les données du sujet
|
||||
* @subject<int> Id du sujet concerné
|
||||
* @contacts<Array> Tableau contenant les données des contacts
|
||||
* @mini<Array> Tableau contenant les données des mini fiches relation
|
||||
* @fiches<Array> Tableau contenant les données des fiches relation
|
||||
|
@ -91,7 +91,7 @@
|
|||
$offset = intval($uniqid) + 1;
|
||||
|
||||
// on enregistre l'id du sujet
|
||||
$subject_id = intval($subject['subject_id']);
|
||||
$subject_id = intval($subject);
|
||||
|
||||
// Contiendra la valeur de l'id maximum
|
||||
$maxId = $offset;
|
||||
|
@ -420,10 +420,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
/* TRAITE LES DONNÉES D'UN FORMULAIRE DE TYPE FACEBOOK
|
||||
*
|
||||
* @subject<Array> Tableau contenant les données du sujet
|
||||
* @subject<id> Id du sujet concerné
|
||||
* @contacts<Array> Tableau contenant les données des contacts
|
||||
* @mini<Array> Tableau contenant les données des mini fiches relation
|
||||
* @fiches<Array> Tableau contenant les données des fiches relation
|
||||
|
@ -450,7 +449,7 @@
|
|||
$offset = intval($uniqid) + 1;
|
||||
|
||||
// on enregistre l'id du sujet
|
||||
$subject_id = intval($subject['subject_id']);
|
||||
$subject_id = intval($subject);
|
||||
|
||||
// Contiendra la valeur de l'id maximum
|
||||
$maxId = $offset;
|
||||
|
|
|
@ -41,3 +41,46 @@
|
|||
{"id":44,"name":"contact-42","sexe":"0","age":"2","studies1":"3","reltype":"2","dist":"."}
|
||||
{"id":45,"name":"contact-43","sexe":"1","age":"3","studies1":"4","reltype":"3","dist":"."}
|
||||
{"id":46,"name":"contact-44","sexe":"0","age":"4","studies1":"5","reltype":"4","dist":"."}
|
||||
{"id":58,"name":"contact-x","sexe":"1","age":"6","studies2":"01","reltype":"7","dist":"1","job":"82","famsit":"0","city":"35","cp":"10025","quartier":"25","duration":["25","125"],"context":"11","contextExtra":["internet","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":59,"name":"contact-1","sexe":"0","age":"6","studies2":"06","reltype":"6","dist":"2","job":"36","famsit":"0","city":"16","cp":"10006","quartier":"6","duration":["6","16"],"context":"6","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":60,"name":"contact-2","sexe":"1","age":"7","studies2":"07","reltype":"7","dist":"3","job":"41","famsit":"0","city":"17","cp":"10007","quartier":"7","duration":["7","17"],"context":"7","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":61,"name":"contact-3","sexe":"2","age":"8","studies2":"08","reltype":"autre","dist":"0","job":"46","famsit":"0","city":"18","cp":"10008","quartier":"8","duration":["8","18"],"context":"8","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":62,"name":"contact-4","sexe":"0","age":"9","studies2":"09","reltype":"0","dist":"1","job":"47","famsit":"0","city":"19","cp":"10009","quartier":"9","duration":["9","19"],"context":"9","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":63,"name":"contact-5","sexe":"1","age":"10","studies2":"10","reltype":"1","dist":"2","job":"48","famsit":"0","city":"20","cp":"10010","quartier":"10","duration":["10","110"],"context":"10","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":64,"name":"contact-6","sexe":"2","age":"11","studies2":"11","reltype":"2","dist":"3","job":"51","famsit":"0","city":"21","cp":"10011","quartier":"11","duration":["11","111"],"context":"11","contextExtra":["internet","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":65,"name":"contact-7","sexe":"0","age":"12","studies2":"","reltype":"3","dist":"0","job":"54","famsit":"0","city":"22","cp":"10012","quartier":"12","duration":["12","112"],"context":"12","contextExtra":["","association",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":66,"name":"contact-8","sexe":"1","age":"13","studies2":"01","reltype":"4","dist":"1","job":"55","famsit":"0","city":"23","cp":"10013","quartier":"13","duration":["13","113"],"context":"13","contextExtra":["","","autre"],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":67,"name":"contact-9","sexe":"2","age":"14","studies2":"02","reltype":"5","dist":"2","job":"56","famsit":"0","city":"24","cp":"10014","quartier":"14","duration":["14","114"],"context":"0","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":68,"name":"contact-10","sexe":"0","age":"15","studies2":"03","reltype":"6","dist":"3","job":"61","famsit":"0","city":"25","cp":"10015","quartier":"15","duration":["15","115"],"context":"1","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":69,"name":"contact-11","sexe":"1","age":"16","studies2":"04","reltype":"7","dist":"0","job":"66","famsit":"0","city":"26","cp":"10016","quartier":"16","duration":["16","116"],"context":"2","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":70,"name":"contact-12","sexe":"2","age":"17","studies2":"05","reltype":"autre","dist":"1","job":"69","famsit":"0","city":"27","cp":"10017","quartier":"17","duration":["17","117"],"context":"3","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":71,"name":"contact-13","sexe":"0","age":"18","studies2":"06","reltype":"0","dist":"2","job":"71","famsit":"0","city":"28","cp":"10018","quartier":"18","duration":["18","118"],"context":"4","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":72,"name":"contact-14","sexe":"1","age":"0","studies2":"07","reltype":"1","dist":"3","job":"72","famsit":"0","city":"29","cp":"10019","quartier":"19","duration":["19","119"],"context":"5","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":73,"name":"contact-15","sexe":"2","age":"1","studies2":"08","reltype":"2","dist":"0","job":"73","famsit":"0","city":"30","cp":"10020","quartier":"20","duration":["20","120"],"context":"6","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":74,"name":"contact-16","sexe":"0","age":"2","studies2":"09","reltype":"3","dist":"1","job":"74","famsit":"0","city":"31","cp":"10021","quartier":"21","duration":["21","121"],"context":"7","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":75,"name":"contact-17","sexe":"1","age":"3","studies2":"10","reltype":"4","dist":"2","job":"75","famsit":"0","city":"32","cp":"10022","quartier":"22","duration":["22","122"],"context":"8","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":76,"name":"contact-18","sexe":"2","age":"4","studies2":"11","reltype":"5","dist":"3","job":"76","famsit":"0","city":"33","cp":"10023","quartier":"23","duration":["23","123"],"context":"9","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":77,"name":"contact-19","sexe":"0","age":"5","studies2":"","reltype":"6","dist":"0","job":"81","famsit":"0","city":"34","cp":"10024","quartier":"24","duration":["24","124"],"context":"10","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":79,"name":"contact-21","sexe":"2","age":"7","studies2":"02","reltype":"autre","dist":"2","job":"10","famsit":"0","city":"36","cp":"10026","quartier":"26","duration":["26","126"],"context":"12","contextExtra":["","association",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":80,"name":"contact-22","sexe":"0","age":"8","studies2":"03","reltype":"0","dist":"3","job":"21","famsit":"0","city":"37","cp":"10027","quartier":"27","duration":["27","127"],"context":"13","contextExtra":["","","autre"],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":81,"name":"contact-23","sexe":"1","age":"9","studies2":"04","reltype":"1","dist":"0","job":"22","famsit":"0","city":"38","cp":"10028","quartier":"28","duration":["28","128"],"context":"0","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":82,"name":"contact-24","sexe":"2","age":"10","studies2":"05","reltype":"2","dist":"1","job":"23","famsit":"0","city":"39","cp":"10029","quartier":"29","duration":["29","129"],"context":"1","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":83,"name":"contact-25","sexe":"0","age":"11","studies2":"06","reltype":"3","dist":"2","job":"31","famsit":"0","city":"40","cp":"10030","quartier":"30","duration":["30","130"],"context":"2","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":84,"name":"contact-26","sexe":"1","age":"12","studies2":"07","reltype":"4","dist":"3","job":"32","famsit":"0","city":"41","cp":"10031","quartier":"31","duration":["31","131"],"context":"3","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":85,"name":"contact-27","sexe":"2","age":"13","studies2":"08","reltype":"5","dist":"0","job":"36","famsit":"0","city":"42","cp":"10032","quartier":"32","duration":["32","132"],"context":"4","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":86,"name":"contact-28","sexe":"0","age":"14","studies2":"09","reltype":"6","dist":"1","job":"41","famsit":"0","city":"43","cp":"10033","quartier":"33","duration":["33","133"],"context":"5","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":87,"name":"contact-29","sexe":"1","age":"15","studies2":"10","reltype":"7","dist":"2","job":"46","famsit":"0","city":"44","cp":"10034","quartier":"34","duration":["34","134"],"context":"6","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":88,"name":"contact-30","sexe":"2","age":"16","studies2":"11","reltype":"autre","dist":"3","job":"47","famsit":"0","city":"45","cp":"10035","quartier":"35","duration":["35","135"],"context":"7","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":89,"name":"contact-31","sexe":"0","age":"17","studies2":"","reltype":"0","dist":"0","job":"48","famsit":"0","city":"46","cp":"10036","quartier":"36","duration":["36","136"],"context":"8","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":90,"name":"contact-32","sexe":"1","age":"18","studies2":"01","reltype":"1","dist":"1","job":"51","famsit":"0","city":"47","cp":"10037","quartier":"37","duration":["37","137"],"context":"9","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":91,"name":"contact-33","sexe":"2","age":"0","studies2":"02","reltype":"2","dist":"2","job":"54","famsit":"0","city":"48","cp":"10038","quartier":"38","duration":["38","138"],"context":"10","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":92,"name":"contact-34","sexe":"0","age":"1","studies2":"03","reltype":"3","dist":"3","job":"55","famsit":"0","city":"49","cp":"10039","quartier":"39","duration":["39","139"],"context":"11","contextExtra":["internet","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":93,"name":"contact-35","sexe":"1","age":"2","studies2":"04","reltype":"4","dist":"0","job":"56","famsit":"0","city":"50","cp":"10040","quartier":"40","duration":["40","140"],"context":"12","contextExtra":["","association",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":94,"name":"contact-36","sexe":"2","age":"3","studies2":"05","reltype":"5","dist":"1","job":"61","famsit":"0","city":"51","cp":"10041","quartier":"41","duration":["41","141"],"context":"13","contextExtra":["","","autre"],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":95,"name":"contact-37","sexe":"0","age":"4","studies2":"06","reltype":"6","dist":"2","job":"66","famsit":"0","city":"52","cp":"10042","quartier":"42","duration":["42","142"],"context":"0","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":96,"name":"contact-38","sexe":"1","age":"5","studies2":"07","reltype":"7","dist":"3","job":"69","famsit":"0","city":"53","cp":"10043","quartier":"43","duration":["43","143"],"context":"1","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":97,"name":"contact-39","sexe":"2","age":"6","studies2":"08","reltype":"autre","dist":"0","job":"71","famsit":"0","city":"54","cp":"10044","quartier":"44","duration":["44","144"],"context":"2","contextExtra":["","",""],"freq":["4","9","14","19","24"],"connect":["1","3","5","7","9","11"],"connectExtra":["",""]}
|
||||
{"id":99,"name":"contact-41","sexe":"1","age":"","studies1":"2","reltype":"1","dist":"."}
|
||||
{"id":100,"name":"contact-42","sexe":"0","age":"2","studies1":"3","reltype":"2","dist":"."}
|
||||
{"id":101,"name":"contact-43","sexe":"1","age":"3","studies1":"4","reltype":"3","dist":"."}
|
||||
{"id":102,"name":"contact-44","sexe":"0","age":"4","studies1":"5","reltype":"4","dist":"."}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"2":{"line":0},"3":{"line":1},"4":{"line":2},"5":{"line":3},"6":{"line":4},"7":{"line":5},"8":{"line":6},"9":{"line":7},"10":{"line":8},"11":{"line":9},"12":{"line":10},"13":{"line":11},"14":{"line":12},"15":{"line":13},"16":{"line":14},"17":{"line":15},"18":{"line":16},"19":{"line":17},"20":{"line":18},"21":{"line":19},"23":{"line":20},"24":{"line":21},"25":{"line":22},"26":{"line":23},"27":{"line":24},"28":{"line":25},"29":{"line":26},"30":{"line":27},"31":{"line":28},"32":{"line":29},"33":{"line":30},"34":{"line":31},"35":{"line":32},"36":{"line":33},"37":{"line":34},"38":{"line":35},"39":{"line":36},"40":{"line":37},"41":{"line":38},"43":{"line":39},"44":{"line":40},"45":{"line":41},"46":{"line":42}}
|
||||
{"2":{"line":0},"3":{"line":1},"4":{"line":2},"5":{"line":3},"6":{"line":4},"7":{"line":5},"8":{"line":6},"9":{"line":7},"10":{"line":8},"11":{"line":9},"12":{"line":10},"13":{"line":11},"14":{"line":12},"15":{"line":13},"16":{"line":14},"17":{"line":15},"18":{"line":16},"19":{"line":17},"20":{"line":18},"21":{"line":19},"23":{"line":20},"24":{"line":21},"25":{"line":22},"26":{"line":23},"27":{"line":24},"28":{"line":25},"29":{"line":26},"30":{"line":27},"31":{"line":28},"32":{"line":29},"33":{"line":30},"34":{"line":31},"35":{"line":32},"36":{"line":33},"37":{"line":34},"38":{"line":35},"39":{"line":36},"40":{"line":37},"41":{"line":38},"43":{"line":39},"44":{"line":40},"45":{"line":41},"46":{"line":42},"58":{"line":43},"59":{"line":44},"60":{"line":45},"61":{"line":46},"62":{"line":47},"63":{"line":48},"64":{"line":49},"65":{"line":50},"66":{"line":51},"67":{"line":52},"68":{"line":53},"69":{"line":54},"70":{"line":55},"71":{"line":56},"72":{"line":57},"73":{"line":58},"74":{"line":59},"75":{"line":60},"76":{"line":61},"77":{"line":62},"79":{"line":63},"80":{"line":64},"81":{"line":65},"82":{"line":66},"83":{"line":67},"84":{"line":68},"85":{"line":69},"86":{"line":70},"87":{"line":71},"88":{"line":72},"89":{"line":73},"90":{"line":74},"91":{"line":75},"92":{"line":76},"93":{"line":77},"94":{"line":78},"95":{"line":79},"96":{"line":80},"97":{"line":81},"99":{"line":82},"100":{"line":83},"101":{"line":84},"102":{"line":85}}
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
{"1":{"line":0},"52":{"line":1},"53":{"line":2},"54":{"line":3}}
|
||||
{"52":{"line":0},"53":{"line":0},"54":{"line":0},"1":{"line":0}}
|
|
@ -1 +1 @@
|
|||
54
|
||||
106
|
|
@ -34,7 +34,6 @@
|
|||
"parameters": {}
|
||||
},
|
||||
|
||||
|
||||
"markdown": {
|
||||
"description": "Retourne une description en markdown des différents modules de l'API",
|
||||
"permissions": [],
|
||||
|
@ -42,7 +41,6 @@
|
|||
"parameters": {}
|
||||
},
|
||||
|
||||
|
||||
"apiBlueprint": {
|
||||
"description": "Retourne une documentation de l'API au format API Blueprint.",
|
||||
"permissions": [],
|
||||
|
@ -70,7 +68,6 @@
|
|||
"parameters": {}
|
||||
},
|
||||
|
||||
|
||||
"getById": {
|
||||
"description": "Retourne les informations d'un utilisateur.",
|
||||
"permissions": ["admin"],
|
||||
|
@ -82,7 +79,6 @@
|
|||
}
|
||||
},
|
||||
|
||||
|
||||
"getAll": {
|
||||
"description": "Retourne les informations de tous les utilisateurs.",
|
||||
"permissions": ["admin"],
|
||||
|
@ -92,7 +88,6 @@
|
|||
}
|
||||
},
|
||||
|
||||
|
||||
"create": {
|
||||
"description": "Creation d'un nouvel administrateur.",
|
||||
"permissions": ["admin"],
|
||||
|
@ -106,7 +101,6 @@
|
|||
}
|
||||
},
|
||||
|
||||
|
||||
"remove": {
|
||||
"description": "Suppression d'un utilisateur.",
|
||||
"permissions": ["admin"],
|
||||
|
@ -127,7 +121,6 @@
|
|||
}
|
||||
},
|
||||
|
||||
|
||||
"generate": {
|
||||
"description": "Création d'un token de nom et de durée donnée",
|
||||
"permissions": ["admin"],
|
||||
|
@ -174,7 +167,6 @@
|
|||
}
|
||||
},
|
||||
|
||||
|
||||
"create": {
|
||||
"description": "Creation d'un nouveau sujet.",
|
||||
"permissions": ["admin"],
|
||||
|
@ -190,11 +182,26 @@
|
|||
|
||||
"input": {
|
||||
|
||||
"surveysync": {
|
||||
"description": "Enregistre les données d'une enquête lab-surveys.",
|
||||
"permissions": ["admin"],
|
||||
"parameters": {
|
||||
"subject": { "description": "Id du sujet concerné.", "type": "id" },
|
||||
"contacts": { "description": "Données des contacts de l'enquête.", "type": "array<array>" },
|
||||
"mini": { "description": "Mini fiches relations sur les contacts de l'enquête.", "type": "array<array>" },
|
||||
"fiches": { "description": "Fiches relation sur les plus proches contacts de l'enquête.", "type": "array<array>" },
|
||||
"matrice": { "description": "Matrice contenant les relations entre les plus proches contacts", "type": "array<array>", "optional": true }
|
||||
},
|
||||
"output": {
|
||||
"subject_id": { "description": "Identifiant du sujet complété", "type": "id" }
|
||||
}
|
||||
},
|
||||
|
||||
"phone": {
|
||||
"description": "Enregistre les données d'une enquête téléphonique.",
|
||||
"permissions": ["admin"],
|
||||
"parameters": {
|
||||
"subject": { "description": "Données sur le sujet de l'enquête.", "type": "array" },
|
||||
"subject": { "description": "Id du sujet concerné", "type": "id" },
|
||||
"contacts": { "description": "Données des contacts de l'enquête.", "type": "array<array>" },
|
||||
"mini": { "description": "Mini fiches relations sur les contacts de l'enquête.", "type": "array<array>" },
|
||||
"fiches": { "description": "Fiches relation sur les plus proches contacts de l'enquête.", "type": "array<array>" },
|
||||
|
@ -209,7 +216,7 @@
|
|||
"description": "Enregistre les données d'une enquête facebook.",
|
||||
"permissions": ["admin"],
|
||||
"parameters": {
|
||||
"subject": { "description": "Données sur le sujet de l'enquête.", "type": "array" },
|
||||
"subject": { "description": "Id du sujet concerné", "type": "id" },
|
||||
"contacts": { "description": "Données des contacts de l'enquête.", "type": "array<array>" },
|
||||
"mini": { "description": "Mini fiches relations sur les contacts de l'enquête.", "type": "array<array>" },
|
||||
"fiches": { "description": "Fiches relation sur les plus proches contacts de l'enquête.", "type": "array<array>" },
|
||||
|
@ -256,9 +263,6 @@
|
|||
"options": { "download": true },
|
||||
"parameters": {
|
||||
"subjects": { "description": "Identifiants des sujets d'enquêtes à intégrer.", "type": "array<id>", "optional": true },
|
||||
"phone": { "description": "Si vaut TRUE, renvoie les sujets cellulaires.", "type": "boolean", "optional": true },
|
||||
"facebook": { "description": "Si vaut TRUE, renvoie les sujet facebook.", "type": "boolean", "optional": true },
|
||||
"survey": { "description": "Si vaut TRUE, renvoie les sujets ResTIC.", "type": "boolean", "optional": true },
|
||||
"all": { "description": "Si vaut TRUE, renvoie tous les sujets enregistrés.", "type": "boolean", "optional": true }
|
||||
}
|
||||
},
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
$sub = $sl->fetch(1);
|
||||
|
||||
var_dump( count($sub['relations']) );
|
||||
var_dump( 'contacts: '.count($sub['contacts']) );
|
||||
var_dump( 'relations: '.count($sub['relations']) );
|
||||
|
||||
foreach($sub['relations'] as $rel){
|
||||
if( $rel['idA'] == 1 )
|
|
@ -61,8 +61,8 @@ $pers = $request->answer();
|
|||
<h4>Exporter les données au format .csv pour un logiciel de visualisation de réseau</h4>
|
||||
|
||||
<strong>Choix des sujets</strong>
|
||||
<br><input type='radio' name='charts_subject-group' data-name='group' id='charts_group_0' value='all' ><label for='charts_group_0'>Tous les sujets</label>
|
||||
<br><input type='radio' name='charts_subject-group' data-name='group' id='charts_group_1' value='sel' checked><label for='charts_group_1'>Les sujets selectionnés uniquement</label>
|
||||
<br><input type='radio' name='charts_subject-group' data-name='group' id='charts_group_0' value='all' checked><label for='charts_group_0'>Tous les sujets</label>
|
||||
<br><input type='radio' name='charts_subject-group' data-name='group' id='charts_group_1' value='sel' ><label for='charts_group_1'>Les sujets selectionnés uniquement</label>
|
||||
<br><br>
|
||||
|
||||
<article style='display: inline;' id='charts_subject-list'>
|
||||
|
@ -70,10 +70,10 @@ $pers = $request->answer();
|
|||
</article>
|
||||
<input type='button' id='charts_add-subject' class='primary' value='+' style='padding:.2em .6em; margin: .5em 0'>
|
||||
|
||||
<br><br><br><strong>Types de données</strong>
|
||||
<!-- <br><br><br><strong>Types de données</strong>
|
||||
<br><br><input type='checkbox' data-name='phone' value='1' id='charts_phone_0' ><label for='charts_phone_0'>Données cellulaires</label>
|
||||
<br><br><input type='checkbox' data-name='facebook' value='1' id='charts_facebook_0'><label for='charts_facebook_0'>Données Facebook</label>
|
||||
<br><br><input type='checkbox' data-name='restic' value='1' id='charts_restic_0' ><label for='charts_restic_0'>Données <i>Lab Surveys</i></label>
|
||||
<br><br><input type='checkbox' data-name='restic' value='1' id='charts_restic_0' ><label for='charts_restic_0'>Données <i>Lab Surveys</i></label> -->
|
||||
|
||||
<br><br><input type='submit' class='primary hover' style='padding:.5em 2em;' value='Télécharger' id='charts_export-all'>
|
||||
</section>
|
||||
|
|
|
@ -82,7 +82,7 @@ $('#export-form #export_export-all').addEventListener('click', function(e){
|
|||
|
||||
|
||||
|
||||
/* [0] Gestion de l'export
|
||||
/* [0] Gestion de l'export GEPHI
|
||||
=========================================================*/
|
||||
/* (0) Initialisation des variables */
|
||||
var chartsSubjectList = $('#charts_subject-list');
|
||||
|
@ -134,17 +134,10 @@ $('#charts-form #charts_export-all').addEventListener('click', function(e){
|
|||
/* (4) On construit la requête */
|
||||
var request = {
|
||||
path: 'download/chart',
|
||||
phone: deflated.phone == '1', // VRAI si on veut les données téléphoniques
|
||||
facebook: deflated.facebook == '1', // VRAI si on veut les données facebook
|
||||
survey: deflated.survey == '1', // VRAI si on veut les données ResTIC
|
||||
subjects: subjects,
|
||||
all: deflated.group == 'all' // VRAI si on veut TOUS les sujets
|
||||
};
|
||||
|
||||
// On ajoute les sujets s'il y en a
|
||||
if( deflated.group != 'all' && subjects.length > 0 )
|
||||
request.subjects = subjects;
|
||||
|
||||
|
||||
/* (5) On lance la requête */
|
||||
api.send(request, function(res){
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@ var phoneRoutine = function(){
|
|||
var request = {
|
||||
path: 'input/phone',
|
||||
|
||||
subject: lsi.export('p_subject')[0],
|
||||
subject: lsi.export('p_subject')[0].subject_id,
|
||||
contacts: lsi.export('p_contacts'),
|
||||
mini: lsi.export('p_mini-fiches'),
|
||||
fiches: lsi.export('p_fiches'),
|
||||
|
@ -457,7 +457,7 @@ var facebookRoutine = function(){
|
|||
|
||||
/* (1) On construit les données */
|
||||
var data = {
|
||||
subject: lsi.export('f_subject')[0],
|
||||
subject: lsi.export('f_subject')[0].subject_id,
|
||||
contacts: lsi.export('f_contacts'),
|
||||
mini: lsi.export('f_mini-fiches'),
|
||||
fiches: lsi.export('f_fiches'),
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
var exportSubjectList=$("#export_subject-list"),exportSubjectAdd=$("#export_add-subject"),exportDeflater=new FormDeflater(document.getElementById("export-form"),["input"],["data-name"]);exportSubjectAdd.addEventListener("click",function(b){b=document.createElement("input");b.type="number";b.dataset.name="subjects";b.placeholder="Sujet";b.style="width: 5em; display: block;";exportSubjectList.appendChild(b)},!1);
|
||||
$("#export-form #export_export-all").addEventListener("click",function(b){var a=(new FormDeflater(exportSubjectList,["input"],["data-name"])).deflate().subjects;b=[];a instanceof Array||(a=[a]);for(var c=0;c<a.length;c++)0<a[c].length&&!isNaN(a[c])&&b.push(a[c]);a=exportDeflater.deflate();api.send({path:"download/multiple",subjects:b,all:"all"==a.group},function(a){if(0!=a.ModuleError)return!1;document.location=a.link;Notification.success("OK","Lancement du t\u00e9l\u00e9chargement..")})},!1);
|
||||
var chartsSubjectList=$("#charts_subject-list"),chartsSubjectAdd=$("#charts_add-subject"),chartsDeflater=new FormDeflater(document.getElementById("charts-form"),["input"],["data-name"]);chartsSubjectAdd.addEventListener("click",function(b){b=document.createElement("input");b.type="number";b.dataset.name="subjects";b.placeholder="Sujet";b.style="width: 5em; display: block;";chartsSubjectList.appendChild(b)},!1);
|
||||
$("#charts-form #charts_export-all").addEventListener("click",function(b){var a=(new FormDeflater(chartsSubjectList,["input"],["data-name"])).deflate().subjects;b=[];a instanceof Array||(a=[a]);for(var c=0;c<a.length;c++)0<a[c].length&&!isNaN(a[c])&&b.push(a[c]);a=chartsDeflater.deflate();c={path:"download/chart",phone:"1"==a.phone,facebook:"1"==a.facebook,survey:"1"==a.survey,all:"all"==a.group};"all"!=a.group&&0<b.length&&(c.subjects=b);api.send(c,function(a){if(0!=a.ModuleError)return!1;document.location=
|
||||
a.link;Notification.success("OK","Lancement du t\u00e9l\u00e9chargement..")})},!1);
|
||||
var exportSubjectList=$("#export_subject-list"),exportSubjectAdd=$("#export_add-subject"),exportDeflater=new FormDeflater(document.getElementById("export-form"),["input"],["data-name"]);exportSubjectAdd.addEventListener("click",function(a){a=document.createElement("input");a.type="number";a.dataset.name="subjects";a.placeholder="Sujet";a.style="width: 5em; display: block;";exportSubjectList.appendChild(a)},!1);
|
||||
$("#export-form #export_export-all").addEventListener("click",function(a){var b=(new FormDeflater(exportSubjectList,["input"],["data-name"])).deflate().subjects;a=[];b instanceof Array||(b=[b]);for(var c=0;c<b.length;c++)0<b[c].length&&!isNaN(b[c])&&a.push(b[c]);b=exportDeflater.deflate();api.send({path:"download/multiple",subjects:a,all:"all"==b.group},function(a){if(0!=a.ModuleError)return!1;document.location=a.link;Notification.success("OK","Lancement du t\u00e9l\u00e9chargement..")})},!1);
|
||||
var chartsSubjectList=$("#charts_subject-list"),chartsSubjectAdd=$("#charts_add-subject"),chartsDeflater=new FormDeflater(document.getElementById("charts-form"),["input"],["data-name"]);chartsSubjectAdd.addEventListener("click",function(a){a=document.createElement("input");a.type="number";a.dataset.name="subjects";a.placeholder="Sujet";a.style="width: 5em; display: block;";chartsSubjectList.appendChild(a)},!1);
|
||||
$("#charts-form #charts_export-all").addEventListener("click",function(a){var b=(new FormDeflater(chartsSubjectList,["input"],["data-name"])).deflate().subjects;a=[];b instanceof Array||(b=[b]);for(var c=0;c<b.length;c++)0<b[c].length&&!isNaN(b[c])&&a.push(b[c]);b=chartsDeflater.deflate();api.send({path:"download/chart",subjects:a,all:"all"==b.group},function(a){if(0!=a.ModuleError)return!1;document.location=a.link;Notification.success("OK","Lancement du t\u00e9l\u00e9chargement..")})},!1);
|
||||
|
|
|
@ -9,17 +9,18 @@ function(a){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargeme
|
|||
function(a){$('[data-sublink="phone"] #p_local-upload').click()},!1),$('[data-sublink="phone"] #p_local-upload').addEventListener("click",function(a){a.target.value=null},!1),$('[data-sublink="phone"] #p_local-upload').addEventListener("change",function(a){a={path:"upload/local_data",file:$('[data-sublink="phone"] #p_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("p_subject",0,a.local_data.subject);lsi["import"]("p_contacts",
|
||||
a.local_data.contacts);lsi["import"]("p_mini-fiches",a.local_data.mini);lsi["import"]("p_fiches",a.local_data.fiches);lsi.set("p_matrice",0,a.local_data.matrice);pSubjectManager.storageToFields();pContactManager.storageToFields();pMatriceManager.storageToFields();pDynamicUpdate(!0)})},!1),$('[data-sublink="phone"] #p_submit-all').addEventListener("click",function(a){console.log("> GATHERING ALL DATA");pContactManager.fieldsToStorage();pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();
|
||||
if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!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 <i>fiche rapide</i> <b>"+b+"</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 <i>fiche compl\u00e8te</i> <b>"+(parseInt(c)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),
|
||||
!1;c={path:"input/phone",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 <strong>"+a.subject_id+"</strong> ! Tout s'est bien d\u00e9roul\u00e9.",1E4);console.log(a)},!1)},!1),console.groupEnd())};
|
||||
!1;c={path:"input/phone",subject:lsi["export"]("p_subject")[0].subject_id,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 <strong>"+a.subject_id+"</strong> ! Tout s'est bien d\u00e9roul\u00e9.",1E4);console.log(a)},!1)},!1),console.groupEnd())};
|
||||
include("/js/includes/input-phone-subject.js",function(){pLoaded[0]=1;phoneRoutine()});include("/js/includes/input-phone-contact.js",function(){pLoaded[1]=1;phoneRoutine()});include("/js/includes/input-phone-mini.js",function(){pLoaded[2]=1;phoneRoutine()});include("/js/includes/input-phone-fiche.js",function(){pLoaded[3]=1;phoneRoutine()});include("/js/includes/input-phone-matrice.js",function(){pLoaded[4]=1;phoneRoutine()});
|
||||
var fAlready=0,fLoaded=[0,0,0,0,0],facebookRoutine=function(){!Math.min.apply(Math,fLoaded)|fAlready||(fAlready=1,console.groupEnd(),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.top_size=20,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-facebook-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");pContactManager.fieldsToStorage();
|
||||
pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!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 <i>fiche rapide</i> <b>"+b+"</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 <i>fiche compl\u00e8te</i> <b>"+
|
||||
(parseInt(c)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;c={path:"input/facebook",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 <strong>"+a.subject_id+"</strong> ! Tout s'est bien d\u00e9roul\u00e9.",
|
||||
1E4);console.log(a)},!1)},!1),console.groupEnd())};include("/js/includes/input-facebook-subject.js",function(){fLoaded[0]=1;facebookRoutine()});include("/js/includes/input-facebook-contact.js",function(){fLoaded[1]=1;facebookRoutine()});include("/js/includes/input-facebook-mini.js",function(){fLoaded[2]=1;facebookRoutine()});include("/js/includes/input-facebook-fiche.js",function(){fLoaded[3]=1;facebookRoutine()});include("/js/includes/input-facebook-matrice.js",function(){fLoaded[4]=1;facebookRoutine()});
|
||||
!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].subject_id,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-facebook-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");pContactManager.fieldsToStorage();pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!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 <i>fiche rapide</i> <b>"+b+"</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 <i>fiche compl\u00e8te</i> <b>"+(parseInt(c)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;c={path:"input/facebook",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 <strong>"+a.subject_id+"</strong> ! Tout s'est bien d\u00e9roul\u00e9.",1E4);console.log(a)},!1)},!1),console.groupEnd())};include("/js/includes/input-facebook-subject.js",function(){fLoaded[0]=1;facebookRoutine()});include("/js/includes/input-facebook-contact.js",function(){fLoaded[1]=1;facebookRoutine()});include("/js/includes/input-facebook-mini.js",function(){fLoaded[2]=1;facebookRoutine()});include("/js/includes/input-facebook-fiche.js",function(){fLoaded[3]=1;facebookRoutine()});
|
||||
include("/js/includes/input-facebook-matrice.js",function(){fLoaded[4]=1;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.groupEnd();console.groupEnd();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){console.warn("xx",a);if(0!=a.ModuleError)return console.groupEnd(),!1;lsi["import"]("p_friends",a.subjects);pMiniManager.storageToFields();pFicheManager.storageToFields();pMatriceManager.storageToFields();pContactManager.storageToFields();pMiniManager.updateNavBar();pFicheManager.updateNavBar()}):(pMiniManager.storageToFields(),pFicheManager.storageToFields(),pMatriceManager.storageToFields(),
|
||||
pMiniManager.updateNavBar(),pFicheManager.updateNavBar(),(c||b)&&pContactManager.storageToFields());console.groupEnd()},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.groupEnd();console.groupEnd();console.group("[facebook] Dynamic Update");fMiniManager.fieldsToStorage();
|
||||
|
|
Loading…
Reference in New Issue