diff --git a/lang/en.json b/lang/en.json index fbbb7663a1b759ed2f0d3e5d9e1af9765d3d3454..6caa89f9106d44ca577fb5597117ced67df0a76e 100755 --- a/lang/en.json +++ b/lang/en.json @@ -445,6 +445,11 @@ "attachments": "Attachments", "emails": "Emails", "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 diff --git a/lang/fr.json b/lang/fr.json index f369a1ebc6e4b55620641adc1473879fb0542348..1c2a232735a6dfec05df7eaf260f45d1270f8c19 100755 --- a/lang/fr.json +++ b/lang/fr.json @@ -445,6 +445,7 @@ "configurations": "Configurations", "docIsInMailGroup": "Ce document est issu d'un publipostage", "makeActionOnDocInMailGroup": "Voulez-vous valider les autres documents avec les tampons actuels ?", - "mailing": "Publipostage" + "mailing": "Publipostage", + "delegatedUser": "Utilisateur délégué" } } diff --git a/src/frontend/app/profile/profile.component.html b/src/frontend/app/profile/profile.component.html index d9fbb062b9c8f390b3566f16af851cdebdc435dd..3ebd5bdb7f0549e3d6a146d410f2f407e9d758d0 100644 --- a/src/frontend/app/profile/profile.component.html +++ b/src/frontend/app/profile/profile.component.html @@ -174,10 +174,11 @@ </ion-item> </ion-list> <ion-list *ngIf="authService.user.substitute === null"> - <ion-item *ngFor="let user of userList"> - <ion-checkbox color="primary" slot="start" [value]="user" (ionChange)="selectSubstitute($event.detail.value)"></ion-checkbox> + <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-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-list> <ng-container *ngIf="authService.user.substitute != null && signaturesService.signaturesList.length > 0"> diff --git a/src/frontend/app/profile/profile.component.ts b/src/frontend/app/profile/profile.component.ts index 6ad3229d83e94084ea64bb7512f779b59bcbea0d..3e04009af8f3979f6776f72979b0805c5c0ec7ee 100644 --- a/src/frontend/app/profile/profile.component.ts +++ b/src/frontend/app/profile/profile.component.ts @@ -88,7 +88,7 @@ export class ProfileComponent implements OnInit { ngOnInit(): void { this.initProfileInfo(); - this.getPassRules(); + this.getPassRules(); } dismissModal() { @@ -101,7 +101,7 @@ export class ProfileComponent implements OnInit { } else if (ev.detail.value.length >= 3) { this.http.get('../rest/autocomplete/users?search=' + ev.detail.value).pipe( 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 => { this.notificationService.handleErrors(err); @@ -408,4 +408,8 @@ export class ProfileComponent implements OnInit { this.notificationService.success('lang.modificationSaved'); }); } + + checkSubstitutes(id: number, substitute: boolean) { + return this.authService.user.substitutes.includes(id) || substitute === true ? true : false; + } }