From 80bbf5fe444603c92c90c552a61bd8a6980be1e2 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 29 Dec 2023 17:48:35 +0000 Subject: [PATCH] Bug 35657: Display assignee under updates --- .../prog/en/modules/cataloguing/concerns.tt | 2 +- .../prog/js/modals/display_ticket.js | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt index 56b1cc258d6..ac0f04e0f07 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt @@ -196,7 +196,7 @@ { "data": function(row, type, val, meta) { let resolved = ( row.resolved_date ) ? true : false; - let result = ' ' + _("Details") + ''; + let result = ' ' + _("Details") + ''; return result; }, "searchable": false, diff --git a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js b/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js index 553aee13622..d8fc79f9904 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js +++ b/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js @@ -4,6 +4,7 @@ $(document).ready(function() { let button = $(event.relatedTarget); let ticket_id = button.data('concern'); let resolved = button.data('resolved'); + let assignee = button.data('assignee'); modal.find('.modal-footer input').val(ticket_id); if ( resolved ) { @@ -17,6 +18,9 @@ $(document).ready(function() { // Display ticket details let display = '
'; display += '
'; + if (assignee) { + display += '' + __("Assignee") + ': ' + assignee + ''; + } display += '' + detail + ''; display += '
'; display += '
'; @@ -32,7 +36,7 @@ $(document).ready(function() { url: "/api/v1/tickets/" + ticket_id + "/updates", method: "GET", headers: { - "x-koha-embed": [ "user", "+strings" ] + "x-koha-embed": [ "user", "assignee", "+strings" ] }, }).success(function(data) { let updates_display = $('#concern-updates'); @@ -52,10 +56,18 @@ $(document).ready(function() { url: true }) + ' (' + $datetime(item.date) + ')'; if ( item.status ) { - updates += ''; + updates += ''; updates += item._strings.status ? escape_str(item._strings.status.str) : ""; updates += '' } + if ( item.assignee ) { + updates += ''; + updates += $patron_to_html(item.assignee, { + display_cardnumber: false, + url: true + }); + updates += '' + } updates += ''; updates += '
'; }); -- 2.44.0