Skip to content
Snippets Groups Projects
Commit 1c633c1d authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #8218 improve home res list

parent d03382b6
No related branches found
No related tags found
No related merge requests found
...@@ -29,75 +29,92 @@ ...@@ -29,75 +29,92 @@
<mat-tab-group> <mat-tab-group>
<mat-tab label="Mes derniers courriers"> <mat-tab label="Mes derniers courriers">
<table mat-table [dataSource]="dataSource" matSort matSortActive="res_id" matSortDisableClear matSortDirection="asc" style="width:100%;table-layout: fixed;"> <table mat-table [dataSource]="dataSource" matSort matSortActive="res_id" matSortDisableClear matSortDirection="asc"
<ng-container matColumnDef="res_id"> style="width:100%;table-layout: fixed;">
<td mat-cell *matCellDef="let row" [ngStyle]="{'width': mobileMode ? '30%' : '10%'}" style="text-align:center;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;vertical-align: top;"> <!-- Number Column -->
<div *ngIf="row.closing_date == null && mobileMode" id="{{row.res_id}}_creation_date" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;" <ng-container matColumnDef="res_id">
title='{{row.creation_date | date : "le dd/MM/y à HH:mm"}}'> <td mat-cell *matCellDef="let row" [ngStyle]="{'width': mobileMode ? '30%' : '10%'}" style="text-align:center;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;vertical-align: middle;">
<i class="fa fa-calendar" title="date d'enregistrement"></i> {{row.creation_date | timeAgo}} <div *ngIf="row.closing_date == null && mobileMode" id="{{row.res_id}}_creation_date" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"
</div> title='{{row.creation_date | date : "le dd/MM/y à HH:mm"}}'>
<div style="overflow: hidden;text-overflow: ellipsis;"> <i class="fa fa-calendar" title="date d'enregistrement"></i> {{row.creation_date | timeAgo}}
<mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="{{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}} {{row.status_icon}} {{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}}-2x" </div>
title="{{row.status_label}}"></mat-icon> <div *ngIf="!mobileMode" style="padding-top: 5px;color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;" title="{{lang[row.category_id]}}">
</div> {{lang[row.category_id]}}
<div style="padding-top: 5px;color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"> </div>
{{row.alt_identifier}} <div style="overflow: hidden;text-overflow: ellipsis;">
</div> <mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="{{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}} {{row.status_icon}} {{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}}-2x" title="{{row.status_label}} ({{row.status_id}})"></mat-icon>
</div>
<div style="padding-top: 5px;color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;" title="{{row.alt_identifier}} (n°{{row.res_id}})">
{{row.alt_identifier}}
</div>
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="subject"> <ng-container matColumnDef="subject">
<td mat-cell *matCellDef="let row" style="width:45%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> <td mat-cell *matCellDef="let row" style="width:50%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;vertical-align: middle;">
<div style="overflow: hidden;text-overflow: ellipsis;" title="{{row.subject}}"> <div *ngIf="row.closing_date == null && mobileMode" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;text-align: right;">
<span class="label" [ngStyle]="{'background': row.priority_color}">{{row.priority_label}}</span>&nbsp; <i class="fa fa-stopwatch" title="date limite de traitement"></i>&nbsp;
<span>{{row.subject}}</span> <span [innerHTML]="row.process_limit_date | timeLimit" title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'></span>
</div> </div>
<div *ngIf="mobileMode" style="text-align: right"> <div style="overflow: hidden;text-overflow: ellipsis;" title="{{row.subject}}">
<button mat-icon-button (click)="$event.stopPropagation();goTo(row);"> <span *ngIf="!mobileMode" class="label" [ngStyle]="{'background': row.priority_color}">{{row.priority_label}}</span>&nbsp;
<mat-icon color="primary" class="fa fa-eye fa-2x"></mat-icon> <span>{{row.subject}}</span>
</button> </div>
</div> <div *ngIf="mobileMode" style="padding-top: 5px;color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;text-align: right;">
</td> {{row.dest_user}}
</ng-container> </div>
<ng-container matColumnDef="contact_society"> <div style="display:hidden;">
<td mat-cell *matCellDef="let row" style="width:25%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> &nbsp;
<div style="overflow: hidden;text-overflow: ellipsis;"> </div>
<i class="fa fa-address-card" color="primary"></i>&nbsp; <div *ngIf="!mobileMode && (row.folder_name || row.case_label)">
<span *ngIf="row.contact_lastname==''">{{row.contact_society}}</span> <span *ngIf="row.folder_name" class="label label-default" style="background-color:rgba(0,0,0,0.4);margin-left: 5px;margin-right: 5px;" title="Dossier"><i class="fa fa-folder"></i> {{row.folder_name}}</span>
<span *ngIf="row.contact_society==''">{{row.contact_lastname}}</span> &nbsp; <span *ngIf="row.case_label" class="label label-default" style="background-color:rgba(0,0,0,0.4);margin-left: 5px;margin-right: 5px;" title="Affaire"><i class="fa fa-suitcase"></i> {{row.case_label}}</span>
<i class="fa fa-arrow-right"></i>&nbsp; </div>
<i class="fa fa-sitemap" color="primary"></i>&nbsp; </td>
<span title="{{row.entity_label}}">{{row.destination}}</span> </ng-container>
</div> <ng-container matColumnDef="contact_society">
<div style="padding-top: 5px;color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"> <td mat-cell *matCellDef="let row" style="width:25%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;vertical-align: middle;">
{{row.dest_user}} <div style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;">
</div> <b>De:</b>&nbsp;
</td> <span *ngIf="row.user_firstname">{{row.user_firstname}}</span>&nbsp;
</ng-container> <span *ngIf="row.user_lastname">{{row.user_lastname}}</span>
<span *ngIf="row.contact_lastname==''">{{row.contact_society}}</span>
<span *ngIf="row.contact_society==''">{{row.contact_lastname}}</span> &nbsp;
</div>
<div style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;">
<b>Pour:</b>&nbsp;
<span title="{{row.user_dest_firstname}}&nbsp;{{row.user_dest_lastname}} ({{row.entity_destination}})">{{row.user_dest_firstname}}&nbsp;{{row.user_dest_lastname}} ({{row.entity_destination}})</span>
</div>
<div style="padding-top:10px;">
<i class="fa fa-file" color="primary"></i>&nbsp;{{row.doctype_label}}
</div>
</td>
</ng-container>
<ng-container matColumnDef="creation_date"> <ng-container matColumnDef="creation_date">
<td mat-cell *matCellDef="let row" style="text-align: right;width:15%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> <td mat-cell *matCellDef="let row" style="text-align: right;width:15%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;vertical-align: middle;">
<div *ngIf="row.closing_date == null" id="{{row.res_id}}_creation_date" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;" <div *ngIf="row.closing_date == null" id="{{row.res_id}}_creation_date" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"
title='{{row.creation_date | date : "le dd/MM/y à HH:mm"}}'> title='{{row.creation_date | date : "le dd/MM/y à HH:mm"}}'>
<i class="fa fa-calendar" title="date d'enregistrement"></i> {{row.creation_date | timeAgo}} <i class="fa fa-calendar" title="date d'enregistrement"></i> {{row.creation_date | timeAgo}}
</div> </div>
<div *ngIf="row.closing_date == null" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"> <div *ngIf="row.closing_date == null" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;">
<i class="fa fa-stopwatch" title="date limite de traitement"></i>&nbsp; <i class="fa fa-stopwatch" title="date limite de traitement"></i>&nbsp;
<span [innerHTML]="row.process_limit_date | timeLimit" title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'></span> <span [innerHTML]="row.process_limit_date | timeLimit" title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'></span>
</div> </div>
<div *ngIf="row.closing_date != null" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"> <div *ngIf="row.closing_date != null" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;">
<i class="fa fa-lock" title="date de clôture"></i>&nbsp; <i class="fa fa-lock" title="date de clôture"></i>&nbsp;
<span title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'>{{row.closing_date | timeAgo}}</span> <span title='{{row.closing_date | date : "le dd/MM/y à HH:mm"}}'>{{row.closing_date | timeAgo}}</span>
</div> </div>
<div> <div>
<button mat-icon-button (click)="$event.stopPropagation();goTo(row);" (mouseenter)="viewThumbnail(row);" (mouseleave)="closeThumbnail();"> <button mat-icon-button (click)="$event.stopPropagation();goTo(row);" (mouseenter)="viewThumbnail(row);" (mouseleave)="closeThumbnail();">
<mat-icon color="primary" class="fa fa-eye"></mat-icon> <mat-icon color="primary" class="fa fa-eye"></mat-icon>
</button> </button>
</div> </div>
</td> </td>
</ng-container> </ng-container>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="goToDetail(row);" style="cursor: pointer;"></tr>
</table> <tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="goToDetail(row);"></tr>
</table>
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>
</mat-card> </mat-card>
......
...@@ -38,7 +38,7 @@ export class HomeComponent extends AutoCompletePlugin implements OnInit { ...@@ -38,7 +38,7 @@ export class HomeComponent extends AutoCompletePlugin implements OnInit {
@ViewChildren(MatExpansionPanel) viewPanels: QueryList<MatExpansionPanel>; @ViewChildren(MatExpansionPanel) viewPanels: QueryList<MatExpansionPanel>;
homeData: any; homeData: any;
dataSource: any; dataSource: any;
displayedColumns: string[] = ['res_id', 'subject', 'creation_date']; displayedColumns: string[] = ['res_id', 'subject', 'contact_society', 'creation_date'];
currentDate : string = ""; currentDate : string = "";
......
...@@ -76,7 +76,31 @@ class HomeController ...@@ -76,7 +76,31 @@ class HomeController
} }
$lastResources = ResModel::getLastResources([ $lastResources = ResModel::getLastResources([
'select' => ['res_letterbox.res_id', 'res_letterbox.subject', 'res_letterbox.creation_date', 'res_letterbox.destination', 'res_letterbox.dest_user', 'mlb_coll_ext.alt_identifier', 'mlb_coll_ext.closing_date', 'mlb_coll_ext.process_limit_date', 'status.label_status as status_label', 'status.img_filename as status_icon', 'priorities.color as priority_color'], 'select' => [
'r.alt_identifier',
'r.category_id',
'r.case_label',
'r.closing_date',
'r.category_id',
'r.contact_lastname',
'r.contact_society',
'r.creation_date',
'r.entity_label as entity_destination',
'r.folder_name',
'priorities.color as priority_color',
'priorities.label as priority_label',
'r.process_limit_date',
'r.res_id',
'status.img_filename as status_icon',
'status.label_status as status_label',
'status.id as status_id',
'r.subject',
'r.type_label as doctype_label',
'r.user_lastname',
'r.user_firstname',
'users.lastname as user_dest_lastname',
'users.firstname as user_dest_firstname',
],
'limit' => 5, 'limit' => 5,
'userId' => $GLOBALS['userId'] 'userId' => $GLOBALS['userId']
]); ]);
......
...@@ -225,18 +225,19 @@ abstract class ResModelAbstract ...@@ -225,18 +225,19 @@ abstract class ResModelAbstract
$resources = DatabaseModel::select([ $resources = DatabaseModel::select([
'select' => $aArgs['select'], 'select' => $aArgs['select'],
'table' => ['history, res_letterbox, mlb_coll_ext, status, priorities'], 'table' => ['history, res_view_letterbox r, status, priorities, users'],
'where' => [ 'where' => [
'history.user_id = ?', 'history.table_name IN (?)', 'history.user_id = ?', 'history.table_name IN (?)',
'history.record_id IS NOT NULL', 'history.record_id != ?', 'history.record_id IS NOT NULL', 'history.record_id != ?',
'history.event_id != ?', 'history.event_id NOT LIKE ?', 'history.event_id != ?', 'history.event_id NOT LIKE ?',
'CAST(history.record_id AS INT) = res_letterbox.res_id', 'CAST(history.record_id AS INT) = r.res_id',
'mlb_coll_ext.res_id = res_letterbox.res_id', 'res_letterbox.status != ?', 'r.res_id = r.res_id', 'r.status != ?',
'res_letterbox.status = status.id', 'r.status = status.id',
'res_letterbox.priority = priorities.id', 'r.priority = priorities.id',
'r.dest_user = users.user_id',
], ],
'data' => [$aArgs['userId'], ['res_letterbox', 'res_view_letterbox'], 'none', 'linkup', 'attach%', 'DEL'], 'data' => [$aArgs['userId'], ['res_letterbox', 'res_view_letterbox'], 'none', 'linkup', 'attach%', 'DEL'],
'group_by' => ['res_letterbox.res_id', 'mlb_coll_ext.alt_identifier', 'mlb_coll_ext.closing_date', 'mlb_coll_ext.process_limit_date', 'status.label_status', 'status.img_filename', 'priorities.color'], 'group_by' => ['users.firstname', 'users.lastname', 'r.user_firstname', 'r.user_lastname', 'r.type_label', 'r.subject', 'r.folder_name', 'r.entity_label', 'r.creation_date', 'r.contact_society', 'r.contact_firstname', 'r.contact_lastname', 'r.case_label', 'r.category_id', 'r.res_id', 'r.alt_identifier', 'r.closing_date', 'r.process_limit_date', 'status.id', 'status.label_status', 'status.img_filename', 'priorities.color', 'priorities.label'],
'order_by' => ['MAX(history.event_date) DESC'], 'order_by' => ['MAX(history.event_date) DESC'],
'limit' => $aArgs['limit'] 'limit' => $aArgs['limit']
]); ]);
......
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