Newer
Older
<div class="attach-container">
<div class="example-loading-shade" *ngIf="sendingData">
<mat-spinner></mat-spinner>
</div>
<h1 mat-dialog-title>
<span *ngIf="!loading" style="flex: 1;" [title]="attachment.title.value">
<ng-container *ngIf="attachment.chrono.value !== null">
{{attachment.chrono.value}} -
</ng-container>
{{attachment.title.value | shorten: 50: '...'}}
</span>
<button [title]="lang.close" mat-icon-button (click)="dialogRef.close();">
<mat-icon class="fa fa-times"></mat-icon>
</button></h1>
<mat-dialog-content class="attach-content">
<ng-container *ngIf="!loading">
<div class="attachment-form col-md-3 col-sm-12">
<div *ngIf="editMode" class="attachment-form-item">
<mat-slide-toggle [checked]="newVersion" color="primary"
(change)="newVersion = !newVersion;">{{lang.newVersion}}</mat-slide-toggle>
</div>
<div *ngIf="newVersion" class="attachment-form-item">
<div class="alert-message alert-message-danger" role="alert"
[innerHTML]="lang.mustEditDocument"></div>
<div class="attachment-form-item">
<mat-form-field class="input-form">
<input matInput placeholder="{{lang.status}}" [formControl]="attachment['status']"
[value]="lang['attachment_'+attachment['status'].value]">
</mat-form-field>
<div class="fieldState">
<i class="fas fa-asterisk noMandatory"></i>
</div>
</div>
<div class="attachment-form-item">
<plugin-select-search [label]="lang.type" [placeholderLabel]="lang.type"
[formControlSelect]="attachment['type']" [datas]="attachmentsTypes"
(afterSelected)="getAttachType($event)" style="width:100%;">
</plugin-select-search>
<i class="fas fa-asterisk fieldRequired"
*ngIf="attachment['type'].hasError('required') && attachment['type'].untouched"></i>
<i class="fas fa-exclamation-triangle fieldError"
*ngIf="attachment['type'].touched && attachment['type'].hasError('required')"></i>
<i class="fas fa-check fieldFull"
*ngIf="attachment['type'].valid && !isEmptyField(attachment['type'])"></i>
</div>
<div class="attachment-form-item">
<mat-form-field class="input-form">
<input matInput placeholder="{{lang.subject}}" [formControl]="attachment['title']">
</mat-form-field>
<i class="fas fa-asterisk fieldRequired"
*ngIf="attachment['title'].hasError('required') && attachment['title'].untouched"></i>
<i class="fas fa-exclamation-triangle fieldError"
*ngIf="attachment['title'].touched && attachment['title'].hasError('required')"></i>
<i class="fas fa-check fieldFull"
*ngIf="attachment['title'].valid && !isEmptyField(attachment['title'])"></i>
<div class="attachment-form-item" *ngIf="sendMassMode" style="display: block;">
<div class="alert alert-info" role="alert" [innerHTML]="lang.mailingMsg"></div>
</div>
<div class="attachment-form-item" *ngIf="!sendMassMode">
<app-contact-autocomplete [control]="attachment['recipient']" style="width:100%;" [singleMode]="true">
</app-contact-autocomplete>
<div class="fieldState">
<i class="fas fa-asterisk noMandatory"></i>
</div>
<div class="attachment-form-item" *ngIf="attachment['signedResponse'].value !== undefined">
<mat-form-field class="input-form">
<input matInput placeholder="{{lang.signedAlt}}" [formControl]="attachment['signDate']"
[value]="attachment['signDate'].value | timeAgo : 'full'">
<div class="fieldState">
<i class="fas fa-asterisk noMandatory"></i>
</div>
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<div class="attachment-form-item" *ngIf="attachment['signedResponse'].value !== undefined">
<mat-form-field class="input-form">
<input matInput placeholder="{{lang.signedAlt}} {{lang.by}}"
[formControl]="attachment['signatory']">
</mat-form-field>
<div class="fieldState">
<i class="fas fa-asterisk noMandatory"></i>
</div>
</div>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
{{lang.othersInfos}}
</mat-panel-title>
</mat-expansion-panel-header>
<div class="attachment-form-item">
<mat-form-field class="input-form">
<input matInput placeholder="{{lang.created}}"
[formControl]="attachment['creationDate']"
[value]="attachment['creationDate'].value | timeAgo : 'full'">
</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">
<input matInput placeholder="{{lang.created}} {{lang.by}}"
[formControl]="attachment['typistLabel']">
</mat-form-field>
<div class="fieldState">
<i class="fas fa-asterisk noMandatory"></i>
</div>
</div>
<div class="attachment-form-item" *ngIf="attachment['modificationDate'].value !== null">
<mat-form-field class="input-form">
<input matInput placeholder="{{lang.modified}}"
[formControl]="attachment['modificationDate']"
[value]="attachment['modificationDate'].value | timeAgo : 'full'">
</mat-form-field>
<div class="fieldState">
<i class="fas fa-asterisk noMandatory"></i>
</div>
</div>
<div class="attachment-form-item" *ngIf="attachment['modificationDate'].value !== null">
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<mat-form-field class="input-form">
<input matInput placeholder="{{lang.modified}} {{lang.by}}"
[formControl]="attachment['modifiedBy']">
</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">
<input matInput placeholder="{{lang.version}}"
[formControl]="attachment['relation']"
[value]="lang.version + ' ' + attachment.relation.value">
</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
[matDatepicker]="picker" [placeholder]="lang.expectedReturnDate" [min]="now"
readonly style="cursor:pointer;">
<mat-datepicker-toggle matSuffix [for]="picker"
*ngIf="!attachment['validationDate'].value">
</mat-datepicker-toggle>
<mat-datepicker [touchUi]="appService.getViewMode()" #picker></mat-datepicker>
<button mat-button color="warn" matSuffix mat-icon-button
*ngIf="attachment['validationDate'].value && !attachment['validationDate'].disabled"
(click)="$event.stopPropagation();attachment['validationDate'].reset();"
[title]="lang.eraseValue">
<mat-icon color="warn" class="fa fa-calendar-times">
</mat-icon>
</button>
</mat-form-field>
<div class="fieldState">
<i class="fas fa-asterisk noMandatory"
*ngIf="attachment['validationDate'].valid && isEmptyField(attachment['validationDate'])"></i>
<i class="fas fa-check fieldFull"
*ngIf="attachment['validationDate'].valid && !isEmptyField(attachment['validationDate'])"></i>
</div>
</div>
</mat-expansion-panel>
Guillaume Heurtier
committed
<mat-tab-group [selectedIndex]="1" class="pjList" *ngIf="!loading" animationDuration="0" style="height: 100%">
<mat-tab label="Document principal" *ngIf="attachment.res_id_master !== null">
<ng-template matTabContent>
<app-document-viewer #appDocumentViewer style="display:block;height:100%;width:100%;overflow: auto;" [editMode]="false"
[resId]="attachment.resIdMaster.value" [title]="'Document principal'">
</app-document-viewer>
</ng-template>
</mat-tab>
<mat-tab *ngIf="attachment.status.value === 'SIGN'">
<ng-template mat-tab-label>
<span style="color:green">{{lang.signedAttachment}}</span>
</ng-template>
<app-document-viewer #appDocumentViewer style="display:block;height:100%;width:100%;overflow: auto;" [editMode]="false"
[resId]="attachment.signedResponse.value" [mode]="'attachment'"
[title]="attachment.chrono.value + ' - ' + attachment.title.value + ' (' + lang.signed + ')'">
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
<span style="color:#135f7f">{{lang.attachment}}</span>
</ng-template>
<app-document-viewer #appAttachmentViewer style="display:block;height:100%;width:100%;overflow: auto;" [editMode]="editMode"
[resId]="data.resId" [resIdMaster]="attachment['resIdMaster'].value" [mode]="'attachment'"
[format]="attachment['format'].value" [attachType]="attachment['type'].value" [infoPanel]="snavLeft"
(triggerEvent)="setDatasViewer($event)"
[title]="attachment.chrono.value + ' - ' + attachment.title.value">
</mat-tab>
<mat-tab label="{{lang.attachment}} ({{lang.version}} {{version.relation}})"
*ngFor="let version of versions">
<ng-template matTabContent>
<app-document-viewer #appDocumentViewer style="display:block;height:100%;width:100%;overflow: auto;" [editMode]="false"
[resId]="version.resId" [mode]="'attachment'" [format]="attachment['format'].value"
[title]="attachment.chrono.value + ' - ' + attachment.title.value + ' (' + version.relation + ')'">
</app-document-viewer>
</ng-template>
</mat-tab>
</mat-tab-group>
</mat-dialog-content>
<div mat-dialog-actions class="actions">
<button mat-raised-button color="primary" *ngIf="!newVersion" (click)="updateAttachment()"
[disabled]="!loading && (!editMode || !attachFormGroup.valid)">{{lang.validate}}</button>
<button mat-raised-button color="primary" *ngIf="!newVersion && sendMassMode && !loading" (click)="updateAttachment('mailing')"
[disabled]="!loading && (!editMode || !attachFormGroup.valid)">{{lang.mailing}}</button>
<button mat-raised-button color="primary" *ngIf="newVersion" (click)="createNewVersion()"
[disabled]="!editMode || !isEditing()">{{lang.createNewVersion}}</button>
<button mat-raised-button color="primary" *ngIf="newVersion && sendMassMode && !loading" (click)="createNewVersion('mailing')"
[disabled]="!editMode || !isEditing()">{{lang.mailing}}</button>
<button mat-raised-button color="warn" *ngIf=" !loading && attachment.status.value === 'SIGN' && (privilegeService.hasCurrentUserPrivilege('sign_document') || this.headerService.user.id == attachment.typist.value)"
(click)="deleteSignedVersion()">{{lang.deleteSignedVersion}}</button>
<button mat-raised-button mat-button [disabled]="loading" (click)="closeModal()">{{lang.close}}</button>