diff --git a/core/xml/actions_pages.xml b/core/xml/actions_pages.xml index cfdfab978680278d924396410fddde79a4016164..9e26703122ab96e6548880809c1d32d326e347d6 100755 --- a/core/xml/actions_pages.xml +++ b/core/xml/actions_pages.xml @@ -466,4 +466,14 @@ An action page is described in a ACTIONPAGE tag : <MODULE>registeredMail</MODULE> <FLAG_CREATE>false</FLAG_CREATE> </ACTIONPAGE> + <ACTIONPAGE> + <ID>sendToRecordManagement</ID> + <LABEL>_SEND_TO_RECORD_MANAGEMENT</LABEL> + <NAME>sendToRecordManagement</NAME> + <DESC>_SEND_TO_RECORD_MANAGEMENT_DESC</DESC> + <component>sendToRecordManagementAction</component> + <ORIGIN>apps</ORIGIN> + <MODULE>recordManagement</MODULE> + <FLAG_CREATE>false</FLAG_CREATE> + </ACTIONPAGE> </ROOT> diff --git a/src/core/lang/lang-fr.php b/src/core/lang/lang-fr.php index 954853b176fea035aab96d9beaa4bd733c0e5b6c..a2f114cc290259c030200ac2d4fc0216234e54b1 100755 --- a/src/core/lang/lang-fr.php +++ b/src/core/lang/lang-fr.php @@ -484,3 +484,5 @@ define('_REGISTERED_MAIL_DISTRIBUTED', 'Accusé de réception reçu : recommand define('_REGISTERED_MAIL_NOT_DISTRIBUTED', 'Accusé de réception reçu : recommandé non distribué'); define('_CONFIGURATION_UPDATED', 'Configuration modifiée'); +define('_SEND_TO_RECORD_MANAGEMENT', 'Envoyer dans un Système d\'Archivage Électronique'); +define('_SEND_TO_RECORD_MANAGEMENT_DESC', 'Envoyer dans un Système d\'Archivage Électronique'); diff --git a/src/frontend/app/actions/actions.service.ts b/src/frontend/app/actions/actions.service.ts index 21fcd7b6d61980a2d0d51a4edb0c1fb15b9b47b5..fc8afe9e30eaccbdabd5ef869d0ba8175ff9c199 100644 --- a/src/frontend/app/actions/actions.service.ts +++ b/src/frontend/app/actions/actions.service.ts @@ -40,7 +40,8 @@ import { SaveRegisteredMailActionComponent } from './save-registered-mail-action import { SaveAndPrintRegisteredMailActionComponent } from './save-and-print-registered-mail-action/save-and-print-registered-mail-action.component'; import { SaveAndIndexRegisteredMailActionComponent } from './save-and-index-registered-mail-action/save-and-index-registered-mail-action.component'; import { PrintRegisteredMailActionComponent } from './print-registered-mail-action/print-registered-mail-action.component'; -import {PrintDepositListActionComponent} from './print-deposit-list-action/print-deposit-list-action.component'; +import { PrintDepositListActionComponent } from './print-deposit-list-action/print-deposit-list-action.component'; +import { SendToRecordManagementComponent } from './send-to-record-management/send-to-record-management.component'; @Injectable() export class ActionsService implements OnDestroy { @@ -1096,4 +1097,27 @@ export class ActionsService implements OnDestroy { }) ).subscribe(); } + + sendToRecordManagementAction(options: any = null) { + const dialogRef = this.dialog.open(SendToRecordManagementComponent, { + panelClass: 'maarch-modal', + autoFocus: false, + disableClose: true, + data: this.setDatasActionToSend() + }); + dialogRef.afterClosed().pipe( + tap((data: any) => { + this.unlockResourceAfterActionModal(data); + }), + filter((data: string) => data === 'success'), + tap((result: any) => { + this.endAction(result); + }), + finalize(() => this.loading = false), + catchError((err: any) => { + this.notify.handleErrors(err); + return of(false); + }) + ).subscribe(); + } } diff --git a/src/frontend/app/actions/send-to-record-management/send-to-record-management.component.html b/src/frontend/app/actions/send-to-record-management/send-to-record-management.component.html new file mode 100644 index 0000000000000000000000000000000000000000..c62e511c9e3541239d83f4f3964fc5afd6cf55cd --- /dev/null +++ b/src/frontend/app/actions/send-to-record-management/send-to-record-management.component.html @@ -0,0 +1,92 @@ +<div class="mat-dialog-content-container"> + <h1 mat-dialog-title>{{data.action.label}}</h1> + <div mat-dialog-content> + <div *ngIf="loading" class="loading" style="display:flex;height:100%;"> + <mat-spinner style="margin:auto;"></mat-spinner> + </div> + <form [formGroup]="actionFormGroup" style="display: contents;"> + <mat-form-field appearance="outline"> + <mat-label>{{'lang.slipLabel' | translate}}</mat-label> + <input type="text" matInput formControlName="packageName"> + </mat-form-field> + <mat-form-field appearance="outline"> + <mat-label>{{'lang.slipId' | translate}}</mat-label> + <input type="text" matInput formControlName="slipId"> + </mat-form-field> + <mat-divider></mat-divider> + <div class="form-group" style="display:flex;flex-direction: row; flex-wrap: wrap;"> + <div class="formType ratio-2 col-sm-12"> + <div class="formType-title"> + {{'lang.transferEntity' | translate}} + </div> + <mat-form-field> + <mat-label>{{'lang.label' | translate}}</mat-label> + <input type="text" matInput formControlName="entityLabelTransferEntity"> + </mat-form-field> + <mat-form-field> + <mat-label>{{'lang.sirenNumber' | translate}}</mat-label> + <input type="text" matInput formControlName="entitySirenTransferEntity"> + </mat-form-field> + <mat-form-field> + <mat-label>{{'lang.sirenNumberArchiveEntity' | translate}}</mat-label> + <input type="text" matInput formControlName="sirenArchiveEntity"> + </mat-form-field> + </div> + <div class="formType ratio-2 col-sm-12"> + <div class="formType-title"> + {{'lang.doctype' | translate}} + </div> + <mat-form-field> + <mat-label>{{'lang.label' | translate}}</mat-label> + <input type="text" matInput formControlName="doctype"> + </mat-form-field> + <mat-form-field> + <mat-label>{{'lang.retentionRule' | translate}}</mat-label> + <input type="text" matInput formControlName="entityRetentionRule"> + </mat-form-field> + <mat-form-field> + <mat-label>{{'lang.durationCurrentUse' | translate}}</mat-label> + <input type="text" matInput formControlName="doctypeDurationCurrentUse"> + </mat-form-field> + <mat-form-field> + <mat-label>{{'lang.finalAction' | translate}}</mat-label> + <input type="text" matInput formControlName="doctypeActionCurrentUse"> + </mat-form-field> + <mat-form-field> + <mat-label>{{'lang.retentionFinalDisposition' | translate}}</mat-label> + <input type="text" matInput formControlName="doctypeRetentionFinalDisposition"> + </mat-form-field> + </div> + </div> + </form> + <mat-tab-group> + <mat-tab *ngFor="let archive of archives; let i=index" label="Archive {{i + 1}}"> + <mat-form-field> + <mat-label>{{'lang.id' | translate}}</mat-label> + <input type="text" matInput [(ngModel)]="archive.id" disabled> + </mat-form-field> + <mat-form-field> + <mat-label>{{'lang.label' | translate}}</mat-label> + <input type="text" matInput [(ngModel)]="archive.label" disabled> + </mat-form-field> + <mat-form-field> + <mat-label>{{'lang.type' | translate}}</mat-label> + <input type="text" matInput [(ngModel)]="archive.type" disabled> + </mat-form-field> + <mat-form-field> + <mat-label>{{'lang.descService' | translate}}</mat-label> + <input type="text" matInput [(ngModel)]="archive.descService" disabled> + </mat-form-field> + </mat-tab> + </mat-tab-group> + </div> + <span class="divider-modal"></span> + <div mat-dialog-actions class="actions"> + <button mat-raised-button mat-button color="primary" [disabled]="loading || !isValidAction()" + (click)="onSubmit()">{{'lang.validate' | translate}}</button> + <button mat-raised-button mat-button color="primary" [disabled]="loading || !isValidAction()" + (click)="onSubmit()">{{'lang.download' | translate}}</button> + <button mat-raised-button mat-button [disabled]="loading" + [mat-dialog-close]="">{{'lang.cancel' | translate}}</button> + </div> +</div> \ No newline at end of file diff --git a/src/frontend/app/actions/send-to-record-management/send-to-record-management.component.scss b/src/frontend/app/actions/send-to-record-management/send-to-record-management.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..f3a780b9c92f5530027907b1abb3c7bf200e66af --- /dev/null +++ b/src/frontend/app/actions/send-to-record-management/send-to-record-management.component.scss @@ -0,0 +1,83 @@ +@import '../../../css/vars.scss'; + +.loading { + display: flex; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #ffffffb3; + z-index: 2; + overflow: hidden; +} + +.formType { + align-items: center; + display: flex; + margin: 10px; + border-radius: 4px; + border: solid 1px #ccc; + position: relative; + padding: 10px; + flex-direction: column; + + &-title { + white-space: pre; + overflow: hidden; + max-width: 85%; + text-overflow: ellipsis; + z-index: 1; + font-size: 10px; + font-weight: bold; + background: white; + position: absolute; + top: -7px; + left: 10px; + padding: 0px; + margin: 0px; + color: #135f7f; + } + + + ::ng-deep.mat-slide-toggle-label { + color: #666; + font-weight: bold; + } + + ::ng-deep.mat-radio-button,::ng-deep.mat-slide-toggle { + opacity: 0.5; + color: #666; + user-select: none; + } + + ::ng-deep.mat-radio-checked,::ng-deep.mat-checked { + opacity: 1; + color: $primary; + } + + + ::ng-deep.mat-checked { + .mat-slide-toggle-label { + color: $primary; + } + } + + ::ng-deep.mat-form-field-suffix { + color: $secondary; + font-size: 15px; + top: 0; + } +} + +.ratio-1 { + flex: 1; +} + +.ratio-2 { + flex: 1; +} + +.mat-input-element:disabled { + color: $primary !important; +} \ No newline at end of file diff --git a/src/frontend/app/actions/send-to-record-management/send-to-record-management.component.ts b/src/frontend/app/actions/send-to-record-management/send-to-record-management.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..56476fa9c518f76e3e3042e7520639646b89fd3d --- /dev/null +++ b/src/frontend/app/actions/send-to-record-management/send-to-record-management.component.ts @@ -0,0 +1,128 @@ +import { HttpClient } from '@angular/common/http'; +import { Component, Inject, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { TranslateService } from '@ngx-translate/core'; +import { FunctionsService } from '@service/functions.service'; +import { NotificationService } from '@service/notification/notification.service'; +import { of } from 'rxjs'; +import { catchError, finalize, tap } from 'rxjs/operators'; + +@Component({ + selector: 'app-send-to-record-management', + templateUrl: 'send-to-record-management.component.html', + styleUrls: ['send-to-record-management.component.scss'] +}) +export class SendToRecordManagementComponent implements OnInit { + + loading: boolean = false; + archiveSenders: [ + { + id: 1, + label: 'test' + } + ]; + archivalAgreement: [ + { + id: 1, + label: 'test' + } + ]; + + actionFormGroup: FormGroup; + + archives: any[] = [ + { + id : 'letterbox_100', + label : 'Procédure INSTALLATION du patch MAARCH 1_7_ARCHIVAGE', + type : 'Document principal', + descService : '???' + }, + { + id : 'attachment_1_1', + label : 'Réponse de Jean', + type : 'Projet de réponse', + descService : '???' + } + ]; + + + constructor( + public translate: TranslateService, + public http: HttpClient, + private notify: NotificationService, + public dialogRef: MatDialogRef<SendToRecordManagementComponent>, + private _formBuilder: FormBuilder, + @Inject(MAT_DIALOG_DATA) public data: any, + public functions: FunctionsService + ) { + this.actionFormGroup = this._formBuilder.group({ + packageName: ['test', Validators.required], + slipId: [{value: 'bblier-20201008-123809', disabled: true}, Validators.required], + slipDate: [new Date(), Validators.required], + entityLabelTransferEntity: [{value: 'Direction Général des services', disabled: true}, Validators.required], + entitySirenTransferEntity: [{value: 'org_987654321_DGS_SA', disabled: true}, Validators.required], + sirenArchiveEntity: [{value: 'org_123456789_Archives', disabled: true}, Validators.required], + archiveId: [{value: 'letterbox_100', disabled: true}, Validators.required], + doctype: [{value: 'Convocation', disabled: true}, Validators.required], + entityRetentionRule: [{value: 'compta_3_03', disabled: true}, Validators.required], + doctypeRetentionFinalDisposition: [{value: 'Destruction', disabled: true}, Validators.required], + doctypeDurationCurrentUse: [{value: '23 jours', disabled: true}, Validators.required], + doctypeActionCurrentUse: [{value: 'Envoi SAE (puis accès restreint)', disabled: true}, Validators.required], + sendDate: ['??? (voir equipe RM)', Validators.required], + receiveDate: ['??? (voir equipe RM)', Validators.required], + }); + } + + ngOnInit(): void { + this.getData(); + } + + getData() { + + // TODO + /*this.http.post(`../rest/resourcesList/users/${this.data.userId}/groups/${this.data.groupId}/baskets/${this.data.basketId}/actions/${this.data.action.id}/checkSendToRecordManagement`, { resources: this.data.resIds }).pipe( + tap((data: any) => { + }), + finalize(() => this.loading = false), + catchError((err: any) => { + this.notify.handleErrors(err); + return of(false); + }) + ).subscribe();*/ + } + + onSubmit() { + this.loading = true; + + if (this.data.resIds.length > 0) { + this.executeAction(); + } + } + + executeAction() { + + const realResSelected: number[] = this.data.resIds; + + this.http.put(this.data.processActionRoute, { resources: realResSelected, data: {} }).pipe( + tap((data: any) => { + if (!data) { + this.dialogRef.close('success'); + } + if (data && data.errors != null) { + this.notify.error(data.errors); + } + }), + finalize(() => this.loading = false), + catchError((err: any) => { + this.notify.handleErrors(err); + return of(false); + }) + ).subscribe(); + } + + isValidAction() { + return true; + } + +} diff --git a/src/frontend/app/app.module.ts b/src/frontend/app/app.module.ts index 503ce73ddd464605a40f86d536e106594d25a6bb..fb8eb18e317b801c1917856a255379ef2260db3a 100755 --- a/src/frontend/app/app.module.ts +++ b/src/frontend/app/app.module.ts @@ -64,6 +64,7 @@ import { SaveAndIndexRegisteredMailActionComponent } from './actions/save-and-in import { SaveAndPrintRegisteredMailActionComponent } from './actions/save-and-print-registered-mail-action/save-and-print-registered-mail-action.component'; import { PrintRegisteredMailActionComponent } from './actions/print-registered-mail-action/print-registered-mail-action.component'; import { PrintDepositListActionComponent } from './actions/print-deposit-list-action/print-deposit-list-action.component'; +import { SendToRecordManagementComponent } from './actions/send-to-record-management/send-to-record-management.component'; // PROCESS @@ -232,6 +233,7 @@ export class MyHammerConfig extends HammerGestureConfig { PrintRegisteredMailActionComponent, PrintDepositListActionComponent, ReconcileActionComponent, + SendToRecordManagementComponent, ], exports : [ SharedModule diff --git a/src/lang/lang-fr.json b/src/lang/lang-fr.json index d1dc3a9701f101654b52668eeb8cdbb36a2d49c5..01e42252a76cb01fccdf3dcc5f46ab69652f0a28 100644 --- a/src/lang/lang-fr.json +++ b/src/lang/lang-fr.json @@ -2057,5 +2057,11 @@ "groupSign" : "Groupe du signataire", "noAdminSearchConfiguration": "Aucune configuration de recherche trouvée", "producerService": "Service producteur", - "recipientsDepartment": "Département des expéditeurs" + "recipientsDepartment": "Département des expéditeurs", + "recordManagement": "Archivage électronique", + "slipLabel": "Label du bordereau", + "slipId": "Identifiant du bordereau", + "transferEntity": "Entité de transfert", + "sirenNumber": "Numéro SIREN", + "sirenNumberArchiveEntity": "Numéro SIREN entité d'archive" }