diff --git a/lang/en.json b/lang/en.json index c78ababeb134bef8242213fc580b271af510f531..c0a5b4f5a93753052a11ee6b5c07fc0d734551e9 100755 --- a/lang/en.json +++ b/lang/en.json @@ -626,6 +626,9 @@ "watermarkContentDesc": "Columns from <b> main_documents </b> can be used. ex: [id] as well as the <b> time variables </b>. ex: [date_now] or [hour_now]", "notificationTemplateTable": "<table style=\"border: 1pt solid #000000; width: 582px; height: 77px;\" border=\"1\" frame=\"box\" cellspacing=\"1\" cellpadding=\"5\">\n<tbody>\n<tr>\n<td><span style=\"font-family: arial,helvetica,sans-serif; font-size: small;\"><strong>Objet</strong></span></td>\n<td><span style=\"font-family: arial,helvetica,sans-serif; font-size: small;\"><strong>Liens</strong></span></td>\n</tr>\n{{rows}}\n</tbody>\n</table>", "notificationTemplateRow": "<tr>\n<td><span style=\"font-family: arial,helvetica,sans-serif; font-size: small;\">{{object}}</span></td>\n<td><span style=\"font-family: arial,helvetica,sans-serif;\"><a href=\"{{link}}\">Voir</a></span></td>\n</tr>", - "azure_samlConnection": "Azure SAML" + "azure_samlConnection": "Azure SAML", + "transmit": "Transmit", + "validateSign": "Validate and sign", + "validateDocumentWarningNote": "You are about to submit this document!" } } \ No newline at end of file diff --git a/lang/fr.json b/lang/fr.json index 671b52422621bd3ced7a6f5f6af95246252b464f..aff6d1cf304c45ad7ad233520b0e907a454919c8 100755 --- a/lang/fr.json +++ b/lang/fr.json @@ -122,7 +122,7 @@ "signature" : "Signature", "signatureDeleted" : "Signature supprimée", "signatureRegistered" : "Signature enregistrée", - "signatures" : "Signatures", + "signatures" : "Mes griffes", "specialCharRequired" : "Caractère spécial requis", "standardModeInfo" : "Mode standard, permettant l'annotation avec tout format (souris, main, stylets de toutes marques).", "stylusWidh" : "Épaisseur du trait", @@ -406,7 +406,7 @@ "reorder" : "Réorganiser", "goToPage": "Aller à la page", "loadingDocument": "Chargement du document", - "affixSignature": "Apposer une signature", + "affixSignature": "Apposer une griffe", "changePassword": "Changer de mot de passe", "circuitModels": "Modèles de circuit", "addNewDate": "Ajouter une nouvelle date", @@ -625,6 +625,9 @@ "signatureScaling": "Taux de mise à l'échelle du bloc de signature", "originaleize": "Taille originale", "scalingDocWith": "{{value}} % de la largeur du document", - "azure_samlConnection": "Azure SAML" + "azure_samlConnection": "Azure SAML", + "transmit": "Transmettre", + "validateSign": "Valider et signer", + "validateDocumentWarningNote": "Vous êtes sur le point de transmettre ce document !" } } diff --git a/src/frontend/app/document/document.component.html b/src/frontend/app/document/document.component.html index 3c866fa1be3217af2eb20c40cc1018fbeed9edad..b047e1a744155c0bc829782e06da79c65bf90197 100755 --- a/src/frontend/app/document/document.component.html +++ b/src/frontend/app/document/document.component.html @@ -134,9 +134,9 @@ </ion-content> <ion-footer *ngIf="!loadingImage && currentDoc === 0" class="ion-no-border footer-buttons"> - <ion-button [disabled]="mainDocument.status === 'CONVERTING'" *ngFor="let action of actionsList" [color]="action.color" shape="round" size="large" fill="outline" (click)="launchEvent(action)"> + <ion-button [disabled]="mainDocument.status === 'CONVERTING'" style="width: fit-content;" *ngFor="let action of actionsList" [color]="action.color" shape="round" size="large" fill="outline" (click)="launchEvent(action)"> <ion-icon *ngIf="action.logo !== ''" [slot]="'start'" [name]="action.logo"></ion-icon> - <ion-label style="font-size: 13px;">{{action.label | translate}}</ion-label> + <ion-label style="font-size: 13px;">{{getLabel(action)}}</ion-label> </ion-button> </ion-footer> diff --git a/src/frontend/app/document/document.component.ts b/src/frontend/app/document/document.component.ts index 5241dbf1f61c67b34af49fb0376423115c8b8dcd..2349b319a5148f007c37e288cf80941ec5eb2d20 100755 --- a/src/frontend/app/document/document.component.ts +++ b/src/frontend/app/document/document.component.ts @@ -103,6 +103,7 @@ export class DocumentComponent implements OnInit { loadingImage: boolean = true; fileContent: string = ''; + userMode: string = ''; constructor(private translate: TranslateService, private router: Router, @@ -132,6 +133,7 @@ export class DocumentComponent implements OnInit { } imageLoaded(ev: any) { + this.userMode = this.mainDocument.workflow.find((item: any) => item.current)?.mode; this.getImageDimensions(true); this.load.dismiss(); this.menu.enable(true, 'right-menu'); @@ -589,7 +591,8 @@ export class DocumentComponent implements OnInit { } async refuseDocument(): Promise<void> { - let msg = this.translate.instant('lang.rejectDocumentWarning'); + let msg: string = this.translate.instant('lang.rejectDocumentWarning'); + const mode: string = this.mainDocument.workflow.find((item: any) => item.current).mode; if (this.signaturesService.notesContent.length === 0) { msg = this.translate.instant('lang.refuseDocumentWithoutNote'); @@ -631,8 +634,8 @@ export class DocumentComponent implements OnInit { } async validateDocument(mode: any): Promise<void> { - let msg = this.translate.instant('lang.validateDocumentWarning'); - + let msg = this.userMode !== 'note' ? this.translate.instant('lang.validateDocumentWarning') : this.translate.instant('lang.validateDocumentWarningNote'); + const event: any = this.actionsList.find((item: any) => item.event === 'validateDocument'); if (this.signaturesService.signaturesContent.length === 0 && this.signaturesService.notesContent.length === 0) { msg = this.translate.instant('lang.validateDocumentWithoutSignOrNote'); } @@ -641,7 +644,7 @@ export class DocumentComponent implements OnInit { } const alert = await this.alertController.create({ cssClass: 'custom-alert-success', - header: this.translate.instant('lang.validate'), + header: this.getLabel(event), message: msg, inputs: [ { @@ -653,7 +656,7 @@ export class DocumentComponent implements OnInit { ], buttons: [ { - text: this.translate.instant('lang.validate'), + text: this.getLabel(event), handler: async (data: any) => { const currentUserWorkflow = this.mainDocument.workflow.filter((line: { current: boolean }) => line.current === true)[0]; const idsToProcess = await this.actionsService.checkGroupMail(this.mainDocument, 'validate'); @@ -820,6 +823,22 @@ export class DocumentComponent implements OnInit { } canShowActions() { - return this.currentDoc == 0 && !this.detailMode && !this.signaturesService.stampLock; + return this.currentDoc === 0 && !this.detailMode && !this.signaturesService.stampLock; + } + + getLabel(action: any) { + if (action.event !== 'validateDocument') { + return this.translate.instant(action.label); + } else { + const mode: string = this.mainDocument.workflow.find((item: any) => item.current).mode; + switch (mode) { + case 'sign': + return this.translate.instant('lang.validateSign'); + case 'visa': + return this.translate.instant('lang.validate'); + case 'note': + return this.translate.instant('lang.transmit'); + } + } } }