From 4422c44d2cca3940aa49dd46ed7184b028e24c63 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 19 Dec 2024 17:37:31 +0000 Subject: [PATCH] Bug 38689: Add basic rendering for errors in edifact messages display --- api/v1/swagger/definitions/edifact_file.yaml | 2 ++ .../prog/en/modules/acqui/edifactmsgs.tt | 21 +++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/api/v1/swagger/definitions/edifact_file.yaml b/api/v1/swagger/definitions/edifact_file.yaml index 4602ba28b68..de74f020934 100644 --- a/api/v1/swagger/definitions/edifact_file.yaml +++ b/api/v1/swagger/definitions/edifact_file.yaml @@ -55,4 +55,6 @@ properties: - string - "null" description: EDIFACT file name + errors: + type: array additionalProperties: false diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt index 69cb4c43c53..c7612cc6ec0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt @@ -82,7 +82,8 @@ }, "embed": [ "vendor", - "basket" + "basket", + "errors" ], "columns": [ { @@ -104,7 +105,23 @@ "data": "status", "title": _("Status"), "searchable": true, - "orderable": true + "orderable": true, + "render": function(daya, type, row, meta) { + let rendered = ''; + if ( row.errors.length > 0 ) { + let errorsList = ''; + rendered = row.status + ' (' + _("with errors") + ')'; + } else { + rendered = row.status; + } + return rendered; + } }, { "data": "vendor.name", -- 2.47.1