Skip to content
Snippets Groups Projects
Commit c9cf482b authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #12327 TIME 1:10 disable view document icon if no document

parent 7db375e9
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,8 @@ class ResourceListController
$select = [
'res_letterbox.res_id', 'res_letterbox.subject', 'res_letterbox.barcode', 'res_letterbox.alt_identifier',
'status.label_status AS "status.label_status"', 'status.img_filename AS "status.img_filename"', 'priorities.color AS "priorities.color"',
'res_letterbox.closing_date', 'res_letterbox.locker_user_id', 'res_letterbox.locker_time', 'res_letterbox.confidentiality'
'res_letterbox.closing_date', 'res_letterbox.locker_user_id', 'res_letterbox.locker_time', 'res_letterbox.confidentiality',
'res_letterbox.filename as res_filename'
];
$tableFunction = ['status', 'priorities'];
$leftJoinFunction = ['res_letterbox.status = status.id', 'res_letterbox.priority = priorities.id'];
......@@ -772,6 +773,7 @@ class ResourceListController
$formattedResources[$key]['priorityColor'] = $resource['priorities.color'];
$formattedResources[$key]['closing_date'] = $resource['closing_date'];
$formattedResources[$key]['countAttachments'] = 0;
$formattedResources[$key]['hasDocument'] = $resource['res_filename'] != null;
foreach ($attachments as $attachment) {
if ($attachment['res_id_master'] == $resource['res_id']) {
$formattedResources[$key]['countAttachments'] = $attachment['count'];
......
......@@ -160,7 +160,8 @@
<mat-icon fontSet="fas" fontIcon="fa-sitemap fa-2x" [color]="snav2.opened && row.checked && currentMode == 'diffusion' ? 'primary' : ''"></mat-icon>
</button>
<button mat-icon-button title="{{lang.viewResource}}" (click)="$event.stopPropagation();viewDocument(row)"
(mouseenter)="viewThumbnail(row);" (mouseleave)="closeThumbnail();">
(mouseenter)="viewThumbnail(row);" (mouseleave)="closeThumbnail();"
[disabled]="!row.hasDocument">
<mat-icon fontSet="fas" fontIcon="fa-eye fa-2x"></mat-icon>
</button>
<button mat-icon-button title="{{lang.linkDetails}}"
......@@ -204,4 +205,4 @@
</mat-sidenav-container>
<app-actions-list (refreshEvent)="refreshDao()" (refreshEventAfterAction)="refreshDaoAfterAction()" #actionsListContext [contextMode]="true"
[totalRes]="allResInBasket.length" [selectedRes]="selectedRes" [currentBasketInfo]="currentBasketInfo" (refreshPanelFolders)="panelFolder.refreshFoldersTree()">
</app-actions-list>
\ No newline at end of file
</app-actions-list>
......@@ -300,7 +300,7 @@ export class BasketListComponent implements OnInit {
Object.keys(element).forEach((key) => {
if (key == 'statusImage' && element[key] == null) {
element[key] = 'fa-question undefined';
} else if ((element[key] == null || element[key] == '') && ['closingDate', 'countAttachments', 'countNotes', 'display', 'folders'].indexOf(key) === -1) {
} else if ((element[key] == null || element[key] == '') && ['closingDate', 'countAttachments', 'countNotes', 'display', 'folders', 'hasDocument'].indexOf(key) === -1) {
element[key] = this.lang.undefined;
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment