From 05ccf02d1bc7315f921de97892198ab1add435e1 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 5 May 2023 13:44:31 +0100 Subject: [PATCH] Bug 33544: Replace title details with one column Combine the request title details fields into onea column for display. Signed-off-by: Lisette Scheer --- .../prog/en/includes/ill-list-table.inc | 8 +- .../intranet-tmpl/prog/js/ill-list-table.js | 119 ++++++++++-------- 2 files changed, 66 insertions(+), 61 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc index bf314c26e10..abf1d1f15fa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc @@ -9,13 +9,7 @@ Request ID Batch - Author - Title - Article title - Issue - Volume - Year - Pages + Request details Request type Order ID Patron 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 0fc313a2213..84bac7ea965 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js @@ -270,62 +270,73 @@ $(document).ready(function () { }, }, { - data: "", // author + data: "", // Request details orderable: false, render: function (data, type, row, meta) { - const author = display_extended_attribute( - row, - "author" - ); - if (author) return author; - const articleAuthor = display_extended_attribute( - row, - "article_author" - ); - if (articleAuthor) return articleAuthor; - return ""; - }, - }, - { - data: "", // title - orderable: false, - render: function (data, type, row, meta) { - return display_extended_attribute(row, "title"); - }, - }, - { - data: "", // article_title - orderable: false, - render: function (data, type, row, meta) { - return display_extended_attribute(row, "article_title"); - }, - }, - { - data: "", // issue - orderable: false, - render: function (data, type, row, meta) { - return display_extended_attribute(row, "issue"); - }, - }, - { - data: "", // volume - orderable: false, - render: function (data, type, row, meta) { - return display_extended_attribute(row, "volume"); - }, - }, - { - data: "", // year - orderable: false, - render: function (data, type, row, meta) { - return display_extended_attribute(row, "year"); - }, - }, - { - data: "", // pages - orderable: false, - render: function (data, type, row, meta) { - return display_extended_attribute(row, "pages"); + let display = ""; + if ( + display_extended_attribute(row, "article_title") !== + "" + ) { + display += + ' Article: ' + + display_extended_attribute( + row, + "article_title" + ) + + ""; + } + if (display_extended_attribute(row, "title") !== "") { + display += + ' Title: ' + + display_extended_attribute(row, "title") + + ""; + } + if ( + display_extended_attribute( + row, + "article_author" + ) !== "" + ) { + display += + ' Article author: ' + + display_extended_attribue( + row, + "article_author" + ) + + ""; + } + if (display_extended_attribute(row, "author") !== "") { + display += + ' Author: ' + + display_extended_attribute(row, "author") + + ""; + } + if (display_extended_attribute(row, "issue") !== "") { + display += + ' Issue: ' + + display_extended_attribute(row, "issue") + + ""; + } + if (display_extended_attribute(row, "volume") !== "") { + display += + ' Volume: ' + + display_extended_attribute(row, "volume") + + ""; + } + if (display_extended_attribute(row, "year") !== "") { + display += + ' Year: ' + + display_extended_attribute(row, "year") + + ""; + } + if (display_extended_attribute(row, "pages") !== "") { + display += + ' Pages: ' + + display_extended_attribute(row, "pages") + + ""; + } + return display; }, }, { -- 2.39.5