From e1ef7380d4afb097c97633534f4beeb340dc55e4 Mon Sep 17 00:00:00 2001 From: "florian.azizian" <florian.azizian@maarch.org> Date: Mon, 17 Feb 2020 18:54:58 +0100 Subject: [PATCH] FEAT #12982 TIME 0:50 some fix on signature Book + change notes restriction --- .../controllers/PreProcessActionController.php | 1 - .../controllers/SignatureBookController.php | 14 +++++++++----- .../app/notes/note-editor.component.html | 18 +++++++++--------- src/frontend/app/signature-book.component.html | 8 ++++---- src/frontend/app/signature-book.component.scss | 5 +++++ 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/app/action/controllers/PreProcessActionController.php b/src/app/action/controllers/PreProcessActionController.php index 41c07512a6a..937983f9d9f 100755 --- a/src/app/action/controllers/PreProcessActionController.php +++ b/src/app/action/controllers/PreProcessActionController.php @@ -1409,7 +1409,6 @@ class PreProcessActionController 'chrono' => $resource['alt_identifier'], 'fields' => !empty($fieldsList) ? implode(", ", $fieldsList) : '' ]; - } else { $canClose[] = $resId; } diff --git a/src/app/signatureBook/controllers/SignatureBookController.php b/src/app/signatureBook/controllers/SignatureBookController.php index 200917cbf23..e615cb8a73e 100755 --- a/src/app/signatureBook/controllers/SignatureBookController.php +++ b/src/app/signatureBook/controllers/SignatureBookController.php @@ -132,6 +132,11 @@ class SignatureBookController 'viewerLink' => "../../rest/resources/{$resId}/content", 'thumbnailLink' => "rest/resources/{$resId}/thumbnail" ]; + } else { + $documents[] = [ + 'alt_id' => $incomingMail['alt_identifier'], + 'title' => $incomingMail['subject'] + ]; } $incomingMailAttachments = AttachmentModel::get([ @@ -196,8 +201,7 @@ class SignatureBookController 'orderBy' => [$orderBy] ]); - $canModify = PrivilegeController::hasPrivilege(['privilegeId' => 'modify_attachments', 'userId' => $args['userId']]); - $canDelete = PrivilegeController::hasPrivilege(['privilegeId' => 'delete_attachments', 'userId' => $args['userId']]); + $canManageAttachment = PrivilegeController::hasPrivilege(['privilegeId' => 'manage_attachments', 'userId' => $args['userId']]); foreach ($attachments as $key => $value) { if ($value['attachment_type'] == 'converted_pdf' || ($value['attachment_type'] == 'signed_response' && !empty($value['origin']))) { @@ -251,12 +255,12 @@ class SignatureBookController $attachments[$key]['typist'] = UserModel::getLabelledUserById(['login' => $value['typist']]); } + $rawUser = UserModel::getById(['id' => $args['userId'], 'select' => ['user_id']]); + $attachments[$key]['canModify'] = false; $attachments[$key]['canDelete'] = false; - if ($canModify || $value['typist'] == $args['userId']) { + if ($canManageAttachment || $value['typist'] == $rawUser['user_id']) { $attachments[$key]['canModify'] = true; - } - if ($canDelete || $value['typist'] == $args['userId']) { $attachments[$key]['canDelete'] = true; } diff --git a/src/frontend/app/notes/note-editor.component.html b/src/frontend/app/notes/note-editor.component.html index eb767b6efc4..fbe3570b692 100644 --- a/src/frontend/app/notes/note-editor.component.html +++ b/src/frontend/app/notes/note-editor.component.html @@ -1,11 +1,3 @@ -<div style="overflow: auto;max-height: 75px;"> - <ng-container *ngFor="let entity of entities | sortBy: 'entity_label';let i=index;"> - <span *ngIf="entitiesRestriction.indexOf(entity.id) > -1" class="label label-default noteRestriction" - (click)="removeEntityRestriction(entitiesRestriction.indexOf(entity.id), i)" - title="{{lang.restrictedEntity}}"><i class="fa fa-sitemap"></i> - {{entity.entity_label}} <i class="fa fa-times" style="cursor: pointer;"></i></span> - </ng-container> -</div> <mat-form-field appearance="outline" class="noteEditorContent"> <textarea matInput placeholder="{{title}}" [(ngModel)]="content"></textarea> <button matSuffix color="primary" mat-icon-button title="{{lang.options}}" [matMenuTriggerFor]="menuMain"> @@ -52,4 +44,12 @@ [disabled]="content.trim() == '' || loading"> <mat-icon fontSet="far" fontIcon="fa-paper-plane fa-2x"></mat-icon> </button> -</mat-form-field> \ No newline at end of file +</mat-form-field> +<div style="overflow: auto;max-height: 75px;"> + <ng-container *ngFor="let entity of entities | sortBy: 'entity_label';let i=index;"> + <span *ngIf="entitiesRestriction.indexOf(entity.id) > -1" class="label label-default noteRestriction" + (click)="removeEntityRestriction(entitiesRestriction.indexOf(entity.id), i)" + title="{{lang.restrictedEntity}}"><i class="fa fa-sitemap"></i> + {{entity.entity_label}} <i class="fa fa-times" style="cursor: pointer;"></i></span> + </ng-container> +</div> \ No newline at end of file diff --git a/src/frontend/app/signature-book.component.html b/src/frontend/app/signature-book.component.html index 1798b007340..e7ec3ed91b9 100755 --- a/src/frontend/app/signature-book.component.html +++ b/src/frontend/app/signature-book.component.html @@ -114,7 +114,7 @@ <i class="fa fa-chevron-left" aria-hidden="true" *ngIf="showLeftPanel"></i> <i class="fa fa-chevron-right" aria-hidden="true" *ngIf="!showLeftPanel"></i> </div> - <div *ngIf="signatureBook.hasWorkflow" class="contentShow"> + <div class="contentShow"> <div *ngIf="signatureBook.attachments[rightSelectedThumbnail] && !showAttachmentPanel" style="height:100%;overflow: auto;"> <div [ngStyle]="{'display': showTopRightPanel ? 'block' : 'none'}" class="pjDetails"> <div class="infoPj" title="{{signatureBook.attachments[rightSelectedThumbnail].attachment_type}}"> @@ -204,14 +204,14 @@ (reloadBadgeAttachments)="refreshAttachments()" (afterActionAttachment)="refreshAttachments()"> </app-attachments-list> </div> - <div *ngIf="!signatureBook.hasWorkflow" class="visaNoWorkflowWarning"> + <div class="visaNoWorkflowWarning"> <div style="margin-top:200px;" [innerHTML]="noVisaWorkflowNoSignature"></div> </div> - <div *ngIf="!signatureBook.attachments[rightSelectedThumbnail] && signatureBook.hasWorkflow" class="visaNoPjWarning"> + <div *ngIf="!signatureBook.attachments[rightSelectedThumbnail]" class="visaNoPjWarning"> <div style="margin-top:200px;" [innerHTML]="noAttachmentClickToAddOne"></div> </div> </div> - <div *ngIf="signatureBook.hasWorkflow" class="panelRight"> + <div class="panelRight"> <div *ngIf="signatureBook.attachments" id="rightPanelContent" class="panelRightContent"> <div title="[{{attachment.attachment_type}}] {{attachment.title}}" style="position: relative;" class="item" *ngFor="let attachment of signatureBook.attachments; let i = index" (click)="changeRightViewer(i)" [ngClass]="{'panelSelectedThumbnail': i == rightSelectedThumbnail && !showAttachmentPanel}"> <span class="fa-stack fa-lg"> diff --git a/src/frontend/app/signature-book.component.scss b/src/frontend/app/signature-book.component.scss index 7ec75ada1f9..447fa7dd910 100755 --- a/src/frontend/app/signature-book.component.scss +++ b/src/frontend/app/signature-book.component.scss @@ -890,3 +890,8 @@ img.panelSelectedThumbnail,img:hover.panelSelectedThumbnail{ transition: all 0.1s; margin-left: 5px; } + +#consigne { + height: 22px !important; + margin-top: 2px !important; +} \ No newline at end of file -- GitLab