Commit d32986f0 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 cd18c180
......@@ -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;
......
......@@ -87,6 +87,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'),
......@@ -274,8 +288,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="['getCreationAndProcessLimitDates', 'getCreationDate', 'getProcessLimitDate'].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,17 +77,31 @@
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>
- <i class="fa fa-stopwatch"
- <i class="fa fa-stopwatch"
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')"
......
......@@ -306,7 +306,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) {
......
......@@ -2525,5 +2525,9 @@
"entitiesParameters_visaCircuit": "Visa workflow",
"entitiesParameters_opinionCircuit": "Opinion workflow",
"entitiesParameters_users": "Users",
"entitiesParameters_templates": "Templates"
"entitiesParameters_templates": "Templates",
"getProcessLimitDate": "Processing deadline",
"getProcessLimitDateSample": "<b color=\"warn\">3 day(s)</b>",
"getCreationDate": "Creation date",
"getCreationDateSample": "Jan. 1st"
}
......@@ -2520,5 +2520,9 @@
"entitiesParameters_visaCircuit": "Circuit de visa",
"entitiesParameters_opinionCircuit": "Circuit d'avis",
"entitiesParameters_users": "Utilisateurs",
"entitiesParameters_templates": "Modèles de documents"
"entitiesParameters_templates": "Modèles de documents",
"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