Commit 849b5dfc authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #16304 TIME 0:30 Result list customization - separate creation date and processing deadline

parent 4832ff73
......@@ -177,6 +177,10 @@ class ResourceListController
} elseif ($value['value'] == 'getCreationAndProcessLimitDates') {
$select[] = 'res_letterbox.creation_date';
$select[] = 'res_letterbox.process_limit_date';
} elseif ($value['value'] == 'getCreationDate') {
$select[] = 'res_letterbox.creation_date';
} elseif ($value['value'] == 'getProcessLimitDate') {
$select[] = 'res_letterbox.process_limit_date';
} elseif ($value['value'] == 'getModificationDate') {
$select[] = 'res_letterbox.modification_date';
} elseif ($value['value'] == 'getOpinionLimitDate') {
......@@ -968,6 +972,12 @@ class ResourceListController
} elseif ($value['value'] == 'getCreationAndProcessLimitDates') {
$value['displayValue'] = ['creationDate' => $resource['creation_date'], 'processLimitDate' => $resource['process_limit_date']];
$display[] = $value;
} elseif ($value['value'] == 'getCreationDate') {
$value['displayValue'] = $resource['creation_date'];
$display[] = $value;
} elseif ($value['value'] == 'getProcessLimitDate') {
$value['displayValue'] = $resource['process_limit_date'];
$display[] = $value;
} elseif ($value['value'] == 'getModificationDate') {
$value['displayValue'] = $resource['modification_date'];
$display[] = $value;
......
......@@ -89,6 +89,20 @@ export class ListAdministrationComponent implements OnInit {
'cssClasses': ['align_leftData'],
'icon': 'fa-calendar'
},
{
'value': 'getCreationDate',
'label': this.translate.instant('lang.getCreationDate'),
'sample': this.translate.instant('lang.getCreationDateSample'),
'cssClasses': ['align_leftData'],
'icon': 'fa-calendar'
},
{
'value': 'getProcessLimitDate',
'label': this.translate.instant('lang.getProcessLimitDate'),
'sample': this.translate.instant('lang.getProcessLimitDateSample'),
'cssClasses': ['align_leftData'],
'icon': 'fa-stopwatch'
},
{
'value': 'getVisaWorkflow',
'label': this.translate.instant('lang.getVisaWorkflow'),
......@@ -273,8 +287,10 @@ export class ListAdministrationComponent implements OnInit {
this.selectedTemplateDisplayedSecondaryDataClone = this.selectedTemplateDisplayedSecondaryData;
this.basketGroup.list_display.subInfos.forEach((element: any) => {
this.addData(element.value);
this.displayedSecondaryData[this.displayedSecondaryData.length - 1].cssClasses = element.cssClasses;
if (element !== undefined) {
this.addData(element.value);
this.displayedSecondaryData[this.displayedSecondaryData.length - 1].cssClasses = element.cssClasses;
}
});
this.selectedListEvent = this.basketGroup.list_event;
......
......@@ -66,8 +66,8 @@
text-overflow: ellipsis;
padding-left: 5px;
padding-right: 5px;" [class.hasEvent]="data.event && data.displayValue !== ('lang.undefined' | translate)" (click)="launchEventSubData(data, row)">
<ng-container *ngIf="data.value == 'getCreationAndProcessLimitDates'">
<ng-container *ngIf="row.closing_date != ('lang.undefined' | translate)">
<ng-container *ngIf="['getCreationDate', 'getProcessLimitDate', 'getCreationAndProcessLimitDates'].indexOf(data.value) > -1">
<ng-container *ngIf="data.value === 'getCreationAndProcessLimitDates' && row.closing_date != ('lang.undefined' | translate)">
<i class="fa fa-calendar"
title="{{'lang.creationDate' | translate}}"></i>&nbsp;<span
[innerHTML]="data.displayValue.creationDate | timeAgo"
......@@ -77,7 +77,8 @@
title='{{row.closing_date | fullDate}}'></span>
</ng-container>
<ng-container *ngIf="row.closing_date == ('lang.undefined' | translate)">
<i class="fa fa-calendar"
<ng-container *ngIf="data.value === 'getCreationAndProcessLimitDates'">
<i class="fa fa-calendar"
title="{{'lang.creationDate' | translate}}"></i>&nbsp;<span
[innerHTML]="data.displayValue.creationDate | timeAgo"
title='{{data.displayValue.creationDate | fullDate}}'></span>
......@@ -85,9 +86,22 @@
title="{{'lang.processLimitDate' | translate}}"></i>&nbsp;<span
[innerHTML]="data.displayValue.processLimitDate | timeLimit"
title='{{data.displayValue.processLimitDate | fullDate}}'></span>
</ng-container>
<ng-container *ngIf="data.value === 'getCreationDate'">
<i class="fa {{data.icon}}"
title="{{'lang.getCreationDate' | translate}}"></i>&nbsp;<span
[innerHTML]="data.displayValue | timeAgo" style="margin-left: 3px;"
title='{{data.displayValue | fullDate}}'></span>
</ng-container>
<ng-container *ngIf="data.value === 'getProcessLimitDate'">
<i class="fa {{data.icon}}"
title="{{'lang.getProcessLimitDate' | translate}}"></i>&nbsp;<span
[innerHTML]="data.displayValue | timeLimit" style="margin-left: 3px;"
title='{{data.displayValue | fullDate}}'></span>
</ng-container>
</ng-container>
</ng-container>
<ng-container *ngIf="data.icon != ''">
<ng-container *ngIf="data.icon != '' && ['getCreationDate', 'getProcessLimitDate'].indexOf(data.value) === -1">
<i class="fa {{data.icon}}" title="{{data.label}}"></i>
&nbsp;
</ng-container>
......@@ -98,7 +112,7 @@
title="{{'lang.' + data.displayValue | translate}}">{{'lang.' + data.displayValue | translate}}</span>
</ng-container>
<ng-container
*ngIf="data.value != 'getCategory' && data.value != 'getCreationAndProcessLimitDates'">
*ngIf="data.value != 'getCategory' && data.value !== 'getCreationDate' && data.value !== 'getProcessLimitDate' && data.value != 'getCreationAndProcessLimitDates'">
<span *ngIf="!data.value.includes('Date')" title="{{data.displayTitle}}"
[innerHTML]="data.displayValue"></span>
<span *ngIf="data.value.includes('Date')"
......
......@@ -305,7 +305,7 @@ export class BasketListComponent implements OnInit, OnDestroy {
element.display.forEach((key: any) => {
key.event = false;
key.displayTitle = key.displayValue;
if ((key.displayValue == null || key.displayValue === '') && ['getCreationAndProcessLimitDates', 'getParallelOpinionsNumber'].indexOf(key.value) === -1) {
if ((key.displayValue == null || key.displayValue === '') && ['getCreationDate', 'getProcessLimitDate', 'getCreationAndProcessLimitDates', 'getParallelOpinionsNumber'].indexOf(key.value) === -1) {
key.displayValue = this.translate.instant('lang.undefined');
key.displayTitle = '';
} else if (['getSenders', 'getRecipients'].indexOf(key.value) > -1) {
......
......@@ -2555,5 +2555,9 @@
"otpVisaUser": "The user will be notified by <b> email </b> at the time of his turn in the circuit.",
"mustSign": "The signature position for external users is mandatory.",
"autoRedirectToUser": "To myself",
"applicationVersion": "Maarch courrier {{version}} Powered by {{author}}"
"applicationVersion": "Maarch courrier {{version}} Powered by {{author}}",
"getProcessLimitDate": "Processing deadline",
"getProcessLimitDateSample": "<b color=\"warn\">3 day(s)</b>",
"getCreationDate": "Creation date",
"getCreationDateSample": "Jan. 1st"
}
......@@ -2545,5 +2545,9 @@
"requestedOpinion": "Avis demandé à la place de",
"sharePointWarning": "Fermez l'éditeur du document avant de valider l'édition",
"autoRedirectToUser": "A moi-même",
"applicationVersion": "Maarch courrier {{version}} Powered by {{author}}"
"applicationVersion": "Maarch courrier {{version}} Powered by {{author}}",
"getProcessLimitDate": "Date limite de traitement",
"getProcessLimitDateSample": "<b color=\"warn\">3 jour(s)</b>",
"getCreationDate": "Date de création",
"getCreationDateSample": "1er janv."
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment