diff --git a/src/app/entity/controllers/ListTemplateController.php b/src/app/entity/controllers/ListTemplateController.php index d1f1f788e6b0f8b2811ae21b58be90cd0910ce00..f4ec8e0e3dca535fa25ea81672c166dbc2e7be3f 100755 --- a/src/app/entity/controllers/ListTemplateController.php +++ b/src/app/entity/controllers/ListTemplateController.php @@ -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']; } } diff --git a/src/frontend/app/visa/visa-workflow.component.ts b/src/frontend/app/visa/visa-workflow.component.ts index e827332d9885a402dc57597a6a54e61465303103..380837d70bd978230b1384ab4d80ea5e156b2983 100644 --- a/src/frontend/app/visa/visa-workflow.component.ts +++ b/src/frontend/app/visa/visa-workflow.component.ts @@ -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'); } }