Création d'un test qui remplit automatiquement 'input/phone' + Correction de la recherche de sujet
This commit is contained in:
parent
c1a7e16cf4
commit
593c56d1d2
|
@ -110,7 +110,7 @@ body{
|
|||
align-items: center;
|
||||
|
||||
|
||||
background-color: $header-dark;
|
||||
background-color: #D7D7D9;
|
||||
|
||||
@include transition( left .3s ease-in-out );
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -54,25 +54,25 @@ fMiniFicheBuilder.setLayout(
|
|||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t<span class='select-container'><select data-name='age'>\n"+
|
||||
"\t\t\t<option value='.' disabled selected>Age:</option>\n"+
|
||||
"\t\t\t<option value='1' >5 à 10 ans</option>\n"+
|
||||
"\t\t\t<option value='2' >10 à 15 ans</option>\n"+
|
||||
"\t\t\t<option value='3' >15 à 20 ans</option>\n"+
|
||||
"\t\t\t<option value='4' >20 à 25 ans</option>\n"+
|
||||
"\t\t\t<option value='5' >25 à 30 ans</option>\n"+
|
||||
"\t\t\t<option value='6' >30 à 35 ans</option>\n"+
|
||||
"\t\t\t<option value='7' >35 à 40 ans</option>\n"+
|
||||
"\t\t\t<option value='8' >40 à 45 ans</option>\n"+
|
||||
"\t\t\t<option value='9' >45 à 50 ans</option>\n"+
|
||||
"\t\t\t<option value='10'>50 à 55 ans</option>\n"+
|
||||
"\t\t\t<option value='11'>55 à 60 ans</option>\n"+
|
||||
"\t\t\t<option value='12'>60 à 65 ans</option>\n"+
|
||||
"\t\t\t<option value='13'>65 à 70 ans</option>\n"+
|
||||
"\t\t\t<option value='14'>70 à 75 ans</option>\n"+
|
||||
"\t\t\t<option value='15'>75 à 80 ans</option>\n"+
|
||||
"\t\t\t<option value='16'>80 à 85 ans</option>\n"+
|
||||
"\t\t\t<option value='17'>85 à 90 ans</option>\n"+
|
||||
"\t\t\t<option value='18'>90 à 95 ans</option>\n"+
|
||||
"\t\t\t<option value='19'>95 à 100 ans</option>\n"+
|
||||
"\t\t\t<option value='0' >5 à 10 ans</option>\n"+
|
||||
"\t\t\t<option value='1' >10 à 15 ans</option>\n"+
|
||||
"\t\t\t<option value='2' >15 à 20 ans</option>\n"+
|
||||
"\t\t\t<option value='3' >20 à 25 ans</option>\n"+
|
||||
"\t\t\t<option value='4' >25 à 30 ans</option>\n"+
|
||||
"\t\t\t<option value='5' >30 à 35 ans</option>\n"+
|
||||
"\t\t\t<option value='6' >35 à 40 ans</option>\n"+
|
||||
"\t\t\t<option value='7' >40 à 45 ans</option>\n"+
|
||||
"\t\t\t<option value='8' >45 à 50 ans</option>\n"+
|
||||
"\t\t\t<option value='9' >50 à 55 ans</option>\n"+
|
||||
"\t\t\t<option value='10'>55 à 60 ans</option>\n"+
|
||||
"\t\t\t<option value='11'>60 à 65 ans</option>\n"+
|
||||
"\t\t\t<option value='12'>65 à 70 ans</option>\n"+
|
||||
"\t\t\t<option value='13'>70 à 75 ans</option>\n"+
|
||||
"\t\t\t<option value='14'>75 à 80 ans</option>\n"+
|
||||
"\t\t\t<option value='15'>80 à 85 ans</option>\n"+
|
||||
"\t\t\t<option value='16'>85 à 90 ans</option>\n"+
|
||||
"\t\t\t<option value='17'>90 à 95 ans</option>\n"+
|
||||
"\t\t\t<option value='18'>95 à 100 ans</option>\n"+
|
||||
"\t\t</select></span>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
|
@ -182,25 +182,25 @@ fFicheBuilder.setLayout(
|
|||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t<span class='select-container'><select data-name='age'>\n"+
|
||||
"\t\t\t<option value='.' disabled selected>Age:</option>\n"+
|
||||
"\t\t\t<option value='1' >5 à 10 ans</option>\n"+
|
||||
"\t\t\t<option value='2' >10 à 15 ans</option>\n"+
|
||||
"\t\t\t<option value='3' >15 à 20 ans</option>\n"+
|
||||
"\t\t\t<option value='4' >20 à 25 ans</option>\n"+
|
||||
"\t\t\t<option value='5' >25 à 30 ans</option>\n"+
|
||||
"\t\t\t<option value='6' >30 à 35 ans</option>\n"+
|
||||
"\t\t\t<option value='7' >35 à 40 ans</option>\n"+
|
||||
"\t\t\t<option value='8' >40 à 45 ans</option>\n"+
|
||||
"\t\t\t<option value='9' >45 à 50 ans</option>\n"+
|
||||
"\t\t\t<option value='10'>50 à 55 ans</option>\n"+
|
||||
"\t\t\t<option value='11'>55 à 60 ans</option>\n"+
|
||||
"\t\t\t<option value='12'>60 à 65 ans</option>\n"+
|
||||
"\t\t\t<option value='13'>65 à 70 ans</option>\n"+
|
||||
"\t\t\t<option value='14'>70 à 75 ans</option>\n"+
|
||||
"\t\t\t<option value='15'>75 à 80 ans</option>\n"+
|
||||
"\t\t\t<option value='16'>80 à 85 ans</option>\n"+
|
||||
"\t\t\t<option value='17'>85 à 90 ans</option>\n"+
|
||||
"\t\t\t<option value='18'>90 à 95 ans</option>\n"+
|
||||
"\t\t\t<option value='19'>95 à 100 ans</option>\n"+
|
||||
"\t\t\t<option value='0' >5 à 10 ans</option>\n"+
|
||||
"\t\t\t<option value='1' >10 à 15 ans</option>\n"+
|
||||
"\t\t\t<option value='2' >15 à 20 ans</option>\n"+
|
||||
"\t\t\t<option value='3' >20 à 25 ans</option>\n"+
|
||||
"\t\t\t<option value='4' >25 à 30 ans</option>\n"+
|
||||
"\t\t\t<option value='5' >30 à 35 ans</option>\n"+
|
||||
"\t\t\t<option value='6' >35 à 40 ans</option>\n"+
|
||||
"\t\t\t<option value='7' >40 à 45 ans</option>\n"+
|
||||
"\t\t\t<option value='8' >45 à 50 ans</option>\n"+
|
||||
"\t\t\t<option value='9' >50 à 55 ans</option>\n"+
|
||||
"\t\t\t<option value='10'>55 à 60 ans</option>\n"+
|
||||
"\t\t\t<option value='11'>60 à 65 ans</option>\n"+
|
||||
"\t\t\t<option value='12'>65 à 70 ans</option>\n"+
|
||||
"\t\t\t<option value='13'>70 à 75 ans</option>\n"+
|
||||
"\t\t\t<option value='14'>75 à 80 ans</option>\n"+
|
||||
"\t\t\t<option value='15'>80 à 85 ans</option>\n"+
|
||||
"\t\t\t<option value='16'>85 à 90 ans</option>\n"+
|
||||
"\t\t\t<option value='17'>90 à 95 ans</option>\n"+
|
||||
"\t\t\t<option value='18'>95 à 100 ans</option>\n"+
|
||||
"\t\t</select></span>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -67,7 +67,7 @@ pMiniFicheBuilder.setLayout(
|
|||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t<span class='select-container'><select data-name='age'>\n"+
|
||||
"\t\t\t<option value='.' disabled selected>Age:</option>\n"+
|
||||
"\t\t\t<option value='1' >5 à 10 ans</option>\n"+
|
||||
"\t\t\t<option value='0' >5 à 10 ans</option>\n"+
|
||||
"\t\t\t<option value='2' >10 à 15 ans</option>\n"+
|
||||
"\t\t\t<option value='3' >15 à 20 ans</option>\n"+
|
||||
"\t\t\t<option value='4' >20 à 25 ans</option>\n"+
|
||||
|
@ -202,25 +202,25 @@ pFicheBuilder.setLayout(
|
|||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t<span class='select-container'><select data-name='age'>\n"+
|
||||
"\t\t\t<option value='.' disabled selected>Age:</option>\n"+
|
||||
"\t\t\t<option value='1' >5 à 10 ans</option>\n"+
|
||||
"\t\t\t<option value='2' >10 à 15 ans</option>\n"+
|
||||
"\t\t\t<option value='3' >15 à 20 ans</option>\n"+
|
||||
"\t\t\t<option value='4' >20 à 25 ans</option>\n"+
|
||||
"\t\t\t<option value='5' >25 à 30 ans</option>\n"+
|
||||
"\t\t\t<option value='6' >30 à 35 ans</option>\n"+
|
||||
"\t\t\t<option value='7' >35 à 40 ans</option>\n"+
|
||||
"\t\t\t<option value='8' >40 à 45 ans</option>\n"+
|
||||
"\t\t\t<option value='9' >45 à 50 ans</option>\n"+
|
||||
"\t\t\t<option value='10'>50 à 55 ans</option>\n"+
|
||||
"\t\t\t<option value='11'>55 à 60 ans</option>\n"+
|
||||
"\t\t\t<option value='12'>60 à 65 ans</option>\n"+
|
||||
"\t\t\t<option value='13'>65 à 70 ans</option>\n"+
|
||||
"\t\t\t<option value='14'>70 à 75 ans</option>\n"+
|
||||
"\t\t\t<option value='15'>75 à 80 ans</option>\n"+
|
||||
"\t\t\t<option value='16'>80 à 85 ans</option>\n"+
|
||||
"\t\t\t<option value='17'>85 à 90 ans</option>\n"+
|
||||
"\t\t\t<option value='18'>90 à 95 ans</option>\n"+
|
||||
"\t\t\t<option value='19'>95 à 100 ans</option>\n"+
|
||||
"\t\t\t<option value='0' >5 à 10 ans</option>\n"+
|
||||
"\t\t\t<option value='1' >10 à 15 ans</option>\n"+
|
||||
"\t\t\t<option value='2' >15 à 20 ans</option>\n"+
|
||||
"\t\t\t<option value='3' >20 à 25 ans</option>\n"+
|
||||
"\t\t\t<option value='4' >25 à 30 ans</option>\n"+
|
||||
"\t\t\t<option value='5' >30 à 35 ans</option>\n"+
|
||||
"\t\t\t<option value='6' >35 à 40 ans</option>\n"+
|
||||
"\t\t\t<option value='7' >40 à 45 ans</option>\n"+
|
||||
"\t\t\t<option value='8' >45 à 50 ans</option>\n"+
|
||||
"\t\t\t<option value='9' >50 à 55 ans</option>\n"+
|
||||
"\t\t\t<option value='10'>55 à 60 ans</option>\n"+
|
||||
"\t\t\t<option value='11'>60 à 65 ans</option>\n"+
|
||||
"\t\t\t<option value='12'>65 à 70 ans</option>\n"+
|
||||
"\t\t\t<option value='13'>70 à 75 ans</option>\n"+
|
||||
"\t\t\t<option value='14'>75 à 80 ans</option>\n"+
|
||||
"\t\t\t<option value='15'>80 à 85 ans</option>\n"+
|
||||
"\t\t\t<option value='16'>85 à 90 ans</option>\n"+
|
||||
"\t\t\t<option value='17'>90 à 95 ans</option>\n"+
|
||||
"\t\t\t<option value='18'>95 à 100 ans</option>\n"+
|
||||
"\t\t</select></span>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@
|
|||
$uniqid = 0;
|
||||
|
||||
// Décalage à appliquer à tous les ids
|
||||
$offset = intval($uniqid) + 2;
|
||||
$offset = intval($uniqid) + 1;
|
||||
|
||||
// on enregistre l'id du sujet
|
||||
$subject_id = intval($uniqid) + 1;
|
||||
$subject_id = $subject['subject_id'];
|
||||
|
||||
// Contiendra la valeur de l'id maximum
|
||||
$maxId = 0;
|
||||
|
@ -81,8 +81,7 @@
|
|||
/* [2] On enregistre les données du sujet
|
||||
=========================================================*/
|
||||
$file['subject'] = array(
|
||||
'id' => $subject_id,
|
||||
'name' => $subject['username']
|
||||
'id' => $subject_id
|
||||
);
|
||||
|
||||
|
||||
|
@ -246,10 +245,10 @@
|
|||
$uniqid = 0;
|
||||
|
||||
// Décalage à appliquer à tous les ids
|
||||
$offset = intval($uniqid) + 2;
|
||||
$offset = intval($uniqid) + 1;
|
||||
|
||||
// on enregistre l'id du sujet
|
||||
$subject_id = intval($uniqid) + 1;
|
||||
$subject_id = $subject['subject_id'];
|
||||
|
||||
// Contiendra la valeur de l'id maximum
|
||||
$maxId = 0;
|
||||
|
|
|
@ -189,9 +189,13 @@
|
|||
/* (2) On récupère tous les sujets */
|
||||
foreach($ids as $id){
|
||||
$sub = $db->fetch($id)['subject'];
|
||||
$sub['phone'] = true;
|
||||
if( compareSearch($name, $sub['name']) )
|
||||
$subjects[$id] = $sub;
|
||||
if( compareSearch($name, $sub['name']) ){
|
||||
|
||||
if( !isset($subjects[$id]) )
|
||||
$subjects[$id] = $sub;
|
||||
|
||||
$subjects[$id]['phone'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* (3) On ferme la bd */
|
||||
|
@ -208,9 +212,13 @@
|
|||
/* (2) On récupère tous les sujets */
|
||||
foreach($ids as $id){
|
||||
$sub = $db->fetch($id)['subject'];
|
||||
$sub['facebook'] = true;
|
||||
if( compareSearch($name, $sub['name']) )
|
||||
$subjects[$id] = $sub;
|
||||
if( compareSearch($name, $sub['name']) ){
|
||||
|
||||
if( !isset($subjects[$id]) )
|
||||
$subjects[$id] = $sub;
|
||||
|
||||
$subjects[$id]['facebook'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* (3) On ferme la bd */
|
||||
|
@ -226,9 +234,14 @@
|
|||
/* (2) On récupère tous les sujets */
|
||||
foreach($ids as $id){
|
||||
$sub = $db->fetch($id)['subject'];
|
||||
$sub['survey'] = true;
|
||||
if( compareSearch($name, $sub['name']) )
|
||||
$subjects[$id] = $sub;
|
||||
if( compareSearch($name, $sub['name']) ){
|
||||
|
||||
if( !isset($subjects[$id]) )
|
||||
$subjects[$id] = $sub;
|
||||
|
||||
$subjects[$id]['survey'] = true;
|
||||
$subjects[$id]['name'] = $sub['name'];
|
||||
}
|
||||
}
|
||||
|
||||
/* (3) On ferme la bd */
|
||||
|
|
|
@ -1 +1 @@
|
|||
412
|
||||
1261
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,29 +1,35 @@
|
|||
var sField=$("#search-field"),sSubmit=$("#search-subject"),sList=$('section[data-sublink="survey"] ul[data-list]');
|
||||
sSubmit.addEventListener("click",function(a){api.send({path:"subject/search",name:sField.value},function(c){if(0!=c.ModuleError)return Notification.error("Erreur","La recherche a \u00e9chou\u00e9."),!1;console.log(c);var b="",a;for(a in c.results)b+="<li data-element data-id='"+a+"'>",b+="<div data-user><span>SUJET</span></div>",b+="<div> <span data-prefix='Identifiant'><span class='flag'>"+a+"</span></span> </div>",b+="<div> <span data-prefix='Nom'>"+c.results[a].name+"</span> </div>",b+="<div> <span><input type='checkbox' id='s_"+
|
||||
a+"' "+(null!=c.results[a].survey?"checked":"")+" disabled><label for='s_"+a+"'>ResTIC</label>",b+="</span> </div>",b+="<div> <span><input type='checkbox' id='s_"+a+"' "+(null!=c.results[a].facebook?"checked":"")+" disabled><label for='s_"+a+"'>Facebook</label>",b+="</span> </div>",b+="<div> <span><input type='checkbox' id='s_"+a+"' "+(null!=c.results[a].phone?"checked":"")+" disabled><label for='s_"+a+"'>Cellulaire</label>",b+="</span> </div>",b+="</li>";sList.innerHTML=b})},!1);
|
||||
sSubmit.addEventListener("click",function(b){api.send({path:"subject/search",name:sField.value},function(a){if(0!=a.ModuleError)return Notification.error("Erreur","La recherche a \u00e9chou\u00e9."),!1;console.log(a);var c="",b;for(b in a.results)c+="<li data-element data-id='"+b+"'>",c+="<div data-user><span>SUJET</span></div>",c+="<div> <span data-prefix='Identifiant'><span class='flag'>"+b+"</span></span> </div>",c+="<div> <span data-prefix='Nom'>"+a.results[b].name+"</span> </div>",c+="<div> <span><input type='checkbox' id='s_"+
|
||||
b+"' "+(null!=a.results[b].survey?"checked":"")+" disabled><label for='s_"+b+"'>ResTIC</label>",c+="</span> </div>",c+="<div> <span><input type='checkbox' id='s_"+b+"' "+(null!=a.results[b].facebook?"checked":"")+" disabled><label for='s_"+b+"'>Facebook</label>",c+="</span> </div>",c+="<div> <span><input type='checkbox' id='s_"+b+"' "+(null!=a.results[b].phone?"checked":"")+" disabled><label for='s_"+b+"'>Cellulaire</label>",c+="</span> </div>",c+="</li>";sList.innerHTML=c})},!1);
|
||||
var pSubjectManager,pContactManager,pMiniManager,pFicheManager,pMatriceManager;
|
||||
function pDynamicUpdate(a){var c=a instanceof Element,b=c&&"INPUT"==a.tagName&&"submit"==a.type,e=c&&"SPAN"==a.tagName&&("p_nav-mini"==a.parentNode.id||"p_nav-fiche"==a.parentNode.id),c=c&&"SPAN"==a.tagName&&"p_nav-contact"==a.parentNode.id;if(!b&&!e&&!c&&!0!==a)return!1;console.log("> dynamic update");pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();pContactManager.fieldsToStorage();pMatriceManager.fieldsToStorage();pFicheManager.sync();pMiniManager.sync();pMiniManager.storageToFields();
|
||||
pFicheManager.storageToFields();pMatriceManager.storageToFields();(b||c)&&pContactManager.storageToFields()}
|
||||
function pDynamicUpdate(b){var a=b instanceof Element,c=a&&"INPUT"==b.tagName&&"submit"==b.type,g=a&&"SPAN"==b.tagName&&("p_nav-mini"==b.parentNode.id||"p_nav-fiche"==b.parentNode.id),a=a&&"SPAN"==b.tagName&&"p_nav-contact"==b.parentNode.id;if(!c&&!g&&!a&&!0!==b)return!1;console.log("> dynamic update");pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();pContactManager.fieldsToStorage();pMatriceManager.fieldsToStorage();pFicheManager.sync();pMiniManager.sync();pMiniManager.storageToFields();
|
||||
pFicheManager.storageToFields();pMatriceManager.storageToFields();(c||a)&&pContactManager.storageToFields()}
|
||||
include("/js/includes/input-phone-subject-min.js",function(){include("/js/includes/input-phone-contact-min.js",function(){include("/js/includes/input-phone-mini-min.js",function(){include("/js/includes/input-phone-fiche-min.js",function(){include("/js/includes/input-phone-matrice-min.js",function(){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="number"]'),
|
||||
$('[data-sublink="phone"] article.subject-panel [data-name="submit"]'));pSubjectManager.attach();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);var a=new ShortcutManager;a.append("s+n+a+k+e",function(){pMatriceManager.snake()});a.listen();$('[data-sublink="phone"] input#p_call_log-import[type="file"]').addEventListener("click",function(c){c.target.value=null},!1);$('[data-sublink="phone"] input#p_call_log-import[type="file"]').addEventListener("change",
|
||||
function(c){c={path:"upload/call_log",phone_number:$('[data-sublink="phone"] #p_subject_phone_number').value,file:c.target.files[0]};api.send(c,function(b){console.log(b);var c=null;if(0!=b.ModuleError)9==b.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",b.ModuleError);else{c=Notification.info("Info","Chargement du journal d'appel");pSubjectManager.tmp_id.value=b.tmp_id;pSubjectManager.fieldsToStorage();
|
||||
pSubjectManager.storageToFields();for(var a=0;a<b.call.length;a++){var d=b.directory[b.call[a]];lsi.set("p_contacts",d.id,{uid:d.id,number:d.number,username:d.name,countsms:d.sms,countcall:d.call,call:a,sms:-1})}for(a=0;a<b.sms.length;a++)if(d=b.directory[b.sms[a]],-1<b.call.indexOf(b.sms[a])){var g=lsi.get("p_contacts",d.id);g.sms=a;lsi.set("p_contacts",d.id,g)}else lsi.set("p_contacts",d.id,{uid:d.id,number:d.number,username:d.name,countsms:d.sms,countcall:d.call,call:-1,sms:a});for(var f in b.directory)f=
|
||||
parseInt(f),-1<b.call.indexOf(f)||-1<b.sms.indexOf(f)||(d=b.directory[f],lsi.set("p_contacts",d.id,{uid:d.id,number:d.number,username:d.name,countsms:d.sms,countcall:d.call,call:-1,sms:-1}));pContactManager.storageToFields();pDynamicUpdate(!0);null!=c&&c.click();Notification.success("OK","Chargement termin\u00e9")}})},!1);$('[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");
|
||||
$('[data-sublink="phone"] #p_nav-fiche'));pFicheManager.attach(pDynamicUpdate);pMatriceManager=new inputPhoneMatrice($('[data-sublink="phone"] article.matrice-panel'));pMatriceManager.attach(pDynamicUpdate);var b=new ShortcutManager;b.append("s+n+a+k+e",function(){pMatriceManager.snake()});b.listen();$('[data-sublink="phone"] input#p_call_log-import[type="file"]').addEventListener("click",function(a){a.target.value=null},!1);$('[data-sublink="phone"] input#p_call_log-import[type="file"]').addEventListener("change",
|
||||
function(a){a={path:"upload/call_log",phone_number:$('[data-sublink="phone"] #p_subject_phone_number').value,file:a.target.files[0]};api.send(a,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 <b>sujet</b> avant d'exporter son journal d'appel"):Notification.error("Erreur",a.ModuleError);else{b=Notification.info("Info","Chargement du journal d'appel");pSubjectManager.tmp_id.value=a.tmp_id;pSubjectManager.fieldsToStorage();
|
||||
pSubjectManager.storageToFields();for(var e=0;e<a.call.length;e++){var d=a.directory[a.call[e]];lsi.set("p_contacts",d.id,{uid:d.id,number:d.number,username:d.name,countsms:d.sms,countcall:d.call,call:e,sms:-1})}for(e=0;e<a.sms.length;e++)if(d=a.directory[a.sms[e]],-1<a.call.indexOf(a.sms[e])){var f=lsi.get("p_contacts",d.id);f.sms=e;lsi.set("p_contacts",d.id,f)}else lsi.set("p_contacts",d.id,{uid:d.id,number:d.number,username:d.name,countsms:d.sms,countcall:d.call,call:-1,sms:e});for(var h in a.directory)h=
|
||||
parseInt(h),-1<a.call.indexOf(h)||-1<a.sms.indexOf(h)||(d=a.directory[h],lsi.set("p_contacts",d.id,{uid:d.id,number:d.number,username:d.name,countsms:d.sms,countcall:d.call,call:-1,sms:-1}));pContactManager.storageToFields();pDynamicUpdate(!0);null!=b&&b.click();Notification.success("OK","Chargement termin\u00e9")}})},!1);$('[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");
|
||||
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-phone-data.json";b.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(a));b.click()},!1);$('[data-sublink="phone"] #p_import-all').addEventListener("click",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");pSubjectManager.fieldsToStorage();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,e;for(e in a)if(!isNaN(e)&&(b++,
|
||||
!a[e].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(e in a)if(!a[e].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(e)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;e={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(e,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)})})})})});var fSubjectManager,fContactManager,fMiniManager,fFicheManager,fMatriceManager;
|
||||
function fDynamicUpdate(a){var c=a instanceof Element,b=c&&"INPUT"==a.tagName&&"submit"==a.type,e=c&&"SPAN"==a.tagName&&("f_nav-mini"==a.parentNode.id||"f_nav-fiche"==a.parentNode.id),c=c&&"SPAN"==a.tagName&&"f_nav-contact"==a.parentNode.id;if(!b&&!e&&!c&&!0!==a)return!1;console.log("> dynamic update");fMiniManager.fieldsToStorage();fFicheManager.fieldsToStorage();fContactManager.fieldsToStorage();fMatriceManager.fieldsToStorage();fFicheManager.sync();fMiniManager.sync();fMiniManager.storageToFields();
|
||||
fFicheManager.storageToFields();fMatriceManager.storageToFields();(b||c)&&fContactManager.storageToFields()}
|
||||
pMatriceManager.storageToFields();pDynamicUpdate(!0)})},!1);$('[data-sublink="phone"] #p_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 <i>sujet</i>"),!1;a=lsi["export"]("p_mini-fiches");var b=0,g;for(g in a)if(!isNaN(g)&&(b++,
|
||||
!a[g].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(g in a)if(!a[g].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(g)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;g={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(g,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)})})})})});var fSubjectManager,fContactManager,fMiniManager,fFicheManager,fMatriceManager;
|
||||
function fDynamicUpdate(b){var a=b instanceof Element,c=a&&"INPUT"==b.tagName&&"submit"==b.type,g=a&&"SPAN"==b.tagName&&("f_nav-mini"==b.parentNode.id||"f_nav-fiche"==b.parentNode.id),a=a&&"SPAN"==b.tagName&&"f_nav-contact"==b.parentNode.id;if(!c&&!g&&!a&&!0!==b)return!1;console.log("> dynamic update");fMiniManager.fieldsToStorage();fFicheManager.fieldsToStorage();fContactManager.fieldsToStorage();fMatriceManager.fieldsToStorage();fFicheManager.sync();fMiniManager.sync();fMiniManager.storageToFields();
|
||||
fFicheManager.storageToFields();fMatriceManager.storageToFields();(c||a)&&fContactManager.storageToFields()}
|
||||
include("/js/includes/input-facebook-subject-min.js",function(){include("/js/includes/input-facebook-contact-min.js",function(){include("/js/includes/input-facebook-mini-min.js",function(){include("/js/includes/input-facebook-fiche-min.js",function(){include("/js/includes/input-facebook-matrice-min.js",function(){fSubjectManager=new inputFacebookSubject($('[data-sublink="facebook"] article.subject-panel [data-name="subject_id"]'),$('[data-sublink="facebook"] article.subject-panel [data-name="submit"]'));
|
||||
fSubjectManager.attach();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");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 c=$('[data-sublink="facebook"] #f_download-target');
|
||||
c.download="local-facebook-data.json";c.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(a));c.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);fSubjectManager.storageToFields();fContactManager.storageToFields();fMatriceManager.storageToFields();fDynamicUpdate(!0)})},!1);$('[data-sublink="facebook"] #f_submit-all').addEventListener("click",
|
||||
function(a){console.log("> GATHERING ALL DATA");fSubjectManager.fieldsToStorage();fContactManager.fieldsToStorage();fMiniManager.fieldsToStorage();fFicheManager.fieldsToStorage();if(!fSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;a=lsi["export"]("f_mini-fiches");var c=0,b;for(b in a)if(!isNaN(b)&&(c++,!a[b].valid))return Notification.warning("Attention","La <i>fiche rapide</i> <b>"+c+"</b> est incompl\u00e8te et/ou incorrecte"),
|
||||
!1;a=lsi["export"]("f_fiches");for(b in a)if(!a[b].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(b)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;b={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(b,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),
|
||||
fFicheManager.attach(fDynamicUpdate);fMatriceManager=new inputFacebookMatrice($('[data-sublink="facebook"] article.matrice-panel'));fMatriceManager.attach(fDynamicUpdate);$('[data-sublink="facebook"] #f_clear-all').addEventListener("click",function(b){lsi.clear("f_subject");lsi.clear("f_contacts");lsi.clear("f_mini-fiches");lsi.clear("f_fiches");lsi.clear("f_matrice");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(b){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");b={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 a=$('[data-sublink="facebook"] #f_download-target');
|
||||
a.download="local-facebook-data.json";a.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(b));a.click()},!1);$('[data-sublink="facebook"] #f_import-all').addEventListener("click",function(b){$('[data-sublink="facebook"] #f_local-upload').click()},!1);$('[data-sublink="facebook"] #f_local-upload').addEventListener("click",function(b){b.target.value=null},!1);$('[data-sublink="facebook"] #f_local-upload').addEventListener("change",function(b){b={path:"upload/local_data",file:$('[data-sublink="facebook"] #f_local-upload').files[0]};
|
||||
api.send(b,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);fSubjectManager.storageToFields();fContactManager.storageToFields();fMatriceManager.storageToFields();fDynamicUpdate(!0)})},!1);$('[data-sublink="facebook"] #f_submit-all').addEventListener("click",
|
||||
function(b){console.log("> GATHERING ALL DATA");fSubjectManager.fieldsToStorage();fContactManager.fieldsToStorage();fMiniManager.fieldsToStorage();fFicheManager.fieldsToStorage();if(!fSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;b=lsi["export"]("f_mini-fiches");var a=0,c;for(c in b)if(!isNaN(c)&&(a++,!b[c].valid))return Notification.warning("Attention","La <i>fiche rapide</i> <b>"+a+"</b> est incompl\u00e8te et/ou incorrecte"),
|
||||
!1;b=lsi["export"]("f_fiches");for(c in b)if(!b[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;console.log(a)},!1)},!1)})})})})});
|
||||
function testRoutinePhone(b){var a=lsi["export"]("p_contacts"),c=lsi["export"]("p_mini-fiches"),g=lsi["export"]("p_fiches"),e=0;if(null!=b&&b)for(var d in c)isNaN(d)||(b="",null!=a[d]&&(b=a[d].username),c=$('#p_nav-mini [data-n="'+d+'"]'),c.click(),$("#unknown_min_p_"+d).checked=0==b.length,0==b.length?($("#sexeI_mini_p_"+d).checked=!0,$('input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="age"]').value=e%19,$('input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="studies"]').value=0,
|
||||
$("#reltype9_mini_p_"+d).checked=!0):(b=["H","F"][Math.floor(e%2)],$("#sexe"+b+"_mini_p_"+d).checked=!0,$('input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="age"]').value=e%19,$('input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="studies"]').value=1+e%6,b=e%10,9==b?($("#reltype10_mini_p_"+d).checked=!0,$('input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+b+"_mini_p_"+d).checked=!0,e++));for(var f in g)isNaN(f)||(c=$('#p_nav-fiche [data-n="'+
|
||||
f+'"]'),c.click(),b=["H","F","I"][Math.floor(e%3)],$("#sexe"+b+"_p_"+f).checked=!0,$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="age"]').value=e%19,a="10 21 22 23 31 32 36 41 46 47 48 51 54 55 56 61 66 69 71 72 73 74 75 76 81 82".split(" "),a=a[e%a.length],$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="job"]').value=a,a=(e%12).toString(),1==a.length&&(a="0"+a),$('article.fiche-relation > input[data-name="uid"][value="'+
|
||||
f+'"] ~ h5 select[data-name="studies"]').value=a,b=e%9,8==b?($("#reltype10_p_"+f).checked=!0,$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+b+"_p_"+f).checked=!0,$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="city"]').value=(10+e).toString(),$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="cp"]').value=(1E4+e).toString(),$('article.fiche-relation > input[data-name="uid"][value="'+
|
||||
f+'"] ~ h5 input[data-name="quartier"]').value=e,$("#loc"+["A","B","C","D"][Math.floor(e%4)]+"_p_"+f).checked=!0,a=$$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="duration"]'),a[0].value=e.toString(),a[1].value=1+e.toString(),a=e%14,$("article.fiche-relation #contexte"+a+"_p_"+f).checked=!0,g=$$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="contextSpecial"]'),11==a&&(g[0].value="internet"),12==a&&(g[1].value="association"),
|
||||
13==a&&(g[2].value="autre"),e++)};
|
||||
|
|
213
view/js/input.js
213
view/js/input.js
|
@ -933,3 +933,216 @@ include('/js/includes/input-facebook-matrice-min.js', function(){
|
|||
|
||||
|
||||
}); }); }); }); });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*=========================================================*/
|
||||
/*============= Routine de test CELLULAIRE ================*/
|
||||
/*=========================================================*/
|
||||
function testRoutinePhone(doMini){
|
||||
|
||||
/* [0] Récupération des données
|
||||
=========================================================*/
|
||||
var contacts = lsi.export('p_contacts');
|
||||
var mini = lsi.export('p_mini-fiches');
|
||||
var fiches = lsi.export('p_fiches');
|
||||
|
||||
var count = 0;
|
||||
|
||||
/* [1] Remplissage des mini-fiches
|
||||
=========================================================*/
|
||||
if( doMini != null && doMini ){
|
||||
for( var m in mini ){
|
||||
|
||||
/* (0) Si la fiche n'est pas affichée, on passe à la suivante */
|
||||
if( isNaN(m) )
|
||||
continue;
|
||||
|
||||
/* (1) On récupére le nom du contact associé */
|
||||
var name = '';
|
||||
if( contacts[m] != null )
|
||||
name = contacts[m].username;
|
||||
|
||||
/* (2) On remplit la mini fiche */
|
||||
// {1} On se positionne sur la fiche en question //
|
||||
var navBut = $('#p_nav-mini [data-n="'+m+'"]');
|
||||
navBut.click();
|
||||
|
||||
// {2} Si la personne n'a pas de nom, on met que ce contact est inconnu, puis les valeurs par défaut //
|
||||
$('#unknown_min_p_'+m).checked = name.length == 0;
|
||||
|
||||
|
||||
/* (3) Si personne inconnue -> valeurs indéterminées */
|
||||
if( name.length == 0 ){
|
||||
|
||||
// {1} Sexe indéterminé //
|
||||
$('#sexeI_mini_p_'+m).checked = true;
|
||||
|
||||
// {2} Age indéterminé //
|
||||
$('input[data-name="uid"][value="'+m+'"] ~ h5 select[data-name="age"]').value = count % 19;
|
||||
|
||||
// {3} Etudes indéterminées //
|
||||
$('input[data-name="uid"][value="'+m+'"] ~ h5 select[data-name="studies"]').value = 0;
|
||||
|
||||
// {4} Type de relation inconnue //
|
||||
$('#reltype9_mini_p_'+m).checked = true;
|
||||
|
||||
|
||||
|
||||
|
||||
continue;
|
||||
/* (4) Si la personne est connue on incrémente les valeurs */
|
||||
}else{
|
||||
|
||||
// {1} On remplit le sexe //
|
||||
var sexeVal = ['H', 'F'][ Math.floor(count % 2) ];
|
||||
$('#sexe'+sexeVal+'_mini_p_'+m).checked = true;
|
||||
|
||||
// {2} On remplit l'age //
|
||||
$('input[data-name="uid"][value="'+m+'"] ~ h5 select[data-name="age"]').value = count % 19;
|
||||
|
||||
// {3} On remplit les études //
|
||||
$('input[data-name="uid"][value="'+m+'"] ~ h5 select[data-name="studies"]').value = 1 + (count % 6);
|
||||
|
||||
// {4} Type de relation //
|
||||
var relVal = count % 10;
|
||||
// Si AUTRE
|
||||
if( relVal == 9 ){
|
||||
$('#reltype10_mini_p_'+m).checked = true;
|
||||
$('input[data-name="uid"][value="'+m+'"] ~ h5 input[data-name="reltypeSpecial"]').value = 'autre';
|
||||
// Sinon
|
||||
}else
|
||||
$('#reltype'+relVal+'_mini_p_'+m).checked = true;
|
||||
|
||||
}
|
||||
|
||||
count++;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* [2] Remplissage des fiches complètes
|
||||
=========================================================*/
|
||||
for( var f in fiches ){
|
||||
|
||||
/* (0) Si la fiche n'est pas affichée, on passe à la suivante */
|
||||
if( isNaN(f) )
|
||||
continue;
|
||||
|
||||
/* (1) On récupére le nom du contact associé */
|
||||
var name = '';
|
||||
if( contacts[fiches[f].contact] != null )
|
||||
name = contacts[fiches[f].contact].username;
|
||||
|
||||
/* (2) On remplit la fiche */
|
||||
// {1} On se positionne sur la fiche en question //
|
||||
var navBut = $('#p_nav-fiche [data-n="'+f+'"]');
|
||||
navBut.click();
|
||||
|
||||
|
||||
|
||||
// {1} On remplit le sexe //
|
||||
var sexeVal = ['H', 'F', 'I'][ Math.floor(count % 3) ];
|
||||
$('#sexe'+sexeVal+'_p_'+f).checked = true;
|
||||
|
||||
// {2} On remplit l'age //
|
||||
$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="age"]').value = count % 19;
|
||||
|
||||
// {3} On remplit la profession //
|
||||
var jobVal = ['10', '21', '22', '23', '31', '32', '36', '41', '46', '47', '48', '51', '54', '55', '56', '61', '66', '69', '71', '72', '73', '74', '75', '76', '81', '82'];
|
||||
jobVal = jobVal[ count % jobVal.length ];
|
||||
$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="job"]').value = jobVal;
|
||||
|
||||
// {4} On remplit les études //
|
||||
var stuVal = (count % 12).toString();
|
||||
if( stuVal.length == 1 ) stuVal = '0'+stuVal;
|
||||
$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="studies"]').value = stuVal;
|
||||
|
||||
// {5} Type de relation //
|
||||
var relVal = count % 9;
|
||||
|
||||
// Si AUTRE
|
||||
if( relVal == 8 ){
|
||||
$('#reltype10_p_'+f).checked = true;
|
||||
$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="reltypeSpecial"]').value = 'autre';
|
||||
// Sinon
|
||||
}else
|
||||
$('#reltype'+relVal+'_p_'+f).checked = true;
|
||||
|
||||
// {6} La ville, le CP et le quartier //
|
||||
$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="city"]').value = (10 + count).toString();
|
||||
$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="cp"]').value = (10000 + count).toString();
|
||||
$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="quartier"]').value = count;
|
||||
|
||||
// {7} Temps entre les domiciles //
|
||||
var locVal = ['A', 'B', 'C', 'D'][ Math.floor(count % 4) ];
|
||||
$('#loc'+locVal+'_p_'+f).checked = true;
|
||||
|
||||
// {8} Temps de connaissance //
|
||||
var duration = $$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="duration"]');
|
||||
duration[0].value = count.toString();
|
||||
duration[1].value = 1+count.toString();
|
||||
|
||||
// {9} Contexte de rencontre //
|
||||
var ctxVal = count % 14;
|
||||
$('article.fiche-relation #contexte'+ctxVal+'_p_'+f).checked = true;
|
||||
|
||||
var ctxSpe = $$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="contextSpecial"]');
|
||||
|
||||
// Si special1
|
||||
if( ctxVal == 11 )
|
||||
ctxSpe[0].value = 'internet';
|
||||
|
||||
// Si special2
|
||||
if( ctxVal == 12 )
|
||||
ctxSpe[1].value = 'association';
|
||||
|
||||
// Si special3
|
||||
if( ctxVal == 13 )
|
||||
ctxSpe[2].value = 'autre';
|
||||
|
||||
|
||||
|
||||
count++;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue