`input-phone-fiche.js` gestion de `freq`

This commit is contained in:
xdrm-brackets 2016-11-27 16:01:22 +01:00
parent fe9ade8717
commit cda98e2fd8
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ inputPhoneFiche.prototype = {
duration: ['', ''],
context: '0', // Choix 1 à 14
contextSpecial: ['', '', ''],
freq: ['4', '9', '14', '19', '24'], // 1er choix des 4 pour chaque question
freq: ['3', '8', '13', '18', '23'], // 1er choix des 4 pour chaque question
connect: ['1', '3', '5', '7', '9', '11'], // Le deuxième choix (Oui/Non) donc 'Non' par défaut pour chaque question
connectSpecial: ['', ''],
timestamp: 0,

View File

@ -1,4 +1,4 @@
function inputPhoneFiche(a,b){this.container=a;this.nav_container=b;this.top_size=10}inputPhoneFiche.prototype={container:this.container,nav_container:this.nav_container,selected:0,handler:null,defaultData:{sexe:"2",age:".",job:".",famsit:"0",studies:"0",reltype:"0",reltypeSpecial:"",city:"",quartier:"",cp:"",loc:"0",duration:["",""],context:"0",contextSpecial:["","",""],freq:["4","9","14","19","24"],connect:"1 3 5 7 9 11".split(" "),connectSpecial:["",""],timestamp:0,valid:!1}};
function inputPhoneFiche(a,b){this.container=a;this.nav_container=b;this.top_size=10}inputPhoneFiche.prototype={container:this.container,nav_container:this.nav_container,selected:0,handler:null,defaultData:{sexe:"2",age:".",job:".",famsit:"0",studies:"0",reltype:"0",reltypeSpecial:"",city:"",quartier:"",cp:"",loc:"0",duration:["",""],context:"0",contextSpecial:["","",""],freq:["3","8","13","18","23"],connect:"1 3 5 7 9 11".split(" "),connectSpecial:["",""],timestamp:0,valid:!1}};
inputPhoneFiche.prototype.fieldsToStorage=function(){console.group("[phone.fiche] fields to storage");var a,b,c,e,d,h=$$('[data-sublink="phone"] article.relation-panel .fiche-relation');a=0;for(b=h.length;a<b;a++)if(c=new FormDeflater(h[a],["input","select"],["data-name"]),e=c.deflate(),c=lsi.get("p_fiches",e.uid))e={sexe:e.sexe,age:e.age,job:e.job,famsit:e.famsit,studies:e.studies,reltype:e.reltype,reltypeSpecial:e.reltypeSpecial,city:e.city,quartier:e.quartier,cp:e.cp,loc:e.loc,duration:e.duration,
context:e.context,contextSpecial:e.contextSpecial,freq:e.freq,connect:e.connect,connectSpecial:e.connectSpecial,uid:parseInt(e.uid),contact:parseInt(e.contact)},d=crc32(JSON.stringify(e)),c.hasOwnProperty("hash")&&d==c.hash||(e.hash=d,e.valid=this.check(e),e.timestamp=Date.now(),console.warn("> FICHE UPDATE ("+(e.timestamp-input_ts)+")"),lsi.set("p_fiches",e.uid,e));console.groupEnd()};
inputPhoneFiche.prototype.add=function(a){if(null==a.uid||isNaN(a.uid)||null==a.contact||isNaN(a.contact))return!1;a.city=null!=a.city?a.city:this.defaultData.city;a.quartier=null!=a.quartier?a.quartier:this.defaultData.quartier;a.cp=null!=a.cp?a.cp:this.defaultData.cp;a.duration[0]=null!=a.duration[0]?a.duration[0]:this.defaultData.duration[0];a.duration[1]=null!=a.duration[1]?a.duration[1]:this.defaultData.duration[1];a.reltypeSpecial=null!=a.reltypeSpecial?a.reltypeSpecial:this.defaultData.reltypeSpecial;