From 162396a44e39e4a11d71e73336261e1fb7985a79 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 16 Oct 2024 09:54:50 +0200 Subject: [PATCH] Bug 33484: Fix libraries table We added columns to the table but never displayed them, and they were not part of the columns settings. I am not sure what was the purpose of that but it looks completely wrong. If we want to restore them it should be done correctly (ie. add them back to the column list and add the new ones to the columns settings). Signed-off-by: Pedro Amorim Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- .../prog/en/modules/admin/branches.tt | 66 ++----------------- 1 file changed, 5 insertions(+), 61 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt index 67f25fab373..363a8b57da9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt @@ -666,7 +666,7 @@ 'embed': [ 'smtp_server', 'library_hours' ], 'emptyTable': '
'+_("There are no libraries defined.")+' '+_("Start defining libraries")+'.
', "columnDefs": [ { - "targets": [0,1,3,4,7,10,11,12,13,14,15,16,17], + "targets": [1,3,4,5,6], "render": function (data, type, row, meta) { if ( type == 'display' ) { if ( data != null ) { @@ -694,7 +694,7 @@ "orderable": true }, { - "data": function( row, type, val, meta ) { + "render": function( data, type, row, meta ) { const library_info = []; if ( row.address1 != null ) library_info.push(row.address1.escapeHtml()); if ( row.address2 != null ) library_info.push(row.address2.escapeHtml()); @@ -754,7 +754,7 @@ return ''+data.name.escapeHtml()+''; } else { - return _("Default"); + return _("Default").escapeHtml(); } }, "searchable": false, @@ -780,7 +780,7 @@ for (let i = calendarFirstDayOfWeek; counter < 7; i++) { const day = i % 7; // Wrap around the day using modulo operator result += ''; - result += ''+daysOfWeek[day]+''; + result += ''+daysOfWeek[day].escapeHtml()+''; result += ''; result += row.library_hours[day].open_time != null ? $kohatime(row.library_hours[day].open_time): ''; result += ''; @@ -792,7 +792,7 @@ } result += ''; } else { - result = _("Library hours not set"); + result = _("Library hours not set").escapeHtml(); } return result; }, @@ -814,62 +814,6 @@ "searchable": false, "orderable": false }, - { - "data": "address1", - "searchable": true, - "visible": false, - "orderable": false - }, - { - "data": "address2", - "searchable": true, - "visible": false, - "orderable": false - }, - { - "data": "address3", - "searchable": true, - "visible": false, - "orderable": false - }, - { - "data": "city", - "searchable": true, - "visible": false, - "orderable": false - }, - { - "data": "state", - "searchable": true, - "visible": false, - "orderable": false - }, - { - "data": "postal_code", - "searchable": true, - "visible": false, - "orderable": false - }, - { - "data": "country", - "searchable": true, - "visible": false, - "orderable": false - }, - { - "data": function( row, type, val, meta ) { - return ''; // provisional placeholder for opac_info - }, - "searchable": false, - "visible": false, - "orderable": false - }, - { - "data": "notes", - "searchable": true, - "visible": false, - "orderable": false - } ] }, table_settings); -- 2.34.1