Correction d'incohérence pour la couleur dans la navigation si une fiche dupliquée est correcte.
This commit is contained in:
parent
17d8885b23
commit
82356ebe06
|
@ -16,10 +16,10 @@ c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('art
|
|||
d[b].setAttribute("checked","checked"):d[b].removeAttribute("checked");for(c=0;c<a.connect.length;c++)for(d=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="connect'+c+'"]'),b=0;b<d.length&&b<a.connect[c].length;b++)a.connect[c][b].status?d[b].setAttribute("checked","checked"):d[b].removeAttribute("checked")};
|
||||
inputPhoneFiche.prototype.storageToFields=function(){console.log("FICHE: STORAGE TO FIELDS");var a=lsi["export"]("fiches");this.container.innerHTML="";for(var b in a)a[b].uid==this.selected&&this.add(a[b]);this.updateNavBar()};
|
||||
inputPhoneFiche.prototype.sync=function(){console.log("FICHE: SYNC");var a=lsi["export"]("contacts"),b;for(b in a){if(-1<a[b].call){var c=a[b].call,d=lsi.get("fiches",c);null==d&&(d=this.defaultData);d.uid=c;d.contact=b;lsi.set("fiches",c,d)}-1<a[b].sms&&(c=10+a[b].sms,d=lsi.get("fiches",c),null==d&&(d=this.defaultData),d.uid=c,d.contact=b,lsi.set("fiches",c,d))}var a=lsi["export"]("mini-fiches"),d=lsi["export"]("fiches"),e;for(e in d)d[e].timestamp>a[e].timestamp?(a[e].sexe=d[e].sexe,a[e].age=d[e].age,
|
||||
a[e].job=d[e].job,a[e].loc=d[e].loc):(d[e].sexe=a[e].sexe,d[e].age=a[e].age,d[e].job=a[e].job,d[e].loc=a[e].loc),lsi.set("mini-fiches",e,a[e]),lsi.set("fiches",e,d[e]);for(e in d)a=lsi.get("contacts",d[e].contact),null!=a&&-1!=a.sms&&-1!=a.call&&(a=10>parseInt(e)?10+a.sms:a.call,b=d[a],b.timestamp>=d[e].timestamp||(c=d[e],c.uid=b.uid,lsi.set("fiches",b.uid,c),console.log(e+" have been copied to "+a)))};
|
||||
a[e].job=d[e].job,a[e].loc=d[e].loc):(d[e].sexe=a[e].sexe,d[e].age=a[e].age,d[e].job=a[e].job,d[e].loc=a[e].loc),lsi.set("mini-fiches",e,a[e]),lsi.set("fiches",e,d[e]);for(e in d)a=lsi.get("contacts",d[e].contact),null!=a&&-1!=a.sms&&-1!=a.call&&(a=10>parseInt(e)?10+a.sms:a.call,a=d[a],a.timestamp>=d[e].timestamp||(b=d[e],b.uid=a.uid,lsi.set("fiches",a.uid,b)))};
|
||||
inputPhoneFiche.prototype.nav=function(a){if(null==a||!1===a.getData("n")||isNaN(a.getData("n"))||"nav-fiche"!=a.parentNode.id)return!1;for(var b=$$("#nav-fiche > span.active"),c=0;c<b.length;c++)b[c].remClass("active");a.addClass("active");this.selected=parseInt(a.getData("n"))};
|
||||
inputPhoneFiche.prototype.updateNavBar=function(){var a=lsi["export"]("fiches"),b=Object.keys(a).length;if(this.nav_container.children.length!=b){this.nav_container.innerHTML="<span>APPELS</span>";for(var c=0;c<b;c++)9==c?this.nav_container.innerHTML+='<span data-n="'+c+'" class="lc">'+(c%10+1)+"</span> ":(10==c&&(this.nav_container.innerHTML+='<span class="fc">SMS</span>'),this.nav_container.innerHTML+='<span data-n="'+c+'">'+(c%10+1)+"</span>")}for(var d in a)b=this.nav_container.children[a[d].uid],
|
||||
!0===a[d].valid?b.addClass("done"):b.remClass("done");this.nav($('#nav-fiche [data-n="'+this.selected+'"]'))};
|
||||
inputPhoneFiche.prototype.updateNavBar=function(){var a=lsi["export"]("fiches"),b=Object.keys(a).length;if(this.nav_container.children.length!=b){this.nav_container.innerHTML="<span>APPELS</span>";for(var c=0;c<b;c++)9==c?this.nav_container.innerHTML+='<span data-n="'+c+'" class="lc">'+(c%10+1)+"</span> ":(10==c&&(this.nav_container.innerHTML+='<span class="fc">SMS</span>'),this.nav_container.innerHTML+='<span data-n="'+c+'">'+(c%10+1)+"</span>")}for(var d in a)b=$('#nav-fiche [data-n="'+
|
||||
a[d].uid+'"]'),!0===a[d].valid?b.addClass("done"):b.remClass("done");this.nav($('#nav-fiche [data-n="'+this.selected+'"]'))};
|
||||
inputPhoneFiche.prototype.check=function(a){if(isNaN(parseInt(a.age))||2>a.city.length||isNaN(parseInt(a.duration[0]))&&0<a.duration[0].length||isNaN(parseInt(a.duration[1]))&&0<a.duration[1].length||0==a.duration[0].length+a.duration[1].length||"."==a.job||"."==a.studies||!checkRadioValue(a.sexe)||!checkRadioValue(a.famsit)||!checkRadioValue(a.reltype)||!checkRadioValue(a.loc)||!checkRadioValue(a.loc2)||!checkRadioValue(a.context))return!1;for(var b=0;b<a.freq.length;b++)if(!checkRadioValue(a.freq[b]))return!1;
|
||||
for(b=0;b<a.connect.length;b++)if(!checkRadioValue(a.connect[b]))return!1;return a.reltype[8].status&&2>a.reltypeSpecial.length||a.context[11].status&&2>a.contextSpecial[0].length||a.context[12].status&&2>a.contextSpecial[1].length||a.context[13].status&&2>a.contextSpecial[2].length?!1:!0};
|
||||
inputPhoneFiche.prototype.attach=function(a){console.log("FICHE: ATTACH");lsi.createDataset("fiches");this.storageToFields();this.handler=a;var b=this,b=this;this.nav_container.addEventListener("click",function(a){b.nav(a.target);b.handler(a.target)},!1)};
|
||||
|
|
|
@ -524,7 +524,7 @@ inputPhoneFiche.prototype.updateNavBar = function(){
|
|||
/* (3) On montre les FICHES qui sont correctes */
|
||||
for( var key in ficheData ){
|
||||
|
||||
var currentElement = this.nav_container.children[ ficheData[key].uid ];
|
||||
var currentElement = $('#nav-fiche [data-n="'+ficheData[key].uid+'"]');
|
||||
|
||||
// Si la MINI fiche est valide
|
||||
if( ficheData[key].valid === true ) currentElement.addClass('done');
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue