From fc27f3d24a14129b2b8d7ea19fe191d0d884db9d Mon Sep 17 00:00:00 2001 From: "florian.azizian" <florian.azizian@maarch.org> Date: Mon, 10 Feb 2020 10:39:45 +0100 Subject: [PATCH] FEA #12346 TIME 0:25 wording + fix preprocess ESB + hide version if signed document --- src/app/convert/controllers/ConvertThumbnailController.php | 6 +++--- .../controllers/MaarchParapheurController.php | 4 ++-- src/app/resource/controllers/ResourceListController.php | 6 ++++-- src/frontend/app/viewer/document-viewer.component.html | 2 +- src/frontend/app/viewer/document-viewer.component.ts | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/app/convert/controllers/ConvertThumbnailController.php b/src/app/convert/controllers/ConvertThumbnailController.php index d06d782eee9..bf24c816726 100755 --- a/src/app/convert/controllers/ConvertThumbnailController.php +++ b/src/app/convert/controllers/ConvertThumbnailController.php @@ -72,9 +72,9 @@ class ConvertThumbnailController return ['errors' => '[ConvertThumbnail] Document does not exist on docserver']; } - $ext = pathinfo($pathToDocument, PATHINFO_EXTENSION); - $filename = pathinfo($pathToDocument, PATHINFO_FILENAME); - $tmpPath = CoreConfigModel::getTmpPath(); + $ext = pathinfo($pathToDocument, PATHINFO_EXTENSION); + $filename = pathinfo($pathToDocument, PATHINFO_FILENAME); + $tmpPath = CoreConfigModel::getTmpPath(); $fileNameOnTmp = rand() . $filename; if (in_array($ext, ['maarch', 'html'])) { diff --git a/src/app/external/externalSignatoryBook/controllers/MaarchParapheurController.php b/src/app/external/externalSignatoryBook/controllers/MaarchParapheurController.php index 64fe8b883ec..9f985e22125 100755 --- a/src/app/external/externalSignatoryBook/controllers/MaarchParapheurController.php +++ b/src/app/external/externalSignatoryBook/controllers/MaarchParapheurController.php @@ -78,7 +78,7 @@ class MaarchParapheurController } if (!empty($mainResource[0]['filename'])) { $adrMainInfo = ConvertPdfController::getConvertedPdfById(['resId' => $aArgs['resIdMaster'], 'collId' => 'letterbox_coll']); - if (empty($adrMainInfo['docserver_id']) || strtolower(pathinfo($mainResource[0]['filename'], PATHINFO_EXTENSION)) != 'pdf') { + if (empty($adrMainInfo['docserver_id']) || strtolower(pathinfo($adrMainInfo['filename'], PATHINFO_EXTENSION)) != 'pdf') { return ['error' => 'Document ' . $aArgs['resIdMaster'] . ' is not converted in pdf']; } $docserverMainInfo = DocserverModel::getByDocserverId(['docserverId' => $adrMainInfo['docserver_id']]); @@ -417,7 +417,7 @@ class MaarchParapheurController return ['sended' => $attachmentToFreeze, 'historyInfos' => $historyInfos]; } - public static function setMetadata($args = []) + public static function setMetadata($args = []) { $metadata = []; if (!empty($args['priority'])) { diff --git a/src/app/resource/controllers/ResourceListController.php b/src/app/resource/controllers/ResourceListController.php index c80fe021113..e847c5cd042 100644 --- a/src/app/resource/controllers/ResourceListController.php +++ b/src/app/resource/controllers/ResourceListController.php @@ -76,7 +76,7 @@ class ResourceListController $resIds = ResourceListController::getIdsWithOffsetAndLimit(['resources' => $rawResources, 'offset' => $data['offset'], 'limit' => $data['limit']]); $followedDocuments = UserFollowedResourceModel::get([ - 'select' => ['res_id'], + 'select' => ['res_id'], 'where' => ['user_id = ?'], 'data' => [$GLOBALS['id']], ]); @@ -457,7 +457,9 @@ class ResourceListController } } $historic = empty($methodResponse['history']) ? '' : $methodResponse['history']; - ActionMethodController::terminateAction(['id' => $aArgs['actionId'], 'resources' => $resourcesForAction, 'basketName' => $basket['basket_name'], 'note' => $body['note'], 'history' => $historic]); + if (!empty($resourcesForAction)) { + ActionMethodController::terminateAction(['id' => $aArgs['actionId'], 'resources' => $resourcesForAction, 'basketName' => $basket['basket_name'], 'note' => $body['note'], 'history' => $historic]); + } if (!empty($methodResponses)) { return $response->withJson($methodResponses); diff --git a/src/frontend/app/viewer/document-viewer.component.html b/src/frontend/app/viewer/document-viewer.component.html index 0e8c66d67c1..4c4c1fff572 100644 --- a/src/frontend/app/viewer/document-viewer.component.html +++ b/src/frontend/app/viewer/document-viewer.component.html @@ -68,7 +68,7 @@ </button> </mat-menu> <ng-container *ngIf="mode === 'mainDocument' && !functions.empty(file.subinfos)"> - <button *ngIf="file.subinfos.mainDocVersions.length > 1" mat-button + <button *ngIf="file.subinfos.mainDocVersions.length > 1 && !file.subinfos.signedDocVersions" mat-button [matBadge]="file.subinfos.mainDocVersions.length" [matMenuTriggerFor]="menuVersionsDoc"> {{lang.versions}} </button> diff --git a/src/frontend/app/viewer/document-viewer.component.ts b/src/frontend/app/viewer/document-viewer.component.ts index 2b4df0a924a..7776184b190 100644 --- a/src/frontend/app/viewer/document-viewer.component.ts +++ b/src/frontend/app/viewer/document-viewer.component.ts @@ -941,7 +941,7 @@ export class DocumentViewerComponent implements OnInit { } unsignMainDocument() { - this.dialogRef = this.dialog.open(ConfirmComponent, { autoFocus: false, disableClose: true, data: { title: this.lang.unsignDocument, msg: this.lang.confirmAction } }); + this.dialogRef = this.dialog.open(ConfirmComponent, { autoFocus: false, disableClose: true, data: { title: this.lang.UNSIGN, msg: this.lang.confirmAction } }); this.dialogRef.afterClosed().pipe( filter((data: string) => data === 'ok'), -- GitLab