document.component.html 10.3 KB
Newer Older
1
2
3
4
5
<ion-header *ngIf="!loadingdocument" [translucent]="true">
    <ion-toolbar color="light">
        <ion-buttons slot="start">
            <ion-menu-button></ion-menu-button>
          </ion-buttons>
6
7
        <ion-segment value="favorite" [value]="signaturesService.currentToobal"
            (ionChange)="signaturesService.currentToobal=$event.detail.value">
8
9
10
11
12
13
14
15
16
17
18
            <ion-segment-button value="mainDocumentDetail" (click)="openMainDocumentDetail();">
                <ion-label color="primary">{{'lang.informations' | translate}}</ion-label>
                <ion-icon color="primary" name="information-circle"></ion-icon>
            </ion-segment-button>
            <ion-segment-button value="documentList" (click)="openDocumentList();">
                <ion-label color="primary">{{'lang.attachedElements' | translate | ucfirst}}</ion-label>
                <ion-icon color="primary" name="document-attach-outline"></ion-icon>
                <ion-badge color="danger" style="position: absolute;top: 10px;right: 40%;">
                    {{mainDocument.attachments.length + 1}}
                </ion-badge>
            </ion-segment-button>
19
            <ion-segment-button value="associatedDocuments"
20
                *ngIf="mainDocument.linkedDocuments !== undefined && mainDocument.linkedDocuments.length > 0"
21
                (click)="openAssociatedDocuments();">
22
23
24
25
26
27
28
29
30
31
32
33
34
35
                <ion-label color="primary">{{'lang.associatedDocuments' | translate | ucfirst}}</ion-label>
                <ion-icon color="primary" name="link-outline"></ion-icon>
                <ion-badge color="danger" style="position: absolute;top: 10px;right: 40%;">
                    {{mainDocument.linkedDocuments.length}}
                </ion-badge>
            </ion-segment-button>
            <ion-segment-button value="visaWorkflow" (click)="openVisaWorkflow();">
                <ion-label color="primary">{{'lang.circuit' | translate}}</ion-label>
                <ion-icon color="primary" name="list-outline"></ion-icon>
                <ion-badge color="danger" style="position: absolute;top: 10px;right: 40%;">
                    {{mainDocument.workflow.length}}
                </ion-badge>
            </ion-segment-button>
        </ion-segment>
36
        <ion-buttons slot="end" *ngIf="!detailMode">
37
            <ion-button color="primary" (click)="openAction($event)" [disabled]="!canShowActions() || mainDocument.status === 'CONVERTING'">
38
39
40
41
42
43
              <ion-icon slot="icon-only" name="settings-sharp"></ion-icon>
            </ion-button>
          </ion-buttons>
    </ion-toolbar>
</ion-header>
<ion-toolbar class="ion-text-center" color="primary"
44
    *ngIf="authService.user.substitute !== null && docList[currentDoc]">
45
46
    <ion-label style="font-size: 13px;">{{'lang.substitutionInfo' | translate}}</ion-label>
</ion-toolbar>
47
<ion-toolbar class="ion-text-center" color="danger" *ngIf="mainDocument.id !== 0 && mainDocument.status === 'CONVERTING'">
48
49
    <ion-label style="font-size: 13px;">{{'lang.convertingDocument' | translate}}</ion-label>
</ion-toolbar>
50
51
52
<ion-toolbar class="ion-text-center" color="danger" *ngIf="mainDocument.id !== 0 && mainDocument.status === 'ERROR'">
    <ion-label style="font-size: 13px;">{{'lang.errorConvertingDocument' | translate}}</ion-label>
</ion-toolbar>
53
<ion-content *ngIf="!loadingdocument" #mainContent>
54
    <ng-container *ngIf="(mainDocument.notes !== undefined && mainDocument.notes !== null) || hasWorkflowNotes">
55
56
57
58
59
60
61
62
63
64
65
66
67
68
        <ion-fab-button *ngIf="!expandedNote" ngDraggable [bounds]="myBounds" [inBounds]="true"
            (movingOffset)="signaturesService.dragging=true" (endOffset)="signaturesService.dragging=false"
            [title]="'lang.expandNote' | translate" (click)="expandedNote = true;"
            style="top: 40px;right: 40px;z-index:2;position:absolute;" [disabled]="signaturesService.dragging">
            <ion-icon name="chatbubble-ellipses-outline"></ion-icon>
        </ion-fab-button>
        <div ngDraggable (movingOffset)="signaturesService.dragging=true" (endOffset)="signaturesService.dragging=false"
            [bounds]="myBounds" [inBounds]="true" *ngIf="expandedNote" class="note">
            <div class="note-title">
                <i class="far fa-sticky-note" style="padding-right: 5px;"></i>
                <span style="flex:1;">{{'lang.note' | translate}}</span>
                <i class="fa fa-minus-square" style="cursor: pointer;" (click)="expandedNote = false;"
                    [title]="'lang.collapseNote' | translate"></i>
            </div>
69
70
71
72
73
74
75
76
77
78
79
            <ng-container *ngIf="mainDocument.notes !== undefined && mainDocument.notes !== null">
                <div class="note-creator">
                    {{mainDocument.notes.creator}} ({{mainDocument.notes.creationDate}}) :
                </div>
                <div class="note-content">
                    {{mainDocument.notes.value}}
                </div>
            </ng-container>
            <ng-container *ngFor="let step of mainDocument.workflow">
                <div *ngIf="step.note">
                    <div class="note-creator">
80
                        {{step.noteCreator}} ({{step.processDate}}) :
81
82
83
84
85
86
                    </div>
                    <div class="note-content">
                        {{step.note}}
                    </div>
                </div>
            </ng-container>
Damien's avatar
Damien committed
87
        </div>
88
89
90
91
92
    </ng-container>
    <div style="display: contents;">
        <drag-scroll style="overflow:auto;height: 100%;width: 100%;margin: auto;"
            [drag-scroll-disabled]="(signaturesService.dragging || signaturesService.resizing) && signaturesService.mobileMode"
            [drag-disabled]="(signaturesService.dragging || signaturesService.resizing) && !signaturesService.mobileMode"
93
            [style.maxWidth.px]="signaturesService.workingAreaWidth" #nav (click)="canShowActions() ? openAction($event) : false">
94
95
96
            <div style="position:relative;cursor: grab;" [style.width.px]="signaturesService.workingAreaWidth"
                [style.height.px]="signaturesService.workingAreaHeight" id="myBounds" #myBounds>
                <app-document-note-list *ngIf="currentDoc == 0 && !loadingImage">
Damien's avatar
Damien committed
97
                </app-document-note-list>
98
                <app-document-sign-list *ngIf="currentDoc === 0 && !loadingImage && this.signaturesService.signaturesContent[pageNum]" [bounds]="myBounds">
99
                </app-document-sign-list>
100
101
                <app-document-date-list *ngIf="currentDoc === 0 && !loadingImage && this.signaturesService.datesContent[pageNum]" [bounds]="myBounds">
                </app-document-date-list>
102
                <ion-img
103
                    *ngIf="docList[currentDoc] !== undefined && !functionsService.empty(docList[currentDoc].imgContent[pageNum])"
104
105
106
107
108
109
110
                    class="img-content" [src]="docList[currentDoc].imgContent[pageNum]"
                    [style.width.px]="signaturesService.workingAreaWidth"
                    [style.height.px]="signaturesService.workingAreaHeight" (ionImgDidLoad)="imageLoaded($event)" #img>
                </ion-img>
                <!--<ngx-extended-pdf-viewer style="display: none;" [src]="pdfname" [useBrowserLocale]="true"
                    [textLayer]="false" [showHandToolButton]="true" (pdfLoaded)="onPagesLoaded($event)">
                </ngx-extended-pdf-viewer>-->
Damien's avatar
Damien committed
111
            </div>
112
113
114
115
        </drag-scroll>
    </div>
    <section class="page-info"
        *ngIf="!signaturesService.dragging && !signaturesService.resizing && docList[currentDoc]">
116
117
118
        <div class="page-info-doc">
            {{docList[currentDoc].title}}
        </div>
119
        <div class="page-info-page" (click)="openSelect($event)">{{'lang.page' | translate}} {{ pageNum }} / {{ totalPages }}</div>
120
121
        <ion-select interface="popover" [(ngModel)]="pageNum" [interfaceOptions]="{cssClass : this.totalPages > 10  ? 'popover-class' : 'custom-popover-class'}"  style="max-height: 100%;" #pagesList (ionChange)='goTo($event.target.value)' hidden="true">
            <ion-select-option *ngFor="let page of pagesArray(this.totalPages);let i=index" [value]="i+1" [disabled]="i+1 === pageNum">{{ i + 1 }}</ion-select-option>
122
        </ion-select>
123
    </section>
124
125
126
127
    <ion-item *ngIf="mainDocument.isCertified" lines="none" class="certified">
        <ion-icon slot="start" name="ribbon-outline" color="success"></ion-icon>
        <ion-label>{{'lang.certifiedDocument' | translate}}</ion-label>
    </ion-item>
128
129
130
131
132
133
134
135
136
137
138
    <ng-container *ngIf="!signaturesService.dragging && !signaturesService.resizing && !loadingImage">
        <ion-fab-button *ngIf="pageNum > 1 && !loadingImage" (click)="prevPage()" class="paginate-left">
            <ion-icon name="chevron-back-outline"></ion-icon>
        </ion-fab-button>
        <ion-fab-button *ngIf="pageNum < totalPages && !loadingImage" (click)="nextPage()" 
            class="paginate-right">
            <ion-icon name="chevron-forward-outline"></ion-icon>
        </ion-fab-button>
    </ng-container>

</ion-content>
139
<ion-footer *ngIf="!loadingImage && currentDoc === 0" class="ion-no-border footer-buttons" [ngStyle]="{'grid-template-columns': actionsList.length === 2 ? 'repeat(2, 1fr)' : 'repeat(3, 1fr)'}">
140
    <ion-button [disabled]="isNotReady()" *ngFor="let action of actionsList" [color]="action.color" shape="round" size="large" fill="outline" (click)="launchEvent(action)" style="width: auto;">
141
        <ion-icon *ngIf="action.logo !== ''" [slot]="'start'" [name]="action.logo"></ion-icon>
142
        <ion-label style="font-size: 13px;">{{getLabel(action)}}</ion-label>
143
144
    </ion-button>
</ion-footer>
145

146
<ng-template #rightContent>
147
148
    <app-visa-workflow [visaWorkflow]="mainDocument.workflow"
        *ngIf="signaturesService.currentToobal == 'visaWorkflow'" style="display: contents;">
149
    </app-visa-workflow>
150
151
    <app-document-list #appDocumentList [currentDocId]="currentDoc"
        [docList]="docList" *ngIf="signaturesService.currentToobal == 'documentList'"
152
        (triggerEvent)="loadDoc($event)" style="display: contents;"></app-document-list>
153
154
    <app-associated-documents #appAssociatedDocuments
        [associatedDocuments]="mainDocument.linkedDocuments" *ngIf="signaturesService.currentToobal == 'associatedDocuments'"
155
        style="display: contents;"></app-associated-documents>
156
157
    <app-main-document-detail #appMainDocumentDetail [mainDocument]="mainDocument"
        *ngIf="signaturesService.currentToobal == 'mainDocumentDetail'" style="display: contents;">
158
159
    </app-main-document-detail>
</ng-template>