diff --git a/sql/develop.sql b/sql/develop.sql index cf29b342df5ca603dae92471e0fbec9d5d142db6..70f634828f3b96e94881db674668795af3760e05 100755 --- a/sql/develop.sql +++ b/sql/develop.sql @@ -134,6 +134,12 @@ END$$; /* REFACTORING */ ALTER TABLE mlb_coll_ext DROP COLUMN IF EXISTS flag_notif; + +/* PARAM LIST DISPLAY */ +UPDATE groupbasket SET list_display = '[{"value":"getPriority","cssClasses":[],"icon":"fa-traffic-light"},{"value":"getCategory","cssClasses":[],"icon":"fa-exchange-alt"},{"value":"getDoctype","cssClasses":[],"icon":"fa-suitcase"},{"value":"getAssignee","cssClasses":[],"icon":"fa-sitemap"},{"value":"getRecipients","cssClasses":[],"icon":"fa-user"},{"value":"getSenders","cssClasses":[],"icon":"fa-book"},{"value":"getCreationAndProcessLimitDates","cssClasses":["align_rightData"],"icon":"fa-calendar"}]' WHERE result_page = 'list_with_attachments' OR result_page = 'list_copies'; +UPDATE groupbasket SET list_display = '[{"value":"getPriority","cssClasses":[],"icon":"fa-traffic-light"},{"value":"getCategory","cssClasses":[],"icon":"fa-exchange-alt"},{"value":"getDoctype","cssClasses":[],"icon":"fa-suitcase"},{"value":"getParallelOpinionsNumber","cssClasses":["align_rightData"],"icon":"fa-comment-alt"},{"value":"getOpinionLimitDate","cssClasses":["align_rightData"],"icon":"fa-stopwatch"}]' WHERE result_page = 'list_with_avis'; +UPDATE groupbasket SET list_display = '[{"value":"getPriority","cssClasses":[],"icon":"fa-traffic-light"},{"value":"getDoctype","cssClasses":[],"icon":"fa-suitcase"},{"value":"getVisaWorkflow","cssClasses":[],"icon":"fa-list-ol"},{"value":"getCreationAndProcessLimitDates","cssClasses":["align_rightData"],"icon":"fa-calendar"}]' WHERE result_page = 'list_with_signatory'; + /* RE-CREATE VIEW*/ CREATE OR REPLACE VIEW res_view_letterbox AS SELECT r.tablename, diff --git a/src/frontend/app/list/basket-list.component.html b/src/frontend/app/list/basket-list.component.html index 3a0a480196a5678fd2f39085d4151a244291eea2..d73e90d2e9852bdbaa36b9f4acbf52f7da20ddf5 100644 --- a/src/frontend/app/list/basket-list.component.html +++ b/src/frontend/app/list/basket-list.component.html @@ -47,10 +47,10 @@ </ng-container> <ng-container *ngIf="data.value == 'getCategory'"> <span *ngIf="!lang[data.displayValue]" style="opacity: 0.5" title="id: {{data.displayValue}}">_UNDEFINED</span> - <span *ngIf="lang[data.displayValue]">{{lang[data.displayValue]}}</span> + <span *ngIf="lang[data.displayValue]" title="{{data.displayTitle}}">{{lang[data.displayValue]}}</span> </ng-container> <ng-container *ngIf="data.value != 'getCategory' && data.value != 'getCreationAndProcessLimitDates'"> - <span *ngIf="!data.value.includes('Date')" title="{{data.displayValue}}" [innerHTML]="data.displayValue"></span> + <span *ngIf="!data.value.includes('Date')" title="{{data.displayTitle}}" [innerHTML]="data.displayValue"></span> <span *ngIf="data.value.includes('Date')" [innerHTML]="data.displayValue | timeAgo"></span> </ng-container> </div> diff --git a/src/frontend/app/list/basket-list.component.ts b/src/frontend/app/list/basket-list.component.ts index b7d942f329f0feb66189c112a94670c332f7f925..4f20334d32da78fa7a5c328acd8b684a767c415f 100755 --- a/src/frontend/app/list/basket-list.component.ts +++ b/src/frontend/app/list/basket-list.component.ts @@ -222,7 +222,7 @@ export class BasketListComponent implements OnInit { data.resources.forEach((element: any) => { // Process main datas Object.keys(element).forEach((key) => { - if (key == 'statusImage' && element[key] == null) { + if (key == 'statusImage' && element[key] == null) { element[key] = 'fa-question undefined'; } else if ((element[key] == null || element[key] == '') && ['closingDate', 'countAttachments', 'countNotes', 'display'].indexOf(key) === -1) { element[key] = this.lang.undefined; @@ -231,48 +231,61 @@ export class BasketListComponent implements OnInit { // Process secondary datas element.display.forEach((key: any) => { + key.displayTitle = key.displayValue; if ((key.displayValue == null || key.displayValue == '') && ['getCreationAndProcessLimitDates', 'getParallelOpinionsNumber'].indexOf(key.value) === -1) { key.displayValue = this.lang.undefined; - + key.displayTitle = ''; } else if (["getSenders", "getRecipients"].indexOf(key.value) > -1) { - if (key.displayValue.length > 1) { + key.displayTitle = key.displayValue.join(' - '); key.displayValue = this.lang.isMulticontact; } else { key.displayValue = key.displayValue[0]; } - } else if(key.value == 'getCreationAndProcessLimitDates') { + } else if (key.value == 'getCreationAndProcessLimitDates') { key.icon = ''; - } else if(key.value == 'getVisaWorkflow') { + } else if (key.value == 'getVisaWorkflow') { let formatWorkflow: any = []; let content = ''; let user = ''; - key.displayValue.forEach((visa: any) => { + let currentKey = 0; + let displayTitle: string[] = []; + key.displayValue.forEach((visa: any, key: number) => { content = ''; user = visa.user; + displayTitle.push(user); + if (visa.mode == 'sign') { - user = '<u>'+user+'</u>'; - } + user = '<u>' + user + '</u>'; + } if (visa.date == '') { - content = '<i class="fa fa-hourglass-half"></i> <span title="' + this.lang[visa.mode+'User'] + '">' + user + '</span>'; + content = '<i class="fa fa-hourglass-half"></i> <span title="' + this.lang[visa.mode + 'User'] + '">' + user + '</span>'; } else { - content = '<span color="accent" style=""><i class="fa fa-check"></i> <span title="' + this.lang[visa.mode+'User'] + '">' + user + '</span></span>'; + content = '<span color="accent" style=""><i class="fa fa-check"></i> <span title="' + this.lang[visa.mode + 'User'] + '">' + user + '</span></span>'; } if (visa.current) { - content = '<b color="primary">'+content+'</b>'; + currentKey = key; + formatWorkflow = ['...', formatWorkflow[key - 1]]; + content = '<b color="primary">' + content + '</b>'; + } + + if (key <= currentKey + 1) { + formatWorkflow.push(content); + } else if (key == currentKey + 2) { + formatWorkflow.push('...'); } - formatWorkflow.push(content); }); - key.icon = ''; key.displayValue = formatWorkflow.join(' <i class="fas fa-long-arrow-alt-right"></i> '); - } else if(key.value == 'getParallelOpinionsNumber') { + key.displayTitle = displayTitle.join(' - '); + } else if (key.value == 'getParallelOpinionsNumber') { + key.displayTitle = key.displayValue + ' ' + this.lang.opinionsSent; + if (key.displayValue > 0) { key.displayValue = '<b color="primary">' + key.displayValue + '</b> ' + this.lang.opinionsSent; } else { key.displayValue = key.displayValue + ' ' + this.lang.opinionsSent; } - } key.label = this.lang[key.value]; }); diff --git a/src/frontend/app/list/export/export.component.ts b/src/frontend/app/list/export/export.component.ts index 7c8f92fd1a522a6cef03d932001a7c7b81a4bd31..fa89f9bcfe276b32947593e35095c32153af9c68 100644 --- a/src/frontend/app/list/export/export.component.ts +++ b/src/frontend/app/list/export/export.component.ts @@ -187,13 +187,13 @@ export class ExportComponent implements OnInit { isFunction: true }, { - value: 'getSender', - label: this.lang.sender, + value: 'getSenders', + label: this.lang.getSenders, isFunction: true }, { - value: 'getRecipient', - label: this.lang.recipient, + value: 'getRecipients', + label: this.lang.getRecipients, isFunction: true }, { diff --git a/src/frontend/app/notification.service.ts b/src/frontend/app/notification.service.ts index 2b65ce232c7bb17af484b55774594fda8247073b..7320855a268259104912c390a9097cec32643dc5 100755 --- a/src/frontend/app/notification.service.ts +++ b/src/frontend/app/notification.service.ts @@ -39,17 +39,21 @@ export class NotificationService { } else if (err.status === 0 && err.statusText === 'Unknown Error') { this.error(this.lang.connectionFailed); } else { - if (err.error.errors !== undefined) { - this.error(err.error.errors); - if (err.status === 403 || err.status === 404) { - this.router.navigate(['/home']); + if (err.error !== undefined) { + if (err.error.errors !== undefined) { + this.error(err.error.errors); + if (err.status === 403 || err.status === 404) { + this.router.navigate(['/home']); + } + } else if (err.error.exception !== undefined) { + this.error(err.error.exception[0].message); + } else if(err.error.error !== undefined){ + this.error(err.error.error.message); + } else { + this.error(err.status + ' : ' + err.statusText); } - } else if (err.error.exception !== undefined) { - this.error(err.error.exception[0].message); - } else if(err.error.error !== undefined){ - this.error(err.error.error.message); } else { - this.error(err.status + ' : ' + err.statusText); + this.error(err); } } }