From 5a0cd2959c6cae1ce31216009bd33992c0227927 Mon Sep 17 00:00:00 2001
From: Alex Orluc <alex.orluc@maarch.org>
Date: Thu, 7 Nov 2019 23:27:40 +0100
Subject: [PATCH] FIX #12091 TIME 0:15 fix resId and chrono

---
 .../attachment-show-modal.component.scss      |  2 ++
 .../folder-document-list.component.html       | 10 ++++----
 .../folder-document-list.component.ts         | 24 +++++++++----------
 .../folder-action-list.component.ts           |  4 ++--
 4 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/src/frontend/app/attachments/attachment-show-modal/attachment-show-modal.component.scss b/src/frontend/app/attachments/attachment-show-modal/attachment-show-modal.component.scss
index eedd4afc56f..447d08cd23c 100644
--- a/src/frontend/app/attachments/attachment-show-modal/attachment-show-modal.component.scss
+++ b/src/frontend/app/attachments/attachment-show-modal/attachment-show-modal.component.scss
@@ -2,6 +2,8 @@
 
 .mat-dialog-title {
     padding: 10px;
+    display: flex;
+    align-items: center;
 }
 .modal-container{
     height: auto;
diff --git a/src/frontend/app/folder/document-list/folder-document-list.component.html b/src/frontend/app/folder/document-list/folder-document-list.component.html
index 0eb9a52ac67..a1d34f4b2f6 100644
--- a/src/frontend/app/folder/document-list/folder-document-list.component.html
+++ b/src/frontend/app/folder/document-list/folder-document-list.component.html
@@ -89,9 +89,9 @@
                     <table #tableBasketListSort="matSort" cdkDropList id="folder-list"
                         [cdkDropListConnectedTo]="listTodrag()" [cdkDropListData]="data"
                         [cdkDropListDisabled]="dragInit || appService.getViewMode()" mat-table [dataSource]="data"
-                        matSort matSortActive="res_id" matSortDisableClear matSortDirection="asc" style="width:100%;">
+                        matSort matSortActive="resId" matSortDisableClear matSortDirection="asc" style="width:100%;">
 
-                        <ng-container matColumnDef="res_id">
+                        <ng-container matColumnDef="resId">
                             <td mat-cell *matCellDef="let row"
                                 style="padding:0;border-top: solid 1px rgba(0, 0, 0, 0.12);"
                                 [class.selected-data]="row.checked">
@@ -117,13 +117,13 @@
                                     <span *ngIf="!appService.getViewMode()" class="main-info-data"
                                         style="width:200px;text-align:center;cursor:pointer;">
                                         <ng-container
-                                            *ngIf="row.alt_identifier == lang.undefined && row.barcode != lang.undefined">
+                                            *ngIf="row.chrono == lang.undefined && row.barcode != lang.undefined">
                                             <span style="color: rgba(0,0,0,0.4);font-size: 90%;">
                                                 <i title="{{lang.barcode}}" class="fas fa-barcode"></i>
                                                 {{row.barcode}}</span>
                                         </ng-container>
                                         <ng-container *ngIf="row.barcode == lang.undefined">
-                                            {{row.alt_identifier}}
+                                            {{row.chrono}}
                                         </ng-container>
                                     </span>
                                     <span class="main-info-data" style="font-weight:bold;flex:1;cursor:pointer;"
@@ -169,7 +169,7 @@
                             <div class="dragPreview" *cdkDragPreview><i class="fas fa-envelope-open-text fa-2x"></i>
                                 <br />
                                 {{lang.classifyInFolder}} :
-                                <b>{{row.alt_identifier}}</b>
+                                <b>{{row.chrono}}</b>
                             </div>
                         </tr>
                     </table>
diff --git a/src/frontend/app/folder/document-list/folder-document-list.component.ts b/src/frontend/app/folder/document-list/folder-document-list.component.ts
index 09cb50518f0..9ece47c985a 100644
--- a/src/frontend/app/folder/document-list/folder-document-list.component.ts
+++ b/src/frontend/app/folder/document-list/folder-document-list.component.ts
@@ -57,11 +57,11 @@ export class FolderDocumentListComponent implements OnInit {
     @ViewChild('snav', { static: true }) sidenavLeft: MatSidenav;
     @ViewChild('snav2', { static: true }) sidenavRight: MatSidenav;
 
-    displayedColumnsBasket: string[] = ['res_id'];
+    displayedColumnsBasket: string[] = ['resId'];
 
     displayedMainData: any = [
         {
-            'value': 'alt_identifier',
+            'value': 'chrono',
             'cssClasses': ['softColorData', 'align_centerData', 'chronoData'],
             'icon': ''
         },
@@ -221,11 +221,11 @@ export class FolderDocumentListComponent implements OnInit {
 
     goTo(row: any) {
         this.filtersListService.filterMode = false;
-        if (this.docUrl == '../../rest/resources/' + row.res_id + '/content' && this.sidenavRight.opened) {
+        if (this.docUrl == '../../rest/resources/' + row.resId + '/content' && this.sidenavRight.opened) {
             this.sidenavRight.close();
         } else {
-            this.docUrl = '../../rest/resources/' + row.res_id + '/content';
-            this.currentChrono = row.alt_identifier;
+            this.docUrl = '../../rest/resources/' + row.resId + '/content';
+            this.currentChrono = row.chrono;
             this.innerHtml = this.sanitizer.bypassSecurityTrustHtml(
                 "<iframe style='height:100%;width:100%;' src='" + this.docUrl + "' class='embed-responsive-item'>" +
                 "</iframe>");
@@ -234,7 +234,7 @@ export class FolderDocumentListComponent implements OnInit {
     }
 
     goToDetail(row: any) {
-        location.href = "index.php?page=details&dir=indexing_searching&id=" + row.res_id;
+        location.href = "index.php?page=details&dir=indexing_searching&id=" + row.resId;
     }
 
     togglePanel(mode: string, row: any) {
@@ -244,7 +244,7 @@ export class FolderDocumentListComponent implements OnInit {
         this.toggleAllRes(thisDeselect);
         this.toggleRes(thisSelect, row);
 
-        if (this.currentResource.res_id == row.res_id && this.sidenavRight.opened && this.currentMode == mode) {
+        if (this.currentResource.resId == row.resId && this.sidenavRight.opened && this.currentMode == mode) {
             this.sidenavRight.close();
         } else {
             this.currentMode = mode;
@@ -289,7 +289,7 @@ export class FolderDocumentListComponent implements OnInit {
     }
 
     viewThumbnail(row: any) {
-        this.thumbnailUrl = '../../rest/resources/' + row.res_id + '/thumbnail';
+        this.thumbnailUrl = '../../rest/resources/' + row.resId + '/thumbnail';
         $j('#viewThumbnail').show();
         $j('#listContent').css({ "overflow": "hidden" });
     }
@@ -310,7 +310,7 @@ export class FolderDocumentListComponent implements OnInit {
                 }
             });
 
-            element['checked'] = this.selectedRes.indexOf(element['res_id']) !== -1;
+            element['checked'] = this.selectedRes.indexOf(element['resId']) !== -1;
         });
 
         return data;
@@ -318,12 +318,12 @@ export class FolderDocumentListComponent implements OnInit {
 
     toggleRes(e: any, row: any) {
         if (e.checked) {
-            if (this.selectedRes.indexOf(row.res_id) === -1) {
-                this.selectedRes.push(row.res_id);
+            if (this.selectedRes.indexOf(row.resId) === -1) {
+                this.selectedRes.push(row.resId);
                 row.checked = true;
             }
         } else {
-            let index = this.selectedRes.indexOf(row.res_id);
+            let index = this.selectedRes.indexOf(row.resId);
             this.selectedRes.splice(index, 1);
             row.checked = false;
         }
diff --git a/src/frontend/app/folder/folder-action-list/folder-action-list.component.ts b/src/frontend/app/folder/folder-action-list/folder-action-list.component.ts
index 41bb943b751..9f3a2b69f55 100644
--- a/src/frontend/app/folder/folder-action-list/folder-action-list.component.ts
+++ b/src/frontend/app/folder/folder-action-list/folder-action-list.component.ts
@@ -66,8 +66,8 @@ export class FolderActionListComponent implements OnInit {
         this.contextMenuPosition.x = x + 'px';
         this.contextMenuPosition.y = y + 'px';
 
-        this.contextMenuTitle = row.alt_identifier;
-        this.contextResId = row.res_id;
+        this.contextMenuTitle = row.chrono;
+        this.contextResId = row.resId;
 
         // Opens the menu
         this.contextMenu.openMenu();
-- 
GitLab