|
|
@@ -41,6 +41,8 @@ export class ShowLinksComponent implements OnInit
|
|
|
this.categorieService.getByIdCategorie(this.numeroCategorie).subscribe( data => { this.categorie = data; });
|
|
|
|
|
|
this.retreiveDatas();
|
|
|
+ this.resetEtatBoutonsUnlinked();
|
|
|
+ this.resetEtatBoutonsLinked();
|
|
|
}
|
|
|
|
|
|
private retreiveDatas()
|
|
|
@@ -49,6 +51,12 @@ export class ShowLinksComponent implements OnInit
|
|
|
this.presentationService.getUnlinkedProductions().subscribe(data => { this.unlinkedProductions = data; });
|
|
|
}
|
|
|
|
|
|
+ lettresOrdre: string[] = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
|
|
|
+ indexLettre: number = 0;
|
|
|
+
|
|
|
+ resetLettre() { this.indexLettre = 0; }
|
|
|
+ nextLettre(): string { if ((this.indexLettre >= 0) && (this.indexLettre < 26)) { this.indexLettre++; return "#" + this.lettresOrdre[this.indexLettre - 1]; } return ""; }
|
|
|
+
|
|
|
goToListPresentations() { this.router.navigate(['/show-list'], { queryParams: { 'refresh': this.menu.getRandomInteger(1, 100000) } }); }
|
|
|
|
|
|
changeEtatBoutonsUnlinked(event: any)
|
|
|
@@ -59,6 +67,10 @@ export class ShowLinksComponent implements OnInit
|
|
|
|
|
|
if (this.boutonLier) { if (b) { this.renderer.removeClass(this.boutonLier.nativeElement, 'disabled'); } else { this.renderer.addClass(this.boutonLier.nativeElement, 'disabled'); } }
|
|
|
}
|
|
|
+ resetEtatBoutonsUnlinked()
|
|
|
+ {
|
|
|
+ if (this.boutonLier) { this.renderer.addClass(this.boutonLier.nativeElement, 'disabled'); }
|
|
|
+ }
|
|
|
|
|
|
changeEtatBoutonsLinked(event: any)
|
|
|
{
|
|
|
@@ -70,10 +82,16 @@ export class ShowLinksComponent implements OnInit
|
|
|
if (this.boutonAvancer) { if (b) { this.renderer.removeClass(this.boutonAvancer.nativeElement, 'disabled'); } else { this.renderer.addClass(this.boutonAvancer.nativeElement, 'disabled'); } }
|
|
|
if (this.boutonReculer) { if (b) { this.renderer.removeClass(this.boutonReculer.nativeElement, 'disabled'); } else { this.renderer.addClass(this.boutonReculer.nativeElement, 'disabled'); } }
|
|
|
}
|
|
|
+ resetEtatBoutonsLinked()
|
|
|
+ {
|
|
|
+ if (this.boutonRetirer) { this.renderer.addClass(this.boutonRetirer.nativeElement, 'disabled'); }
|
|
|
+ if (this.boutonAvancer) { this.renderer.addClass(this.boutonAvancer.nativeElement, 'disabled'); }
|
|
|
+ if (this.boutonReculer) { this.renderer.addClass(this.boutonReculer.nativeElement, 'disabled'); }
|
|
|
+ }
|
|
|
|
|
|
- lierProduction() { if (this.numeroProduction > 0) { this.presentationService.lierProduction(this.numeroCategorie, this.numeroProduction).subscribe(() => { this.retreiveDatas(); }); } }
|
|
|
+ lierProduction() { if (this.numeroProduction > 0) { this.presentationService.lierProduction(this.numeroCategorie, this.numeroProduction).subscribe(() => { this.retreiveDatas(); this.resetEtatBoutonsUnlinked(); }); } }
|
|
|
|
|
|
- retirerProduction() { if (this.numeroProduction < 0) { this.presentationService.retirerProduction(this.numeroCategorie, this.numeroProduction).subscribe(() => { this.retreiveDatas(); }); } }
|
|
|
+ retirerProduction() { if (this.numeroProduction < 0) { this.presentationService.retirerProduction(this.numeroCategorie, this.numeroProduction).subscribe(() => { this.retreiveDatas(); this.resetEtatBoutonsLinked(); }); } }
|
|
|
|
|
|
avancerProduction() { if (this.numeroProduction < 0) { this.presentationService.avancerProduction(this.numeroCategorie, this.numeroProduction).subscribe(() => { this.retreiveDatas(); }); } }
|
|
|
|