Skip to content
Snippets Groups Projects
Verified Commit 0ec8be56 authored by Damien's avatar Damien
Browse files

FEAT #14949 TIME 1:00 Fix list template with invalid users

parent 72cdf80a
No related branches found
No related tags found
No related merge requests found
......@@ -665,7 +665,7 @@ class ListTemplateController
}
if ($item['type'] == 'user') {
$user = UserModel::getById(['id' => $item['id'], 'select' => ['status']]);
if ($user == 'SPD' || $user == 'DEL') {
if (empty($user) || $user['status'] == 'SPD' || $user['status'] == 'DEL') {
return ['errors' => 'Item user is not valid'];
}
}
......
......@@ -535,7 +535,7 @@ export class VisaWorkflowComponent implements OnInit {
}
isValidWorkflow() {
if ((this.visaWorkflow.items.filter((item: any) => item.requested_signature).length > 0 && this.visaWorkflow.items.filter((item: any) => (!item.hasPrivilege || !item.isValid) && item.process_date === null).length === 0) && this.visaWorkflow.items.length > 0) {
if ((this.visaWorkflow.items.filter((item: any) => item.requested_signature).length > 0 && this.visaWorkflow.items.filter((item: any) => (!item.hasPrivilege || !item.isValid) && (item.process_date === null || this.functions.empty(item.process_date))).length === 0) && this.visaWorkflow.items.length > 0) {
return true;
} else {
return false;
......@@ -547,7 +547,7 @@ export class VisaWorkflowComponent implements OnInit {
return this.translate.instant('lang.signUserRequired');
} else if (this.visaWorkflow.items.filter((item: any) => !item.hasPrivilege).length > 0) {
return this.translate.instant('lang.mustDeleteUsersWithNoPrivileges');
} else if (this.visaWorkflow.items.filter((item: any) => !item.isValid && item.process_date === null).length > 0) {
} else if (this.visaWorkflow.items.filter((item: any) => !item.isValid && (item.process_date === null || this.functions.empty(item.process_date))).length > 0) {
return this.translate.instant('lang.mustDeleteInvalidUsers');
}
}
......
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