From 48c6fae7bad55d13301ad607c0ab237433643b47 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 4 Aug 2023 16:02:40 +0000 Subject: [PATCH] Bug 34431: Show both status and status_alias - if exists - in table column Signed-off-by: Stephen Graham Signed-off-by: Tomas Cohen Arazi Signed-off-by: Katrin Fischer --- .../intranet-tmpl/prog/js/ill-list-table.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js index 6a1033c905..c3060814c4 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js @@ -51,6 +51,19 @@ $(document).ready(function() { return ''; } + function display_request_status(row) { + let status = row._strings.status.str; + let status_alias = row._strings.status_av ? + row._strings.status_av.str ? + row._strings.status_av.str : + row._strings.status_av.code : + null; + + let status_label = status + (status_alias ? " "+status_alias+"" : ""); + + return status_label; + } + // Possible prefilters: borrowernumber, batch_id // see ill/ill-requests.pl and members/ill-requests.pl let additional_prefilters = {}; @@ -316,12 +329,7 @@ $(document).ready(function() { "data": "status", "orderable": true, "render": function(data, type, row, meta) { - let status_label = row._strings.status_av ? - row._strings.status_av.str ? - row._strings.status_av.str : - row._strings.status_av.code : - row._strings.status.str - return escape_str(status_label); + return display_request_status(row); } }, { -- 2.39.5