From 8f0e3ce4a032dedfc9fe76f50b20a8c9f245e7bd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 6 Jan 2026 16:22:10 +0100 Subject: [PATCH] Bug 41566: Tidy kohaTable - catalogue_detail.inc|catalogue/detail.tt This is a non-trivial one. * SpineLabelShowPrintOnBibDetails is removed from the controller and we fetch it from the Koha.Preference TT plugin (because it is how it should be) * A lot of JS variable instantiations are moved in a dedicated script tag: they all use TT plugins * We are using stores to permissions and sysprefs That's a lot of changes but nothing complicated, just a move from TT vars to JS vars To test this you will need to fully test the holdings tables. --- catalogue/detail.pl | 2 - .../tables/items/catalogue_detail.inc | 289 ++++++++++-------- .../prog/en/modules/catalogue/detail.tt | 102 +++++-- 3 files changed, 228 insertions(+), 165 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index f8a1fe447ec..1834d154ce4 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -173,8 +173,6 @@ my $fw = GetFrameworkCode($biblionumber); my $showallitems = $query->param('showallitems'); my $marcflavour = C4::Context->preference("marcflavour"); -$template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") ); - $template->param( ocoins => !$invalid_marc_record ? $biblio->get_coins : undef ); # some useful variables for enhanced content; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index d74198bdaf0..5be8f2af20a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -42,7 +42,7 @@ [% IF Koha.Preference('EasyAnalyticalRecords') %]Host records[% END %] [% IF ( analyze ) %]Used in[% END %] [% IF Koha.Preference('UseCourseReserves') %]Course reserves[% END %] - [% IF ( SpineLabelShowPrintOnBibDetails ) %]Spine label[% END %] + [% IF Koha.Preference('SpineLabelShowPrintOnBibDetails') %]Spine label[% END %] [% IF ( CAN_user_editcatalogue_edit_items ) %] [% END %] @@ -95,7 +95,77 @@ [% BLOCK build_items_table_js %] + + + + + - $(document).ready(function() { - [% IF Koha.Preference('AcquisitionDetails') %] - var table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail', 'acquisitiondetails-table', 'json') | $raw %]; + [% IF Koha.Preference('AcquisitionDetails') %] + + + + [% END %] - [% IF suggestions.count %] + [% IF suggestions.count %] + + [% END %] + + [% IF ( reviews ) %] + + + + [% END %] - [% IF found1 && Koha.Preference('RetainCatalogSearchTerms') %] + [% IF found1 && Koha.Preference('RetainCatalogSearchTerms') %] + + [% END %] + + [% IF Koha.Preference('EnableItemGroups') %] + + [% END # /IF EnableItemGroups %] +