Commit f3c2f56a authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #17080 TIME 2:30 save document original name

parent d0fde705
......@@ -133,7 +133,8 @@ export class AttachmentCreateComponent implements OnInit {
type: new FormControl({ value: 'response_project', disabled: false }, [Validators.required]),
validationDate: new FormControl({ value: '', disabled: false }),
format: new FormControl({ value: '', disabled: false }, [Validators.required]),
encodedFile: new FormControl({ value: '', disabled: false }, [Validators.required])
encodedFile: new FormControl({ value: '', disabled: false }, [Validators.required]),
originalFilename: new FormControl({ value: '', disabled: true })
});
setTimeout(() => {
this.getAttachType('response_project', 0);
......@@ -254,7 +255,8 @@ export class AttachmentCreateComponent implements OnInit {
recipientType: element.recipient.value.length > 0 ? element.recipient.value[0].type : null,
validationDate: element.validationDate.value !== '' ? element.validationDate.value : null,
encodedFile: element.encodedFile.value,
format: element.format.value
format: element.format.value,
originalFilename: element.originalFilename.value.substr(0, element.originalFilename.value.lastIndexOf('.'))
});
});
......@@ -265,6 +267,7 @@ export class AttachmentCreateComponent implements OnInit {
this.appDocumentViewer.toArray()[this.indexTab].getFile().pipe(
distinctUntilChanged(),
tap((data) => {
this.attachments[this.indexTab].originalFilename.setValue(data.name);
this.attachments[this.indexTab].encodedFile.setValue(data.content);
this.attachments[this.indexTab].format.setValue(data.format);
}),
......@@ -396,6 +399,7 @@ export class AttachmentCreateComponent implements OnInit {
if (ev === 'uploadFile') {
const filename = this.appDocumentViewer.toArray()[i].file.name;
this.attachments[i].originalFilename.setValue(filename);
this.attachments[i].title.setValue(filename.substr(0, filename.lastIndexOf('.')));
}
}
......@@ -407,7 +411,8 @@ export class AttachmentCreateComponent implements OnInit {
type: new FormControl({ value: 'response_project', disabled: false }, [Validators.required]),
validationDate: new FormControl({ value: null, disabled: false }),
encodedFile: new FormControl({ value: '', disabled: false }, [Validators.required]),
format: new FormControl({ value: '', disabled: false }, [Validators.required])
format: new FormControl({ value: '', disabled: false }, [Validators.required]),
originalFilename: new FormControl({ value: '', disabled: true })
});
this.attachFormGroup.push(new FormGroup(this.attachments[this.attachments.length - 1]));
this.indexTab = this.attachments.length - 1;
......
......@@ -140,6 +140,15 @@
<i class="fas fa-asterisk noMandatory"></i>
</div>
</div>
<div class="attachment-form-item" *ngIf="!functions.empty(attachment['originalFilename'].value)">
<mat-form-field class="input-form">
<input matInput placeholder="{{'lang.originalFilename' | translate}}"
[formControl]="attachment['originalFilename']">
</mat-form-field>
<div class="fieldState">
<i class="fas fa-asterisk noMandatory"></i>
</div>
</div>
<div class="attachment-form-item">
<mat-form-field class="input-form" (click)="picker.open()" style="cursor:pointer;">
<input [formControl]="attachment['validationDate']" matInput
......
......@@ -136,7 +136,8 @@ export class AttachmentPageComponent implements OnInit {
validationDate: new FormControl({ value: data.validationDate !== null ? new Date(data.validationDate) : null, disabled: !this.editMode }),
signedResponse: new FormControl({ value: data.signedResponse, disabled: false }),
encodedFile: new FormControl({ value: '_CURRENT_FILE', disabled: !this.editMode }, [Validators.required]),
format: new FormControl({ value: data.format, disabled: true }, [Validators.required])
format: new FormControl({ value: data.format, disabled: true }, [Validators.required]),
originalFilename: new FormControl({ value: data.originalFilename, disabled: true })
};
this.versions = data.versions;
......
......@@ -167,6 +167,7 @@ export class IndexationComponent implements OnInit {
tap((data: any) => {
formatdatas['encodedFile'] = data.content;
formatdatas['format'] = data.format;
formatdatas['originalFilename'] = data.name.substr(0, data.name.lastIndexOf('.'));
this.isMailing = !this.functions.empty(formatdatas.recipients) && formatdatas.recipients.length > 0 && this.currentIndexingModel.category === 'outgoing' && formatdatas['encodedFile'] === null;
......
......@@ -44,6 +44,11 @@ export class TechnicalInformationComponent implements OnInit {
value: '',
icon: 'fas fa-quote-right'
},
originalFilename: {
label: 'originalFilename',
value: '',
icon: 'fas fa-quote-right'
},
docserverPathFile: {
label: 'docserverPathFile',
value: '',
......@@ -89,8 +94,9 @@ export class TechnicalInformationComponent implements OnInit {
this.techData.fulltext.value = data.information.fulltext_result,
this.techData.docserverPathFile.value = data.information.docserverPathFile,
this.techData.filename.value = data.information.filename,
this.techData.originalFilename.value = data.information.originalFilename,
this.techData.initiator.value = data.information.typistLabel,
this.techData.creationDate.value = this.datePipe.transform(data.information.creationDate, 'dd/MM/y HH:mm') ,
this.techData.creationDate.value = this.datePipe.transform(data.information.creationDate, 'dd/MM/y HH:mm'),
this.loading = false;
}),
exhaustMap(() => this.http.get('../rest/customFields')),
......
......@@ -2203,5 +2203,6 @@
"infoResId": "Vous pouvez remplir automatiquement ce champ en utilisant le mot-clé <b>@resId</b> pour cibler une ressource du document en cours de traitement",
"canAddCopies": "Pouvoir ajouter des personnes en copie (CC / CCI)",
"systemTechnicalFields": "Champs techniques \"Système\"",
"customTechnicalFields": "Champs techniques personnalisés"
"customTechnicalFields": "Champs techniques personnalisés",
"originalFilename": "Nom original"
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment