From 01acc744b2dfc06a435dbe81a64f96558a30c5e1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 3 May 2022 07:57:46 +0200 Subject: [PATCH] Bug 32030: Merge the agreement and ID columns Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- .../js/vue/components/ERM/AgreementsList.vue | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue index a1c7c38fd1..9bf0bca56f 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue @@ -75,7 +75,7 @@ export default { }, "order": [[1, "asc"]], "columnDefs": [{ - "targets": [0, 1, 2, 3, 4], + "targets": [0, 2], "render": function (data, type, row, meta) { if (type == 'display') { return escape_str(data) @@ -85,10 +85,13 @@ export default { }], "columns": [ { - "title": __("Agrement ID"), - "data": "agreement_id", + "title": __("Name"), + "data": ["me.agreement_id", "me.name"], "searchable": true, - "orderable": true + "orderable": true, + "render": function (data, type, row, meta) { + return escape_str(`${row.name} (#${row.agreement_id})`) + } }, { "title": __("Vendor"), @@ -99,12 +102,6 @@ export default { return row.vendor_id != undefined ? escape_str(vendors_map[row.vendor_id].name) : "" } }, - { - "title": __("Name"), - "data": "name", - "searchable": true, - "orderable": true - }, { "title": __("description"), "data": "description", @@ -177,9 +174,9 @@ export default { preDrawCallback: function (settings) { var table_id = settings.nTable.id $("#" + table_id).find("thead th").eq(1).attr('data-filter', 'av_vendors') - $("#" + table_id).find("thead th").eq(4).attr('data-filter', 'av_statuses') - $("#" + table_id).find("thead th").eq(5).attr('data-filter', 'av_closure_reasons') - $("#" + table_id).find("thead th").eq(7).attr('data-filter', 'av_renewal_priorities') + $("#" + table_id).find("thead th").eq(3).attr('data-filter', 'av_statuses') + $("#" + table_id).find("thead th").eq(4).attr('data-filter', 'av_closure_reasons') + $("#" + table_id).find("thead th").eq(6).attr('data-filter', 'av_renewal_priorities') } }, columns_settings, 1)