Skip to content
Snippets Groups Projects
Commit 57599e3b authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #15550 TIME 0:20 fix Substitute user has already substituted + translate

parent 816242fd
No related branches found
No related tags found
No related merge requests found
...@@ -445,6 +445,11 @@ ...@@ -445,6 +445,11 @@
"attachments": "Attachments", "attachments": "Attachments",
"emails": "Emails", "emails": "Emails",
"workflowTemplates": "Workflow templates", "workflowTemplates": "Workflow templates",
"configurations": "Configurations" "configurations": "Configurations",
"signaturesInDocAdded": "Signature (s) affixed to page (s) {{0}}",
"docIsInMailGroup": "This document is the result of a direct mail",
"makeActionOnDocInMailGroup": "Do you want to validate the other documents with the current stamps?",
"mailing": "Direct mail",
"delegatedUser": "Delegated user"
} }
} }
\ No newline at end of file
...@@ -445,6 +445,7 @@ ...@@ -445,6 +445,7 @@
"configurations": "Configurations", "configurations": "Configurations",
"docIsInMailGroup": "Ce document est issu d'un publipostage", "docIsInMailGroup": "Ce document est issu d'un publipostage",
"makeActionOnDocInMailGroup": "Voulez-vous valider les autres documents avec les tampons actuels ?", "makeActionOnDocInMailGroup": "Voulez-vous valider les autres documents avec les tampons actuels ?",
"mailing": "Publipostage" "mailing": "Publipostage",
"delegatedUser": "Utilisateur délégué"
} }
} }
...@@ -174,10 +174,11 @@ ...@@ -174,10 +174,11 @@
</ion-item> </ion-item>
</ion-list> </ion-list>
<ion-list *ngIf="authService.user.substitute === null"> <ion-list *ngIf="authService.user.substitute === null">
<ion-item *ngFor="let user of userList"> <ion-item *ngFor="let user of userList" [disabled]="checkSubstitutes(user.id, user.substitute)">
<ion-checkbox color="primary" slot="start" [value]="user" (ionChange)="selectSubstitute($event.detail.value)"></ion-checkbox> <ion-checkbox color="primary" slot="start" [value]="user" (ionChange)="selectSubstitute($event.detail.value)"></ion-checkbox>
<ion-label>{{ user.firstname }} {{ user.lastname }}</ion-label> <ion-label>{{ user.firstname }} {{ user.lastname }}</ion-label>
<ion-note slot="end">{{ user.email }}</ion-note> <ion-note *ngIf="!checkSubstitutes(user.id, user.substitute)" slot="end">{{ user.email }}</ion-note>
<ion-note *ngIf="checkSubstitutes(user.id, user.substitute)" slot="end" color="danger">{{ 'lang.delegatedUser' | translate }}</ion-note>
</ion-item> </ion-item>
</ion-list> </ion-list>
<ng-container *ngIf="authService.user.substitute != null && signaturesService.signaturesList.length > 0"> <ng-container *ngIf="authService.user.substitute != null && signaturesService.signaturesList.length > 0">
......
...@@ -88,7 +88,7 @@ export class ProfileComponent implements OnInit { ...@@ -88,7 +88,7 @@ export class ProfileComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.initProfileInfo(); this.initProfileInfo();
this.getPassRules(); this.getPassRules();
} }
dismissModal() { dismissModal() {
...@@ -101,7 +101,7 @@ export class ProfileComponent implements OnInit { ...@@ -101,7 +101,7 @@ export class ProfileComponent implements OnInit {
} else if (ev.detail.value.length >= 3) { } else if (ev.detail.value.length >= 3) {
this.http.get('../rest/autocomplete/users?search=' + ev.detail.value).pipe( this.http.get('../rest/autocomplete/users?search=' + ev.detail.value).pipe(
tap((res: any) => { tap((res: any) => {
this.userList = res.filter((item: any) => item.id !== this.profileInfo.id); this.userList = res.filter((item: any) => item.id !== this.profileInfo.id);
}), }),
catchError(err => { catchError(err => {
this.notificationService.handleErrors(err); this.notificationService.handleErrors(err);
...@@ -408,4 +408,8 @@ export class ProfileComponent implements OnInit { ...@@ -408,4 +408,8 @@ export class ProfileComponent implements OnInit {
this.notificationService.success('lang.modificationSaved'); this.notificationService.success('lang.modificationSaved');
}); });
} }
checkSubstitutes(id: number, substitute: boolean) {
return this.authService.user.substitutes.includes(id) || substitute === true ? true : false;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment